Industrial IoT library for ESP32. Eliminates boilerplate for WiFi, MQTT, encrypted dashboard connectivity, Modbus RTU, digital I/O, OTA updates, and structured logging.
#include <EdgeSync.h>
EdgeSyncLib edge;
void setup() {
Serial.begin(115200);
edge.begin();
}
void loop() {
edge.loop();
edge.client.sendReading("temperature", 25.4, "C");
edge.client.flush();
}Configure at runtime via Serial Monitor:
set wifi_ssid YourNetwork
set wifi_pass YourPassword
set srv_host 192.168.0.101
set dev_token YOUR_DEVICE_TOKEN
reboot
Each module lives in its own subfolder under src/ with a dedicated README:
| Folder | Class | Purpose |
|---|---|---|
config/ |
EdgeConfig |
NVS-backed config + serial CLI |
wifi/ |
EdgeWiFi |
WiFi with static IP, auto-reconnect, SoftAP fallback |
mqtt/ |
EdgeMQTT |
MQTT wrapper with auto-reconnect + topic routing |
client/ |
EdgeClient |
WebSocket + HTTP client for EdgeSync dashboard |
crypto/ |
EdgeCrypto |
AES-256-CBC encryption (matches server protocol) |
modbus/ |
EdgeModbus |
Modbus RTU master for RS485 industrial sensors |
io/ |
EdgeInput, EdgeOutput |
Digital I/O debouncing + relay interlocks |
sensor/ |
EdgeSensor |
Sensor data accumulation (avg/min/max) |
ota/ |
EdgeOTA |
HTTP firmware update with progress UI |
log/ |
EdgeLog |
Logging to Serial + SD card + MQTT |
You can include individual modules without the master header:
#include <config/EdgeConfig.h>
#include <mqtt/EdgeMQTT.h>Install via Arduino Library Manager:
- PubSubClient by Nick O'Leary
- WebSockets by Markus Sattler
- ArduinoJson by Benoit Blanchon
- Crypto by Rhys Weatherley
- base64 by Densaugeo
| Key | Description | Example |
|---|---|---|
wifi_ssid |
WiFi network name | MyNetwork |
wifi_pass |
WiFi password | secret123 |
wifi_ip |
Static IP (optional) | 192.168.0.100 |
wifi_gw |
Gateway (optional) | 192.168.0.1 |
wifi_sub |
Subnet (optional) | 255.255.255.0 |
mqtt_host |
MQTT broker address | 192.168.0.193 |
mqtt_port |
MQTT broker port | 1883 |
mqtt_user |
MQTT username | device1 |
mqtt_pass |
MQTT password | pass |
srv_host |
EdgeSync server host | 192.168.0.101 |
srv_port |
EdgeSync server port | 8000 |
dev_token |
Device auth token | XWDWdQ... |
dev_name |
Device display name | EnergyMeter_01 |
- 01_BasicWiFi — WiFi + config CLI (simplest possible)
- 02_MQTTPublish — WiFi + MQTT sensor publishing
- 03_EdgeSyncDashboard — Full encrypted dashboard connection
- 04_ModbusEnergyMeter — RS485 energy meter → MQTT
- 05_DigitalIO_Andon — 8-switch + 4-relay andon system
- 06_FullIndustrialNode — All modules together
src/
├── EdgeSync.h ← master include
├── config/
│ └── EdgeConfig.h/.cpp NVS storage — foundation
├── wifi/
│ └── EdgeWiFi.h/.cpp Station + SoftAP
├── log/
│ └── EdgeLog.h/.cpp Serial + SD + MQTT logging
├── mqtt/
│ └── EdgeMQTT.h/.cpp PubSubClient wrapper
├── crypto/
│ └── EdgeCrypto.h/.cpp AES-256-CBC
├── client/
│ └── EdgeClient.h/.cpp WebSocket + HTTP → dashboard
├── modbus/
│ └── EdgeModbus.h/.cpp RS485 Modbus RTU
├── io/
│ ├── EdgeInput.h/.cpp Debounced digital inputs
│ └── EdgeOutput.h/.cpp Relay control + interlocks
├── sensor/
│ └── EdgeSensor.h/.cpp Reading accumulator
└── ota/
└── EdgeOTA.h/.cpp HTTP firmware update
MIT