I am trying to test the deep sleep mode (pin disturb) using micropython code ( x.sleep_now and x.wake_reason()).
As using the Development kit triggers the SLEEP_REQ pin (pin #9) somehow, I am just applying 3.5V to pin 1 from a power supply.
While doing that, to check if the code is running well or not, I am printing all the statements
through MQTT. Meaning, I am sending all relevant variables to an mqtt server.
I noticed, that after some arbitrary amount of time, my code stops sending anything to the server.
I just did a 17hours test. Where the module wakes up at 10mins interval and sends some data to the server.
The module did not miss any data transmission or reboot in between. But it stopped connecting (or stopped sending to the server) after 17hours.
Even though I have programmed the module to reboot after 30 unsuccessful connection attempts, seems it is not connecting to the network/internet at all even after rebooting the module.
Why would the connection drop all of a sudden after working well for 17hours?
It worked just fine right after that when I just unplugged and plugged it back in.
As I can not connect the module to the PC to see print statements on the terminal, I do not get to see the error message.
If I use the normal sleep method (time.sleep()) instead of deep sleep (x.sleep_now) method then the code runs, however many times I want it to run. Though I haven’t tested it for 17hours as the project would not need it.
My SM is set to 0 (Normal).
I have tried using SM = 0 (normal) and 5 (Cyclic sleep Pin Wake)
I am on AP =4 (MicroPython)
How can I resolve this?