Hi @dvanaken and guys,
I came across this thread because I have a similar project - using only esp8266/nodemcu - but I measure voltage only.
I have an issue that the wifi of the NodeMcu always got disconnected - I am using emonlib - but I modified it slightly so it measure one analog input input (A0) only. The wifi works (ping-able) for couples of second, and then got disconnected. I notice that the wifi got disconnected the moment the sketch starts reading the analog input ( calcVI()
);.
After some investigation, I found that reading analog input very fast or too frequent (in a while
loop for example) and relatively long duration will force the wifi to disconnect. Please see here and here.
Some says adding yield()
or delay(0)
in the void loop()
section within the sketch or inside the while
loop could help (to avoid the wifi disconnect issue), but I tried that and it does not work either.
I assume you use Arduino IDE, do you manage to make the wifi working with your sketch ()? If yes, do you mind to share your sketch (if it’s not a secret ), or give me direction on how to workaround this issue?
Thanks in advance,
miq