We recommend Windows PCs for development because the excellent EsPy integrated development environment (IDE) runs only on Windows. If you are running MacOS or Linux operating systems, there are other IDEs available, such as uPyCraft (for Windows and Mac) and ESPlorer (written in Java, runs on all platforms), but they do not offer as comprehensive functionalities as does EsPy, such as a file system viewer that allows you to see the files on your WioLink board. The PyCharm IDE is an advanced commercial Python IDE that runs on all platforms. It has a plug-in that supports MicroPython. You can read about this plug-in here. Visual Studio Code has an extension for MicroPython as well.
Organizing your downloaded files
We will be downloading a lot of files. It is a good idea to put everything you have downloaded into one folder (e.g. Downloads), and create a new folder (e.g. on your desktop called “MicroPython”) to organize all your extracted files.
In order to run EsPy, make sure you have the following installed:
Any version of Python 3 will work (Python 2 will not work in this case). Make sure you check “Add Python to PATH” option when installing Python 3:
Downloading EsPy IDE
Use the following link to download the latest version of EsPy (126.96.36.199 as of Apr. 23, 2018). The 7-Zip Archive Manager that you have just installed can be used to work with the downloaded 7z file. Double-click on the file and extract the “Release” folder to the “MicroPython” folder that you have just created. Feel free to rename the “Release” folder to “EsPy” if you wish.
Flashing MicroPython Firmware
The EsPy IDE comes with an excellent GUI for flashing the firmware you have just downloaded. You can use it to flash the downloaded firmware to the WioLink board with the following steps:
2. Put the WioLink board to Flash mode and connect it to the computer
If you haven’t already, use the following link to install the CP2012 driver for your system. Next, hold the config button on the WioLink board (the one to the left of the MicroUSB port) and connect it to your computer.
3. Flash the firmware
Open the EsPy program. It should be in a folder called “EsPy” or “Release” in the “MicroPython” folder on your desktop.
Go to “Device”->”Ports”->”COMx” where
x could be any number. Make sure the
COMx is selected. Then, go to “Device”->’EspTool…”.
In the Dialog that opens subsequently (shown below), make sure “Serial Port” is the one that you saw in the “Ports” menu. Leave “Baud Rate”, “Python.exe”, and “esptool.py” as default. Use the “..” button on the same line as “firmware.bin” to locate the firmware file (micropython-1.9.3-wiolink-clean.bin) that you have just downloaded. Leave everything else to default values.
Click the “1. Erase” button first. After the old firmware is successfully erased, flash the new firmware by clicking the “2. Write” button.
Close the EspTool dialog and click on the “Reset” button on the board to reset the board. Click the “Connect” button on the toolbar of EsPy. If you see something like:
Press Ctrl+D to do a software reset
Press Ctrl+I to interrupt the current program
Congratulations! You are ready to program your WioLink board.