ucode-mod-mosquitto: add libmosquitto binding for ucode#29295
ucode-mod-mosquitto: add libmosquitto binding for ucode#29295januszdziedzic wants to merge 1 commit intoopenwrt:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new OpenWrt package providing a native ucode module that wraps libmosquitto and integrates MQTT socket I/O into the libubox/uloop event loop.
Changes:
- Introduces
mosquittoucode module implemented in C with uloop-based polling and callback bridging. - Adds OpenWrt package Makefile to build and install the
mosquitto.soucode module.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| utils/ucode-mod-mosquitto/src/mosquitto.c | Implements the ucode ↔ libmosquitto bindings and uloop integration for MQTT client operations and callbacks. |
| utils/ucode-mod-mosquitto/Makefile | Adds packaging/build logic to compile and install the new ucode module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Already pass claude review in openwrt/openwrt#23187 - AI fight? :) |
|
I'm probably missing some context, but what is the intended use case? Is some app going to depend on this? |
|
Look, looking at it, I'd say it's going to get a bit confusing soon, both for beginners and even for us. You created the I do get that mosquitto is located in the packages repository, but @GeorgeSapkin asks a valid question. That definitely deserves an answer. |
I am using device_agent.uc ucode script that connect MQTT broker, report status and handle cmds - mainly configure network/wifi from broker - instead of using C code just use scripts for that. Today cloud app talk also with MQTT broker and manage devices. In the future plan to add device_controler.uc that will work on GW and configure network. This is how I implement SDN (tls connetion with signed certs - all managed from MQTT broker). |
I also think mosquitto should be directly in openwrt git - this is really important package. Didn't add it to ucode, that was a choice like for other ucode-mod-*. But don't see any issue with move it to ucode directly - but maybe after more people will test it and code became mature. |
Add a native ucode C module wrapping libmosquitto with libubox/uloop integration. Provides an MQTT v3.1.1 client API for ucode scripts: TLS (via libmosquitto-ssl), QoS 0/1/2, will messages, username/password authentication and manual reconnect via the on_disconnect callback. The module registers the libmosquitto socket with uloop so MQTT I/O runs in the same event loop as the rest of the application, avoiding the libmosquitto helper thread. Assisted-by: Claude:Opus 4.7 Signed-off-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
📦 Package Details
Maintainer: @januszdziedzic
Description:
New package: native ucode C module wrapping libmosquitto with libubox/uloop
integration. Provides an MQTT v3.1.1 client API for ucode scripts: QoS 0/1/2,
will messages, username/password authentication, manual reconnect via the
on_disconnect callback, and TLS when libmosquitto-ssl is installed. The
libmosquitto socket is registered with uloop so MQTT I/O runs in the same
event loop as the rest of the application; the libmosquitto helper thread
is not used.
Originally proposed at openwrt/openwrt#23187 — moved here because the package
depends on libmosquitto, which lives in this feed and isn't visible to the
core-packages CI in openwrt/openwrt.
🧪 Run Testing Details
✅ Formalities
If your PR contains a patch:
Not applicable — this PR adds a new package, not a patch to existing code.