1.4 Beta
-
Hi guys,
I just got relays working with but struggling requesting a variable value on Beta 1.4.
My set variable commands looks as follow.
Switching On - > 1;1;1;0;2;1 (work as expected)
Off -> 1;1;1;0;2;0 (work as expected)Request variable for the same relay -> 1;1;2;0;2; (sets the relay to 0 ???)
Can someone confirm if my request variable command is correct and if not what should it be?
Thanks
-
Hi guys,
I just got relays working with but struggling requesting a variable value on Beta 1.4.
My set variable commands looks as follow.
Switching On - > 1;1;1;0;2;1 (work as expected)
Off -> 1;1;1;0;2;0 (work as expected)Request variable for the same relay -> 1;1;2;0;2; (sets the relay to 0 ???)
Can someone confirm if my request variable command is correct and if not what should it be?
Thanks
@lodewyk I use this:
void incomingMessage(const MyMessage &msg) {
// We only expect one type of message from controller. But we better check anyway.
if (msg.type==V_LIGHT) {
if (strlen(msg.getString())==0) {
gw.send(message.setSensor(msg.sensor).setType(V_LIGHT).set(digitalRead(msg.sensor-1+RELAY_1)?RELAY_ON:RELAY_OFF));
} else {
digitalWrite(msg.sensor-1+RELAY_1, msg.getBool()?RELAY_ON:RELAY_OFF);
gw.saveState(msg.sensor, msg.getBool());
}
}
}(How do i use [code] ?? I start to hate this forum :P)
-
Hi guys,
I just got relays working with but struggling requesting a variable value on Beta 1.4.
My set variable commands looks as follow.
Switching On - > 1;1;1;0;2;1 (work as expected)
Off -> 1;1;1;0;2;0 (work as expected)Request variable for the same relay -> 1;1;2;0;2; (sets the relay to 0 ???)
Can someone confirm if my request variable command is correct and if not what should it be?
Thanks
The relay example does not support requesting state. You must add some code in incomingMessage() to handle incoming request-messages (and reply to them).
To reply incoming request-command in incomingMessage for the RelayActuator-example do something like this (note I have not compiled/tested this)
if (mGetCommand(msg) == C_REQ) { mSetCommand(msg, C_SET); msg.setDestination(msg.getSender()); msg.set(gw.loadState(msg.getSensor()); gw.send(msg); } else ( // Do the normal stuff here } -
@Damme said:
(How do i use [code] ?? I start to hate this forum :P)
This forum uses markdown. If you need help, press the little questionmark-icon in the compose window. http://daringfireball.net/projects/markdown/syntax
To decorate your codeblock use 4 spaces or one tab character first on each line.
-
Hi guys,
I just got relays working with but struggling requesting a variable value on Beta 1.4.
My set variable commands looks as follow.
Switching On - > 1;1;1;0;2;1 (work as expected)
Off -> 1;1;1;0;2;0 (work as expected)Request variable for the same relay -> 1;1;2;0;2; (sets the relay to 0 ???)
Can someone confirm if my request variable command is correct and if not what should it be?
Thanks
-
Pushed a few new changes/bugfixes. Sorry for the slow progress. Had to wait until we got home and had the chance to do some verification.
- Ack bit in header indicating if message is an ack (see RelayWithButton for an example how to read it out).
- Sleep functions now takes unsigned long. This allows sensor to sleep for than 30 sec ;)
- Corrected string termination
-
A major code drop coming from @ToSa has now been merged into 1.4. It contains:
- The new MySensors Bootloader supporting Over-the-air sketch updates ("client"-side).
- A simple NodeJs Controller to test the OTA stuff ("server"-side).
- Changes to cope with new sketch meta data stored in EEPROM and conversion between serial protocol/binary data and some new STREAM command types added.
- A new internal command has also been added to allow resetting a node remotely.
A more detailed change log can be found here:
https://github.com/ToSa27/Arduino/commits/developmentI haven't had time to test myself yet but everything has been verified by @ToSa and is reported working. He is on a business trip right now so advanced bootloader questions have to wait until he's back.
-
A major code drop coming from @ToSa has now been merged into 1.4. It contains:
- The new MySensors Bootloader supporting Over-the-air sketch updates ("client"-side).
- A simple NodeJs Controller to test the OTA stuff ("server"-side).
- Changes to cope with new sketch meta data stored in EEPROM and conversion between serial protocol/binary data and some new STREAM command types added.
- A new internal command has also been added to allow resetting a node remotely.
A more detailed change log can be found here:
https://github.com/ToSa27/Arduino/commits/developmentI haven't had time to test myself yet but everything has been verified by @ToSa and is reported working. He is on a business trip right now so advanced bootloader questions have to wait until he's back.
-
@hek Sounds like a good step forward!
Only one boot loader question: does this mean we can use an external boot loader or do we have to use an external boot loader now? -
Pushed a few new changes/bugfixes. Sorry for the slow progress. Had to wait until we got home and had the chance to do some verification.
- Ack bit in header indicating if message is an ack (see RelayWithButton for an example how to read it out).
- Sleep functions now takes unsigned long. This allows sensor to sleep for than 30 sec ;)
- Corrected string termination
@hek There are still some problem with string termination,
repeater started, id 3
send: 3-3-0-0 s=255,c=0,t=18,pt=0,l=15,st=fail:1.4b1 (18848a2)
send: 3-3-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
send: 3-3-0-0 s=255,c=3,t=11,pt=0,l=9,st=fail:Relaytest848a2)
send: 3-3-0-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0aytest848a2)
read: 5-5-0 s=11,c=1,t=1,pt=0,l=4:58.4
send: 5-3-0-0 s=11,c=1,t=1,pt=0,l=4,st=fail:58.4
send: 3-3-0-0 s=10,c=1,t=0,pt=0,l=5,st=fail:26.20 -
@hek There are still some problem with string termination,
repeater started, id 3
send: 3-3-0-0 s=255,c=0,t=18,pt=0,l=15,st=fail:1.4b1 (18848a2)
send: 3-3-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
send: 3-3-0-0 s=255,c=3,t=11,pt=0,l=9,st=fail:Relaytest848a2)
send: 3-3-0-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0aytest848a2)
read: 5-5-0 s=11,c=1,t=1,pt=0,l=4:58.4
send: 5-3-0-0 s=11,c=1,t=1,pt=0,l=4,st=fail:58.4
send: 3-3-0-0 s=10,c=1,t=0,pt=0,l=5,st=fail:26.20 -
Pushed a few new changes/bugfixes. Sorry for the slow progress. Had to wait until we got home and had the chance to do some verification.
- Ack bit in header indicating if message is an ack (see RelayWithButton for an example how to read it out).
- Sleep functions now takes unsigned long. This allows sensor to sleep for than 30 sec ;)
- Corrected string termination
-
Pushed a few new changes/bugfixes. Sorry for the slow progress. Had to wait until we got home and had the chance to do some verification.
- Ack bit in header indicating if message is an ack (see RelayWithButton for an example how to read it out).
- Sleep functions now takes unsigned long. This allows sensor to sleep for than 30 sec ;)
- Corrected string termination
-
How do I request information from a node from the gateway?
I have a relayactuator node with 2 relays that is transmitting its initial state at the startup of the node. This is also received by the gw.
But after that I cant seem to request the current relay status from the node by sending a message from the gateway.I tried lots of combinations, nothing worked.
I thought this would be correct:
1;2;2;1;2;0\n
1=node number
2=sensor (relay number 2)
2=request
1=ack message
2=light
0=string??Can anyone point me in the correct location?
maybe a new API page for 1.4 would be handyedit: also I can't find anywhere what the debug letters mean
what is s=,c=,t=,pt=,l=,st= ?? -
How do I request information from a node from the gateway?
I have a relayactuator node with 2 relays that is transmitting its initial state at the startup of the node. This is also received by the gw.
But after that I cant seem to request the current relay status from the node by sending a message from the gateway.I tried lots of combinations, nothing worked.
I thought this would be correct:
1;2;2;1;2;0\n
1=node number
2=sensor (relay number 2)
2=request
1=ack message
2=light
0=string??Can anyone point me in the correct location?
maybe a new API page for 1.4 would be handyedit: also I can't find anywhere what the debug letters mean
what is s=,c=,t=,pt=,l=,st= ??You cannot request state from a node without programming a little . I answered exactly this question a couple of posts back in this thread.
-
@hek
Could u plz help me
getting in eth GW. Vera and Libs updated.**0;0;3;9;Arduino startup complete.
0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
0;0;3;9;version mismatch0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
0;0;3;9;version mismatch0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
0;0;3;9;version mismatch0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
** -
@hek
Could u plz help me
getting in eth GW. Vera and Libs updated.**0;0;3;9;Arduino startup complete.
0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
0;0;3;9;version mismatch0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
0;0;3;9;version mismatch0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
0;0;3;9;version mismatch0;0;3;9;read: 0-0-0 s=0,c=0,t=0,pt=0,l=0:
**