Hello,
I had tested MySensor 1.5 vor about 8 month, with one gateway at the USB-Port of the Raspi with one Testsensor with the script from @sweebee whats send “0” and “1”.
That has worked.
Now I had update the Gateway to Mysensor V2 and use at the Testsensor this script:
#define OPEN 1
#define CLOSE 0
#define NODE_ID 1
#define CHILD_ID 3
#define MY_RADIO_NRF24
#define MY_DEBUG // Enables debug messages in the serial log
#include <MySensors.h>
#include <SPI.h>
MyMessage msg(NODE_ID, V_TRIPPED);
uint8_t value = OPEN;
void presentation()
{
present(CHILD_ID, S_DOOR);
}
void loop()
{
value = value == OPEN ? CLOSE : OPEN;
send(msg.set(value));
sleep(10000);
}
This will send a “0” and after 10s a “1” and so on.
The Console of the Arduino Software shows this:
TSM:ID
TSM:CHKID:OK (ID=3)
TSM:UPL
TSP:PING:SEND (dest=0)
TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
TSP:MSG:READ 0-0-3 s=255,c=3,t=25,pt=1,l=1,sg=0:1
TSP:MSG:PONG RECV (hops=1)
TSP:CHKUPL:OK
TSM:UPL:OK
TSM:READY
TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
TSP:MSG:SEND 3-3-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
TSP:MSG:READ 0-0-3 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
TSP:MSG:SEND 3-3-0-0 s=3,c=0,t=0,pt=0,l=0,sg=0,ft=0,st=ok:
Request registration...
TSP:MSG:SEND 3-3-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
TSP:MSG:READ 0-0-3 s=255,c=3,t=27,pt=1,l=1,sg=0:1
Node registration=1
Init complete, id=3, parent=0, distance=1, registration=1
TSP:MSG:SEND 3-3-0-0 s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=ok:0
TSP:MSG:SEND 3-3-0-0 s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=ok:1
TSP:MSG:SEND 3-3-0-0 s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=ok:0
And on the ssh terminal on the Raspi I see this:
sudo screen /dev/serial/by-path/platform-3f980000.usb-usb-0:1.4:1.0-port0 115200
0;255;3;0;9;
TSP:MSG:READ 3-3-0 s=1,c=1,t=16,pt=1,l=1,sg=0:1
3;1;1;0;16;1
0;255;3;0;9;
TSP:SANCHK:OK
0;255;3;0;9;
TSP:MSG:READ 3-3-0 s=1,c=1,t=16,pt=1,l=1,sg=0:0
3;1;1;0;16;0
0;255;3;0;9;
TSP:MSG:READ 3-3-0 s=1,c=1,t=16,pt=1,l=1,sg=0:1
3;1;1;0;16;1
So I think the Testsensor and the Gateway is working.
But the device in Pimatic don’t change from open to close.
In the Pimatic config is the following:
{
"plugin": "mysensors",
"driver": "serialport",
"protocols": "1.5.1",
"driverOptions": {
"serialDevice": "/dev/serial/by-path/platform-3f980000.usb-usb-0:1.4:1.0-port0",
"baudrate": 115200
},
"startingNodeId": 3
},
{
"nodeid": 1,
"sensorid": 3,
"id": "mysensor-test",
"name": "MySensor_Test",
"class": "MySensorsButton"
},
Maybe the “protocols”: “1.5.1”, is wrong.bolded text