Unable to wake up ESP8266 after Deep Sleep

I suspect that you are seeing a race between API and MQTT that doesn’t complete before the ESP goes to sleep. This would explain why different boards present differently.

I never use API and MQTT together. In fact I am moving (slowly) away from MQTT for my devices.

In my case, I have an ESP in each of my cars that is mostly asleep. Every 15 seconds they wake, connect API then go back to sleep. This provides me with a presence detect. (If it’s connected, it’s present).

To do updates OTA, I turn on a helper entity ironically called “OTA_Mode”. In the ESP yaml code, I run an on_connect script to test that helper entity. If the helper entity is not on, it goes back to sleep.

Hope this helps.

Hi Spiro,

thanks for the coding. That works fine, now the MQTT Values stay available. Unfortunately it has no influence to the wake up behavior. I deleted the API lines and send the MQTT Message only. Also I changed the Run and Sleep Time to 60s but it still stay sleeping.

Thanks,
the Noblast

Hi Stevemann,

I tried both ways now. Only API and MQTT only. Also I changed the time to 60s running time and 60 sleeping to have time to complete internal task. But non of these works at the mentioned boards.

But now I’m curious, what do you use ESP for in your cars? And I also find the implementation with the helper interesting. Would you send me your Yaml code so that I can perhaps optimize mine?

Thanks and greetings
the Noblast

If by wake up behaviour you mean that you can’t get the device to go into OTA mode then perhaps there is something wrong with the way you are trying to trigger it. Show the code you are using to send the MQTT message for sleep prevent. If you are getting readings on the sensor that update then it is waking and going back to sleep.

The ESP’s are a beacon. If the API connects, the car is ‘home’. It is an interconnect. If neither car is ‘home’, the garage door automation won’t run.

Here is a link to my notebook:
Esphome example deep sleep - Notebook (mann.ws)

Hello Spiro,

the problem is that the board doesn’t wake up. The OTA message can of course only be recognised in running mode. If the ESP are awake, the OTA function works to prevent them from going back to sleep very well.
The strange thing is that the boards sometimes only wake up when the resistor is soldered between 3.3 volts and SDD0. Without adjusting the Yaml code, the behaviour of the board changes.
And not just with one board, but with several.

Greetings
the Noblast

Ok, it was just that you were able to show logs of the device above. I suspect then that was just when you did a hard reset of the D1 Mini but wouldn’t afterwards wake from deep sleep.
Checking one last thing.

When you said externally you meant supplying 3.3V and GND from an external source to the 3.3V and GND pins and not from putting 5V to the 5V pin on your D1 mini?

Hello Spiro,

yes, I always started the log after a reset, this is the boot process until the first deep sleep.

I got the information about the resistor from the following link:

ESP.deepSleep hangs after wakeup - ESP12F (Working on older chips) #6007

Here a bridge is placed from the 3.3 volt pin to the SDD0 pin:

Greetings
the Noblast

external supply
I meant about suppyling the board from an external 3.3v to the 3.3v pin and not having a usb plugged in.

Hi Spiro,

sorry for the misunderstanding. I powered ist in different ways. First I Powered ist like your sketch with an Step Down converter. It Converts the 12 V from my car to the 3.3 V. I have also tried it with a capacitor.

Then I tried it with the USB voltage. That didn’t make any difference.

For the last test, I only worked with the USB voltage.

Greetings
the Noblast

What is this witchcraft? :rofl:

LOL. Now you see it , now you don’t . The camera never lies.
Still can’t work out why this doesn’t wake up. I’ve never had problem waking D1 mini waking up. I’ve mostly used ESP12F with cells (and solar panel) to avoid wasting energy on a 5v regulator. I must be assuming something that’s wrong.

1 Like

Personally I just go for esp32’s for deep sleep projects.

More features and less hassle.

…but that’s not the topic…:wink:

As I said before:

Are you still running API and MQTT at the same time? In my experience this never works well.

Hello Stevemann,

I have not yet made any changes to the boards that are already running and the API and MQTT are running in parallel. And it is running.

On the boards where I have the problems, I have not been able to get them to run either when I have only run API or MQTT. Unfortunately, this made no difference, even if I extended the runtime.

I might try to change the way, how I send them to deep sleep.

thanks,
the Noblast

Do you know if you have clones or originals?

Some clones can be poor quality.

I don’t know much about AZ-Delivery.

azdelivery
I think that isnt a legit AZ delivery as no branding.

Who is the original?
Expressif publishes schematics and PC board files for ANYONE to make development boards. So, by this logic they are ALL clones.

I have purchased dozens of ESP development boards from Amazon, eBay, AliExpress and Expressif. I have only experienced one DOA board, and even then I can’t be sure that I didn’t smoke it.

We’ve discussed this before, @stevemann. The term “clone” may not be the best choice of word. I use it as shorthand (a term I picked up from the linked thread), but I appreciate it might be misleading. I’ll try to remember to avoid using it in the future to avoid debate and the potential for being misleading.

Previously, I bought the cheapest options until I started getting weird reliability issues (broadly like the current one, which is what prompted me to make the connections and mention it, especially since other common causes seem to have been explored), also prompting the creation of the thread I mentioned.

If you haven’t had issues with inexpensive purchases, that’s great – no need to change I guess. Personally, I switched to higher-quality boards and now encounter fewer problems, which works for me.

I primarily wanted to highlight that some cheaper boards have lower-quality components and may have reliability issues.

Can I just say thank you for this. I have 2 NodeMCU 8266’s that were refusing to wake from deep sleep and this was the cure. Don’t know why or how but I’ll take it. 10k resistor between 3.3v and S0 on my board.