Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    ESP-Now support

    Scheduled Pinned Locked Moved Enhancements
    esp-now
    7 Posts 5 Posters 1.9k Views 6 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      BetterAuto Pybytes Beta
      last edited by

      How about it? :-)
      https://www.espressif.com/en/products/software/esp-now/overview

      I see a library being started over here:
      https://github.com/micropython/micropython-esp32/issues/197

      1 Reply Last reply Reply Quote 2
      • sebS Offline
        seb
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • B Offline
          BetterAuto Pybytes Beta
          last edited by

          I may use this workaround: Configure an ESP8266 as an ESP-Now client and control it from the Wi-Py over UART.

          1 Reply Last reply Reply Quote 0
          • B Offline
            BetterAuto Pybytes Beta
            last edited by

            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

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              livius @BetterAuto
              last edited by

              @BetterAuto
              yes, it is really usefull way to comunicate between boards :)

              think about people first, then computers

              1 Reply Last reply Reply Quote 0
              • R Offline
                RonanG
                last edited by

                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 callable
                

                Any thoughts?

                1 Reply Last reply Reply Quote 0
                • G Offline
                  Gijs
                  last edited by

                  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!")
                  
                  1 Reply Last reply Reply Quote 2

                  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
                  • 1 / 1
                  • First post
                    Last post

                  Pycom on Twitter

                  Pycom