Esp now m5stickC problem



  • Hi, my name is Gianni and I'm an italian student. I have a problem with the m5stickC espnow. I have 2 m5stickC, 1 puppy and 1 potentiometer and my aim is to command the puppy with the potentiometer. The problem is that after a short time, the m5stick on the puppy does not receive the data. It is as if the buffer is clogged and can no longer read the data. Initially it works well, then suddenly it freezes. Do you have any idea? Do I have to load the code?Thank you all and sorry for my english.

    I have upload a video of the problem on this link:

    https://youtu.be/lna4hDC6cDY



  • @gianni are you downloading the code or running it directly from UIFlow? I’ve had an issue where the same app will run for an extended period in one environment, but fail after a few minutes in the other.



  • @Devilstower i downloaded the code but it didn't work. anyway I tried to remove the code from the "receive" and it seems to work .. but i don't understand the reason :(



  • @gianni, you can try below code. Maybe help you. The function receiving data, saves received data into variables and only the LED blinks. Short code with the least delays possible. And the correct reading of data from these variables and their processing takes place in the main loop of the program. I created it for fast debug esp-now transmission. Tested it with uiflow 1.4.5 web and 1.4.2 firmware on stickc

    0_1591440613587_Screenshot_20200606-120611.jpg

    Transmiter code i wrote directly in python and looks that:

    import network, espnow
    import time
    import urandom

    #configure WIFI
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)

    #initialize espnow
    espnow.init()
    espnow.get_mac_addr()
    espnow.set_pmk('0000000000000000')

    #MAIN LOOP
    while True:
    color = urandom.randint(0, 360)
    #broadcast data as string
    espnow.broadcast(1, str(color) )
    #debug
    print('mac:',espnow.get_mac_addr(),'sent:', str(color) )
    time.sleep_ms(1000)