I had been struggling with apparent hanging of the Nodemcu.
After watch its operation closely I noticed it was always hanging in the same point in the code - just after it requested to read the energy meter - there was a time out in the code which used the value of millis added 5000 to it and if the current value of millis was greater than the calculated value then drop out of the loop and try again.
Well millis is an unsigned long integer and I was trying to compare it to an int - oops
Changed my variable to a long integer and presto no more hanging has worked consistently for days now.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.