aREST icon indicating copy to clipboard operation
aREST copied to clipboard

esp8266

Open pickeld opened this issue 8 years ago • 11 comments

Hey, im using aREST for controlling my relay, all goes fine untill after few hours the esp8266 get bricked and i need to physically unplug and re-plug it. whilee trying to figure out why my esp8266 is no longer responsive i attached the rx and tx to the computer and add the code Serial.println(WiFi.status());

the results are

WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 6 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3 WiFi Status: 3

does anyone knows whats going on here?

pickeld avatar Feb 13 '16 09:02 pickeld

My first guess would be power issues. I experience similar issues when running with a USB cable via pc and those breadboard power adapters. There's not enough current.

What module are you running?

saliehendricks avatar Feb 13 '16 11:02 saliehendricks

i was using a poor 5v 500mAh phone charger. while running esp8266 and a relay. now i've changed to 5v 2000mAh . ill update for any change. thank you

pickeld avatar Feb 13 '16 17:02 pickeld

here's an update: i change the power suplly as mentioned above. that DIDNT helped. the power supply mac current is 2000mAh. and it provieds 5v. the esp8266 uses 3.3v so i added an ams1777 to regulate the volage to 3.3. the ams1117-3.3 max current as i read is above 1mA to thats not a problem.

I've read too many articles about preventing the esp8266 reseting, some of them say to attach a 0/1uf - 1uf from the vcc to gnd. that didnt make the trick for me.

should a firmware upgrade will do the work? what should i do then?

hopefully someone here will help me. im lost :(

here is my code & sketch:

// Import required libraries #include <ESP8266WiFi.h> #include <aREST.h>

// Create aREST instance aREST rest = aREST();

// WiFi parameters const char* ssid = "SSID"; const char* password = "PASSWORD";

// The port to listen for incoming TCP connections #define LISTEN_PORT 80

// Create an instance of the server WiFiServer server(LISTEN_PORT);

// Declare functions to be exposed to the API int ledControl(String command);

void setup(void) { // Function to be exposed rest.function("led", ledControl);

// Connect to WiFi while (WiFi.status() != WL_CONNECTED) { WiFi.begin(ssid, password); delay(10000); } // Start the server server.begin(); }

void loop() { // TRYING TO FORCE ESP8266 RECONNECT WHENEVER THERE IS NO CONNECTION while (WiFi.status() != WL_CONNECTED) { WiFi.begin(ssid, password); delay(7000); server.begin(); }

// Handle REST calls WiFiClient client = server.available(); if (!client) { return; } while (!client.available()) { delay(1); } rest.handle(client);

}

// Custom function accessible by the API int ledControl(String command) {

// Get state from command int state = command.toInt();

digitalWrite(2, state); return 1; }

sketch

pickeld avatar Feb 14 '16 09:02 pickeld

Hi Marco, I am also experiencing dropouts. I am using the Adafruit Huzzah board with a 5v 2 Amp power supply. I am running your example program controlling a relay from your book. I can see the webserver running with the on and off buttons displayed but after a few hours I cannot get the buttons to appear. The Huzzah appears to still be on line but no webpage. Attached is a screenshot of the buttons as they appear before the text and buttons no longer show up. screenshot from 2016-02-29 13 49 03

Regards,

Steve V

sverzulli avatar Feb 29 '16 18:02 sverzulli

Hello, from what I know so far it seems like a memory leak problem of the ESP8266 & Arduino IDE. I couldn't find the problems on my own sketch, so it might be an issue with the compiling step with the ESP8266 Arduino library. I'll look more into it.

marcoschwartz avatar Mar 11 '16 17:03 marcoschwartz

Hello, I am having same type of issues, works a for a while then locks or reboots, I have tested 2 nodeMCU v3 and a wemos. Seems like a memory leak somewhere.

yomasa avatar Mar 19 '16 03:03 yomasa

i've changed to mqtt. all works great. hope to change back to aRest soon when the bug is fixed good luck!

pickeld avatar Mar 19 '16 09:03 pickeld

Can someone recommend a more stable platform or hardware, I don't know if I can wait for the Ardino IDE to fix all the issues with the esp8266 ?

yomasa avatar Apr 08 '16 18:04 yomasa

@yomasa I actually released a new version of aREST yesterday that adds the support for the latest board of Arduino, the MKR1000. It's more expensive than the ESP8266 but also has built-in WiFi. No problems so far :)

marcoschwartz avatar Apr 09 '16 08:04 marcoschwartz

@marcoschwartz Thank you for doing that, I just ordered one. I also ordered a LinkIt Smart 7688 Duo looks like it may be also useful and only $15.00 and Arduino Yún compatible http://www.seeedstudio.com/depot/LinkIt-Smart-7688-Duo-p-2574.html

yomasa avatar Apr 09 '16 16:04 yomasa

I would suggest for powering the esp to use a buck-converter like lm2596, it's far more stable than a single regulator.

odyslam avatar Aug 16 '16 14:08 odyslam