NodeMCU deepSleep Fehler vermeiden

NodeMCU

Während meiner Versuche mit dem NodeMCU und deepSleep stieß ich auf zwei Fehler die man machen kann, aber nicht sollte. Der erste lies mich den Baustein nicht mehr mit neuem Code bespielen. Der Grund ist, dass der Baustein während er im deepSleep Mode ist, sich nicht mehr flashen lässt. Die Lösung des Problems ist hier beschrieben:

Solution: https://forum.arduino.cc/index.php?topic=613412.0

You do not say what version of ESP8266 your using but if it has two buttons on the module (maybe called Reset & Flash) then hold down the flash button, briefly press the reset button and then after a second or two release the flash button. This should put the ESP into programming mode where the built in bootloader is running instead of your sketch.

Is there any other method putting the Wemos into programming mode instead of the second (flash) button?
Connect GPIO0 (that I think is pin D3 on the D1 Mini) to GND and then press the reset button.
You may also need to remove the D0-RST link but I’m not sure.

Der andere schwierig zu findende Fehler war, (vor lauter Begeisterung vergessen 😉 ) abzufangen, falls mal keine Verbindung zustande kommt. Hier ganz einfach mit dem Zähler tries behoben. Ansonsten geht er in Endlosschleife …

//connect to your local wi-fi network
WiFi.begin(ssid, password);/check wi-fi is connected to wi-fi network
int tries = 0;
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.print(".");
tries++;
if (tries > 10) {
// wenn keine verbindung gelingt
Serial.println("No WiFi! Gonig to Sleep");
ESP.deepSleep(10e7);
}}
Serial.println("");
Serial.println("WiFi connected..!");
Serial.print("Got IP: "); Serial.println(WiFi.localIP());

Leave a Reply

Your email address will not be published. Required fields are marked *