Multiple Controllers - Single Gateway ?



  • I new here, so likely to ask stupid questions... I'm led to believe that the gateway is stateless (sounds like a good plan) and I'm wondering if it's possible for an ethernet gateway to serve multiple controllers. It would presumably need to service multiple ports to do that, but I think that the shield I am using (5100) can do that.

    I'm presuming that there would need to be minimal changes to the gateway sketch... but really asking if (a) this has been / could be done, and (b) if this is a really silly thing to be asking.



  • The ethernet shield allows up to 4 connections even to the same port, thats what i'm doing at the moment.



  • Ah, that's what I had read about the shield. So, just to confirm, with no changes at all, the ethernet gateway sketch can serve up to 4 different controllers simultaneously - the only interaction being through any state change of the MySensors nodes? That sounds like magic.


  • Hardware Contributor

    IMO, this is one of the big advantages of MQTT since any number of clients can subscribe to the messages. I started playing with the ethernet gateway,then went to the MQTT gateway (which is a very limited broker), then the MQTT client gateway (which connects to an external broker), and have finally settled on the serial gateway (full circle). Using the serial gateway connected to a raspberry pi with a simple Python script to read the messages and turn them into MQTT messages gives me more control over how the messages look and how it works. Any number of clients (controllers) can connect to the MQTT broker and receive messages which is great because you can try out new controllers or new displays without changing anything in the sensor network. That also puts all of the parts of the system I might want to change in easily modified software on the raspberry pi vs in the firmware of the arduinos (which is a pain to change after everything is installed). Of course this does require a raspberry pi (or other server machine) and controllers that can use MQTT.


  • Hardware Contributor

    Would you share your python script? Does the script send received messages from the MQTT to the sensors, too?

    Greetings

    Andreas


  • Hardware Contributor

    @ahhk said:

    Would you share your python script? Does the script send received messages from the MQTT to the sensors, too?

    Sorry - I don't have anything up and working yet. I'm still flipping back and forth between ideas so I haven't gotten around to finishing my script. I'm basing it on these repositories though which might be usable by you:
    https://github.com/thehawkes/pymygw
    https://github.com/wbcode/ham



  • I have been a Vera user , all flavors , for more than 8 years now, I have tried Ui1.5.x.x and UI7.x.x ,I have tried the Vera Edge with approx 40 sensors and modules and using PLEG for controlling most all aspects of the Home automation. I found the Vera Edge could not handle all the Automation, tech support worked with me for 3 weeks to try to get the Edge to cooperate . I finally sent it back to where I bought the Unit. I changed over to my Veralite and my Vera3 and split the work up between the 2 controllers. I run Mysensor Ethernet Gateway on both of my controllers, 1 gateway for 2 Veras.
    I have Zwave motion sensors,Zwave modules, Zwave dimmer modules, Zwave Honeywell Thermostat and Temperature and Humid sensors that are Zwave. I have Mysensor door/window sensor built with Attiny 85, so much cheaper to build than using
    Nano or Pro-Mini I also have Scene controllers built with pro-Mini that control ceiling fans remotely, bedroom lights remotely, Entertainment Centers remotely. You get the Idea. Now nothing is perfect I have had my glitches but for FREE their is no other controller I will use , unless someone comes up with one as reliable and cost effect as MCV.


Log in to reply
 

Suggested Topics

  • 90
  • 3
  • 7
  • 13
  • 2
  • 4

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts