Giter Site home page Giter Site logo

esp-now's Introduction

ESP-Now

Note: *** help make this 5 times faster and so extend the battery life 5 times longer - ask to get this issue fixed: esp8266/Arduino#3408 ***

ESP-Now is an interesting ESP8266 protocol that could be used for battery powered sensors. Its built on top of 802.11 vendor-specific action frames which enables sending data without having to first establish a WiFi AP to Station connection which is time consuming and so adds significantly to draining the batteries on each sensor wakeup.

I've given some examples of it before, here, however ESP-Now doesn't work with Wifi so a gateway receiving ESP-Now transmissions can't also connect to a Wifi network, so thats made it pretty impractical for most uses.

I've been playing about with ESP-Now again recently and come up with two workarounds for the Wifi co-existence problem. One is to restart the ESP8266 after receiving each ESP-Now transmission, the other is to use two ESP8266's - one as the ESP-Now receiver and the other as the Wifi gateway.

The first approach of restarting the ESP8266 might seem a bit clunky but it actually works ok. The restart takes a few seconds (most of the time spent reconnecting WiFi), so if there aren't too many remote ESP-Now sensors or the sensor transmissions aren't too frequent then the Gateway being regularly unavailable for a few seconds doesn't actually matter.

The second approach with using two ESP8266s is more complicated to set up but also more robust and allows higher throughput. I've used a simple serial link with the ESP-Now receiver simply writing the received data to the Serial port which another ESP8266 can read using SoftwareSerial. You could also try writing a more fancy I2C or SPI driver too.

These are some ESP-Now devices using this approach. A battery powered temperature/humidity/pressure sensor built into a LED light case and an ESP-Now to Wifi Gateway using the DIY USB powered ESP (described here).

Sample code for these are in this repository.

Alt text

You can see the data from that ESP-Now based BME280 sensor thats in my back garden in London here.

esp-now's People

Contributors

antelder avatar torntrousers avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.