Hello Sara and Rui,
As a frequent and happy user of your courses I would like to have your advice, tips etc. on connecting a ESP8266 esp-now sensor network to a TTGO ESP32 LORA, that works as ESP-NOW receiver and LORA-sender. This LORA sensor connects to Things Stack network as OTAA device. I’ve managed to get it working, but without implementing deep sleep.
I couldn’t find, examples and/or libraries of systems that implement deep sleep in a way that would suit this project. Most of the time I “reengineer” the work the very nice people that share there knowledge github, youtube …..
I’m imagining a systen consisting of a many-to-one ESP-NOW ESP8266 sensor network. The slave of this network collects the sensor readings, writes it in one record (structure) and sends this record in a timely fashion to the LORA sender(TTGO). The system is meant for a community garden so should battery operated. It is possible to connect the slave ESP8266 to a small solar panel, in case this would be an advantage (less complex) to keep it alive 24 hours.
I hope you can point in the right direction and give me a headstart.
Kind regards and keep up your good work
In what way do you want to implement deep sleep? In which boards? What sleep pattern? What’s the wake-up method you want to use?
Thanks for the quick answer.
In what way do you want to implement deep sleep?
Deep Sleep in an ESP-NOW network
In which boards?
Wemos d1 mini ESP8266 and TTGO ESP32 LORA Oled.
What sleep pattern?
A pattern that is able to update sensors readings every 10 minutes.
What’s the wake-up method you want to use?
The best wake-up method would be that the
- Wemos d1 wakes up every 10 minutes on timer
- Wemos d1 wakes up TTGO and sends its readings (eg temperature, humidity …..) via ESP-NOW
- TTGO reads ESP-NOW sensor readings
- Wemos goes to deep sleep
- TTGO join TTS network and uplinks the sensor readings
- TTGO goes to deep sleep until woken up by Wemos 10 minutes later
You can easily put the Wemos D1 mini to sleep every 10 minutes and send readings every time it wakes up. You can easily do that with a timer wake-up. Check the following tutorial:https://randomnerdtutorials.com/esp8266-deep-sleep-with-arduino-ide/
Unfortunately, the receiver board (the TTGO in your case) can’t be woken up wirelessly by the other board. It can either be awakened by a timer or via a physical signal.
A workaround is to use MQTT with retained messages and awake the boards with a timer. In that case, when the receiver wakes up, it can check with the broker if it received the last message. With ESP-NOW that doesn’t happen. If the recipient didn’t get the message, it won’t be saved anywhere else.
I hope this is clear.
Let me know if you need further help.