Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQTT support discussion
#21
I got through a good bit of the incoming value handling stuff today. Or, more of it was just banging out the errors that I was finding now that it was actually running enough to make them apparent.

Then I got distracted to dealing some general coding stuff. I've been continuing my home improvement work on the code, and really trying not to ignore anything that is bugging me, and this MQTT stuff brought up some of those that I dug into today.

But I was to the point where I was basically in the 'ready state' and processing msgs appropriately, sending keepalive pings and receiving publish msgs when I pushed something up via my little tester. I need now to test that value storage and error checking of the incoming value and all that to make sure that's tight. But it's pretty far along now.
Dean Roddey
Explorans limites defectum
Reply
#22
Dean are you planning on including the security layer of MQTT so that we can secure the communication?
Reply
#23
I didn't see anything about MQTT specific security in the documentation. Do you mean just using a secure socket connection to the server?

If you put a user name/password in the config file, those will be used in the connect message. I didn't show them in the above sample since that's the one I'm using with the mosquitto test server and I don't think it supports credentials.
Dean Roddey
Explorans limites defectum
Reply
#24
It's a good thing you mentioned that before I got further along. I changed it over to use data sources instead of raw sockets. That lets it support secure or non-secure socket connections to the MQTT server. It would have been more annoying to make that change as time went on and it got more refined.

The mosquitto test server supports both types so I should be able to test them out.
Dean Roddey
Explorans limites defectum
Reply
#25
OK, for a secure connection the first part would look like this:

Code:
<!DOCTYPE MQTTCfg PUBLIC "urn:charmedquark.com:CQC-MQTTCfg.DTD" "CQCMQTTCfg.DTD">
<MQTTCfg Version="1" MQTTPort="8883" MQTTAddr="test.mosquitto.org" Secure="Yes"
         SecPrincipal="test.mosquitto.org">

If the security principle isn't provided, it will use the MQTTAddr value, which is usually right. So mostly you'd set Secure to yes and use the right TLS enabled port for the server. I just tested it on the test server and it worked.
Dean Roddey
Explorans limites defectum
Reply
#26
Outstanding!
Reply
#27
So, after getting a pretty good feel for the way of the thing, I'm dumping the idea of a separate service. It's not going to be complex enough to justify that. I'm just moving that code into the driver itself. That'll just be that many fewer complications and moving parts.
Dean Roddey
Explorans limites defectum
Reply
#28
I got a lot done today. I converted it over to the pure driver form. What was the service becomes an I/O thread in the driver. And I worked out the communications between the main driver thread and the I/O thread (which of course is a lot simpler now that they are in the same package.)

I just got that worked out and have a couple of incoming field types being processed and the results being shuttled over to the driver to find the field and update it.

I'll pick up there tomorrow and may have something actually pretty workable tomorrow. I need to get a new drop out since I've got some other bits pending as well. I may spend some time tomorrow doing a good bit of testing to make sure none of my recent code modernization shenanigans have caused issues and get at new drop out (without the MQTT stuff yet, I'll save that for the next one, since I'd want to do more work before I put it out there.) Actually I've already done a good bit of that testing. And I've been being better about writing new unit tests as well, which helps.
Dean Roddey
Explorans limites defectum
Reply
#29
I have been following this thread, and have searched the internet to learn more about MQTT, but I am still not sure how this will help us with CQC.  Could you give us some examples of how MQTT might work within our systems?  Perhaps even describing it a bit more in detail in Post #1, as I am not familiar with it and can't seem to figure out what it would actually do.
Reply
#30
Others here are more qualified to really 'splain it from a usefulness standpoint. But basically it's a simple messaging protocol that IBM came up with. It provides a simple protocol that lets devices or programs 'publish' information to a server, and others to 'subscribe' to that information, which means the server will tell them any time it changes.

Various hardware and software systems support this protocol, and so it sort of acts like a gateway to all those devices via a single interface. That means we don't have to have drivers specifically for them. If we understand the MQTT protocol, and can subscribe to the information those devices publish, we can get that information into CQC.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Official 5.4 Beta Discussion Thread Dean Roddey 334 22,601 02-15-2019, 03:20 PM
Last Post: Dean Roddey
  Official 5.3 Beta Discussion Thread Dean Roddey 815 119,190 07-05-2018, 12:44 PM
Last Post: Dean Roddey
  Official 5.2 Beta Discussion Thread Dean Roddey 244 77,397 10-14-2017, 07:57 PM
Last Post: Dean Roddey
  Official 5.1 Beta Discussion Thread Dean Roddey 453 176,206 05-16-2017, 03:45 PM
Last Post: Dean Roddey
  Official 4.7 Beta discussion thread Dean Roddey 295 77,215 04-23-2015, 04:19 PM
Last Post: Dean Roddey
  4.4 Beta Discussion Thread Dean Roddey 327 75,951 10-06-2013, 12:46 PM
Last Post: Dean Roddey
  4.3 Beta Discussion Thread Dean Roddey 386 83,705 04-24-2013, 04:37 PM
Last Post: Dean Roddey
  4.2 Beta Discussion Thread Dean Roddey 216 46,863 08-01-2012, 12:44 PM
Last Post: Dean Roddey
  Official 4.0 Beta Discussion Thread Dean Roddey 573 124,599 09-01-2011, 11:35 AM
Last Post: Dean Roddey
  XBMC discussion Dean Roddey 19 9,357 03-13-2011, 02:51 PM
Last Post: wuench

Forum Jump:


Users browsing this thread: 1 Guest(s)