I have updated my findings in this issue:
The problem is still not resolved, 0.8.0-rc.2 doesn’t fix it.
Seems even worse than before, because even though I have
SYSTEM_MODE(MANUAL);
SYSTEM_THREAD(ENABLED);
The application is completely blocked when WiFi is lost.
WiFi connectivity handling still seems to be absolutely terrible.
I am getting unhappy about my choice of Particle as a platform for my products.
Is it too much to ask from an IOT platform that:
- Losing WiFi does not completely block the system
- Wifi disconnects and channel switches are handled correctly and when WiFi returns
- it always reconnects
- A TCP server ran by the device does not get into an unrecoverable error state when WiFi is bad or temporarily lost?
I have given you test code. I reported this bug over 6 months ago. I feel unheard and ignored.
Is it perhaps possible to add some system event hooks to handle WiFi disconnects?
I’m really trying to find a solution because I have a lot of customers affected by this. Why can’t someone at particle provide some example code that:
- Handles WiFi connecting/disconnecting without blocking the main thread
- Handles running a TCP server on the photon that in a robust way