MQTT

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

sstivers
Posts: 1
Joined: Tue Jun 07, 2016 7:22 pm

MQTT

Post by sstivers » Tue Jun 07, 2016 8:06 pm

Has anyone used the MQTT messaging protocol with LiveCode? Is there a library?

ivarandreassen
Posts: 1
Joined: Mon Nov 06, 2017 3:39 pm

Re: MQTT

Post by ivarandreassen » Mon Nov 06, 2017 3:41 pm

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.

carambola
Posts: 3
Joined: Thu Feb 09, 2017 11:55 am

Re: MQTT

Post by carambola » Sun Nov 26, 2017 9:46 am

Hi all,
I am interested in the MQTT protocol and IoT too and it would be great to use this protocol with LiveCode.

mimu
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 76
Joined: Tue Mar 05, 2013 7:00 pm
Location: Berlin
Contact:

Re: MQTT

Post by mimu » Wed Nov 21, 2018 5:00 pm

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

revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 49
Joined: Sat Apr 02, 2011 4:06 pm

MQTT & LiveCode

Post by revRider » Mon Jul 22, 2019 3:43 am

<t>Good Day.<br/>
<br/>
Are there any examples or tutorials for using LiveCode and MQTT?<br/>
<br/>
Thanks<br/>
~David</t>

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: MQTT & LiveCode

Post by bogs » Mon Jul 22, 2019 9:49 am

You are talking about that transport scheme for IOT devices, right?

If so, not that I'm aware of.
Image

revRider
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 49
Joined: Sat Apr 02, 2011 4:06 pm

Re: MQTT & LiveCode

Post by revRider » Mon Jul 22, 2019 5:14 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: MQTT & LiveCode

Post by FourthWorld » Mon Jul 22, 2019 6:49 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: MQTT & LiveCode

Post by mwieder » Mon Jul 22, 2019 9:52 pm

Trevor put some lcb code together for the last conference to use libmosquitto.

Code: Select all

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

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: MQTT

Post by mwieder » Mon Jul 22, 2019 10:02 pm

Trevor created an lcb extension to use libmosquitto:

Code: Select all

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: MQTT & LiveCode

Post by FourthWorld » Tue Jul 23, 2019 3:44 am

There is a parallel thread on this subject here:
viewtopic.php?f=11&t=27457

Should I merge them?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: MQTT & LiveCode

Post by mwieder » Tue Jul 23, 2019 3:51 am

make it so

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: MQTT & LiveCode

Post by FourthWorld » Tue Jul 23, 2019 4:21 am

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

Re: MQTT

Post by karmacomposer » Mon Apr 13, 2020 6:42 pm

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

karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

Re: MQTT

Post by karmacomposer » Wed Apr 15, 2020 2:09 pm

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

Post Reply

Return to “Internet”