ESP8266-12 HANGS WHEN COMING OUT OF DEEP SLEEP MODE
ESP8266-12 HANGS WHEN COMING OUT OF DEEP SLEEP MODE
Postby TheWho » Sun Sep 27, 2015 12:57 pm
I'm using adafruits' esp8266 HUZZAH board (ESP8266-12) connected to a temp / humidity sensor (DHTxx) which is sending temp / humidity data to thingspeak.
The issue is that the ESP8266 will hang when coming out of deep sleep. Whens it's in a deep sleep the red LED will be dim. When it hangs, it turns bright red and the blue light may or may not be lit. It works for hours and then fails for hours with no distinct pattern.
What has me stumped is that I've tried multiple power supplies and cannot detect a pattern.
Any reasons or solutions?
The issue is that the ESP8266 will hang when coming out of deep sleep. Whens it's in a deep sleep the red LED will be dim. When it hangs, it turns bright red and the blue light may or may not be lit. It works for hours and then fails for hours with no distinct pattern.
What has me stumped is that I've tried multiple power supplies and cannot detect a pattern.
Any reasons or solutions?
Re: ESP8266-12 HANGS WHEN COMING OUT OF DEEP SLEEP MODE
Postby ESP_Faye » Fri Oct 09, 2015 3:07 pm
Hi,
Documentation about sleep mode
To wake up from deep-sleep, XPD_DCDC needs to connects to EXT_RSTB with 0 ohm resistor.
Documentation about sleep mode
To wake up from deep-sleep, XPD_DCDC needs to connects to EXT_RSTB with 0 ohm resistor.
Re: ESP8266-12 HANGS WHEN COMING OUT OF DEEP SLEEP MODE
Postby TheWho » Sat Oct 10, 2015 2:11 pm
The system is on a breadboard so the jumper is directly corrected with no resistance. See attached photo.
Could the resistance be incorrect?
********************************************************************************************************************
Here's the code I'm using.
********************************************************************************************************************
#include <DHT.h>
#include <ESP8266WiFi.h>
// replace with your channel's thingspeak API key,
String apiKey = "<Key>";
const char* ssid = "<Network>";
const char* password = "<Key>";
const char* server = "api.thingspeak.com";
#define DHTPIN 5 // what pin we're connected to
DHT dht(DHTPIN, DHT11, 15);
WiFiClient client;
void setup() {
// Time to sleep (in seconds):
const int sleepTimeS = 300;
float h = dht.readHumidity();
float t = dht.readTemperature(true);
Serial.begin(115200);
delay(10);
dht.begin();
WiFi.begin(ssid, password);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(3000);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
if (client.connect(server, 80)) { // "184.106.153.149" or api.thingspeak.com
String postStr = apiKey;
postStr += "&field1=";
postStr += String(t);
postStr += "&field2=";
postStr += String(h);
postStr += "\r\n\r\n";
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" degrees Fahrenheit Humidity: ");
Serial.print(h);
Serial.println("% send to Thingspeak");
}
client.stop();
//Serial.println("Waiting...");
// thingspeak needs minimum 15 sec delay between updates
// delay(300000);
// deepSleep time is defined in microseconds. Multiply
// seconds by 1e6
ESP.deepSleep(sleepTimeS * 1000000);
delay(1000);
}
void loop() {
}
Could the resistance be incorrect?
********************************************************************************************************************
Here's the code I'm using.
********************************************************************************************************************
#include <DHT.h>
#include <ESP8266WiFi.h>
// replace with your channel's thingspeak API key,
String apiKey = "<Key>";
const char* ssid = "<Network>";
const char* password = "<Key>";
const char* server = "api.thingspeak.com";
#define DHTPIN 5 // what pin we're connected to
DHT dht(DHTPIN, DHT11, 15);
WiFiClient client;
void setup() {
// Time to sleep (in seconds):
const int sleepTimeS = 300;
float h = dht.readHumidity();
float t = dht.readTemperature(true);
Serial.begin(115200);
delay(10);
dht.begin();
WiFi.begin(ssid, password);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(3000);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
if (client.connect(server, 80)) { // "184.106.153.149" or api.thingspeak.com
String postStr = apiKey;
postStr += "&field1=";
postStr += String(t);
postStr += "&field2=";
postStr += String(h);
postStr += "\r\n\r\n";
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" degrees Fahrenheit Humidity: ");
Serial.print(h);
Serial.println("% send to Thingspeak");
}
client.stop();
//Serial.println("Waiting...");
// thingspeak needs minimum 15 sec delay between updates
// delay(300000);
// deepSleep time is defined in microseconds. Multiply
// seconds by 1e6
ESP.deepSleep(sleepTimeS * 1000000);
delay(1000);
}
void loop() {
}
Re: ESP8266-12 HANGS WHEN COMING OUT OF DEEP SLEEP MODE
Postby TheWho » Sat Oct 10, 2015 2:11 pm
The system is on a breadboard so the jumper is directly corrected with no resistance. See attached photo.
Could the resistance be incorrect?
********************************************************************************************************************
Here's the code I'm using.
********************************************************************************************************************
#include <DHT.h>
#include <ESP8266WiFi.h>
// replace with your channel's thingspeak API key,
String apiKey = "<Key>";
const char* ssid = "<Network>";
const char* password = "<Key>";
const char* server = "api.thingspeak.com";
#define DHTPIN 5 // what pin we're connected to
DHT dht(DHTPIN, DHT11, 15);
WiFiClient client;
void setup() {
// Time to sleep (in seconds):
const int sleepTimeS = 300;
float h = dht.readHumidity();
float t = dht.readTemperature(true);
Serial.begin(115200);
delay(10);
dht.begin();
WiFi.begin(ssid, password);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(3000);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
if (client.connect(server, 80)) { // "184.106.153.149" or api.thingspeak.com
String postStr = apiKey;
postStr += "&field1=";
postStr += String(t);
postStr += "&field2=";
postStr += String(h);
postStr += "\r\n\r\n";
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" degrees Fahrenheit Humidity: ");
Serial.print(h);
Serial.println("% send to Thingspeak");
}
client.stop();
//Serial.println("Waiting...");
// thingspeak needs minimum 15 sec delay between updates
// delay(300000);
// deepSleep time is defined in microseconds. Multiply
// seconds by 1e6
ESP.deepSleep(sleepTimeS * 1000000);
delay(1000);
}
void loop() {
}
Could the resistance be incorrect?
********************************************************************************************************************
Here's the code I'm using.
********************************************************************************************************************
#include <DHT.h>
#include <ESP8266WiFi.h>
// replace with your channel's thingspeak API key,
String apiKey = "<Key>";
const char* ssid = "<Network>";
const char* password = "<Key>";
const char* server = "api.thingspeak.com";
#define DHTPIN 5 // what pin we're connected to
DHT dht(DHTPIN, DHT11, 15);
WiFiClient client;
void setup() {
// Time to sleep (in seconds):
const int sleepTimeS = 300;
float h = dht.readHumidity();
float t = dht.readTemperature(true);
Serial.begin(115200);
delay(10);
dht.begin();
WiFi.begin(ssid, password);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(3000);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
if (client.connect(server, 80)) { // "184.106.153.149" or api.thingspeak.com
String postStr = apiKey;
postStr += "&field1=";
postStr += String(t);
postStr += "&field2=";
postStr += String(h);
postStr += "\r\n\r\n";
client.print("POST /update HTTP/1.1\n");
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" degrees Fahrenheit Humidity: ");
Serial.print(h);
Serial.println("% send to Thingspeak");
}
client.stop();
//Serial.println("Waiting...");
// thingspeak needs minimum 15 sec delay between updates
// delay(300000);
// deepSleep time is defined in microseconds. Multiply
// seconds by 1e6
ESP.deepSleep(sleepTimeS * 1000000);
delay(1000);
}
void loop() {
}
Last edited by TheWho on Sat Oct 10, 2015 2:13 pm, edited 1 time in total.
Re: ESP8266-12 HANGS WHEN COMING OUT OF DEEP SLEEP MODE
Postby OlgaPaw » Wed Oct 28, 2015 10:02 pm
Hello.
I'm trying to run deep sleep with SDK code, but have no idea in which code place it wakes up. After wakeup esp prints some unidentified chars to UART, but nothing else happend. I use esp-12. With no extra connections. Also tried with esp-01 with the same result.
What should I do? Should I connect GPIO16 to sth? To What?
thanks for answers
I'm trying to run deep sleep with SDK code, but have no idea in which code place it wakes up. After wakeup esp prints some unidentified chars to UART, but nothing else happend. I use esp-12. With no extra connections. Also tried with esp-01 with the same result.
What should I do? Should I connect GPIO16 to sth? To What?
thanks for answers
Re: ESP8266-12 HANGS WHEN COMING OUT OF DEEP SLEEP MODE
Postby TheWho » Thu Oct 29, 2015 12:30 am
OlgaPaw wrote:Hello.
I'm trying to run deep sleep with SDK code, but have no idea in which code place it wakes up. After wakeup esp prints some unidentified chars to UART, but nothing else happend. I use esp-12. With no extra connections. Also tried with esp-01 with the same result.
What should I do? Should I connect GPIO16 to sth? To What?
thanks for answers
GPIO will need to be connected to RST pinout. I used a jumper to do that or you can solder a wire.
I'm using the ESP-12 on a breakout board. The ESP-01 requires a wire to be soldered from the chip wire to the pin.
The deep sleep code will wake up and restart at the beginning.
Who is online
Users browsing this forum: No registered users and 3 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.