UI Flow 2.0 Switching back from main.py to the config&launch app
-
Hi,
I just started with an Core S3 and UIFlow 2.0. I am absolutely delighted about the OTA feature.
One thing I could not find out by extensive research:
When I once use the button "Download the button to the device" I cannot get back to the initial configuration UI.
It appears like there is a main.py saved to the Core S3 and whenever it boots this is executed.
Am I missing something - i tried all kinds of key-pressing during boot?An related question - I would like to connect via MQTT to a server. Do I need to initialize Wifi inside my app? Obviously the device is online itself as this enables OTA. If I should use the configured WIFI - is it possible to try to connect to a fallback WIFI-Network in case the configured Network is not available (I plan to use the device in a mobile scenario).
Thanks for Your help!
Ralf -
@sistar_hh 1
This is normal, as download premaritally set the program to start on boot.
To reset you have to use M5Burner to change the boot configuration.Yes, OTA only work in test mode (the "> Run" button if you download, wifi is not activated an you will need to manually activate the wifi interface and connect to the target wifi.
-
@sistar_hh and every one who reads this in the future )))
If you set in your program:
Boot option set to 'Run main.py directly'
set_boot_option(0)it will be executed by default on boot.
But! If you press G0 (BtnA) button as soon as the device is powered on, then the default UIFlow2 app will be started.
I've found it in https://github.com/m5stack/uiflow-micropython/blob/master/m5stack/fs/user/boot.py
""" boot_option: 0 -> Run main.py directly 1 -> Show startup menu and network setup 2 -> Only network setup Quick reference: when use uiflow2.m5stack.com website, click RUN button to run workspace code, boot_option won't change, if you click DOWNLOAD button to download workspace code to device, boot_option will change to 2, it means after download code done, device will auto reboot and won't show startup menu, only do the network connect, but after network connect success, you can still download or run workspace code. If you don't want do anything after boot, you can delete this whole file. If you want show startup menu again, you can hold BtnA(most device) and click reset button or repower device until show the startup menu(for those devices with screens, and this is a temporary method and may change in the future), after that the boot_option will change to 1, so next time still will show the startup menu. BTW, the network connection time has a default timeout (60s), you can modify the following definition to change this default value. """