Documentation & Setup Guide
Comprehensive integration guide for ESP32 hardware, Arduino Client Library, Auto-Provisioning Serial Numbers, Fleet Grouping Analytics, and REST APIs.
1. MeOTA Smart-AirSync™ Architecture Overview
MeOTA Platform is an enterprise-grade IoT fleet management and Over-The-Air (OTA) firmware distribution engine powered by the proprietary MeOTA Smart-AirSync™ architecture. It enables connected devices across Smart Farms, Industrial Automation, Solar Telemetry, and Remote Sensors to receive secure remote firmware updates reliably over Wi-Fi and Cellular networks.
🌾 Universal IoT Ready
Group devices by farms, greenhouse zones, or factory lines with donut analytics.
🛡️ Anti-Brick Rollback
Dual-partition A/B rollback with SHA-256 validation if boots fail.
⚡ High-Availability Cloud
High-speed OTA distribution with automated device load balancing.
⚡ Adding a Device & Going Online (Step-by-Step)
Follow these 3 simple steps to register, configure, and connect your hardware to MeOTA:
Step 1: Register Node
Go to Devices menu, click '+ Register Hardware'. Use 'Auto-Generate ID' or type your custom ID (e.g. FARM-NODE-01).
Step 2: Copy Arduino Code
Click '💻 Setup Sketch' on your device row. MeOTA will generate tailored C++ code with your server domain, Device ID, and auth tokens pre-filled!
Step 3: Flash & Online
Enter your Wi-Fi SSID/password, click Upload in Arduino IDE. When connected, the status light on MeOTA console turns Green (Online)!
In Arduino IDE menu, go to Tools ➔ Partition Scheme and select 'Minimal SPIFFS (1.9MB OTA with spiffs)' or 'No OTA (2MB APP)' with dual partition. This ensures your ESP32 has enough flash room for downloading new firmware safely!
2. Installing MeOTA Library in Arduino IDE
- Download MeOTA.zip library archive.
- Open Arduino IDE on your computer.
- Navigate to menu: Sketch ➔ Include Library ➔ Add .ZIP Library...
- Select the downloaded
MeOTA.zipfile. - Find example sketches under: File ➔ Examples ➔ MeOTA ➔ ESP32_WiFi_OTA
3. ESP32 Wi-Fi Client Quickstart
Copy the production sketch below into your Arduino IDE. (Tip: You can also click '💻 Setup Sketch' on any device row in your console to get this code with your exact server domain & Device ID pre-filled!):
#include <WiFi.h>
#include <MeOTA.h>
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";
// MeOTA Enterprise Cloud Endpoint & Hardware ID
const char* otaServer = "https://ota.258877.xyz";
const char* deviceId = "FARM_NODE_01";
const char* currentFwVer = "1.0.0";
MeOTA ota;
unsigned long lastCheck = 0;
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Initialize MeOTA client (Auto-provisions SN on first connect)
ota.begin(otaServer, deviceId, currentFwVer);
// Confirm successful boot to cancel ESP32 automatic rollback
ota.markAppValid();
// Send initial heartbeat (Battery 95%, Wi-Fi RSSI)
ota.sendHeartbeat(95, WiFi.RSSI());
}
void loop() {
// Check for firmware updates every 60 seconds
if (millis() - lastCheck > 60000) {
lastCheck = millis();
MeOTAUpdateInfo update = ota.checkUpdate();
if (update.updateAvailable) {
Serial.printf("New version %s found! Upgrading...\n", update.targetVersion.c_str());
ota.updateFromWiFi(update);
} else {
Serial.println("Firmware is up to date.");
}
}
}
4. Sensor & Farm Telemetry Integration
MeOTA is not limited to OTA updates; devices can also send sensor telemetry directly to your fleet console:
// Send farm sensor telemetry: Soil Moisture, Air Temp, Humidity, Valve Status DynamicJsonDocument doc(256); doc["soil_moisture"] = 65.4; doc["temperature"] = 28.5; doc["humidity"] = 74.2; doc["valve_state"] = "OPEN"; doc["group"] = "Smart Farm Zone A"; String jsonString; serializeJson(doc, jsonString); // Push telemetry to MeOTA cloud ota.sendTelemetryJson(jsonString);
5. Dual-Boot A/B Safe Rollback (Anti-Brick Architecture)
ESP32 flash memory is split into dual partitions (ota_0 and ota_1):
- When a new firmware binary is received, it is flashed to the inactive partition and boot priority is switched in state
PENDING_VERIFY. - Upon booting and establishing network connectivity,
ota.markAppValid()permanently confirms the update. - If the new firmware crashes or boot loops: The hardware bootloader immediately rolls back to the previous working slot. Zero downtime, zero bricked hardware!
6. Automated Serial Numbers & Fleet Grouping Analytics
MeOTA provides automated zero-touch device onboarding and full fleet grouping capabilities designed for commercial deployments:
🏷️ Zero-Touch Auto SN Engine
On first boot, the platform automatically provisions an official Serial Number like SN-2026-XXXX-XXXX and records the hardware MAC address without requiring manual pre-registration.
📊 Fleet Grouping & Donut Analytics
Organize hardware into custom groups (e.g. Smart Farm Zone A, Solar Plant, Factory Lines). The console renders real-time Donut Charts showing unit counts and percentages (%) for targeted OTA campaigns.
7. REST API Reference (Clean URLs)
Hardware clients and external platforms can communicate via clean HTTP REST endpoints:
/api/ota/check?device_id={ID}&version={VER}
Check if a new firmware rollout is available for this device.
/api/ota/download?id={RELEASE_ID}&device_id={ID}
Download binary firmware file (.bin) with HTTP Range support for resumable transfers.
/api/ota/report
Report installation result (Status: success or failed).
/api/telemetry
Send Heartbeat, battery percentage, signal RSSI, and custom sensor metrics as JSON.
8. Troubleshooting & FAQ
Q: Device receives HTTP 404 error during checkUpdate?
A: Ensure the server URL in your Arduino code is set to https://ota.258877.xyz without a trailing slash and without .php
Q: Can multiple users manage their own separate devices?
A: Yes! Anyone can register at /register to receive an isolated console with their own devices, releases, and campaigns. Administrators can manage user permissions via the Users menu.