Use another node than gateway for control
-
Hi all,
In a MySensors network a controller is connected with a gateway to read messages from sensor nodes and send messages to actuators.
In my MySensors network I use a serial gateway mainly for reading the messages and for the sake of simplicity I would like to keep it that way. (I use a labview application for logging purposes).
As my network grows I want to add some actuators, but I do not want to control them via the gateway as described before.
Would it be possible to send the control-messages around using another node than the gateway using serial communication? Or in other words: would it be possible to send messages in a similar way as would be done via the gateway but now using a dedicated node for that?
I read through the forum but could not find a real answer unfortunately
Best regards,
Boozz
-
@boozz messages can be addressed to any node. It is done like this:
message.setDestination(DESTINATION_NODE_ID);
For a practical example, see https://www.openhardware.io/view/53#tabs-source
Messages will still be routed through the gateway though.
-
hey thanks!
I didn't think of using message.destination... I used it in the past to have 2 nodes talking to each other. Now I need some code to get serial input translated to messages.
I think I know where I can find such code for that.
If that idea works I'll post the sketch.
Boozz
-
@boozz Cool. What are you getting the serial input from? Is your actuator connected to serial?
-
@mfalkvidd
Serial input will come from a windows based PC. Probably the same as the one that acts as the datalogger.
The actuator could be any actuator-node.To give you some more info:
I have some lights in my shed (mancave actually....) that should turn on when pressing a button, somewhere nearby, i.e. near the door. This button is connected to a node that sends the command to the actuator node. setdestination will play a role in this node.
There's also an automation scheme to turn on (and more important: off) the lights. As the shed is quite far away it is very handy to turn off the lights when I have returned to my home and forgotten to turn of the lights (for whatever reason). For this purpose I will use this specific node. Once I manage to controll the lights in the shed, I will be able to controll some more things around.
Suggested Topics
-
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
Human presence sensors....
General Discussion • 31 Jan 2025, 10:54 • skywatch 9 Feb 2025, 19:36 -
Code Garage to the rescue.
General Discussion • 11 Jan 2025, 11:25 • skywatch 23 Feb 2025, 14:57 -
Anybody got one / a few spare minimalist rfm69hw shields for wemos d1 mini?
General Discussion • 20 Sept 2024, 08:45 • kiesel 11 Oct 2024, 15:32 -
No merge into master in the last 5 years, should we use development?
General Discussion • 23 Sept 2024, 17:48 • kiesel a day ago -
Meet in Malmö, Summer 2016?
General Discussion • 1 Feb 2016, 15:34 • bjacobse 23 days ago