In the previous article, we introduced to MicroPython. Here are the Steps of ESP32 MicroPython Setup with uPyCraft IDE. It is very easy to setup from GUI and blink the onboard LED of ESP32. We will guess that the reader already configured Arduino IDE with ESP32 (thereby the USB Serial drivers are already installed).
Setup are near same for Windows 10, MacOS and Linux. Essentially you need to download the following things. First is Python for GUI, which is this link :
1 | https://www.python.org/downloads/ |
Download and start installing the software. Enable the option at the bottom “Add Python 3.7 to PATH” at the installation wizard and press the “Install Now” button and complete installation.
---
Second software is uPyCraft IDE for Windows 10, follow this link to get the latest EXE file :
1 | https://github.com/DFRobot/uPyCraft |
It will not require installation of the software. The IDE will run upon double clicking the EXE file (for Windows 10). It will require the firmware which is the third and final thing to download :
1 | http://micropython.org/download |
Scroll down to “Firmware for ESP8266 boards”, download the .bin
file which looks like this :
1 | esp8266-20190125-v1.10.bin (elf, map) (latest) |
Open uPyCraft IDE. It will want to install SourceCode font. Accept that prompt. Go to Tools > Serial and select ESP32 COM port. Go to Tools > Board and make sure you selected the “esp32” option. Go to Tools > BurnFirmware menu. Select board: esp32, burn_addr: 0x1000, erase_flash: yes, com: COMX (your COM port), Firmware: Select “Users” and choose the esp8266-20190125-v1.10.bin
file downloaded earlier. Hold down the “BOOT” button on ESP32 board and click the “ok” button in the burn firmware window.
You are done!
You will find a paper clip icon on uPyCraft IDE, it is for connecting the IDE to board. Click it once. Again clicking it will disconnect. Copy-paste this code to test blink :
1 2 3 4 5 6 7 8 | from machine import Pin from time import sleep led = Pin(2, Pin.OUT) while True: led.value(not led.value()) sleep(0.5) |
Open new file, paste it, save the file with some name like blink.py
. Then, find play icon on uPyCraft IDE and click it to run the Python script to blink. Sooner, you’ll see the on-board LED of ESP32 is blinking.
This ends this guide. Probably you will like to write the Python file on ESP32 to run it standalone. That is tricky and we will use command line tools to do it. Actually you need to run server like :
1 | https://github.com/robert-hh/FTP-Server-for-ESP8266-and-ESP32 |
Thereafter use FileZilla like FTP client, connect to 192.168.1.131
at port 21 as anonymous user in plain FTP (insecure) mode. Instead of that way we will follow command line way in another guide.