Is possible to publish data with the Electron to a given MQTT broker?

Hello,

Probably a naive question, but is it possible to publish data to a given cloud or MQTT broker using the Electron (over cellular), or is it only possible to publish data to the Particle cloud?

Thanks!

As long that MQTT broker doesn’t require secure connection you can give this library a try
https://build.particle.io/libs/MQTT/0.4.28

Secure transfer is a bit more tricky, but there also is a library which may work (or not :wink: )
https://build.particle.io/libs/MQTT-TLS/0.2.19

However, since cellular connections are using UDP by default (rather than TCP) you may run into issues with these libraries.

2 Likes

I have used ScruffR’s first link (but 0.4.27) and can confirm it works with Electron and ThinkSpeak’s MQTT broker , for what it’s worth.

1 Like