(1) Download the micropython from http://www.micropython.org/download/esp32spiram/ , the current version is v1.19.1 (2022-06-18)
esptool --chip esp32 --port /dev/ttyUSB0 erase_flash esptool --chip esp32 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x1000 esp32spiram-20220618-v1.19.1.bin
Notice that the speed of rate should be
115200
instead of9600
when you connect to port but see nothing.
Download the vscode Download the RT-Thread plugin: https://marketplace.visualstudio.com/items?itemName=RT-Thread.rt-thread-micropython#Introduction Use RT-Thread to connect to ESP32.
Normally, it is noe necessary to change
boot.py
If you have a new folder to send, create the folder on ESP32 first. E.g. You want to sendsrc/image.png
to ESP32. First runos.mkdir('src')
on ESP32 to create the path. Then send thesrc
to ESP32. Once the files undersrc
is changed, sync the wholesrc
to ESP32 instead of only send changed file.
(6) Check the config.json
of projeck and follow or change the port number of it to connect the ESP32 with sensors.
Plug in all devices with USB Port run batch_setup.sh
- Windows/Linux/Macos
- ESP32
- Sensors:Dht22,OLED monitor
- Set up usb connection in WSL2
- sudo bash batch_setup.sh
git clone https://github.com/todbot/blink1-tool
cd blink1-tool
make
sudo apt-get install libusb-1.0-0-dev
make
wget https://github.com/todbot/blink1-tool/blob/main/51-blink1.rules
sudo udevadm control --reload
sudo udevadm trigger
cp blink1-tool/blink1-tool "$PATH:/home/..."
sudo blink1-tool --add_udev_rules
blink1-tool -m 100 --rgb=255,0,255
Only need to be executed once. To read the flash from an ESP32 chip, you can use the following command:
sudo esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 read_flash 0 ALL esp32_dump.bin
Before flashing a new firmware onto the ESP32, you need to erase the current flash. After erasing, you can then write the new firmware:
sudo esptool.py --port /dev/ttyUSB0 erase_flash
sudo esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 write_flash 0x00000 esp32_dump.bin
Change to the appropriate PATH
export PATH=$PATH:/home/ptw/.local/bin
LOG_FILE="/home/ptw/Schreibtisch/smart/smart_office_station/logfile.log"
sudo -u ptw bash -c "cd /home/ptw/Schreibtisch/smart/smart_office_station; bash batch_setup.sh" # Optionally, redirect output to the log file: >> $LOG_FILE 2>&1
bash usb_monitor.sh
bash usb_monitor.sh --from file
-Copying: red
-Copy succeed: green
-Standby: white
Caution! Start the program before plugging in the ESP32 USB. Only insert when the light turns white.
http://www.micropython.org/download/esp32/ https://www.jianshu.com/p/9097920ea915