I was toying with mqtt and I got stuck when I introduced a timer to call the mqtt connection.
This is what happens: if I call the mqtt object connect() method while the broker server is offline, I get an OSError exception. So far so good.
However, I need my mcu to send a data report every fixed amount of time and therefore I set up a timer. If the broker is offline, everything get stuck after the connect() call giving no exception message back.
I then tried to import the micropython module and create a buffer before init the timer as follows:
Code: Select all
import micropython micropython.alloc_emergency_exception_buf(100)
Can anyone help? thank you!