Lazarus

Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: picstart on September 24, 2015, 11:19:03 pm

Title: MQTT
Post by: picstart on September 24, 2015, 11:19:03 pm
MQTT is a communications protocol often used for IoT.
Has anyone got MQTT client modules for Lazarus?
 There is Delphi code available ..has anyone ported it to the lazarus IDE?
Title: Re: MQTT
Post by: derek.john.evans on September 25, 2015, 01:43:14 am
I guess you are talking about this?
http://jamiei.com/blog/code/mqtt-client-library-for-delphi/

It uses Synapse (unit blcksock) which works with FreePascal. I looked at the code, and I cant see any issues.

I guess, try it and find out. You may need to place {$MODE DELPHI} at the top of the 2 files.

Title: Re: MQTT
Post by: picstart on September 25, 2015, 05:32:52 pm
Yes I brought the MQTT.pas and the MQTTReadThread.pas units and the needed synapse units. It compiles under  the Lazarus IDE with the addition of {$MODE DELPHI} to the two units. It mostly works but errors on a call to  MQTTClient.Free;
I was hoping with the increasing interest in IoT a perfected MQTT feature may have been available for Lazarus. Maybe I'm the first to consider Lazarus as useful for IoT
Thanks for the help.
Title: Re: MQTT
Post by: Dimitrios Chr. Ioannidis on January 15, 2016, 12:30:11 pm
Yes I brought the MQTT.pas and the MQTTReadThread.pas units and the needed synapse units. It compiles under  the Lazarus IDE with the addition of {$MODE DELPHI} to the two units. It mostly works but errors on a call to  MQTTClient.Free;
I was hoping with the increasing interest in IoT a perfected MQTT feature may have been available for Lazarus. Maybe I'm the first to consider Lazarus as useful for IoT
Thanks for the help.

I succesfully used that code but for me the lack of QoS 1 and 2 is a showstopper.

Plz try this code from here https://github.com/pjde/delphi-mqtt (https://github.com/pjde/delphi-mqtt).

Regards,
Title: Re: MQTT
Post by: jdp on April 16, 2016, 07:58:02 pm
Hi all. I need to have mqtt in Lazarus ob Raspberry Pi.
I managed to get a app working but it will crash at random when calling the ping or when receiving a payload. It works well on Windows but crashes on the Raspberry Pi.

Can sombody please help me as I need a GUI app on Raspberry Pi.
I can share the little app if it will help to try and fix the problem.
Title: Re: MQTT
Post by: DonAlfredo on April 17, 2016, 08:19:26 am
I could try ... I have a bunch of RPi, RPi2 and RPi3.
Title: Re: MQTT
Post by: jdp on April 17, 2016, 11:59:00 pm
Hi. That would be great. I am willing to pay a consulting fee to get it working stable. Where do I send the code? I have a Mosquitto server running on one of the Pi's that you can connect to.
Title: Re: MQTT
Post by: DonAlfredo on April 18, 2016, 07:18:35 am
Just PM me through this forum.
And an eventual fee may be donated to FPC/Lazarus community !