Does Python3-Paho-mqtt 1.6.1-1 fits Mosquitto 2.0.11

I did not used these before. Raspberry Pi OS APT has list of approved software that has taken time to validate for dependencies. Hence they lag behind the lastest version of Mosquitto and Python Paho client.

The bookworm RPi OS APT ‘recommends’ Mosquitto 2.0.11 and Python3-Paho-mqtt client version 1.6.1-1

Are these version of Broker and Client fitting each other? If not, which version to use? Can they support mqtt protocol 5, 3.11 or 3.1?

I used some youtube examples based of mqtt 3.x, obviously created under different software versions and might also wrongly mixed-up by me. I am using Python, RPi 5, 8GB RAM, RPi OS 64 bits with desktop, with sudo apt update and sudo apt upgrade.

My Python code run well if I put time.sleep(0.2) before publishing next message. Value higher or lower than 0.2 second make the code execute one time only or hangup after says 30 minutes. If I remove the time.sleep(0.2), it can process much higher number of message per second, but will hangup after tens of minutes.

Mosquitto has been very stable, no hangup. Just my Python code hangup.

Is this example fitting the above Broker and Client? https://cedalo.com/blog/configuring-paho-mqtt-python-client-with-examples/

The Paho Python client and Mosquitto should work fine together.

A common mistake with the Python client is to forget to use one of loop_start() or loop_forever() on your client. Do you have one of those calls in your code? Can you post a minimal example that shows the behaviour you are seeing?

Regards,

Roger

Many thanks. I am starting on this. My first task would be gathering software and hardware versions information, the, try them out.

Would be grateful if you might recommend which version for:

(a) mosquitto running under Debian on PC hardware (powerful hardware)

(b) Is Paho the ‘standard’ client for python running on a computer?

(c) Is peterhinch/micropython-mqtt a good client for microcontroller (limited small-sized hardware)?

(d) what are the pro and con to choose between mqtt protocol 5 and 3?

(e) Debian 12 apt list of dependency test-and-approved list.
mosquitto is 2.0.11-1.2+deb12u1
python paho is 1.6.1-1 instead of the major change (1.x to 2.x) latest version of 2.1.0
initial test on the 1.x version is fine. Should I stay at 1.x instead of going to the latest 2.x which break the Debian approved dependency list.

Many thanks