ESP8266 internet connected switch esp-01 bugs

7 years 10 months ago #3733 by Nikoloudakis
Hi,
I tried to construct project ESP8266 internet connected switch (EasyIoT Cloud MQTT API V1) - improved with esp-01 and after a lot of effort and debugging, i think i found 2 bugs (only for esp-01).
1)esp-01 doesn't have a BUILTIN_LED ,so in order to run it on the esp-01 I had to comment all the references in the code that was similar to BUILTIN_LED code.
2)After some manual power-down resets ,esp was going in AP-mode and some other times it connected without problem
I think there is a problem with the sketch.
When the esp restarts in my case, it immediately tries to connect to the WiFi.
In the beginning of the code we write WiFi.begin(storage.ssid, storage.pwd);
After debugging I found that sometimes after restart esp connected in the background immediately to WiFi before the code reaches WiFi.begin! Strange and odd! And after the code reaches WiFi.begin, it is already connected, so the connection fails and goes to AP mode
I inserted a statement if (WiFi.status() != WL_CONNECTED) before WiFi.begin and now I don't have a single connection failure. :P Hope someone can replicate these finding's, and i hope I helped someone.
The following user(s) said Thank You: EasyIoT

Please Log in or Create an account to join the conversation.

7 years 9 months ago #3740 by EasyIoT

Nikoloudakis wrote: Hi,
I tried to construct project ESP8266 internet connected switch (EasyIoT Cloud MQTT API V1) - improved with esp-01 and after a lot of effort and debugging, i think i found 2 bugs (only for esp-01).
1)esp-01 doesn't have a BUILTIN_LED ,so in order to run it on the esp-01 I had to comment all the references in the code that was similar to BUILTIN_LED code.
2)After some manual power-down resets ,esp was going in AP-mode and some other times it connected without problem
I think there is a problem with the sketch.
When the esp restarts in my case, it immediately tries to connect to the WiFi.
In the beginning of the code we write WiFi.begin(storage.ssid, storage.pwd);
After debugging I found that sometimes after restart esp connected in the background immediately to WiFi before the code reaches WiFi.begin! Strange and odd! And after the code reaches WiFi.begin, it is already connected, so the connection fails and goes to AP mode
I inserted a statement if (WiFi.status() != WL_CONNECTED) before WiFi.begin and now I don't have a single connection failure. :P Hope someone can replicate these finding's, and i hope I helped someone.


Thank you for your feedback.
BUILTIN_LED is only for ESP8266 NODEMCU. Also as I tested you can debug only if you are using ESP8266 NODEMCU, but not with ESP-01. ESP8266 NODEMCU is recommend for beginners, because it easy to debug and LED and button is already connected, also power supply is built in.

Please Log in or Create an account to join the conversation.

Time to create page: 0.215 seconds

Forum latest

  • No posts to display.