Concepts
A quick mental model of how Pulsync works on-device.
Scheduler
Your loop() calls Pulsync.loop(), which runs any due scheduler callbacks and returns immediately. Nothing blocks. Schedule work with setInterval / setTimeout, cancel with clearInterval / clearTimeout. Up to 32 tasks by default (PULSYNC_MAX_TASKS).
Transport
The live device connection runs over MQTT (plaintext on a local server, TLS/MQTTS to the hosted platform). Enrollment and OTA downloads use HTTP(S). getTransportName() reports "mqtt" when connected, "none" otherwise.
Network I/O runs on a background FreeRTOS task, so it never stalls your user code. A small RAM ring buffer holds outgoing messages; queuedCount() grows when the link is down, so you can back off non-critical sends.
The broker endpoint isn’t hardcoded — the server hands the device an mqtt_url during enrollment (and can update it via heartbeat), so the device always connects to the right broker.
Enrollment
A pairing code hardcoded in firmware is exchanged for a device token on first boot. The token lives in NVS and is reused on later boots. The server can rotate it transparently via heartbeat.
OTA
The device reports its firmware version in every heartbeat. When the server offers a build whose version differs, the device downloads, verifies the signature and checksum, applies it, and reboots — with rollback if the new image fails to confirm.
See OTA Updates for the versioning rules.