ESPNow UIFlow - communication stopps after 10 messages



  • I try ESPNow to connect a M5Stack face to an M5Stack Fire.
    Face is sender - Fire is receiver.
    This is the send block in Face:
    0_1611764889538_face tx.jpg

    This is the receive block in Fire:
    0_1611764963669_fire.jpg

    After every send message I'm waiting.

    It works - but only 10 times.
    After the 10 times the received message is no longer changing.
    The programs are working - I can see it on the color change in the small squares.

    After a new start - again - 10 times chaging the message - then OFF.

    It feels like a buffer or something like that is full - but -- NO documentation.

    Can anybody help what's going on in this quit "very complex" software :-)

    K.D.



  • @ramaker said in ESPNow UIFlow - communication stopps after 10 messages:

    M5Stack face

    Try to put the "Set communication channel 6" on the M5Stack face



  • In your receive callback function you shouldn't use any time delay, this function should be as short as possible. This callback breaks/pause your main program like interrupt and run yours code. Probably in your case one of this callback "runs" time delay function when next receive callback at this moment run the same code as previous callback.

    In my case there is a small delay 5ms (but in compare to 1 seconds it is almost nothing)

    I make some receiver code for stickc, ewentually you make some cosmetic changes.

    0_1611771091348_block.jpeg



  • @Arno: To set a communication channel was wrong in that sketch. I didn't make the screen shots from the actual version. Both M5Stack are connected to the same WLAN - so you need not set the communication channel.

    @robalstona: Thank you for that information - now the communication is working.
    One litte question: What does the "Set pmk" do and where can I find it ?

    When I looked to the MicroPython version of the block I see, that the declaration of, then I find:

    rx_adresse, _, rx_data = espnow.recv_data(encoder='str')

    There is a encoder declaration with "string". If my interpretation is right, then there should be other encoders more - maybe for numeric values. (If there is only one encoder, then a special declarion of the type would be senseless.

    Do you know more about this ?
    Maybe do you know how to make this with an Arduino sketch ?

    I want to use the M5Stick joysticks to control a big RC vehicle, like RoverC.
    So the best would be to transfer the numerical values.

    regards
    K.D.



  • The set.pmk function is used to "encrypt" data transmissions, you set the same key in the transmitter and receiver. I have not had the opportunity or need to test if it works. You can find a library for arduino esp-now on the internet. Practically the functions have the same or similar names as those in python. I think the easiest way would be to send from the transmitter all values separated by commas as text and receive them the same way. in uiflow or in python using split function which will make you a list with separated values

    Lists -> make list from text with delimiter.

    As a delimiter you set your separator character e.g. ","

    Then you read each value with

    Lists -> in list ... get # item number

    Translated with www.DeepL.com/Translator (free version)