ESP-Now support
-
How about it? :-)
https://www.espressif.com/en/products/software/esp-now/overviewI see a library being started over here:
https://github.com/micropython/micropython-esp32/issues/197 -
Hi,
This is a feature we will be looking into but we don't have a specific date for when it might be available I am afraid.
-
I may use this workaround: Configure an ESP8266 as an ESP-Now client and control it from the Wi-Py over UART.
-
I was happy to see this is finally being added :-)
https://forum.pycom.io/topic/7016/new-beta-release-v1-20-3-b3?page=1
-
@BetterAuto
yes, it is really usefull way to comunicate between boards :) -
Re: New Beta Release v1.20.3.b3
I'm interested in testing ESPNow, I have tried to create an ESPNOW interface instance following the example here https://github.com/glenn20/micropython/blob/espnow-g20/docs/library/espnow.rst
However the ESPNOW module is not callable;
from network import ESPNOW e=ESPNOW() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'module' object isn't callableAny thoughts?
-
Hi,
We're working on getting the documentation out there. In the meantime you can find it here: https://github.com/pycom/pycom-documentation/pull/387/files (near the bottom):from network import WLAN from network import ESPNOW import binascii import time # The callback to be registered when a message has been sent to a Peer def espnow_tx(result): # "result" is the parameter in form of 2 element long tuple # "peer" is the Peer which the message has been sent to # "sent" is a boolean showing whether the message could be sent peer, sent = result mac = peer.addr() if(sent == False): print("Sending message to %s failed!" % binascii.hexlify(mac)) else: print("Message sent to: %s" % (binascii.hexlify(mac))) # The callback to be registered when a message has been received def espnow_rx(result): # "result" is the parameter in form of 3 element long tuple # "mac" is the MAC address of the sender # "peer" is the Peer which the message has been received from. If message has been received from a not registered Peer this parameter is None # "msg" is the payload from the received message mac, peer, msg = result if(peer is not None): print("Message received from %s with content: %s" % (binascii.hexlify(mac), msg)) peer.send("Sending back an answer") # The ESPNOW module needs that WLAN is initialized w = WLAN() # Initialize the ESPNOW module ESPNOW.init() # Register the callback which will be called on TX ESPNOW.on_send(espnow_tx) # Register the callback which will be called on RX ESPNOW.on_recv(espnow_rx) # Add a dedicated Peer with MAC address: 11:22:33:44:55:66 p = ESPNOW.add_peer("112233445566") # Send a message dedicated to the Peer p.send("My Message") # Sending 1 message to all Peers which are registered ESPNOW.send(None, "Hello all Peers!")
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login