Author Topic: ESP-12F deep Sleep  (Read 8071 times)

dinoi

  • freakyfriday
  • Sr. Member
  • *
  • Posts: 441
  • Karma: +7/-0
    • Dinoi
ESP-12F deep Sleep
« on: May 03, 2019, 03:54:06 PM »
Hallo Zusammen
Irgenwie komme ich nicht zum Ziel. Der ESP-12F will einfach nicht sauber aus dem deep Sleep aufwachen.
D16 und RST habe ich verbunden. Nach dem Schlafen blinkt er auch kurz mit der Led aber dann läuft Programm nicht weiter.

Hat da jemand eine Idee?

Unten das Serial Protokoll und her mein Coding:

Code: [Select]
/*
 * ESP8266 Deep sleep mode example
 */
const int ledPin =  14;// the number of the LED pin

// Variables will change:
int ledState = LOW;             // ledState used to set the LED

// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0;        // will store last time LED was updated

// constants won't change:
const long interval = 1000;           // interval at which to blink (milliseconds)


void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(57600);
  digitalWrite(ledPin, HIGH);
  delay(2000);
  Serial.setTimeout(2000);
  digitalWrite(ledPin, LOW);
 
  // Wait for serial to initialize.
  while(!Serial) { }
 
  // Deep sleep mode for 30 seconds, the ESP8266 wakes up by itself when GPIO 16 (D0 in NodeMCU board) is connected to the RESET pin
  Serial.println("I'm awake, but I'm going into deep sleep mode for 10 seconds");
  ESP.deepSleep(10e6);
  delay(200);

  // Deep sleep mode until RESET pin is connected to a LOW signal (for example pushbutton or magnetic reed switch)
  //Serial.println("I'm awake, but I'm going into deep sleep mode until RESET pin is connected to a LOW signal");
  //ESP.deepSleep(0);
}

void loop() {

  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis >= interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;

    // if the LED is off turn it on and vice-versa:
    if (ledState == LOW) {
      ledState = HIGH;
    } else {
      ledState = LOW;
    }

    // set the LED with the ledState of the variable:
    digitalWrite(ledPin, ledState);
  }
 
}

dinoi

  • freakyfriday
  • Sr. Member
  • *
  • Posts: 441
  • Karma: +7/-0
    • Dinoi
Re: ESP-12F deep Sleep
« Reply #1 on: May 03, 2019, 08:27:40 PM »
Also jetzt habe ich die ganze Schaltung nochmals neu aufgebaut und es funktioniert  ;D
An der Programmierung habe ich nichts geändert, daher denke ich dass ich irgend etwas nicht
richtig angeschlossen hatte.  ;)

Gruss Reto