Publish and subscribe to MQTT from Pico LTE

Publish and subscribe to MQTT topics from the Pico LTE over the cellular connection, with MQTTHQ as the test broker.

These examples publish and subscribe to MQTT topics from the Pico LTE over the cellular connection. MQTT is a lightweight messaging protocol for constrained devices and low-bandwidth, high-latency or unreliable networks, common in IoT. The test broker is MQTTHQ, with its web client on the other side. No extra hardware is needed.

Before you begin

Required

Hardware

  • Sixfab Pico LTE or Pico LTE 2Registered and active in Sixfab Connect, connected to the computer with the micro USB cable.

Software

Prepare broker

Go to MQTTHQ, note the Broker URL and the TCP Port, and click Try our Web Client Now.

In the web client, set the QoS to 1 (At Least Once) and note the topic and the QoS.

Run examples

The scripts are in the examples/mqtt folder of the SDK repository.

Troubleshooting

A timeout error with QoS 0: set the QoS to 1 or 2 on the board and on all other clients.