torntrousers wrote:Does anyone have deep sleep working well on an ESP-01? ... it always ends up in the zombie mode
Just as FYI - this seems to have been resolved by soldering a 100uF capacitor directly to the power pins of the ESP-01
Explore... Chat... Share...
Moderator: igrr
torntrousers wrote:Does anyone have deep sleep working well on an ESP-01? ... it always ends up in the zombie mode
client.stop();
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
ESP.deepSleep(30000000ul);
delay(100);
//extern "C" { // For 'system_deep_sleep()'
//#include "user_interface.h"
//}
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include "TimeClient.h"
float utcOffset = 9.5; // enter your UTC
TimeClient timeClient(utcOffset);
const char* ssid = "SSID";
const char* password = "Password";
IPAddress ipBroadCast(192, 168, 1, 200); // Destination IP
const unsigned int udpRemotePort = 8889; // Destination Port
const int sleepTimeS = 3; // Deep sleep time (s)
const int UDP_PACKET_SIZE = 10; // excluding NL character
char udpBuffer[UDP_PACKET_SIZE];
WiFiUDP udp; // setup UDP object
//////////////// SETUP ///////////////
void setup() {
delay(500);
Serial.begin(57600);
delay(100);
// We start by connecting to a WiFi network
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.print("Destination IP address: ");
Serial.println(ipBroadCast);
Serial.print("Port: ");
Serial.println(udpRemotePort);
Serial.println("Starting UDP");
}
void loop() {
timeClient.updateTime();
//String time = timeClient.getFormattedTime();
strcpy(udpBuffer, "abcdefghij"); // Debug message
udp.beginPacket(ipBroadCast, udpRemotePort);
delay(10);
udp.write(udpBuffer, sizeof(udpBuffer));
delay(10);
udp.endPacket();
udp.flush(); // not required (doesn't help)
Serial.print("Sent: ");
Serial.println(udpBuffer);
//// SLEEP ////
Serial.println("Entering sleep mode...");
Serial.println("");
//WiFi.forceSleepBegin();
//ESP.deepSleep(sleepTimeS * 1000*1000, WAKE_RF_DEFAULT); // or WAKE_RFCAL or WAKE_NO_RFCAL or WAKE_RF_DISABLED or WAKE_RF_DEFAULT
//ESP.deepSleep(3 * 1000*1000);
//system_deep_sleep(3 * 1000*1000);
Serial.println("Exiting sleep mode...");
delay(1*1000);
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]