Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ESP32-NOW #3999

Closed
hierophect opened this issue Jan 14, 2021 · 34 comments · Fixed by #7470
Closed

Support ESP32-NOW #3999

hierophect opened this issue Jan 14, 2021 · 34 comments · Fixed by #7470
Assignees
Milestone

Comments

@hierophect
Copy link
Collaborator

ESP32-NOW is a custom connectionless protocol developed by Espressif, which allows ESP32 and ESP32S2 boards to communicate directly with each other without using WiFi. It's supposedly similar to the 2.4GHz connectivity used in wireless mouses. This would enable ESP32S2 projects to connect multiple devices without the need for a router or any kind of internet connection, such as gathering data from a network of remote sensors, talking between a remote control and a receiver, sending instructions to a swarm of receiver units, etc. In terms of the projects it enables, it'd be similar to a lower range, built in LORA radio.

This link seems to have some good examples (all written for Arduino). Espressif documentation is here.

Some of the traits of ESP32-NOW include:

  • It's connectionless, so no handshaking
  • Open field range reportedly about 200m
  • Works simultaneously with wifi (though it's a bit finicky)
  • Short packets, 250 bytes max per packet.
  • 10 peers max when encrypted, up to 20 unencrypted
@hierophect hierophect added proposal espressif applies to multiple Espressif chips labels Jan 14, 2021
@askpatrickw
Copy link

Question: Would this be a library or must it be implemented in the ESP32-S2 port?

@hierophect
Copy link
Collaborator Author

@askpatrickw it will need to be implemented on the port level, it doesn't make use of existing wifi calls, if that's what you mean. But we might want a library on top of it.

@dhalbert dhalbert added this to the Long term milestone Jan 14, 2021
@microdev1
Copy link
Collaborator

How about a new MESH module for this... the top-level stuff can also be shared with Zigbee (#4007).

@anecdata
Copy link
Member

There's also ESP-MESH which is a more typical wi-fi mesh protocol. Naming may get confusing.

@microdev1
Copy link
Collaborator

How about a new MESH module for this... the top-level stuff can also be shared with Zigbee (#4007).

I got confused between ESP-NOW and ESP-MESH here.
ESP-NOW seems to be more of a point-to-point receiver-to-transmitter communication rather than a mesh network.

@ehagerty
Copy link

FWIW, i'm using their esp-mdf C stack right now doing some PoC for my healthech startup - utilising their meshkit-sense, meshkit-light and soon meshkit-button. Their reference code for the button actually uses both esp-mesh and esp-now modes. Don't know if that is useful to you guys at all.

@microdev1
Copy link
Collaborator

Their reference code for the button actually uses both esp-mesh and esp-now modes.

Interesting... ESP-NOW is more lightweight than ESP-MESH so one can assume it would work better when it comes to sensor or button nodes which are not always active and require power consumption to be minimal.

@BetterAutomations
Copy link

BetterAutomations commented May 7, 2021

Since this is being integrated into MicroPy and Pycom could their modules be imported in CircuitPy?

@hierophect
Copy link
Collaborator Author

Since this is being integrated into MicroPy and Pycom could their modules be imported in CircuitPy?

It'll certainly make implementation easier. I'm thinking of tackling this for a personal project so I'll check it out over the weekend.

@hierophect
Copy link
Collaborator Author

For anyone who is interested in this module - what kinds of projects would you use it for? And what do you feel the biggest draws of it are, compared to other similar options?

@wifijt
Copy link

wifijt commented May 11, 2021

I would LOVE this - the biggest use cases would be in-vehicle networks - specifically boats and RV's where I don't run a router - also in the shop for things like dust collection automation. Basically anything that doesn't need WiFi connectivity to the internet or to a server resource.

@BetterAutomations
Copy link

For anyone who is interested in this module - what kinds of projects would you use it for? And what do you feel the biggest draws of it are, compared to other similar options?

I would use it for accessories connecting to a central unit. The biggest drawback for me is the requirement that the central and the accessory knows each other’s MAC address. When selling accessories I cannot know this in advance. The MAC must be shared on another channel first such as Bluetooth. Another drawback is that the protocol isn’t open; only ESPs can talk to ESPs by ESP-NOW.

@vkichline
Copy link

ESP-NOW is a great remote control protocol. It can achieve much longer range (with much lower bandwidth) than WiFi and needs no network access, making it resistant to many issues that affect portable control systems, such as security.
I would use this protocol today if it were available to write a wireless multi-servo control, using an M5 for the UI/HID and an ESP32-S2 as the receiver/controller.

@SultanOfSolder
Copy link

For anyone who is interested in this module - what kinds of projects would you use it for? And what do you feel the biggest draws of it are, compared to other similar options?

For community theater, props that can trigger their own sound queues. Think "How do we trigger a gun shot sound when the actor pulls the trigger, instead of having the sound guy inevitably triggering it 1.5 seconds late in at least one performance?" {Trust me, this happens all the time!}
The transmitter is in the prop, and the receiver sends a MIDI command when triggered, or signals a WAV file player that is plugged into the sound board.
The biggest draws are fast response, a private network that is less likely to be hacked, and lower power consumption.

@tannewt
Copy link
Member

tannewt commented Sep 15, 2021

@SultanOfSolder How far away is the prop from receiver? You could use BLE instead of Wifi.

@wifijt
Copy link

wifijt commented Sep 15, 2021 via email

@SultanOfSolder
Copy link

@tannewt It varies, but can easily be 50 to 75 feet, line of sight. One of the theaters I work with is 110 seats, another is 1700. You could place the receiver above/below the stage and run a cable back to the sound board, but that's less than ideal. Not every show will need it, so I'm looking for a PnP solution.

@deshipu
Copy link

deshipu commented Sep 15, 2021

I would also love to have the ability to use ESP-Now for my robots. Bluetooth is not an option, since this is an ESP32-S2. I will use regular WiFi for now.

@BetterAutomations
Copy link

Remember that other high speed protocol devices exist, such as LoRA or the HC-12 module. Cheap and effective, not secure but you can always add that on top in software.

@SultanOfSolder
Copy link

@BetterAutomations All of which require an antenna of some length that you may not be able to bury in the prop. The arduino libs work, but it's a lot easier to figure out what you wrote in python when you have to make changes a year later.

@grahamwarby
Copy link

Given the fact that esp now connects in milliseconds and wifi takes 6-7 seconds battery life for deep sleep etc. will be greatly extended. My application is for wands for my grandchildren that control leds.

@BaunLib
Copy link

BaunLib commented Nov 24, 2021

ESP NOW for offline communications in areas without internet?

@tomasApo
Copy link

Not really, the bit rate is extremely small. An example of the use for this tech is to transfer temperature/humidity readings to another esp microcontroller with distances less than 200m. > ESP NOW for offline communications in areas without internet?

@BaunLib
Copy link

BaunLib commented Nov 24, 2021

Thanks

@BaunLib
Copy link

BaunLib commented Nov 24, 2021

Wishing to utilise the WIFI on Raspberry Pi or ESP32 for education delivery in rural communities

@hierophect
Copy link
Collaborator Author

hoping to maybe have a crack at this over christmas

@adafruit adafruit deleted a comment from BaunLib Dec 20, 2021
@ladyada
Copy link
Member

ladyada commented Feb 16, 2022

heres a minimal implementation for anyone who wants to take a crack at adding to circuitpy https://github.com/chrmlinux/tinyESPNow

@richsad
Copy link

richsad commented Apr 3, 2022

@hierophect did you ever get ESP32-NOW working on CP? I have a number of ESP32-S2-based dev boards and I'd be interested in experimenting with this protocol for the same type of use cases where'd I'd use LORA or other lightweight radio system. The advantages of this protocol seem to be:

  • No additional radio required for an ESP32
  • better suited to low power use cases than WiFi
  • does not require a router
  • ideal for small (<=250 byte) packets

If this is still ongoing perhaps I can help with the code. I'm a systems level programmer with lots of experience implementing libraries to access low level systems. I'd work on this as part of my hobby work with microcontrollers (primarily purchased from Adafruit)

@deshipu
Copy link

deshipu commented Apr 3, 2022

If this is still ongoing perhaps I can help with the code.

@richsad I don't think anybody is working on it at the moment, so if you feel like this, just go ahead and try it. There shouldn't be any problems merging it, as far as I know, and the devs were always happy to review such patches.

@muttstang
Copy link

muttstang commented May 2, 2022

Has anybody been working on this?

Something like this would be very useful for a project I'm working on currently. I have 2 boards. One in a stationary box on my boat and another in a hand controller. I'd like to try to keep communication between the 2 boards as simple as possible

@askpatrickw
Copy link

@muttstang I've not heard anyone talk about it.

@americoperez49
Copy link

Since this is being integrated into MicroPy and Pycom could their modules be imported in CircuitPy?

It'll certainly make implementation easier. I'm thinking of tackling this for a personal project so I'll check it out over the weekend.

Have you made any progress on this? If not, if you could give me some guidance on how to start, I would be willing to try to work on this. I desperately want this feature and considering that there are builds of micropython out there with ESP-NOW support, maybe it won't be super difficult to complete this.

@askpatrickw
Copy link

askpatrickw commented Oct 17, 2022

@americoperez49 I think the first place to track is the MicroPython (MP) pull request. micropython#6515

That will need to be merged and released and then CircuitPython (CP) will need to pickup that new MP release before someone in the CP community can work on this.

You could start by building CP off of that PR, but I think that would be very unstable especially in the API since that MP PR has not been code reviewed yet.

@askpatrickw
Copy link

askpatrickw commented Oct 18, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.