uiflow: usocket module does not work if upload a sketch through the "download"



  • I have a problem: the usocket module does not work if upload a sketch through the "download" item in the uiflow IDE.
    Here's an example of sketch:

    from m5stack import lcd
    import usocket as socket

    lcd.clear()
    lcd.setCursor(0, 0)
    lcd.setColor(lcd.WHITE)

    try:
    addr = socket.getaddrinfo('micropython.org', 80)[0][-1]
    s = socket.socket()
    s.connect(addr)
    s.send(b'GET / HTTP/1.1\r\nHost: micropython.org\r\n\r\n')
    data = s.recv(1000)
    s.close()
    lcd.println("OK\n")
    lcd.print("Data len: " + str(len(data)))

    except:
    lcd.print("Got Error!")

    If you upload by button with the triangle icon (looks like play) - it works, data received. If uploaded on the M5 through download - always fails.



  • @torabora what do you mean by doesn't work.
    if you restart the m5stack, can you run the app from the app menu?



  • @ajb2k3 The app starts after reboot M5 Fire, but the code is triggered in the exception block and displays message "Got Error!".