- set wifi static IP
- read many sensors (ow, i2c)
- wait for wifi GOT_IP (register eventmon with idle app)
- send report to a server
This used to work nicely, the 'wait' part was around 60ms. Earlier this year I updated the fw and the wait went up to around 800ms. This is a significant issue as the device runs from battery.
I now decided to look into the issue and noticed that when the ow connection was bad, and the 'read' was fast (80ms) the wait was 60ms, but when the ow read worked (taking 220ms) the wait was longer (800ms).
I enabled logging and saw that what actually happens during the 'wait' is a DISCONNECT (reason AUTH_EXPIRE) quickly followed by a successful reconnection (GOT_IP). It seems that if the app is kept busy (reading ow and i2c devices) the wifi engine experiences some kind of internal time-out.
Is it possible that hogging the CPU causes wifi to fail? If so, how does one deal avoid the failure?
TIA