MQTT
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: MQTT
Hi Mike/Trevor (or anyone else reading the post) I should be starting a project that will require Mosquitto/MQTT functionalities and I wonder if you would be kind enough to share same code to help me get started with the subject as I'm completely new on this field.
Many thanks in advance.
Regards
Many thanks in advance.
Regards
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: MQTT
Simon- what platform? Does the lcb library on Trevor's github site not do what you want?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: MQTT
Hi @mwieder, many thanks for your prompt reply.
Not sure which platform are you referring to, my development environment is LC9.6.0 running on Mac and the App to be delivered is to be run on mobile (both iOS and Android).
I'm pretty sure Trevor's library is going to be a must for my project but I'm confused as how to use it and was hopping to find out a sample stack to be able to save some time reinventing the wheel...
The App itself is expected to be rather simple: allowing the user to choose a command to be sent (from a bunch of similar options) and retrieving/displaying the result of the command execution
Not sure which platform are you referring to, my development environment is LC9.6.0 running on Mac and the App to be delivered is to be run on mobile (both iOS and Android).
I'm pretty sure Trevor's library is going to be a must for my project but I'm confused as how to use it and was hopping to find out a sample stack to be able to save some time reinventing the wheel...
The App itself is expected to be rather simple: allowing the user to choose a command to be sent (from a bunch of similar options) and retrieving/displaying the result of the command execution
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: MQTT
Mark, I really appreciate your help. Unfortunately I still can't get Trevor's library to work on iOS.
The library appears on the Inclusions Pane as well as in the Extension Manager as can be seen on the screens capture below:
When I run the MosquittoVersion command on my Mac (Mojave & LC 9.6.0) it returns, as expected, the library version: 1.6.2
But when I run the same command on the iPad Simulator (iOS 13.3) I get the following error
I suspect I'm doing something wrong when installing the library.
I'd really appreciate any help to overcome the issue.
Regards
The library appears on the Inclusions Pane as well as in the Extension Manager as can be seen on the screens capture below:
When I run the MosquittoVersion command on my Mac (Mojave & LC 9.6.0) it returns, as expected, the library version: 1.6.2
But when I run the same command on the iPad Simulator (iOS 13.3) I get the following error
I suspect I'm doing something wrong when installing the library.
I'd really appreciate any help to overcome the issue.
Regards
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: MQTT
You're going to need the binaries for the iPad, and unless I'm wrong about this, mobile binaries don't exist.
You might try compiling from source with XCode, but I doubt that's gonna work.
Code: Select all
https://mosquitto.org/download/
Code: Select all
https://github.com/eclipse/mosquitto
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: MQTT
So can I consider then that the iOS icon appearing on the Inclusion Pane is a documentation error?
What would I need for Android? it throws an error as well...
Thanks again for your help
What would I need for Android? it throws an error as well...
Thanks again for your help
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: MQTT
Yes. Once again, there are no mobile binaries.
You're into uncharted territory here.
You can try building from the source, or possibly google around to see if anyone's been there first.
I have to say I'm not optimistic about your chances.
You're into uncharted territory here.
You can try building from the source, or possibly google around to see if anyone's been there first.
I have to say I'm not optimistic about your chances.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: MQTT
I'm surprised (and frustrated) with the fact there is no working solution at the moment.
MQTT is quite popular in the IoT universe and it would make a lot of sense for LC mobile to be able to play that game.
I've sent messages to Trevor (both on this forum and also in FB) asking for help. Hopefully he will answer with ideas, I've no expertise with libraries and the like and therefore can't even try to do it myself
Will see, thanks for your help
MQTT is quite popular in the IoT universe and it would make a lot of sense for LC mobile to be able to play that game.
I've sent messages to Trevor (both on this forum and also in FB) asking for help. Hopefully he will answer with ideas, I've no expertise with libraries and the like and therefore can't even try to do it myself
Will see, thanks for your help
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: MQTT
Yes, we were able to get it to work on 32 and 64 bit windows and mac, but nothing else.
I think the new version has username/password support but not sure and we definitely need it.
Mike
I think the new version has username/password support but not sure and we definitely need it.
Mike
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: MQTT
Hi Mike, in fact there are fields for username/password in the version I've installed on my Mac.
The Initialize button returns
Mosquitto successfully initialized
When running from the IDE the Connect button returns
MosquittoLogCallback
Level: 16
Message: Client mosq/xxxx.....xxxxx sending CONNECT
and that's all, therefore I'm not really sure if it has in fact connected to the server.
On the other hand when running from a Stand Alone the Connect button returns
the input parameters were invalid
Moreover I'm looking to have the stack running on mobile but it seems I've reached a dead end.
I've been in contact with Trevor and this was his answer:
Cheers
The Initialize button returns
Mosquitto successfully initialized
When running from the IDE the Connect button returns
MosquittoLogCallback
Level: 16
Message: Client mosq/xxxx.....xxxxx sending CONNECT
and that's all, therefore I'm not really sure if it has in fact connected to the server.
On the other hand when running from a Stand Alone the Connect button returns
the input parameters were invalid
Moreover I'm looking to have the stack running on mobile but it seems I've reached a dead end.
I've been in contact with Trevor and this was his answer:
Bottom line it seems I've hit the wall and would appreciate if someone could help, after all having LC being able to play in the IoT world should be of some value for the platform...In order for a LiveCode extension to work on a platform you have to compile a library that goes in the ./code folder. Currently there are compiled libraries for macOS and Windows 32/64-bit:
Compiling a library can sometimes be the most time consuming part of developing an extension though. Compiling a C library that will work with a LiveCode extension on iOS or Android isn't something I am familiar with so I can't provide much guidance there. You could try asking on the forums or the mailing list to see if anyone wants to chip in. After all, the beauty of Github and open source is that multiple people can contribute to a project.
Another alternative is to reach out to LiveCode and ask about hiring them to get lc-mosquitto working on mobile. Just be aware that the project was one created for a conference talk. I have not used it in any commercial setting other than running some basic tests.
Cheers
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 9856
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: MQTT
If there a way MQTT functionality could be provided over HTTP, or are hardware vendors using MQTT with binary dependencies exclusively?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: MQTT
Hi Richard,
I've been searching the web for alternatives that would allow LC to interact with Mosquitto servers with no success so far.
May be you find a way to take the rabbit out of the hat...
Best
as far as I know there is no such option available. Would it be, my problem would have been solved...If there a way MQTT functionality could be provided over HTTP
I've been searching the web for alternatives that would allow LC to interact with Mosquitto servers with no success so far.
May be you find a way to take the rabbit out of the hat...
Best
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: MQTT
One thing that has to be done is to make a PEM file for username/password to work.
I have no idea how to make a PEM file. My client gave me a username, password and client ID.
Under the Windows version of MQTT there are switches for all three, but I don't see any clientID switch or variable/function in the Livecode version.
PLUS, the PEM file in the new Mosquitto for Livecode is for Trevore's username and password. One has to be created specific to YOUR username and password (or that of your client).
Hopefully, someone can fill us in the these details and how to create a PEM file???
Mike
I have no idea how to make a PEM file. My client gave me a username, password and client ID.
Under the Windows version of MQTT there are switches for all three, but I don't see any clientID switch or variable/function in the Livecode version.
PLUS, the PEM file in the new Mosquitto for Livecode is for Trevore's username and password. One has to be created specific to YOUR username and password (or that of your client).
Hopefully, someone can fill us in the these details and how to create a PEM file???
Mike
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: MQTT
As far as I know, MQTT for Livecode will only be PC/Mac unless someone steps up with advanced C++ knowledge on how to compile .dlls for Livecode.
Mike
Mike