I have a program to control certain lights and it write to "thingspeak. com" to tell me what it does, well today all day, no matter what I try, it will work and send data but after 20 minutes, it varies, I stop getting any messages from the device, a nodemcu esp8266.
I'm happy to post all the code but maybe this is a familiar phenomenon. I have never seen this in over 4 years of playing with these things.
jremington:
Please read and follow the directions in the "How to use the forum" post.
a bit harsh as OP said he could post the code but was more interested at first to know if this is a common issue
To OP’s question, no this is not something I’ve seen in years playing with arduino and esp, so likely something fishy happening in your code or hardware.
Could be the PC/Mac driver loosing the USB connection after a while (driver bug, poor usb cable?) or USB-port can not provide sufficient current. Check your computer’s console to see if the port drops
a bit harsh as OP said he could post the code but was more interested at first to know if this is a common issue
I've noticed that since day one, some sort of reflexive read the instructions advice. Now, given the fact that this is still going on, clearly posts saying read the instructions are not effective at stopping people from posting questions that will end with a post saying read the instructions. This behavior probably drive a lot of people away and it certainly isn't very effective.
As to what you said, on a Mac, does one just look at system report in about this Mac to see if the port has dropped? On that I see the Seagate external drive and something called a CP1202 USB to Bridge Controller from Silicon Labs. Not sure it that is the ESP device or not.
Also, I commented out everything except for one loop that simply writes the following two items to Serial.monitor every second.
05:14:21.601 -> ###mainloop is alive now
05:14:21.601 -> millis()= 848793
It stopped after 14 minutes. So now in a program that does nothing but write to the monitor, nothing is happening. That's weird.
well - in the general case we tell newcomers (this is usually their first post) to read the instructions as their post lacks the bare minimum to get some help. Your statement was clearer (but still source code and wiring diagram is always good to have)
on a Mac you could look at the Console (in /Applications/Utilities) and see if anything fishy is happening to the CP1202 driver
Not sure which driver you've got. On my Mac I'm using the drivers from mac-usb-serial.com for PL-2303, CH341 and CP2102 USB to Serial devices. Their drivers for Catalina and Mojave are notarized.
From their web site it seems they have a promotion on Sunday:
Sunday, we offer a special discount of 42%. Buy the driver for €6.90 instead of €11.98!
How do you know Serial.print stop working but the program is still running?
An idea may be monitoring TX pin. If you have other usb to uart adapter (or scopemeter/logic analyzer), pick the TX pin and see when or if your program really stop talking.