To get started with MicroPython on your Hibiscus Sense ESP32 Development Board, you will need to flash it with MicroPython firmware with a handy tool called esptool.py.
- Python 3.7X or latest - Python
- MicroPython firmware for ESP32 - Micropython Firmware
Download Python and install it. Make sure the option for Add Python To Environment Variable was ticked
MicroPython are available for various microcontroller ranging from STM32, Raspberry Pi Pico and also Espressif's ESP32 board. You need to make sure you download the right firmware for this development board. Download from the link and save on your machine. ( I recommend to save it in Downloads folder)
You will later install this firmware through terminal and to make life easier, you will need to rename the file when downloading it as something simpler rather than typing the whole name.
- To start, you will need to access terminal on windows. , click the Windows button and type in cmd and click the Command Prompt application.
- Run the following command
pip install esptool
You should now be able to run esptool. If you type esptool.py and run it there will be a few argument printed on the terminal.
You will need to erase whatever firmware in the ESP32 and back to a clean slate.
- On the terminal,run the following command
esptool.py --chip esp32 erase_flash
In my case, I have a few USB device connected and it automatically choose the one with ESP32 on COM11, (more on this later)
- The first thing to do is to identify what is the port number your ESP32 is assigned. To do so, click Windows button on your machine and run Device Manager application. If you collapse the Ports (COM & LPT) option, you will what is the port number assigned to your ESP32 by referring to the deviced named as Silicon Labs CP210x (USB driver IC). Mine was COM11.
- Navigate to the folder where you save your MicroPython firmware. In my case, I saved it in Downloads folder on my machine and to navigate to the folder;
C:\Users\[user]\Downloads
- Run the following command and replace the serial port number and the name of the firmware
esptool.py --chip esp32 --port [serial_port] write_flash -z 0x1000 [esp32.bin]
It should look like this
The final result will look like this
- Thonny - Thonny IDE
- On the website, choose the Windows version and download it.
- Install and run it.
- Setup interpreter on Thonny by going to
Tools > Option >Intrepreter > Micropython (Generic)
- Setup Port
Tools > Option >Intrepreter > Port >