MQTT and Mosquitto: Difference between revisions

From Rsewiki
(Created page with "Back to Scorpi == Installation packages == On Raspberry PI 5 (running 64bit OS) Paho Mqtt can be installed with C++ support. This failed on Raspberry pi 4 (running 32 bit OK - due to Lidar support for YD Lidar S4B). However, the C interface API works on Raspberry 32bit OS (Bullseye). Install: sudo apt install libpaho-mqtt-dev libpaho-mqttpp-dev mosquitto-dev mosquitto-clients - in addition to other packages required for normal compile This should allow the tee...")
 
No edit summary
Line 18: Line 18:


For Paho-mqtt, see https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html
For Paho-mqtt, see https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html
or for C interface: https://eclipse.github.io/paho.mqtt.c/MQTTClient/html/index.html


=== Configure Mosquitto ===
=== Configure Mosquitto ===

Revision as of 18:28, 21 July 2024

Back to Scorpi

Installation packages

On Raspberry PI 5 (running 64bit OS) Paho Mqtt can be installed with C++ support. This failed on Raspberry pi 4 (running 32 bit OK - due to Lidar support for YD Lidar S4B).

However, the C interface API works on Raspberry 32bit OS (Bullseye).

Install:

sudo apt install libpaho-mqtt-dev libpaho-mqttpp-dev mosquitto-dev mosquitto-clients

- in addition to other packages required for normal compile

This should allow the teensy interface to compile.

Documentation MQTT API

For Paho-mqtt, see https://eclipse.dev/paho/files/paho.mqtt.python/html/index.html

or for C interface: https://eclipse.github.io/paho.mqtt.c/MQTTClient/html/index.html

Configure Mosquitto

Copy the full option list example to /etc/mosquitto/conf.d/:

 sudo cp /usr/share/doc/mosquitto/examples/mosquitto.conf /etc/mosquitto/conf.d/

Uncomment and change in the 'listener' group:

#listener
listener 1883

In the security group:

#allow_anonymous false
allow_anonymous true

Restart mosquitto to take effect.

sudo service mosquitto restart