I have a mysensors serial gateway connected to RPi ttyUSB0 and connected to 1 node with radios NRF24L01+ and they are communicating correctly.
The gateway receives the data from node 10 but produces a “Oops Serialport not open” error when I close or open the switch from the pimatic GUI, my remote node has a DHT sensor and a switch.
I have spent quite a bit of time researching this issue but to no avail other than maybe timing issue with the serial port, I am not a programmer I am a hardware and OS specialist, time to ask for help.
If there is anything else I can provide you, let me know, I am very excited to use pimatic, it really looks good!
My Config.json
{
"settings": {
"httpServer": {
"enabled": true,
"port": 80
},
"database": {
"deviceAttributeLogging": [
{
"deviceId": "*",
"attributeName": "*",
"type": "*",
"interval": "0",
"expire": "7d"
},
{
"deviceId": "*",
"attributeName": "*",
"type": "continuous",
"interval": "5min",
"expire": "7d"
},
{
"deviceId": "*",
"attributeName": "temperature",
"type": "number",
"expire": "1y"
},
{
"deviceId": "*",
"attributeName": "humidity",
"type": "number",
"expire": "1y"
}
],
"messageLogging": [
{
"level": "*",
"tags": [],
"expire": "7d"
},
{
"level": "debug",
"tags": [],
"expire": "1d"
}
]
},
"authentication": {
"secret": "xxxxxxxxxx"
},
"httpsServer": {},
"gui": {}
},
"plugins": [
{
"plugin": "cron"
},
{
"plugin": "mobile-frontend",
"theme": "graphite/royal",
"flat": false,
"debug": false,
"mode": "production"
},
{
"plugin": "mysensors",
"driver": "serialport",
"protocols": "1.4.1",
"driverOptions": {
"//": "'/dev/ttyUSB0' if using serial Gateway",
"serialDevice": "/dev/ttyMySensorsGateway",
"baudrate": 115200
}
},
{
"plugin": "shell-execute"
}
],
"devices": [
{
"id": "DHT22",
"name": "Temp Office",
"class": "MySensorsDHT",
"nodeid": 10,
"sensorid": [
0,
1
]
},
{
"id": "Switch",
"name": "Switch",
"class": "MySensorsSwitch",
"nodeid": 10,
"sensorid": 2
}
],
"rules": [],
"pages": [
{
"id": "favourite",
"name": "Favourites",
"devices": [
{
"deviceId": "Switch"
},
{
"deviceId": "DHT22"
}
]
}
],
"groups": [
{
"id": "test",
"name": "Test",
"devices": [],
"rules": [],
"variables": []
},
{
"id": "fromradio",
"name": "FromRadio",
"devices": [
"DHT22",
"Switch"
],
"rules": [],
"variables": []
}
],
"users": [
{
"username": "admin",
"password": "xxxxxxxxxx",
"role": "admin"
}
],
"roles": [
{
"name": "admin",
"permissions": {
"pages": "write",
"rules": "write",
"variables": "write",
"messages": "write",
"events": "write",
"devices": "write",
"groups": "write",
"plugins": "write",
"updates": "write",
"database": "write",
"config": "write",
"controlDevices": true,
"restart": true
}
}
],
"variables": []
}
Output from the serial gateway
0;0;3;0;14;Gateway startup complete.
0;0;3;0;9;read: 10-10-0 s=255,c=0,t=17,pt=0,l=5:1.4.1
10;255;0;0;17;1.4.1
0;0;3;0;9;read: 10-10-0 s=255,c=3,t=6,pt=1,l=1:0
10;255;3;0;6;0
0;0;3;0;9;read: 10-10-0 s=255,c=3,t=11,pt=0,l=8:Humidity
10;255;3;0;11;Humidity
0;0;3;0;9;read: 10-10-0 s=255,c=3,t=12,pt=0,l=3:1.0
10;255;3;0;12;1.0
0;0;3;0;9;read: 10-10-0 s=0,c=0,t=7,pt=0,l=5:1.4.1
10;0;0;0;7;1.4.1
0;0;3;0;9;read: 10-10-0 s=1,c=0,t=6,pt=0,l=5:1.4.1
10;1;0;0;6;1.4.1
0;0;3;0;9;read: 10-10-0 s=4,c=0,t=3,pt=0,l=5:1.4.1
10;4;0;0;3;1.4.1
0;0;3;0;9;read: 10-10-0 s=1,c=1,t=0,pt=7,l=5:23.6
10;1;1;0;0;23.6
0;0;3;0;9;read: 10-10-0 s=0,c=1,t=1,pt=7,l=5:39.0
10;0;1;0;1;39.0
0;0;3;0;9;read: 10-10-0 s=4,c=1,t=2,pt=2,l=2:1
10;4;1;0;2;1
0;0;3;0;9;read: 10-10-0 s=4,c=1,t=2,pt=2,l=2:1
10;4;1;0;2;1
Output from node 10
sensor started, id 10
send: 10-10-0-0 s=255,c=0,t=17,pt=0,l=5,st=ok:1.4.1
send: 10-10-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
send: 10-10-0-0 s=255,c=3,t=11,pt=0,l=8,st=ok:Humidity
send: 10-10-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
send: 10-10-0-0 s=0,c=0,t=7,pt=0,l=5,st=ok:1.4.1
send: 10-10-0-0 s=1,c=0,t=6,pt=0,l=5,st=ok:1.4.1
send: 10-10-0-0 s=4,c=0,t=3,pt=0,l=5,st=ok:1.4.1
send: 10-10-0-0 s=1,c=1,t=0,pt=7,l=5,st=ok:23.6
T: 23.60
send: 10-10-0-0 s=0,c=1,t=1,pt=7,l=5,st=ok:39.0
H: 39.00
send: 10-10-0-0 s=4,c=1,t=2,pt=2,l=2,st=ok:1
Log file
info [pimatic]: Listening for HTTP-request on port 80…
10:52:55info [pimatic-mobile-frontend]: rendering html finished
10:52:47info [pimatic-mobile-frontend]: rendering html
10:52:47info [pimatic-mobile-frontend]: packing static assets finished
10:52:46info [pimatic-mobile-frontend]: packing static assets
10:52:46info [pimatic]: New device “Switch”…
10:52:46info [pimatic-mysensors]: MySensorsSwitch Switch Switch undefined
10:52:46info [pimatic]: New device “Temp Office”…
10:52:46info [pimatic-mysensors]: MySensorsDHT DHT22 Temp Office
10:52:45info [pimatic-cron]: the time is: Thu May 21 2015 10:52:45 GMT-0400 (EDT)
10:52:45info [pimatic]: Loading plugin: “pimatic-shell-execute” (0.8.10)
10:52:45info [pimatic]: Loading plugin: “pimatic-mysensors” (0.8.17)
10:52:43info [pimatic]: Loading plugin: “pimatic-mobile-frontend” (0.8.64)
10:52:42info [pimatic]: Loading plugin: “pimatic-cron” (0.8.5)
And thank you in advance for your help, If there is anything else I can provide you, let me know.
David Schneider
A PC Specialist