serial reading
-
it looks like the gateway never answers, any hint ? bad wiring ? other issue ?
-
Controller normally answer the unit setting requests from sensor. You have to answer manually (or from your perl program).
Check the Troubleshooting section on our website if you're unable to communicate.
@hek right, I've not read thoroughly what @wannabee told me about who sets the ID. I'll know it for the next time.
Should I answer also for the metric ?
I have a strange behavior having commented out the metric line although they are close::
0;0;4;11;Relaying message back to gateway.
0;0;4;11;Tx: fr=0,to=0,la=0,ne=0,ci=255,mt=4,ty=13,cr=52:
0;0;4;11;Ack: receive timeout -
You perl program needs to tell the arudion Gateway if it Imperial or Metric it should you for it's number. The gateway will forward that information to the node
Here is post where I explain how it works.
http://forum.mysensors.org/topic/62/#315Basicly the arduion gatweway don't controll high level stuff. It only controlls the low level stuff. the raido communication.
Your perl program needs to do all the higlevel stuff like responed to request from the network about raido_id, metric system, storing the data,etc. This is what the vera does. you are replacing the vera with your program so now you have to do all the stuff. a quick way forward is to translate https://github.com/mysensors/Vera/blob/master/L_Arduino.lua to perl. You have to build some more function since the Vera is doing stuff like storing data and configuration hat is not in the lua-file.
This is what I have done in python see https://github.com/wbcode/ham and it transform the mysensor api to/from openhab api.
/WB
-
perfect, this is what I was searching for...
I'm too much accustomed to RFX433 or z-Wave that handles many things themself, I now understand that only the basic is here.
I can read easily lua, logic can be simple, afterward I have my scripts, in fact I thought of doing the bidirectionnal integration with domoticz and/or cosm/xively for I've got already many of it. For the first, I guess some local logic must be implemented, discovered devices can be created through JSON, and then updated/queried as you already know, so the glue is possible ;-)
-
perfect, this is what I was searching for...
I'm too much accustomed to RFX433 or z-Wave that handles many things themself, I now understand that only the basic is here.
I can read easily lua, logic can be simple, afterward I have my scripts, in fact I thought of doing the bidirectionnal integration with domoticz and/or cosm/xively for I've got already many of it. For the first, I guess some local logic must be implemented, discovered devices can be created through JSON, and then updated/queried as you already know, so the glue is possible ;-)
-
@jendrush could be a possibility... but to have it exaclty the same, the gateway should do all the work meaning push when a new node is discovered, give all values... the whole vera programm should be built inside the arduino... I don't know how it would fit, but in the meantime some outside scripts can do it.
-
You perl program needs to tell the arudion Gateway if it Imperial or Metric it should you for it's number. The gateway will forward that information to the node
Here is post where I explain how it works.
http://forum.mysensors.org/topic/62/#315Basicly the arduion gatweway don't controll high level stuff. It only controlls the low level stuff. the raido communication.
Your perl program needs to do all the higlevel stuff like responed to request from the network about raido_id, metric system, storing the data,etc. This is what the vera does. you are replacing the vera with your program so now you have to do all the stuff. a quick way forward is to translate https://github.com/mysensors/Vera/blob/master/L_Arduino.lua to perl. You have to build some more function since the Vera is doing stuff like storing data and configuration hat is not in the lua-file.
This is what I have done in python see https://github.com/wbcode/ham and it transform the mysensor api to/from openhab api.
/WB
-
@wannabee I'm desesperatly (as a newbee ) trying to send the message back, but it doesn't seem to work with
echo -en '1;255;4;13;M' > /dev/ttyUSB0
any idea ? my script doesn't seem to write too, strange...
-
@hek right the -n option removed newline, but I have still the same behavior. Can both gateway and sensors on the same machine usb port make a difference in this ?
So this one should be good, but no behavior change (same when writing from perl to the port):
echo -e '1;255;4;13;M' > /dev/ttyUSB0
does reading through perl locks it ? well I'm new on this ...
-
Looks like one got to the sensor:
Sent ack msg to 0 0 0 0 0
Rx: fr=0,to=1,la=0,ci=255,mt=4,t=13,cr=57(ok): M 0 0 0 0
Message addressed for this node. 0 0 0 0
675 Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=1,mt=1,ty=0,cr=216: 20.0Relaying message back to gateway. 0 0 0 0
Tx: fr=1,to=0,la=1,ne=0,ci=1,mt=1,ty=0,cr=216: 20.0 0 0 0 0
676 Ack: received OK
T: 20.00
Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=1,cr=162: 56.0
Ack: received OK
H: 56.00Relaying message back to gateway. 0 0 0 0
Tx: fr=1,to=0,la=1,ne=0,ci=1,mt=1,ty=0,cr=216: 20.0 0 0 0 0
676 Ack: received OK
T: 20.00Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=1,cr=162: 56.0
Ack: received OK
H: 56.00707 Relaying message back to gateway.
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=1,cr=84: 55.0
Ack: receive timeout
H: 55.00Relaying message back to gateway. 0 0 0 0
Tx: fr=1,to=0,la=1,ne=0,ci=0,mt=1,ty=1,cr=84: 55.0 0 0 0 0
Ack: receive timeout 0 0 0 0
H: 55.00 0 0 0 0then nothing...
I unplugged the node, plugged it back and it is asking again the metric...
-
This post is deleted!
-
I'm getting closer, since I launched the arduino console log my scripts works, and is able so write back the answer...
Starting
1 255 0 17 1.3b3 (67f4ca1)
1 255 4 7 0
1 255 4 14 Humidity
1 255 4 15 1.0
1 255 4 13 0
W : 1;255;4;13;M
1 1 1 0 21.0
1 0 1 1 52.0looks like it is sleeping forever ?
-
Hello,
Looks like it's good, in one hour I've had 12 metering values, given I modified the timer in the sensor to 10 instead of 30. It is reporting only changed values which is smart (should be documented, extra value !)
1 1 1 0 21.0
1 0 1 1 52.0
1 0 1 1 53.0
1 0 1 1 54.0
1 1 1 0 20.0
1 1 1 0 21.0
1 1 1 0 20.0
1 0 1 1 55.0
1 0 1 1 54.0
1 0 1 1 55.0
1 0 1 1 54.0
1 0 1 1 55.0
1 1 1 0 21.0 -
well... I tried to replicate this on a cubitruck2 (IBOX), does not work...
I did on the i5 a test to see conf of usb port that works with:
stty -F /dev/ttyUSB1
speed 115200 baud; line = 0;
kill = ^H; min = 0; time = 0;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echokeI tried to replicate it to the cubie:
stty -F /dev/ttyUSB1 cs8 115200 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke -ixon -crtscts kill ^H min 0but still nothing... any idea ?
-
my bad, wrong reading script... works straight with the above parameters, should check if it works without... well no arduino ide run before it works for me now, I'm a bit farther than the arduino.cc forum ;-)
-
Hello,
Works like a charm, I now receive the DHT11 values and I am able to post it to a (now) static node in domoticz (could be used for every system with a json posting interface).
This is where it can be tricky, you need both Temp and Humidity to report, so I have to wait to have them both in memory to push a report.
I expect to use a sqlite3 database locally to handle the last known value and the status/association of a node and its device. Doing so requires that either I handle all in a conf file, or that creation of device are driven by the script which I can handle too (maybe specific to domoticz).
-
I have little success too. I modified some code from other project, and now i can report temperatures(DS18B20), temperatures + humidity(DHT22), motion sensor to Domoticz. Today i will try to handle turning on, and off a switch, and also i am planning to modify relay code to handle my wireless 433MHz wall plugs to work as normal relay. Next time maybe reading status of power meter? But in this case i see a problem - how to read last value of acumulated energy from Domoticz? Now some information about solution. Serial gateway is connected to Raspberry Pi(Domoticz), and there is Node.js script. Script can read, and send messages through serial, and post links to Domoticz by JSON.
-
And screenshoot http://screenshooter.net/1288732/gimyqda