Once in a while, the SAMD21 MCU looses touch with the u-blox R410M-02B on my board. It is probably because of a MQTT broker response that the u-blox module did not expect. The real solution will be to stop using MQTT on this module with NB-IoT, which is not recommended anyway.
But as this happens occasionally (<1x per 500 msgs), I tried this quick and dirty workaround :
- Use “!nbiot.isAlive()” from the library to detect that the problem has occurred.
- Perform a reset of the u-blox module by doing:
With this in the beginning of the code:
#define SARA_RESET 28
I can see the “isAlive” detects that the problem has occurred. But my reset idea doesn’t seem to be working.
- Is it true that these SARA_RESET lines (taken from an example code) are meant to reset the u-blox module?
- If yes, is 28 the correct value for SARA_RESET?
- If I don’t mind losing this one measurement, is there also a command to reset the whole board?
Thanks a lot!