An ESP32-based LoRa message receiver for Heltec Wireless Stick Lite v3 that forwards received messages to various web services including Ntfy, Email, Discord, and custom webhooks.
- π‘ LoRa Message Reception: Receives messages on a predetermined channel with authentication
- π Secure Authentication: Verifies channel name and secret before processing messages
- π¨ Multiple Notification Services:
- Ntfy push notifications
- Email (SMTP)
- Discord webhooks
- Generic HTTP webhooks
- π₯οΈ OLED Display: Real-time status and message display
- πΆ WiFi Connectivity: Automatic connection and reconnection handling
- βοΈ Build-time Configuration: All settings configurable at compile time
- π MeshCore Battery Policies: Adjust a monitored repeater's TX power and repeat role across admin-defined battery ranges
- π MeshCore Battery Graphs: Record every successful node battery check in bounded flash history and view the line graph with or without an admin login
- π SNMP Value Graphs: Graph changed numeric SNMP values while ignoring unchanged or text-based responses
- Heltec Wireless Stick Lite v3 (ESP32-S3 based board with LoRa and OLED)
- USB-C cable for programming and power
- PlatformIO (recommended) or Arduino IDE
- PlatformIO Core (CLI) or PlatformIO IDE (VS Code extension)
-
Clone this repository:
git clone https://github.com/bradhawkins85/ESP32-Monitor.git cd ESP32-Monitor -
Install PlatformIO if you haven't already:
pip install platformio
The project uses a .env file for secure configuration management. This keeps your secrets out of version control.
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envwith your actual credentials:# WiFi Configuration WIFI_SSID=your_actual_wifi_name WIFI_PASSWORD=your_actual_wifi_password # LoRa/MeshCore Channel Configuration CHANNEL_NAME=Alerts CHANNEL_SECRET=your_actual_secret_key # Discord Notification (optional) DISCORD_ENABLED=true DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR_ACTUAL_WEBHOOK # Ntfy Configuration (optional) NTFY_ENABLED=true NTFY_SERVER=https://ntfy.sh NTFY_TOPIC=your_topic_name # Email/SMTP Configuration (optional) EMAIL_ENABLED=false SMTP_HOST=smtp.gmail.com SMTP_PORT=587 EMAIL_RECIPIENT=recipient@example.com EMAIL_SENDER=sender@example.com SMTP_USER=your_email@gmail.com SMTP_PASSWORD=your_app_specific_password
-
The
.envfile is automatically loaded during the build process viaload_env.py
Note: The
.envfile is git-ignored and will never be committed to the repository. This keeps your credentials safe.
You can also use platformio_override.ini (also git-ignored) for configuration:
[env:heltec-wireless-stick-lite-v3]
build_flags =
-D WIFI_SSID='"YourWiFiSSID"'
-D WIFI_PASSWORD='"YourWiFiPassword"'
-D CHANNEL_NAME='"BCAlerts"'
-D CHANNEL_SECRET='"your_secret"'If no .env or override file is provided, the system will use defaults from include/config.h.
LoRa settings can be configured in include/config.h:
#define LORA_FREQ 915.0 // MHz: 915.0 for US, 868.0 for EU, 433.0 for Asia
#define LORA_SPREADING_FACTOR 7 // 7-12 (lower = faster but shorter range)
#define LORA_CODING_RATE 5 // 5-8 for 4/5 to 4/8
#define LORA_BANDWIDTH 125.0 // kHz: 125.0, 250.0, or 500.0For a MeshCore Node service, enable Automated Battery Policy and add as many non-overlapping battery ranges as needed. Each range can set:
- TX power in dBm (leave blank to keep the current TX power)
- Repeater forwarding on or off
- Alert on entry (sends notifications when the node enters that battery range)
The policy is evaluated whenever the monitor receives a status response from the node. If the battery percentage is not covered by a configured range, the remote settings are left unchanged. The monitor must be present in the repeater's Access Control list with Admin permission for remote setting changes.
-
Build the project:
pio run
-
Upload to the board:
pio run --target upload
-
Monitor serial output:
pio device monitor
Or do all at once:
pio run --target upload && pio device monitor- Open the project folder in VS Code
- Click the PlatformIO icon in the sidebar
- Under "Project Tasks", click:
- "Build" to compile
- "Upload" to flash the board
- "Monitor" to view serial output
The receiver expects messages in the following format:
CHANNEL|SECRET|MESSAGE_CONTENT
Example:
uptime_channel|your_secret_key|Server is down!
Only messages with matching channel name and secret will be processed and forwarded.
- Initialization: The device starts up, initializes the OLED display, connects to WiFi, and configures the LoRa radio
- Message Reception: Continuously listens for LoRa packets on the configured frequency
- Verification: When a message is received, it verifies the channel name and secret
- Forwarding: Valid messages are forwarded to all enabled notification services
- Display: Status and received messages are shown on the OLED display
- Double-check SSID and password in configuration
- Ensure the board is within range of your WiFi router
- Check serial monitor for error messages
- Verify the LORA_FREQ matches your transmitter (915MHz for US, 868MHz for EU)
- Ensure both transmitter and receiver use the same channel name and secret
- Check that the LoRa antenna is properly connected
- Verify transmitter is within range
- Check WiFi connection status in serial monitor
- Verify service configuration (URLs, tokens, etc.)
- Review serial output for HTTP error codes
- Test service endpoints manually to ensure they're accessible
ESP32-Uptime-Receiver/
βββ include/
β βββ config.h # Configuration header
βββ src/
β βββ main.cpp # Main application code
βββ platformio.ini # PlatformIO configuration
βββ README.md # This file
To add a new notification service:
- Add configuration defines to
include/config.h - Create a forwarding function (e.g.,
forwardToNewService()) - Call the function in
handleLoRaMessage()when enabled - Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Built for the Heltec Wireless Stick Lite v3
- Uses the Heltec ESP32 library for LoRa and display functionality