Handling usocket errors

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
JoeCharlieH
Posts: 8
Joined: Thu Dec 27, 2018 10:59 pm

Handling usocket errors

Post by JoeCharlieH » Mon Jan 20, 2020 5:58 pm

While debugging a simple MQTT client device, I've encounter many headaches trying to catch the specific error that stopped the execution of my main program. After many attempts (and reading the usockets documentation and the lwip.c module), I learned the hard way that you need to sacrifice "Knowing that my device is always connected" for closing a socket.

My main question is, does these lwip error codes relate to the OSError code values raised by the usocket.py library?
Image

Post Reply