🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    EspNow Add peer macaddress not possible with vairable

    UIFlow
    2
    2
    2.0k
    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.
    • L
      Luc3DSupplies
      last edited by

      In the current UIFLow (offline version 1.0.18 of online version 1.10.1) it is impossible to add a ESPNow peer with the macaddress defined in a variable.

      0_1658781634276_205b077e-d928-46ba-aa4b-93a783fb1c7c-image.png

      My goal is to dynamicly add peers, when de anounce themselfs to the 'server' after a broadcast.
      FLow :

      • Server sends out a broadcast with a Json telling what kind of server it is.
      • when a 'client' device receives an incomming message, the client directly gets the macaddress of the server in the "Receive mac_addre [addr] data [data]" method and thus should be able to stire the server macaddress and create a peer connection towards only that mac address, reserving this device for this server
      • when the client has reserved the server on his side, it responses towards the server to let the server know what kind of device the client is (json data), and what mac address is has.
      • this way, the server,n on his side, can comine the macadress with the device data to enable certain functions and know how to communicate (what json formats) with the client.

      My goal :

      • a M5Papaer as server
      • multiple Atom Lites as clients, all with different setups, predifined in the program

      So PLEASE, could you enable the 'macaddr' of the 'add peer' function as an variable and not yust a field that has to be fixated in code?

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @Luc3DSupplies

        you could try to use an Execute code: block like this:

        0_1658805084760_UIFlowESPNowPeerPerVar_20220726.png

        BTW: The content of the Execute code: block can be found by adding the Add peer block and then switching to the Python tab.

        Note: Above code is untested.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • First post
          Last post