-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial import of mqqt code from Neil #488
Conversation
Input from Neil in the mail: Right now the first design decision is that I'll use wild cards instead So you'll need to add this to the mh.private.ini:
You don't need the user or password as there's no code for it yet. When you start up MH you will get a ton of data and I may have left To test the mqtt, I send data from the command line: mosquitto_pub -d -h test.mosquitto.org -q 0 -t home/ha/test/x10/A1 -m "A1AON" I'm modeling my code after Jason Sharpee's UPB modules. I made a mistake
Which seems to say that I use the objects set method to do that work. |
[copy of a message I sent on the mailing list, I think it is better to continue the discussion here]. Would it make sense to have an object that takes care of the connection to the MQTT server (kind of a gateway) and then have objects per instance that connect to the MQTT server through that gateway object. I implemented such structure for the Squeezebox client interface: What is your opinion on this? |
Actually the _server method does the same thing but I like the method SqueezeboxCLI.pm uses so I've switched over to it. I'll post that code later, I think I have the multiple subscriptions to the same host/port working now and I have some of the set partially working to and from mqtt. Lots and lots of print_logs going on so I can trace the flow. MH is maddeningly frustrating with examples that are understandable |
Hey Neil, feel free to push the changes to this branch on your clone, then everybody can easily access them and I can pull them in this branch. |
On 03/20/2015 02:54 AM, Lieven Hollevoet wrote:
I will in a couple of days (sorry) a bit busy at the moment. But I think mosquitto_pub -d -h 127.0.0.1 -q 0 -t path/to/topic -m "Off" That occurred at the last minute. I need to remove a lot of the Linux Home Automation Neil Cherry [email protected] |
…is to be first working version.
I've made a number of changes to allow more than one mqtt instance. This is meant to provide support for multiple hosts and ports pairs. I noticed that using the same host:port would cause the second request to be disconnected. So I reused the first host:port instance (I really only wanted the socket). So I reused the instance and issued a new subscription. This has man side effects that need to be worked out. There are a number of other fix "me"s and todos (listed in the source). Reconnect handleing among the top issues. See Usage and Example in the source file for changes to instanctiation.
Further work on the mqtt module
Initial import of mqqt code from Neil
Code was submitted on the mailing list. Moving it here so multiple people can work on the same codebase.