🐛8266 MicroPython controller
The tutorial of using the WiFi module as a MicroPython controller
Last updated
The tutorial of using the WiFi module as a MicroPython controller
Last updated
USB Uploader (CH340C)
WiFi ESP8266
Insert the ESP8266 module into the module configuration interface of the USB uploader, and find the corresponding COM port in the Windows device manager.
Download the latest version of Thonny, an out-of-the-box Python editor that natively supports MicroPython.
Download address: https://thonny.org/
The compiled ESP8266 firmware is provided on the MicroPython official website, because our WiFi module is 4MB, please select the latest firmware with the name of ESP8266 with 2MiB+ flash, and download the bin file.
Firmware download address: https://micropython.org/download/esp8266/
There are two ways to upload the MicroPython firmware to the ESP8266 module:
Using the ESPtool download tool, you can more precisely control the partition and use of Flash.
Using Thonny's built-in tool.
For convenience, we use Thonny's built-in tool. The specific steps are as follows:
Open the Thonny, the main interface is as shown below. Thonny uses the Python interpreter in the installation directory by default.
Open Tools -> Options to enter the options page. In the first tab General, we can choose the language we need (needs to be restarted).
Open the second tab Interpreter, we replace the default Python3 interpreter with MicroPython (ESP8266) and select the corresponding port.
At this time, the ESP8266 module has not yet uploaded the MicroPython firmware. Click "Install or update firmware" in the lower right corner of the above picture to update the firmware using the built-in tool.
Select the port (COMx) where the ESP8266 module is located, and select the location where the downloaded MicroPython firmware (.bin file) is located. Check the flash mode: from image file (keep) (the speed will be slower, but it only needs to be burned once and it is not easy to make mistakes), and check the option Erase flash before installing. Press the Install button.
The progress will be displayed in the lower-left corner of the interface, erase the Flash first, and then write the firmware. When the word Done appears, it means that the programming has been completed.
The software preparation work is over, and the following display will appear after closing the download interface. The red text is garbled because ESP8266 will print a string of codes with a baud rate other than 115200 when it starts up. This code cannot be recognized by MicroPython Shell. When Python’s iconic symbol >>> appears, it means that the firmware is uploaded successfully.