First release of the Nodrix Arduino library — connect ESP32 and ESP8266 hardware to Nodrix in a few lines. It hides WiFi, TLS, the WebSocket/HTTP transport, JSON, and the control/telemetry protocol behind a tiny API, so a sketch is mostly your own device logic.
Features
- Control handlers —
NODRIX_WRITE("var") { ... }runs when the cloud writes a variable, with automatic acks and typed value coercion (asBool(),asInt(),asLong(),asFloat(),asDouble(),asString(),isNull()). - Telemetry —
Nodrix.send()with batching; overloads forbool,int,long,float,double,const char*, andString. - Two transports — always-on WebSocket (
begin()/run()) and HTTP polling for deep-sleep devices (beginHTTP()/poll()). - Resilience — multiple WiFi networks with failover (
addAP()), automatic reconnect, heartbeat, and control-variable seeding. - Optional TLS pinning —
setCACert()(ESP32) andsetFingerprint()(ESP8266 HTTP); unvalidatedsetInsecure()by default. - Events — trigger server-side automations with
event().
Boards
ESP32 (including S2, S3, C3, C6, H2) and ESP8266.
Install
- Arduino IDE — install ArduinoJson (v7) and WebSockets (by Markus Sattler) from the Library Manager, then add Nodrix.
- PlatformIO — add
bblanchon/ArduinoJson@^7,links2004/WebSockets@^2.6, and this repo tolib_deps.
Then #include <Nodrix.h>. See the README and the examples/ folder (LedControl, HomeLights, MultiWiFi, SensorTelemetry, DeepSleepSensor). The two DHT11 examples — SensorTelemetry and DeepSleepSensor — also need the DHT sensor library by Adafruit.