As posted 2 weeks ago I noticed an esp8266 nodemcu 12e simply stops sending message. Several of these devices were tried.
Today I thought, why not try simple sketch and see what happens.
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println(__FILE__);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(__FILE__);
delay(60000);
}
and output looks like this
14:06:13.079 -> sketch_oct10c.ino
14:07:13.063 -> sketch_oct10c.ino
14:08:16.647 -> sketch_oct10c.ino
14:09:16.436 -> sketch_oct10c.ino
14:10:13.049 -> sketch_oct10c.ino
14:11:13.055 -> sketch_oct10c.ino
this should not be should it?
Can you explain your objections?
Put a unique print ("start") in setup
what do you mean by objections? it should keep printing until it is unplugged.
You didn't say that that is all it prints, you merely said
and output looks like this
pert
October 10, 2020, 8:12pm
5
Does it stop there no matter how long you wait?
If you add a blinking LED to your code, does the LED keep blinking even after the serial output stops?
Your code looks OK to me.
If you are saying it stops after 6 prints I suggest you try a much shorter delay and see what happens. Having to wait 6 minutes for a test must be tedious.
pert:
Does it stop there no matter how long you wait?
If you add a blinking LED to your code, does the LED keep blinking even after the serial output stops?
It won't blink, the code is blocking with a 60 second delay.
(Well, OK, it will blink every 120 seconds)
I don't have an esp8266 nodemcu 12e, but I do have a WiFi Kit 8, which is also an ESP8266 based board. I put your code on it and got the following output:
21:20:03.671 -> Scratchpad.ino
21:21:03.667 -> Scratchpad.ino
21:22:03.667 -> Scratchpad.ino
21:23:03.667 -> Scratchpad.ino
21:24:03.667 -> Scratchpad.ino
21:25:03.677 -> Scratchpad.ino
21:26:03.681 -> Scratchpad.ino
21:27:03.681 -> Scratchpad.ino
21:28:03.683 -> Scratchpad.ino
21:29:03.678 -> Scratchpad.ino
21:30:03.696 -> Scratchpad.ino
21:31:03.696 -> Scratchpad.ino
I don't see any reason for your code to fail, sorry. I do wonder why you want 1 minute delays and why you are not using millis for timing.
What do Karma points do? Are they like the old Green Stamps? Can we trade them for parts at the parts store here?
They make those of us that answer questions feel we are valued!
I can put blink in with a timer will try that.
bool flipThings = false;
unsigned long CheckTime = 1; unsigned long CheckInterval = 60000;
unsigned long bTime = 1; unsigned long bnterval = 600;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println(__FILE__);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
if (millis() > CheckTime) {
CheckTime = millis() + CheckInterval;
Serial.println(__FILE__);
}
if (millis() > bTime) {
bTime = millis() + bnterval;
digitalWrite(LED_BUILTIN, flipThings);
flipThings = !flipThings;
}
}
16:59:26.789 -> sketch_oct10c.ino
17:00:26.799 -> sketch_oct10c.ino
17:01:28.001 -> sketch_oct10c.ino
17:02:27.935 -> sketch_oct10c.ino
17:03:26.797 -> sketch_oct10c.ino
17:04:26.797 -> sketch_oct10c.ino
17:05:26.795 -> sketch_oct10c.ino
17:06:26.823 -> sketch_oct10c.ino
17:07:26.798 -> sketch_oct10c.ino
17:08:26.823 -> sketch_oct10c.ino
17:09:26.821 -> sketch_oct10c.ino
17:10:26.829 -> sketch_oct10c.ino
17:11:26.808 -> sketch_oct10c.ino
yes it blinks at least. time now is 17:19
++Karma; // bool flipThings Best variable name I have seen in a long time!
Are you saying it works now?
Glad to see millis timing not delay, much better.
So, you didn't like my idea about a unique print during setup?
You like keeping . . . a little edge of uncertainty, huh?
How did you manage to amass two karma points?
How did you manage to amass two karma points?
Well, the second one was because his choice of variable name made me smile
No, as before, the device is working but serial monitor is stopped.
I think it's a bug in the IDE somewhere. I will try it with an Arduino UNO and see what happens.
pert
October 11, 2020, 9:12am
19
There is this:
opened 10:40AM - 08 Oct 20 UTC
Type: Bug
Waiting for feedback
Component: IDE Serial monitor
I connect with Arduino 1.8.13 on MacOS Mojave 10.14.6 to an M5Stack Core2 ESP32 … device. With the Serial Monitor open, if there is no data out of the M5Stack for a little while and then there is, it takes a while for the Serial Monitor to realise there is data. When it does wake up it displays the data all in one go. Sometimes it's just a second or two, sometimes it's longer (10 seconds?). It always updates immediately if I move the mouse pointer.
but the symptoms are different, so I'm doubtful it's the same.
This is a wild guess as I have never used an esp8266. There was a thread the other day where someone was having trouble with the watchdog. The code was in a tight loop waiting for a button press and it triggered the watchdog, I assume because it was preventing something behind the scenes resetting the timer.
It seems that long delays are doing rather the same thing - would they trigger the same exception? I don't know if the watchdog crash dump is sent to serial by default.
The main problem with this theory of course is that it didn't crash on the first big delay.