I uploaded a simple Arduino sketch that outputs to serial when the chip starts. It's outputting this setup info intermittently when I 'm not interacting with the board. I tried powering from USB and battery and the behavior is the same. It seems to be intermittently rebooting on its own.
I tracked when it happened just to see if there was some consistency. The log of reboot times is below.
13:11:58
13:12:49
13:14:13
13:14:49
13:14:54
Is there something I can try to get this board stable?
Feather HUZZAH with ESP8266 rebooting
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Feather HUZZAH with ESP8266 rebooting
It probably means the code running on it is hanging long enough to force a reboot. Post the code you're using (between CODE tags please) and we'll take a look.
- ajdavis
- Posts: 6
- Joined: Mon Aug 21, 2017 1:19 pm
Re: Feather HUZZAH with ESP8266 rebooting
I uploaded a slightly modified blink sketch based on your reply. I'm seeing the same behavior. Here it is:
Code: Select all
void setup() {
Serial.begin(9600);
delay(2000);
Serial.println("");
Serial.println("Runnning...");
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Feather HUZZAH with ESP8266 rebooting
In that code, the calls to delay() are probably causing the trouble.
The ESP8266 runs an operating system that swaps between the user code and the code necessary to run the Wifi radio. It has to swap between them periodically to keep a Wifi connection working, and if the user code doesn't release the CPU for a while, you'll get a watchdog timer interrupt.
Try breaking the delay(1000) into this:
The yield() calls give the OS a chance to check the Wifi.
The ESP8266 runs an operating system that swaps between the user code and the code necessary to run the Wifi radio. It has to swap between them periodically to keep a Wifi connection working, and if the user code doesn't release the CPU for a while, you'll get a watchdog timer interrupt.
Try breaking the delay(1000) into this:
Code: Select all
for ( int i=0 ; i < 100 ; i++ ) {
yield();
delay( 10 );
}
- ajdavis
- Posts: 6
- Joined: Mon Aug 21, 2017 1:19 pm
Re: Feather HUZZAH with ESP8266 rebooting
Thanks, I will try that. Is there a certain threshold that I can keep in mind?
- ajdavis
- Posts: 6
- Joined: Mon Aug 21, 2017 1:19 pm
Re: Feather HUZZAH with ESP8266 rebooting
I modified my code to take into account the ESP8266 watchdog as seen below. I'm still running into random reboots.
Code: Select all
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
safe_delay(1000);
digitalWrite(LED_BUILTIN, LOW);
safe_delay(1000);
}
void safe_delay(int time_in_ms) {
const int SAFE_DELAY_TIME = 10;
for (int i=0 ; i < time_in_ms ; i += SAFE_DELAY_TIME ) {
yield();
delay(SAFE_DELAY_TIME);
}
}
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Feather HUZZAH with ESP8266 rebooting
Okay, let's take a look at the hardware. Post a photo showing the ESP8266 and any connections to it please. 800x600 images usually work best.
- ajdavis
- Posts: 6
- Joined: Mon Aug 21, 2017 1:19 pm
Re: Feather HUZZAH with ESP8266 rebooting
At this point I've simplified as much as possible. I'm using the built in LED, USB connected to a powered hub and a 150mAh battery.
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Feather HUZZAH with ESP8266 rebooting
Everything looks normal there.
Let me check with a couple of other people who know the ESP8266.
Let me check with a couple of other people who know the ESP8266.
- adafruit2
- Posts: 22200
- Joined: Fri Mar 11, 2005 7:36 pm
Re: Feather HUZZAH with ESP8266 rebooting
weird - no idea. we can replace it - email support@adafruit - not sure it will help but worth a shot :)
- ajdavis
- Posts: 6
- Joined: Mon Aug 21, 2017 1:19 pm
Re: Feather HUZZAH with ESP8266 rebooting
I already ordered a Metro Mini to replace it for this project. I was just wanting to test the wifi capabilities since this board is so inexpensive. I'll email support. Thanks.
Please be positive and constructive with your questions and comments.