Upload program to M5



  • Hi. I have successfully made a program on UIFlows using wifi connection and the API-key. I press the "play" button in the UIFlow and the program executes. But when I remove power and reboot the M5Stack the program is gone. I have tried the "download" in the UIFlow menu that makes the M5 screen say "upload", but I end up with the same and the M5 shows the API key and the QR-code. What should I do to make my program stick to the M5 and execute after inital bootup?



  • @tnesheim very cool, could you share the code with us? I'm still trying to figure out how to use the http request blocks. I've heard this is an issue also with programs with the remote blocks too where the downloaded version doesn't work with the internet connection part. Did you do the wifi setup procedure in blocks? as in this forum post
    http://forum.m5stack.com/topic/1345/uiflow-http-request/4

    Alternatively if that doesn't work you can copy and paste the python into a .py script, rename it to boot.py or main.py and then transfer it to the flash of the device with ampy or vscode



  • I'll post a screen dump of my blocks/code tonight. I used the code generator; https://www.blitter.se/utils/basic-authentication-header-generator/ to generate a key to insert in the header instead of using explisit username/password.

    Aha...of course, I need to set up the wifi in the program itself:-) I'll definitely try that when I get home.



  • Also, in respect of making my program "stick" it could be a problem that I use the web connection? I should probably make the USB-connection work with my desktop version of UIFlow?



  • Yes, switching to USB connection made the program "stick". Attached is a snapshot of my M5-to-HC2 block:
    0_1574182633047_49c448c4-3495-4bf8-a581-71cb906744a7-M5toHC2.jpg M5toHC2.jpg



  • @tnesheim The QR code is pointing to the webpage created in your code that is hosted on a temp server on the UIFlow Server.