- Python 3 (i.e. Miniconda/Anaconda). I highly recommend creating new dedicated virtual environment for your project with following libraries:
- esptool -
pip install esptool
- adafruit-ampy -
pip install adafruit-ampy
- esptool -
- USB to UART drivers:
- Latest ESP32 firmware - download
- ESP32 (i.e. DOIT ESP32 DevKit v1)
- Plantower PMS7003 air quality sensor
- USB-UART PL2303
- USB cable
- Jumping wires
- Breadboard
- Temperature/humidity/pressure sensor (i.e. DS18B20, DHT11, BME280)
- RTC
- SSD1303 OLED display
Let's plug ESP32 into computer and check whether everything was installed correctly and board is visible by our machine. Running following command in the terminal ls /dev/tty*USB*
should return ESP32 COM PORT (i.e. /dev/ttyUSB0
on Linux or /dev/tty.SLAB_USBtoUART
on MacOS). If nothing shows up make sure you have installed software correctly.
To make sure that everything is up to date we should erase flash on ESP32 running following command:
python -m esptool --chip esp32 erase_flash
It should automatically find COM PORT.
When our flash was erased we can write latest firware to our board using command. Double check port and path to the downloaded firmware file.
python -m esptool --chip esp32 --port <port> write_flash -z 0x1000 <path/to/esp32/firmware.bin>
screen /dev/ttyUSB0 115200
ampy --port /dev/ttyUSB0 ls
ampy --port /dev/ttyUSB0 put file.py
ampy --port /dev/ttyUSB0 run file.py
- Connect to the REPL.
- Connect to the Internet.
- Install desired package. For further details please visit official micropython-lib repository.
import upip
upip.install('micropython-urllib.urequest')