w0run
New Member
Posts: 1
|
Post by w0run on Aug 20, 2019 23:20:18 GMT -5
I am not sure whether this is the right place for this. I haven't used LB for a few years (been playing with snakes, Pythons to be exact). I am starting to build some IoT apps, and most of them use the Publish/Subscribe paradigm (e.g. Adafruit.io). MQTT is very popular, and there is a Python client for this protocol. I don't know what the right way to handle this would be, but it would be nice to have an easy (read BASIC) way to subscribe to a topic and have a sub kicked off when something new is published to that topic. And also be able to publish to a feed. I am looking at LB as a "playground" for my IoT projects, but I am not sure how to get the data from an MQTT Broker. Would this be best "baked into" LB, on the lines of ON_COM, or would it be an app written in LB that could be used? Has anyone considered this already?
|
|
|
Post by Chris Iverson on Aug 20, 2019 23:56:14 GMT -5
MQTT is a protocol built on top of TCP/IP sockets, and considering we don't have an interface for that directly in LB yet, I don't think MQTT can be expected soon. That said, there's public code available out there, and in particular, I notice this MIT-licensed portable C MQTT client, which might be able to be made into a DLL for LB. Feel free to look up other implementations, as well; I'd advise staying away from anything that's GPL-licensed, though, as (under my current understanding of the GPL) it's possible that it's legally incompatible with LB if you don't have a special exclusion from each author of the GPL'd work. That's a separate task, though. While I'd be willing to consider it(especially since the majority of the code already exists there), I have little enough time as it is to work on sockets DLL I have already. It's not a bad idea; in fact, I can find a lot useful with it, myself. As for how it would work best, I think as a separate DLL that can be called into would be most convenient. There for those who need it, gone for those who don't.
|
|
|
Post by Lurker on Aug 21, 2019 9:08:04 GMT -5
I am not sure whether this is the right place for this. I haven't used LB for a few years (been playing with snakes, Pythons to be exact). <snipped text> but it would be nice to have an easy (read BASIC) way Python snakes are not easy?
|
|
ntech
New Member
Posts: 49
|
Post by ntech on Sept 9, 2019 8:34:25 GMT -5
I am not sure whether this is the right place for this. I haven't used LB for a few years (been playing with snakes, Pythons to be exact). I am starting to build some IoT apps, and most of them use the Publish/Subscribe paradigm (e.g. Adafruit.io). MQTT is very popular, and there is a Python client for this protocol. I don't know what the right way to handle this would be, but it would be nice to have an easy (read BASIC) way to subscribe to a topic and have a sub kicked off when something new is published to that topic. And also be able to publish to a feed. I am looking at LB as a "playground" for my IoT projects, but I am not sure how to get the data from an MQTT Broker. Would this be best "baked into" LB, on the lines of ON_COM, or would it be an app written in LB that could be used? Has anyone considered this already? Like Chris said, you can use a DLL. After some browsing on GitHub, I think this one would be the best fit: wolfMQTT, and if you like, I can compile you a Windows DLL (x64, I don't have a x86 atm). It's 3.6Kb and has built-in support for TLS 1.3 and SSL. It's written in C89, and is thus portable to Mac and Linux. To use the DLL, you'll have to see ther documentation, then you'll be ready to go!
|
|