Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two SIP Raspberry and MQTT
#1
Lightbulb 
First of all, a big thank you to Dan for this great project.
I already have an installation on raspberry and an 8 relays board that works great.
My house has two isolated area , one in front and one in back. In the front I use SIP, in the back a traditional system. I would also like to replace this one with SIP.
I took a second raspberry with an 8 relay board and I installed SIP, but I would like to use only one interface to handle everything, like master and slave. Also, because I have a rain sensor installed in the front and used by SIP.
I installed the mqtt plugin on both SIP, but I'm a beginner and I do not know how to configure it to sending commands and receive feedback to/from the second SIP.
Would anyone, kindly, give me a hand?
Thank you
Reply
#2
Welcome,

You have an interesting request and I will need to give this some thought.

First off the MQTT plugins are primarily designed to allow SIP to communicate with a separate system such a home automation application. It requires an MQTT broker program such as mosquitto to be running on the network. You could install mosquitto on one of your RasPis but SIP is does not have the capability to handle communication between two or more SIP installations.

I'm sure many users would find it useful to be able to add multiple Pis and use one SIP interface to control them.

What would probably need to happen is for the additional Pis to be running a special version of the software that would allow the Master Pi to see them as extension boards.

I will look into the possibility of setting something up but in the mean time you will probably need to use separate interfaces for each installation.

Dan
Reply
#3
After giving this a bit more thought I think it should be possible to modify the mqtt_schedule plugin to work with a specified range of stations.

You would just need to schedule all the stations for both SIP installations on the "master" SIP which would use the mqtt_zones plugin to broadcast all the zone states each time a station is switched on or off.

The "slave" SIP installation would be running the modified mqtt_schedule plugin (I am thinking of naming the plugin mqtt_slave) and would only run selected stations. For example if the master has 8 valves connected to it and the slave has another 8 connected to it, as in your case, you would set the master to have 16 stations ( under Options > Station Handling > Extension boards = 1). You would make the irrigation programs for all 16 stations on the master. When a program switches a valve on or off that information would be sent to the slave(s) by the mqtt_zones plugin. If the valve is in the 9 -16 range, the mqtt_slave program would activate the appropriate valve on the slave. The master would continue to display the status of the station as if it was on the master and log the run as usual.

It looks like modifying the mqtt_schedule plugin will be pretty easy. I will work on it in the next few days.

In the mean time you can try installing the mosquitto MQTT broker on one of your Pis. This may take some tinkering to get working properly. I have a blog with some instructions for installing mosquittto:
https://xperimentia.com/2015/08/20/insta...ebsockets/

After I have a chance to test things out I will be able to give you some detailed and simplified instructions for setting up mosquitto.

I recommend a Raspberry Pi 3 to rum both SIP and mosquitto.

There is a handy utility that can help with testing of MQTT:
http://kamilfb.github.io/mqtt-spy/

Dan
Reply
#4
Star 
Thank you Dan, 
You are too kind
meantime I'll try to configure mqtt broker and play with it
Thanks
Reply
#5
FYI

I already have a proof-of-concept plugin version working. It was even easier than I thought.
What needs to happen now is to make a configuration page for the mqtt_slave plugin and write some documentation.

Looks like it should work with any number of slaves which can have different numbers of stations (4, 8, 16 etc). The slaves can even have different types of hardware interfaces to the valves (relays, triacs, etc).

It will still take a few days to make the final plugin. I still need to do some testing.
Reply
#6
Thanks for update Dan  Smile
Reply
#7
How is your mosquitto installation coming along?

The mqtt_slave plugin is nearly ready. It is working and just needs the documentation to be finished.
If you are interested in testing the plugin I can make it available. You will probably have questions and that could help guide the documentation.
Reply
#8
Hello Dan,
I've installed mosquitto, enabled broker, service and played with the classic "hellow world" between two Raspi Wink
I've read some docs, I think I understand how it's working (I'm still an ignorant about coding Blush )
Unfortunately I have one PI 2 and one PI 3, hope will be enough. If it will not be (enough), I will take another PI 3
Yes, I'd like to try the plugin, but do not be angry if I'll ask you stupid questions.
Thanks
Stefan
Reply
#9
Hi Stefan,

The mqtt_slave plugins has been added to the list of plugins that can be installed with SIP.
I would suggest installing the mqtt_slave plugin on your Pi 2 and using the Pi 3 as your master system with the mosquitto MQTT broker also installed in the Pi 3. The Pi 3 has a quad core processor and it will handle running multiple programs best. Although you could use the Pi 2 as the master, it might just run a bit slower.

Once you install the new plugin, open the mqtt_slave set up page from the Plugins menu and click the Help button. that should open the documentation page with instructions for setting everything up. The Help page is just a first draft and probably contains spelling mistakes, omissions and things that may be hard to understand.

Any questions you have will help improve the documentation.

Let me know how it goes. Thanks.

Dan
Reply
#10
Hi Dan,
I've installed mqqt slave plugin and configured as in documentation.
Pi 2 master (because is already connected to valves)  and Pi3 slave.
But he configuration of the mqtt -slave plugin is not saved, after click "Submit" and going back to the plugin page, the settings are empty.
When press "submit" in the syslog I can see this message "HTTP/1.1 GET /mr2-save" - 303 See Other"
What I missed?

PS: I'll try to revert later this evening
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)