StopWatch: Flash Firmware & Run Code
1. Preparation
- Refer to the UIFlow2 Web IDE Tutorial to learn the basic workflow of UiFlow2 and complete the installation of the M5Burner firmware flashing tool.
- Log in and register for M5Burner. After the device is successfully flashed, the device information will be bound to the account.
2. Firmware Flashing
- Connect the device to the computer via a USB Type-C cable, then press and hold the reset button (approximately 2 seconds) until the green LED lights up, then release. The device has now entered download mode and is ready for flashing.
- Download the firmware for
StopWatch in M5Burner, as shown below.
- Click the
Burn button for the StopWatch firmware, select the corresponding device port, then click Start.
- Enter the Wi-Fi configuration for the device, including Wi-Fi SSID and Wi-Fi Password, as well as any other device configurations that need to be added or modified, then click
Next to start flashing.
When the message Burn successfully, click here to return appears, the flashing is complete. Restart the device to apply the flashed configuration.
Configuration Details
- COM: Serial port
- BaudRate: Baud rate for serial communication
- Server: Server address the device connects to
- WIFI SSID/WIFI Password: Wi-Fi name and password for the device connection
- SNTP Server
- SNTP0: Alibaba Cloud NTP Server (China)
- SNTP1: Japan NTP Server Pool
- SNTP2: Global Public NTP Server Pool
- Timezone: Timezone setting
- Boot Option: Sets the device boot mode after firmware flashing is complete
- run main.py directly: After flashing, directly runs the program in main.py without connecting to the network or displaying the UiFlow2 startup screen
- show startup menu and network setup: The device connects to the network, and devices with screens will display the UiFlow2 startup screen
- only network setup: The device only connects to the network without displaying the UiFlow2 startup screen
3. Modify Device Configuration
After firmware flashing is complete, if you need to modify the device configuration, keep the USB connection, restart the device, click the Configure option in M5Burner, make changes in the pop-up configuration interface, then click next to update the configuration.
4. Log in to UiFlow2
Go to the UiFlow2 page and click the user icon in the upper right corner to log in to the UiFlow2 system account.
UiFlow2 Account
This account must be the same one used to log in to M5Burner. After successful login, devices under this account that are connected to a valid Wi-Fi network can be viewed by clicking Select Device. To change the device owner, you need to unbind the device from the account.
5. Enter the Programming Page
You can connect the device to UiFlow2 via USB or Access Code to enter the programming page. The specific methods are as follows:
USB Method
- Connect StopWatch to the computer via a USB Type-C cable, select the StopWatch device module from the device list, then click
Confirm.
- Set the
Mode to USB at the bottom of the interface.
- Click the
WebTerminal button.
- In the pop-up, select the serial port for
StopWatch and click Connect.
When the WebTerminal screen displays Connected to Serial Port!, the USB connection is successful and you have entered the UiFlow2 programming page for the device.
Access Code Method
Note
Before using the Access Code, make sure StopWatch is connected to the network.
- Set the
Mode to Cloud(Access Code) at the bottom of the interface.
- Obtain the Access Code from the UiFlow2 startup screen on the device.
- Click
Select Code, enter the Access Code in the pop-up interface, then click Add Device to connect StopWatch to UiFlow2.
Access Code Note
1. Switching browsers, using private/incognito mode, or clearing UiFlow website cache will invalidate the existing pairing status.
2. Simply closing the tab, restarting the browser, or logging in/out of an account will not affect the established pairing relationship.
3. Once a device is paired with another browser, the pairing relationship with the original browser will be immediately invalidated.
6. RUN
After completing the above steps, you can start programming with UiFlow2.