relay actuator fails to presenting itself
-
Yes. I use switch as parent with ID ==5
like this :
#include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define CHILD_ID 55 #define BUTTON_PIN 5 // Arduino Digital I/O pin for button/reed switch MySensor gw; Bounce debouncer = Bounce(); int oldValue=-1; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(CHILD_ID,V_LIGHT); void setup() { #define NodeID 5 // Initialize library and add callback for incoming messages gw.begin(NULL, NodeID, false); // gw.begin(); // Setup the button pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN,HIGH); // After setting up the button, setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. gw.present(CHILD_ID, S_LIGHT); } -
re:
And what does the repeater (5) log look like?I do not use repeater. 5 is sample code for switch with hard coded ID == 5
switch monitor log
send: 5-5-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
send: 5-5-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
sensor started, id=5, parent=0, distance=1
send: 5-5-0-0 s=55,c=0,t=3,pt=0,l=0,sg=0,st=ok:
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:1
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:0
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:1re:
As you can see (ack fail) the node is having problem communicating with repeater.do I need to switch off somewhere repeater mode? I do not need repeater.
I use
gw.begin(incomingMessage, NodeID, false,5); in actuator code
gw.begin(NULL, NodeID, false); in switch code.re:
Also.. are you calling gw.process() in the loop-function on your repeater?I added now...
// Check if digital input has changed and send in new value void loop() { debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue) { // Send in the new value gw.send(msg.set(value==HIGH ? 1 : 0)); oldValue = value; } gw.process(); }After I added gw.process(); log looks good but still no traeces of actuator in serial gateway.
Actuator log:
send: 55-55-5-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
send: 55-55-5-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:5
sensor started, id=55, parent=5, distance=1
send: 55-55-5-0 s=255,c=3,t=11,pt=0,l=5,sg=0,st=ok:Relay
send: 55-55-5-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
send: 55-55-5-0 s=55,c=0,t=3,pt=0,l=0,sg=0,st=ok: -
added as repeater node 5, but still no traces of the actuator 55 in the gateway.
send: 5-5-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5
send: 5-5-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
repeater started, id=5, parent=0, distance=1
send: 5-5-0-0 s=55,c=0,t=3,pt=0,l=0,sg=0,st=ok:
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:1 -
55 log looks llike this:
send: 55-55-5-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
send: 55-55-5-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:5
sensor started, id=55, parent=5, distance=1
send: 55-55-5-0 s=255,c=3,t=11,pt=0,l=5,sg=0,st=ok:Relay
send: 55-55-5-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
send: 55-55-5-0 s=55,c=0,t=3,pt=0,l=0,sg=0,st=ok: -
Hek, you are the best!
I plug all three things into my laptop to be able to see all logs and actuator (55) appeared in the serial gateway log
0;0;3;0;9;gateway started, id=0, parent=0, distance=0
0;0;3;0;14;Gateway startup complete.
0;0;3;0;9;read: 5-5-0 s=255,c=0,t=18,pt=0,l=3,sg=0:1.5
5;255;0;0;18;1.5
0;0;3;0;9;read: 5-5-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
5;255;3;0;6;0
0;0;3;0;9;read: 55-5-0 s=255,c=0,t=17,pt=0,l=3,sg=0:1.5
55;255;0;0;17;1.5
0;0;3;0;9;read: 55-5-0 s=255,c=3,t=6,pt=1,l=1,sg=0:5
55;255;3;0;6;5
0;0;3;0;9;read: 5-5-0 s=55,c=0,t=3,pt=0,l=0,sg=0:
5;55;0;0;3;
0;0;3;0;9;read: 5-5-0 s=55,c=1,t=2,pt=2,l=2,sg=0:1
5;55;1;0;2;1
0;0;3;0;9;read: 55-5-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay
55;255;3;0;11;Relay
0;0;3;0;9;read: 55-5-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
55;255;3;0;12;1.0
0;0;3;0;9;read: 55-5-0 s=55,c=0,t=3,pt=0,l=0,sg=0:
55;55;0;0;3;repeater (5) log also showing it
send: 5-5-0-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.5
send: 5-5-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
repeater started, id=5, parent=0, distance=1
send: 5-5-0-0 s=55,c=0,t=3,pt=0,l=0,sg=0,st=ok:
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:1
read: 55-55-0 s=255,c=0,t=17,pt=0,l=3,sg=0:1.5
send: 55-5-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
read: 55-55-0 s=255,c=3,t=6,pt=1,l=1,sg=0:5
send: 55-5-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:5
read: 55-55-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay
send: 55-5-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,st=ok:Relay
read: 55-55-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0
send: 55-5-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
read: 55-55-0 s=55,c=0,t=3,pt=0,l=0,sg=0:
send: 55-5-0-0 s=55,c=0,t=3,pt=0,l=0,sg=0,st=ok:
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:0
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:1understand something wrong was with external power supply.
the only thing left, actuator(55) not receiving from repeater(5) which is the switch sensor, messages. These two entries
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:0
send: 5-5-0-0 s=55,c=1,t=2,pt=2,l=2,sg=0,st=ok:1not getting to actuator...
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