-->
Page 1 of 2

ESP8266 LED control

PostPosted: Wed Sep 09, 2015 12:28 am
by Lotus
Hi,
I'm trying basic LED control, either on/off or PWM with both the Eclipse based compiler by CHERTS (e.g. with the Blinky example) and the Arduino IDE.

I have an issue with the GPIO output not being consistent 100% of the time. There are cyclical times (around every 10 seconds) where the GPIO (used as the output to control an LED) will stall on or off for a second.

Can someone explain why the code is stalling and how to prevent this so as to have a consistent blink rate.

BTW, during the stall there seems to be some UART traffic.

Re: ESP8266 LED control

PostPosted: Wed Sep 09, 2015 12:37 am
by martinayotte
What are you seeing on the serial port during those hangs ?
Is it a crash where the ESP is simply restarting and then the blinking resume ?
(It is probably the usual power supply issue)

Re: ESP8266 LED control

PostPosted: Wed Sep 09, 2015 1:09 am
by Lotus
With the Eclipse Blinky, Blinky2 examples the UART traffic isn't comprehensible. With the Arduino Blink example there is no UART traffic however there are stalls every so often. Occasionally with Arduino there are no stalls.

I'm using a blink rate of 10 Hz to see these stalls.

Re: ESP8266 LED control

PostPosted: Wed Sep 09, 2015 9:24 am
by martinayotte
Add a comprehensive serial.println("Now entering Setup ...") in your setup loop.
If you see that message every time it hangs, then for sure, your ESP is resetting by itself.
Again, probably caused by improper power supply.