SerialGateway can't send to nodes via rules or Serial Monitor
-
Ok, so if I take a step back and exclude OpenHab.
Surly I should be able to send data from gateway to a node?
I can send from node to gateway, and ACK is returned successfully.So, If I use a serial interface and send a string, like I did above, should that work with API 1.5?
-
The api in 1.5 isn't built for attaching sensors on the gateway itself (when it comes to presenting and sending data to the controller). But if you hack around a bit you can do like the Serial gateway example and send out messages from the gateway to nodes in the radio network.
In the branch I'm working on now the gateway acts like any other sensor.
-
Hi Hek,
I don't want to add a sensor to the gateway, I want to send a command to a node with the sensor.
J
-
Hi Everyone,
I tried adding the following code to my gateway, to see if it will send the value to the sensor to set it, but it fails with:
0;0;3;0;9;send: 0-0-101-101 s=2,c=1,t=2,pt=2,l=2,sg=0,st=fail:1Added to loop():
if (!sentSensorValue) { delay(2500); MyMessage message; message.setDestination(101); message.setSensor(2); message.setType(2); message.set(1); gw.send(message); sentSensorValue = true; } -
How are you powering your GW ( arduino and radio)? st=fail:1 usually indicates a problem with power (radio is more sensitive to power noise / fluctuations ).
-
@rvendrame said:
( arduino and radio)
Hi,
I'm powering the gateway from raspberry pi 2 and has a 10uF Cap.
The node is powered from Arduino Nano and has a 22uF Cap.I have tried giving each radio module a separate power supply but that didn't help.
What is interesting though, is that the module sends sensor values for 4 sensors and with ACK, the gateway (Arduino) replies successfully. The failure only comes when I try send from parse information from serial input.
I think I'm going to try put bigger capacitors on each and see what happens... just not sure how big I can go :)
J
-
I upgraded the Cap on the gateway to a 47uF and no change...
This is the serial monitor of the Node, as you can see, it's successfully transmitting data:
send: 101-101-0-0 s=0,c=0,t=6,pt=0,l=0,sg=0,st=ok: send: 101-101-0-0 s=1,c=0,t=6,pt=0,l=0,sg=0,st=ok: send: 101-101-0-0 s=2,c=0,t=7,pt=0,l=0,sg=0,st=ok: send: 101-101-0-0 s=3,c=0,t=16,pt=0,l=0,sg=0,st=ok: send: 101-101-0-0 s=4,c=0,t=3,pt=0,l=0,sg=0,st=ok: send: 101-101-0-0 s=4,c=1,t=0,pt=2,l=2,sg=0,st=ok:0 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.73 send: 101-101-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=ok:23.00 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:39 send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:75 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:42 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.82 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.91 send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:74 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.82 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.91 send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:75 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.82 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:42 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.73 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.73 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64This is the serial output of the gateway, where I let it read for a while then send command via serial (101;4;1;0;3;0):
0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.91 101;0;1;0;0;24.91 0;0;3;0;9;read: 101-101-0 s=3,c=1,t=0,pt=7,l=5,sg=0:74 101;3;1;0;0;74 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.82 101;0;1;0;0;24.82 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.91 101;0;1;0;0;24.91 0;0;3;0;9;read: 101-101-0 s=3,c=1,t=0,pt=7,l=5,sg=0:75 101;3;1;0;0;75 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.82 101;0;1;0;0;24.82 0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:42 101;2;1;0;0;42 0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:41 101;2;1;0;0;41 Sending command from serial input... Destination: 101 Sensor: 4 sensorType: 0 Type: 3 Ack: 0 Payload: 0 0;0;3;0;9;send: 0-0-101-101 s=4,c=1,t=3,pt=4,l=4,sg=0,st=fail:0 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.73 101;0;1;0;0;24.73 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.64 101;0;1;0;0;24.64 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.73 101;0;1;0;0;24.73 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.64 101;0;1;0;0;24.64 -
I did another test, I sent all presentation of sensors to request ACK and this below is the output.
Although there is only two fails, I think I'm going to have to setup dedicated power for each and try again... unless there is another way?Gateway:
0;0;3;0;9;read: 101-101-0 s=255,c=3,t=11,pt=0,l=15,sg=0:Balcony Senso 0;0;3;0;9;send: 0-0-101-101 s=255,c=3,t=11,pt=0,l=15,sg=0,st=fail:Bal 101;255;3;0;11;Balcony Sensors 0;0;3;0;9;read: 101-101-0 s=0,c=0,t=6,pt=0,l=9,sg=0:Soil Temp 0;0;3;0;9;send: 0-0-101-101 s=0,c=0,t=6,pt=0,l=9,sg=0,st=ok:Soil Temp 101;0;0;0;6;Soil Temp 0;0;3;0;9;read: 101-101-0 s=1,c=0,t=6,pt=0,l=8,sg=0:Air Temp 0;0;3;0;9;send: 0-0-101-101 s=1,c=0,t=6,pt=0,l=8,sg=0,st=fail:Air Tem 101;1;0;0;6;Air Temp 0;0;3;0;9;read: 101-101-0 s=2,c=0,t=7,pt=0,l=12,sg=0:Air Humitidy 0;0;3;0;9;send: 0-0-101-101 s=2,c=0,t=7,pt=0,l=12,sg=0,st=fail:Air Hu 101;2;0;0;7;Air Humitidy 0;0;3;0;9;read: 101-101-0 s=4,c=0,t=3,pt=0,l=11,sg=0:Water Relay 0;0;3;0;9;send: 0-0-101-101 s=4,c=0,t=3,pt=0,l=11,sg=0,st=ok:Water Re 101;4;0;0;3;Water Relay 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.64 101;0;1;0;0;24.64 0;0;3;0;9;read: 101-101-0 s=1,c=1,t=0,pt=7,l=5,sg=0:23.00 101;1;1;0;0;23.00 0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:41 101;2;1;0;0;41 0;0;3;0;9;read: 101-101-0 s=3,c=1,t=0,pt=7,l=5,sg=0:76 101;3;1;0;0;76 0;0;3;0;9;read: 101-101-0 s=0,c=1,t=0,pt=7,l=5,sg=0:24.56 101;0;1;0;0;24.56 0;0;3;0;9;read: 101-101-0 s=2,c=1,t=0,pt=7,l=5,sg=0:42 101;2;1;0;0;42Node:
send: 101-101-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5 send: 101-101-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0 sensor started, id=101, parent=0, distance=1 send: 101-101-0-0 s=255,c=3,t=11,pt=0,l=15,sg=0,st=ok:Balcony Sensors send: 101-101-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=fail:1.1 send: 101-101-0-0 s=0,c=0,t=6,pt=0,l=9,sg=0,st=ok:Soil Temp send: 101-101-0-0 s=1,c=0,t=6,pt=0,l=8,sg=0,st=ok:Air Temp send: 101-101-0-0 s=2,c=0,t=7,pt=0,l=12,sg=0,st=ok:Air Humitidy send: 101-101-0-0 s=3,c=0,t=16,pt=0,l=11,sg=0,st=fail:Light Level send: 101-101-0-0 s=4,c=0,t=3,pt=0,l=11,sg=0,st=ok:Water Relay send: 101-101-0-0 s=4,c=1,t=0,pt=2,l=2,sg=0,st=fail:0 read: 0-0-101 s=0,c=0,t=6,pt=0,l=9,sg=0:Soil Temp Incoming message: Soil Temp Sensor: 0 Value: Soil Temp send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64 send: 101-101-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=ok:23.00 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41 send: 101-101-0-0 s=3,c=1,t=0,pt=7,l=5,sg=0,st=ok:76 read: 0-0-101 s=4,c=0,t=3,pt=0,l=11,sg=0:Water Relay Incoming message: Water Relay Sensor: 4 Value: Water Relay send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.56 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:42 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.64 send: 101-101-0-0 s=0,c=1,t=0,pt=7,l=5,sg=0,st=ok:24.56 send: 101-101-0-0 s=2,c=1,t=0,pt=7,l=5,sg=0,st=ok:41``` -
@jgporteous said:
101;4;1;0;3;0
Added ACK to one of my senors, node sending values correctly, but ACK failing.
I've bumped up the CAP on the gateway to 330uF and no change :(
I also dropped bandwidth to 250Kbps and power to low, no change either.