No controller, no gateway | passive node
-
1
bool state = true; #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_NODE_ID 101 #define MY_PASSIVE_NODE #include <MySensors.h> #define BUTTON 1 MyMessage msg(BUTTON,V_STATUS); void presentation() { present(BUTTON, S_BINARY); sendSketchInfo("TEST BUTTON", "1.1"); } void setup() { Serial.begin(115200); } void loop() { Serial.println(" SEND HELLO "); send(msg.setDestination(100).setSensor(1).set(state)); delay(5000); } void receive(const MyMessage &message) { if (message.type == V_STATUS) { Serial.println("Hello is delivered"); } }2
bool state = true; #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_NODE_ID 100 #define MY_PASSIVE_NODE #include <MySensors.h> #define RELAY 1 MyMessage msg(RELAY,V_STATUS); void presentation() { present(RELAY, S_BINARY); sendSketchInfo("TEST RELAY", "1.1"); } void setup() { Serial.begin(115200); } void loop() { Serial.println(" SEND HELLO "); send(msg.setDestination(101).setSensor(1).set(state)); delay(5000); } void receive(const MyMessage &message) { if (message.type == V_STATUS) { Serial.println("Hello is delivered"); } } -
@gohan You can send and receive messages in both directions. It all depends on how it will be implemented in the sketch. You can use more than two nodes. I would use it in case of a gateway failure. This will preserve the basic functionality of the device. For example, a light switch that is physically divided into two nodes. On one node, the touch panel on the other relay node controls the light. There can be a lot of use cases.
-
I know it is just to keep a reference here on the forum and for others less expert in programming that would like to see the actual code :wink:
-
@gohan said in no controller, no gateway:
you didn't put the "MY_PARENT_NO_ID 100" that I saw in the video: is it ok?
yes this is normal, this def is not needed. just forgot to delete when recording a video
two-way sending is done in the above application, this is also not in the video. you just asked about it earlier.
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