Local sensor (no radio)
-
I have a RPi 2 controller connected to a uno that has the radio (serial GW). I also have a arduino mega that controls all my heating zones in the house (11). Right now the mega is just spewing out debug on the serial port but I would love to connect it to the RPi and integrate it into my mysensors network. Is there any libraries for doing this or has anyone done similar? I don't want to add a radio to the mega as it is sitting right beside the controller.
Thanks!
-
Depending on how curious you are, and how advanced a setup you want, You could make a mockup that emulates the serialport protocol, it should be pretty easy to do. Or you could make a nodered flow, that picks up data from your mega, and remaps it to mysensor protocol, and then inject that into the data stream in to you controller of choice.
-
You should have a look at the "gateway-refactoring" branch. Over there it is possible to create a node without radio.
A serially attached gateway motion sensor would look like this:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable serial gateway #define MY_GATEWAY_SERIAL #include <MySensor.h> #define CHILD_ID 1 MyMessage msg(CHILD_ID, V_TRIPPED); void setup() { sendSketchInfo("Motion Sensor", "1.0"); pinMode(DIGITAL_INPUT_SENSOR, INPUT); present(CHILD_ID, S_MOTION); } void loop() { boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; send(msg.set(tripped?"1":"0")); // Send tripped value to gw sleep(INTERRUPT,CHANGE, SLEEP_TIME); } -
You should have a look at the "gateway-refactoring" branch. Over there it is possible to create a node without radio.
A serially attached gateway motion sensor would look like this:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable serial gateway #define MY_GATEWAY_SERIAL #include <MySensor.h> #define CHILD_ID 1 MyMessage msg(CHILD_ID, V_TRIPPED); void setup() { sendSketchInfo("Motion Sensor", "1.0"); pinMode(DIGITAL_INPUT_SENSOR, INPUT); present(CHILD_ID, S_MOTION); } void loop() { boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; send(msg.set(tripped?"1":"0")); // Send tripped value to gw sleep(INTERRUPT,CHANGE, SLEEP_TIME); }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login