Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

πŸ” MQTT library for Arduino that runs WiFi and MQTT in a tight loop, enabling async-like behavior for single-threaded microcontrollers.

License

Notifications You must be signed in to change notification settings

reiniiriarios/arduino-mqtt-looped

Repository files navigation

Arduino MQTT Looped Library

Based on the Adafruit MQTT library, this library enables async-like behavior for MQTT and WiFi on single-threaded microcontrollers.

Most Arduino network libraries are filled with delay() and while(true) loops in order to ensure delivery and receipt of packet information. This library instead reads packets and completes tasks over multiple loops.

⚠️ Because packet processing is happening over multiple loops, this library will likely not function well (or at all) with code where additional data is being sent to and from your network outside of this library.

Compatibility

This library is a work-in-progress and is currently only tested with the WiFiNiNA library. Other WiFi libraries will likely work as well, possibly with minor changes. Because the WiFi connection loop cannot be abstracted to a single connect() method, wider compatibility is not easy. If you'd like to adapt this library for a different WiFi driver, look to the wifiSetup(), wifiConnect(), and mqttConnect() and related methods. If you'd like to adapt the library for ethernet, these same methods could likely be simplified or removed from the loop.

Install

The easiest way to install is to search for MQTT_Looped in the Library Manager in the Arduino IDE or VS Code extension.

Usage

See examples for example usage.

About

πŸ” MQTT library for Arduino that runs WiFi and MQTT in a tight loop, enabling async-like behavior for single-threaded microcontrollers.

Topics

Resources

License

Stars

Watchers

Forks

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /