[fpc-pascal] MQTT package for freepascal/lazarus?

Bo Berglund bo.berglund at gmail.com
Thu Oct 20 11:11:17 CEST 2022


On Tue, 11 Oct 2022 19:42:26 +0200 (CEST), Karoly Balogh via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>Hi,
>
>On Tue, 11 Oct 2022, Bo Berglund via fpc-pascal wrote:
>
>> I am looking for a pascal implementation of the MQTT protocol.
>> I could not find anything inside Lazarus' OnLinePackageManager.
>>
>> Is there something like that available?
>
>I made a front-end Pascal library, and and Object Pascal wrapper for
>libmosquitto a couple of years ago. It's available here. It's know to work
>on Linux, Windows and macOS at least. It's against libmosquitto 1.x. Not
>sure if 2.x got released meanwhile. I can update things if needed. (Pull
>requests are welcomed.)
>
>It's available here:
>https://github.com/chainq/mosquitto-p

Well, the version of the mosquitto broker server that gets installed on my
RaspberryPi4 is:

$ mosquitto --version
Error: Unknown option '--version'.
mosquitto version 2.0.11
mosquitto is an MQTT v5.0/v3.1.1/v3.1 broker.

So this is what I have to communicate with as a client.

I need to be able to publish as well as subscribe to topics.

In the Lazarus forum I have seen people having problems with this when they use
various FPC packages while the native command line works OK (on Linux), probably
because they are using old packages not updated for the changes made in MQTT in
recent years.

So this is why I am asking if there is some MQTT client package available for
FPC/Lazarus that complies to the updated protocols?


-- 
Bo Berglund
Developer in Sweden



More information about the fpc-pascal mailing list