On The Air Update for Micropython ESP32 using Github repository on Raspberrypi http server.
- Must have a github account
- Have created github personal access token
- Follow the config-sample.json
- Replace the details with your details
- create a folder /home/pi/file_server/ESP32
# Create a pip virtual environment
python -m venv venv
# Activate the virtual environment
source /venv/bin/activate
# Install required libaries
pip install -r requirements.txt
# 1. Add inject node interval 10 minutes
# 2. Add this command into a script node
cd development/epd-aquams-electronics/ && bash run.sh
- For Windows must install CP210x USB to UART Bridge
- Download the latest Micropython Firmware: https://micropython.org/download/esp32/
- For easy flash install Thonny IDE.
- Open Thonny IDE Tools > Interpreter.
- Choose the MicroPython ESP32 as interpreter.
- Choose port that your ESP32 connected to.
- Click Install or update firmware at the bottom right.
- Choose port that your ESP32 connected to.
- Browse the firmware that you download.
- Click install. if its error, check your thonny IDE if its access sudo/administrator privilege.
- Open Thonny IDE make sure the intrepreter is Micropython ESP32.
- Create new file named main.py and write a simple python print hello world code.
- Save it choose on MicroPython Device.
- And run the script on Thonny IDE. We will see the hello world is displayed on terminal thats mean the MicroPython is successfully installed.
- We were follow this tutorials for installing MQTT client: https://randomnerdtutorials.com/micropython-mqtt-esp32-esp8266/
- reference here: https://randomnerdtutorials.com/esp32-esp8266-dht11-dht22-micropython-temperature-humidity-sensor/
- IP address has set to static to prevent IP address from conflict between ESP32.
- CO = 192.168.0.120
- DHT22 = 192.168.0.121
- NO2 = 192.168.0.122
- SO2 = 192.168.0.123
- PM2.5 = 192.168.0.124
- O3 = 192.168.0.125
gasType | Unit | Concentration | Voltage | Temperature | Range | |
---|---|---|---|---|---|---|
CO | ppm | float | float | float | 0-1000 | |
SO2 | ppm | float | float | float | 0-20 | |
NO2 | ppm | float | float | float | 0-20 | |
O3 | ppm | float | float | float | 0-10 | |
Temp_C | ℃ | float | float | float | -40-80 | |
Temp_F | ℉ | float | float | float | 40-176 | |
Humidity | %RH | float | float | float | 0-100 | |
PM2.5 | µg/m³ | float | - | - | 0-1000 | |
PM10 | µg/m³ | float | - | - | 0-1000 |
The Architectures: