Page 1 of 2

MQTT

Posted: Tue Jun 07, 2016 8:06 pm
by sstivers
Has anyone used the MQTT messaging protocol with LiveCode? Is there a library?

Re: MQTT

Posted: Mon Nov 06, 2017 3:41 pm
by ivarandreassen
Hello,

Got a request to look into MQTT for IoT project today. Has anyone created a LC based soltuion with MQTT yet? Any experience and example code is much appriciated.

Re: MQTT

Posted: Sun Nov 26, 2017 9:46 am
by carambola
Hi all,
I am interested in the MQTT protocol and IoT too and it would be great to use this protocol with LiveCode.

Re: MQTT

Posted: Wed Nov 21, 2018 5:00 pm
by mimu
Hello,
any news on this topic?

I found a native Objective-C iOS library

https://github.com/novastone-media/MQTT ... -Framework

I could imagine that somebody with the right experience should be able to build an iOS extension / widget,
but i don't know how complicated it would be.

IOT and MQTT are interesting topics today
and if we could access the incoming data it would be easy to built nice interfaces with livecode.

Here you will find a list of MQTT related staff:
https://github.com/hobbyquaker/awesome- ... n-tracking

MQTT & LiveCode

Posted: Mon Jul 22, 2019 3:43 am
by revRider
<t>Good Day.<br/>
<br/>
Are there any examples or tutorials for using LiveCode and MQTT?<br/>
<br/>
Thanks<br/>
~David</t>

Re: MQTT & LiveCode

Posted: Mon Jul 22, 2019 9:49 am
by bogs
You are talking about that transport scheme for IOT devices, right?

If so, not that I'm aware of.

Re: MQTT & LiveCode

Posted: Mon Jul 22, 2019 5:14 pm
by revRider
Yes, well more or less..

Trying to communicate with weather station, Software Defined Radio, and WeMos devices.

I'm pretty good with serial communications, but this is totally new. No clue how to get started..

Was getting good at parsing data, but can't get the data.

~David

Re: MQTT & LiveCode

Posted: Mon Jul 22, 2019 6:49 pm
by FourthWorld
I took a gander at the Wikipedia page for the protocol:
https://en.m.wikipedia.org/wiki/MQTT

Lightweight, TCP-based, client-server - definitely doable in LC, though I'm not aware of an existing library for it.

Doesn't seem like it would take much to write one, though, given sufficient time and motivation. As protocols go, this one seems pretty straightforward, and since you only need the client side it gets simpler still.

It may be helpful to run through this tutorial to get a feel for crafting a simple client-server socket app in LC:
http://lessons.livecode.com/m/4071/l/12 ... ng-sockets

With that under your belt you may find you'll have plenty of confidence to approach MQTT.

Re: MQTT & LiveCode

Posted: Mon Jul 22, 2019 9:52 pm
by mwieder
Trevor put some lcb code together for the last conference to use libmosquitto.

Code: Select all

https://github.com/trevordevore/lc-mosquitto

Re: MQTT

Posted: Mon Jul 22, 2019 10:02 pm
by mwieder
Trevor created an lcb extension to use libmosquitto:

Code: Select all

https://github.com/trevordevore/lc-mosquitto

Re: MQTT & LiveCode

Posted: Tue Jul 23, 2019 3:44 am
by FourthWorld
There is a parallel thread on this subject here:
viewtopic.php?f=11&t=27457

Should I merge them?

Re: MQTT & LiveCode

Posted: Tue Jul 23, 2019 3:51 am
by mwieder
make it so

Re: MQTT & LiveCode

Posted: Tue Jul 23, 2019 4:21 am
by FourthWorld
mwieder wrote:
Tue Jul 23, 2019 3:51 am
make it so
Done, merged into the one in the Internet section where it's more likely to be discovered by interested passersby.

Re: MQTT

Posted: Mon Apr 13, 2020 6:42 pm
by karmacomposer
I tried to get this to work - followed all the instructions - loaded the .lcb file into extension builder. Ran the livecode test file and when I click the check lib Misquitto version button, I get an error:

Code: Select all

button "Check libMosquitto Version": execution error at line 2 (LCB Error in file D:/Documents/clients/renatus/lc-mosquitto-master/mosquitto/mosquitto.lcb at line 164: unable to load foreign library)
Has anyone been able to work with this recently (in 2020)?

Any help is greatly appreciated.

Mike

Re: MQTT

Posted: Wed Apr 15, 2020 2:09 pm
by karmacomposer
Turned out I was using 64 bit in a 32 bit version.

I talked with Trevor and he was able to round up 64 bit versions of the library.

Copying and pasting those in place in the /code folder made this library work in 64 bit.

Thank you Trevor!

Question: how does one log into a IP address to receive messages (I assume a sub) using this library?

My client wants me to receive sensor data by subscribing to his topic after logging into his IP address.
So far it just hangs.

Thanks.

Mike