G
No worries
If the WDT is over 21 minutes, the fipy should try to reconnect to pybytes, shouldn't it?
Yes, though it will take 21 minutes before the reset happens (it will trigger a full system reset, similar to machine.reset()). This is independent of lte.isconnected() or pybytes.isconnected(). As I mentioned before, it will send/receive a PING message from Pybytes every 10 minutes, and when there is no response, it will try again 10 minutes later. If there is still no response, it will trigger the system reset.
The solution I finally found is to insert a callback in my code:
lte.lte_callback(LTE.EVENT_BREAK, lte_cb_handler)
If the callback has been triggered because of a disconnection, then the fipy tries to reconnect to pybytes using
pybytes.connect()
This the only efficient command that I found. It does work but this solution is not so good: there are too many callback occuring so that the fipy spends much time to reconnect to pybytes.
When the callback triggers, you will need to check manually (by for example doing a socket.getaddrinfo() whether the BREAK was caused by a 'permanent' disconnect or something else. We also explain this in the documentation: https://docs.pycom.io/tutorials/networks/lte/#lte-connectivity-loss