MQTT enablement #394
Replies: 9 comments 4 replies
-
|
I have no idea what use could be made of MQTT. Could give the following information?
|
Beta Was this translation helpful? Give feedback.
-
|
For users who are personally technical, there are at least two routes to exploit a regularly published blood glucose reading
For non technical users, its presence offers an opportunity for new and existing apps to consume the data, with little or no user config. MQTT and NodeRed allow the adoption of a much more efficient pub/sub model (than a polling model). MQTT also has the benefit of using an asynchronous, content agnostic transport that can also carry related data from say a fitness tracker. Just as an off the cuff idea, inputs from CGM and fitness tracker can be consumed securely & easily aggregated into a datastructure and concurrently reported on, fead to a health professional and used to build an LLM prompt to feed back on the correlation between exercise markers, such as Blood O2, heart rate and the blood glucose trend and perhaps offer contextually grounded advice on keeping glucose constrained. As for apps that use it, again there are at least three answers:
Because it's an open prototcol, using it both decouples the innards of your app from how it's consumed and makes it MUCH easier to consume and is not a drain on processing, like a polling model. MQTT is a pub-sub model, so if a consumer is interested, it just needs to subscribe and it will get the notification as and when it is published, not on a regular cadence whether or not the information is updated. |
Beta Was this translation helpful? Give feedback.
-
|
https://mqtt.org/use-cases/ |
Beta Was this translation helpful? Give feedback.
-
|
Hi All, Sorry a bit late to this party, but I could see some use for mqtt messaging of my readings, but I can see one downside, that you could miss some readings if you went off line as at best, you can only retain the last message. I am thinking the mqtt part might be better in the server than the mobile device, that would reduce the likely hood of losing data and avoids the polling as it would just send a message when it recieves data from the mobile device. I currently use the server and call the export on a timer to send the data to influxDB and then graph the data in grafana. I use tailscale to maintain a connection to my home network so generally would work fine for me, I have been very happy with it. PS. thanks for the great app, I have been using it for a few years now, but did take a little break due to the cost of the CGM's but found a cheaper one now, 1/2 the price of libra, so trying that out. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks , I didn't realise it could guarantee delivery, I have been using for years, I will have to try it and see, in any case it could be implemented from either end server or mobile, I would use it if available. |
Beta Was this translation helpful? Give feedback.
-
|
Hi All, If you are interested I have done some work on the server code to add mqtt, I have it working on my private server in a kubernetes cluster, the output looks like below, I can put the code up on git if interested. All the mqtt config is contained in the .jugglucorc file. Note you need be careful not clear it due to the -d / -c option. The output is generated when a new reading comes in from the mobile device. This is the output from mosquitto_sub: juggluco/glucose {"sensor_index":0,"sensor_id":"C1QBA5A04503","time":1776667522,"time_local":"2026-04-20 16:45:22","tz":10,"minute_index":5895,"raw_mgdl":131,"raw_mmol":7.3,"cal_mgdl":106.5,"cal_mmol":5.9,"cal_available":true,"change":-0.242246,"trend":3} juggluco/glucose {"sensor_index":0,"sensor_id":"C1QBA5A04503","time":1776667822,"time_local":"2026-04-20 16:50:22","tz":10,"minute_index":5900,"raw_mgdl":131,"raw_mmol":7.3,"cal_mgdl":106.5,"cal_mmol":5.9,"cal_available":true,"change":-0.221180,"trend":3} here is the code https://github.com/stephend61/Juggluco/tree/mqtt-branch/Common/src/main/cpp |
Beta Was this translation helpful? Give feedback.
-
|
Hi All, Great to see @stephend61 has got a server-side implementation working — and with a very rich payload too. Between the two approaches there's now a complete solution for j-kaltes to consider: Server-side (stephend61's implementation)
Android/mobile-side (my fork)
The two are complementary rather than competing. A user running the server gets the richer payload from stephend61's implementation; a user running the app standalone gets coverage from the Android side. If j-kaltes wanted a single merged approach, stephend61's payload schema would be the better one to standardise on — the Android side could be updated to match it. @j-kaltes — would you be open to reviewing one or both of these? Happy to help with anything on the Android/Gradle side. |
Beta Was this translation helpful? Give feedback.
-
Node-RED workaround: Nightscout bridge → MQTT → MySQL + nurse email reportsWhile waiting for native MQTT support in Juggluco, I built a Node-RED-based How it worksJuggluco already knows how to POST to a Nightscout server. This flow Node-RED then:
A second flow subscribes to Flow: Glucose Readings A Bonus: automated glucose report emailsFlow: Glucose Report A dashboard page (Node-RED Dashboard 2) lets you set a nurse/clinician email The HTML email includes:
Sending uses a local SMTP relay (I use the Prerequisites
CREATE TABLE readings (
ts BIGINT PRIMARY KEY,
mgdl INT NOT NULL,
mmol DECIMAL(4,1) NOT NULL
);
Configuration after import
Flow JSON |
Beta Was this translation helpful? Give feedback.
-
Comparison: Node-RED Nightscout bridge vs native MQTTWhy the Node-RED bridge works well
What it misses compared to native MQTT
The fundamental issueThe bridge trades reliability for zero app changes. HTTP fire-and-forget For a CGM specifically — where a missed reading during a hypoglycaemic episode |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hiya,
I know you weren't keen to implement MQTT in Juggluco yourself but I really need it and so I've forked your repo and added MQTT capability using the Paho library that an old colleague of mine maintains. I don't have the Android SDK or experience using it or experience of Gradle, so can we discuss you taking a look at my fork and building it. All I want is an MQTT enabled apk, to see how it's turned out, maybe make a UI tweak or two, if necessary. Then, if it's useful to you or others, run with it. As I recall, there were several of your users, including me who were interested in an MQTT enabled version.
Take a look at: https://github.com/NohWayJose/Juggluco
Please help :D
Regards,
Greg
Beta Was this translation helpful? Give feedback.
All reactions