I used a sketch from Anthony Elder, that I adapted for my needs. There is plenty of information on the Web so there is no real need to reinvent the wheel. ![]() Sample code can be found here too (pdf),ġ use one ESP8266 to read a sensor like the BME280 and send the data via ESP-NOW, keeping the ESP in deepsleep in between.Ģ use another ESP8266 to receive the incoming data and eventually send that via an http request or MQTT to the network Wim3D on instructables however follows an interesting concept as well as he has the sending ESP8266 connect to MQTT if the ESP-NOW transfer goes faulty. Anthony Elder in fact already published code using ESP-NOW to transfer BME280 data and go to sleep in between, and also “ The guy with the Swiss accent’ did, as did some others, but usually based on Anthony’s code.Īnthony’s sketches though do not have the receiving ESP connect to a network as well, but it can be done, albeit in a bit unorthodox way. It is perfectly well possible though to also use it on an ESP8266 and that is what I will be doing here. Sure you can add an LCD to read the data, but it would be handier if the received data would be available on a network, for Home Assistant or openHAB being able to do something with it, or to store it in a database.ĮSP-NOW works fairly straightforward on the ESP32 and a very good “How To” can be found on randomnerdtutorials. That extra ESP can receive data from 20 other ESP’s.Īnother drawback is that the receiving ESP is ‘isolated’. That is also one of the drawbacks: you need an extra ESP8266 (or ESP32). The big gain in using ESP-NOW is that the ESP8266 (or ESP32 for that matter) does not need to make connection with a router, but it sends data immediately to another designated ESP, which makes the process much faster. In ESP-NOW, application data is encapsulated in a vendor-specific action frame and then transmitted from one Wi-Fi device to another without connection. ![]() ESP-NOW is a kind of connectionless Wi-Fi communication protocol that is defined by Espressif. There are other ways to send data though that cost less time and therefore less energy than establishing a WiFi connection. In the previous 4 articles on deepsleep and energy saving, I mainly focussed on establishing a WiFi connection to send data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |