Gateway just another sensor node?
-
i'm trying to send the R0 value which is calculated from voltage
for(int x = 0 ; x < 100 ; x++) { sensorValue = sensorValue + analogRead(A0); } sensorValue = sensorValue/100.0; /*-----------------------------------------------*/ sensor_volt = sensorValue/1024*5.0; RS_air = (5.0-sensor_volt)/sensor_volt; // omit *RL R0 = RS_air/9.9; // The ratio of RS/R0 is 9.9 in LPG gas -
@hek
i've changed delay to wait, but the behaviour is still the same. Seems like "my" serial output in the loop is overwritten by the "debug" serial output.
It is somehow related to the send command and usage of gateway as a sensor, but i don't get whats wrong :confused: -
@gohan
the code was complete in the first post (now its only "wait" instead of "delay" in the end).Here is a longer serial output for active "send command":
0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
IP: 192.168.0.151
0;255;3;0;9;MCO:BGN:STP
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
sensor_volt = 0.0;0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
IP: 192.168.0.151
0;255;3;0;9;MCO:BGN:STP
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
sensor_volt = 0.0;0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
IP: 192.168.0.151
0;255;3;0;9;MCO:BGN:STP
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
sensor_volt = 0.0;0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
IP: 192.168.0.151
0;255;3;0;9;MCO:BGN:STP
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
sensor_volt = 0.0;0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
IP: 192.168.0.151
0;255;3;0;9;MCO:BGN:STP
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
sensor_volt = 0.0;0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
IP: 192.168.0.151
0;255;3;0;9;MCO:BGN:STP
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
sensor_volt = 0.0;0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
...And here is how its look like if send command is commented:
0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGA--,VER=2.1.1
IP: 192.168.0.151
0;255;3;0;9;MCO:BGN:STP
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:INIT OK,TSP=NA
sensor_volt = 0.05V
R0 = 10.84
sensor_volt = 0.05V
R0 = 10.83
sensor_volt = 0.05V
R0 = 10.83 -
Please check if you are not having resets in your gateway due to this:
https://forum.mysensors.org/topic/4462/gatewayw5100-unable-to-get-working-w-v2-0-0
Regards,
Michiel -
You cannot print your own debug messages on a serial gateway as it is the mean of communication against the gateway. The controller will try to interpret your prints according to the serial protocol.