MQTT Support

Hi, we are currently working on a project using mender, and we are planning to use secure communication channel in MQTT instead of let device constantly polling the server over HTTPS. Therefore, is there any possible workarounds for supporting MQTT protocol for Mender?

Welcome to Mender hub and thanks for the post.

I’m not sure how this could be implemented with the current setup. The server would have to be modified to notify of updates via MQTT and the client would have to be modified to detect them. It may be possible to implement a workaround on the client by simply disabling the systemd service, implementing a separate handler which launches the client when it detects an update. But the server side is more of an issue; perhaps something could be done using the API.

What were you thinking as far as server side MQTT?

Hi, currently on server side I can’t see which device is online, I can only check ’ Last check-in time’ to check if device is online, and this is disturbing. By use MQTT it will solve this problem. I think maybe we can create a local mqtt client and proxy local mender http request, on sever side we can use mosquitto and build an other micro service to subscribe mqtt topic and proxy to the api gateway. Or we should replace http entirely, mqtt is better than http on device-server communication.

Hello!

Thanks for the feedback!

This is a rather large architectural change and bidirectional communication indeed the direction Mender is going. We are planning to add a message queue to support device-server communication within the next 6 months.

It is still not decided exactly which technology to use, and we will rather gradually add support for different features like “online status”, update notifications, etc. This may take a longer time to transition to. Also keep in mind that we need to support the current polling method for backward compatibility too.

Not all of our users share your view that MQTT is better though. It does require a always-open TCP connection that can drain network and energy/battery unnecessarily (if you don’t need realtime status/updates). It does have advantage of instant communication. So there are some tradeoffs and we need to take the needs of all the Mender users and community into account.

1 Like

Hi,
I would love to hear more about this feature you’ll are planning to add. I am interested in using Mender Client in standalone mode with firmware upgrade trigger coming from an MQTT channel. The artifacts will be residing on an external HTTPS server. Will the message queue to support device-server communication be binded just to hosted Mender server or will it be able to be used with any external HTTPS server as well?

Thanks,
Minal