This project implements a simple IoT application using ESP32 LoRa devices programmed with MicroPython. The application demonstrates long-range communication between devices, displays critical information on an OLED screen, and sets up a basic web server for data management and visualization.
- Wi-Fi connectivity
- NTP time synchronization
- OLED display for showing device IP and current time
- LoRa communication for sending and receiving data packets
- Data logging with file size management
- Web server for displaying logged data
- ESP32-S3 LoRa device
- OLED display (SSD1306)
- USB cable for programming and power
- MicroPython firmware for ESP32-S3
- Thonny IDE (or any MicroPython-compatible IDE)
- Required libraries:
ssd1306,sx127x
-
Flash MicroPython Firmware
- Download the latest MicroPython firmware for ESP32-S3 from micropython.org
- Erase the ESP32 flash:
esptool.py --chip esp32s3 erase_flash - Flash the new firmware:
Replace
esptool.py --chip esp32s3 --baud 460800 write_flash -z 0x0 esp32s3-XXXXXXXX.binXXXXXXXXwith the actual firmware version.
-
Install Required Libraries
- Connect to your ESP32 using Thonny IDE
- Use Tools > Manage packages to install
ssd1306 - Manually install the
sx127xlibrary for LoRa functionality
-
Configure the Application
- Open
main.pyin your IDE - Update the Wi-Fi credentials:
SSID = 'your_wifi_ssid' PASSWORD = 'your_wifi_password'
- Adjust pin configurations if necessary to match your hardware setup
- Open
-
Upload the Code
- Save the modified
main.pyto your ESP32 device
- Save the modified
-
Power on your ESP32 device
-
The device will automatically:
- Connect to Wi-Fi
- Synchronize time with an NTP server
- Display IP and time on the OLED screen
- Start the LoRa communication loop
- Launch a web server for data visualization
-
To view logged data, connect to the same Wi-Fi network as the ESP32 and navigate to
http://<ESP32-IP-ADDRESS>in a web browser
- If the device fails to connect to Wi-Fi, check your credentials and network availability
- For LoRa communication issues, ensure proper wiring and antenna connection
- If the OLED display is not working, verify I2C connections and address
Contributions to this project are welcome. Please fork the repository and submit a pull request with your improvements.
This project is open-source and available under the MIT License.
- MicroPython community for firmware and libraries
- Espressif for the ESP32-S3 hardware
- Contributors to the
ssd1306andsx127xlibraries