Page 1 of 1

S_WIND

Posted: Thursday 21 January 2016 22:26
by JohanRC
Hi,

I am building a wind speed sensor node, but I am having diffictulty's in getting it to work

The sensor I am using has a 0 to 5V analog output for windspeeds from 0 to 32,4 m/s.
So what I did right now is I took the lightsensor example code (Arduino) and changed the formula to give me the value in m/s instead of lux, this already works.
And the node sends wind in m/s to Domoticz, but Domotics thinks it is LUX (makes sense because of the S and V LIGHT_LEVEL)

But now I would also like it that my Domoticz gateway would also see it as a wind speed sensor instead of a light sensor.
So changed V_LIGHT_LEVEL and S_LIGHT_LEVEL to S_WIND and V_WIND, unfortunatly than it doenst work anymore.
I can see in the log file that the node reports itself to Domoticz but that is it.

At this moment I am running Domoticz on a RaspberryPi with build version 2.4269

Any hints/tips/help would be greatly appriciated!

Greetz Johan
(FYI I am only 4 days old with Domoticz)

Re: S_WIND

Posted: Friday 22 January 2016 13:50
by Jan80
Did you try to delete the node (and devices), restart Domoticz and then add it again?

Re: S_WIND

Posted: Friday 22 January 2016 16:39
by JohanRC
Jan80 wrote:Did you try to delete the node (and devices), restart Domoticz and then add it again?
When I remove the node (when available from Light) after a restart it will not automaticly come back as a windmeter.
The Domoticz log file show Arduino Sketch name and number from the windmeter but thats it than.
There is no further data beeing seen by Domoticz.

Do you have any suggestions what I can try to do?

Greetz Johan

Re: S_WIND

Posted: Friday 22 January 2016 19:43
by Jan80
Are you sure the node is sending data to the gateway? You should check this with the serial monitor. Post the results. ;)

Re: S_WIND

Posted: Friday 22 January 2016 21:29
by JohanRC
Jan80 wrote:Are you sure the node is sending data to the gateway? You should check this with the serial monitor. Post the results. ;)
Here is the codebender serial data with the "LIGHT_LEVEL" Arduino code, here you can see that it is sending 11,4m/s in LUX.

Code: Select all

send: 4-4-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
send: 4-4-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
read: 0-0-4 s=255,c=3,t=6,pt=0,l=1,sg=0:M
sensor started, id=4, parent=0, distance=1
send: 4-4-0-0 s=255,c=3,t=11,pt=0,l=11,sg=0,st=fail:Wind Sensor
send: 4-4-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:2.0
send: 4-4-0-0 s=1,c=0,t=16,pt=0,l=0,sg=0,st=ok:
11.23
send: 4-4-0-0 s=1,c=1,t=23,pt=7,l=5,sg=0,st=ok:11.2
11.39
send: 4-4-0-0 s=1,c=1,t=23,pt=7,l=5,sg=0,st=ok:11.4
11.39
send: 4-4-0-0 s=1,c=1,t=23,pt=7,l=5,sg=0,st=ok:11.4
11.39
send: 4-4-0-0 s=1,c=1,t=23,pt=7,l=5,sg=0,st=ok:11.4
Now the exact same code and hardware only I changed S_LIGHT_LEVEL and V_LIGHT_LEVEL to S_WIND and V_WIND

Code: Select all

send: 4-4-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
send: 4-4-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=fail:0
sensor started, id=4, parent=0, distance=1
send: 4-4-0-0 s=255,c=3,t=11,pt=0,l=11,sg=0,st=fail:Wind Sensor
send: 4-4-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=fail:2.0
send: 4-4-0-0 s=1,c=0,t=9,pt=0,l=0,sg=0,st=ok:
11.23
send: 4-4-0-0 s=1,c=1,t=8,pt=7,l=5,sg=0,st=fail:11.2
11.42
send: 4-4-0-0 s=1,c=1,t=8,pt=7,l=5,sg=0,st=ok:11.4
11.39
send: 4-4-0-0 s=1,c=1,t=8,pt=7,l=5,sg=0,st=ok:11.4
11.39
send: 4-4-0-0 s=1,c=1,t=8,pt=7,l=5,sg=0,st=ok:11.4
11.39
send: 4-4-0-0 s=1,c=1,t=8,pt=7,l=5,sg=0,st=ok:11.4
Can you explain what I am seeing? I am not new to Arduino but very new to Domotics and its communication.

Re: S_WIND

Posted: Friday 22 January 2016 22:22
by JohanRC
I found a small example code here, with a bit of modification it works :mrgreen:
viewtopic.php?f=42&t=6306&p=42867&hilit=wind#p42867

Well at leat I am seeing a windspeed sensor and it is receiving wind data :D

I will modify the code a bit more and than I will upload it here for reference.

Re: S_WIND

Posted: Sunday 24 January 2016 23:08
by Jan80
The log you posted has nothing to to with Domoticz. It's all pure MySensors. See https://www.mysensors.org/download/serial_api_15

Re: S_WIND

Posted: Tuesday 26 January 2016 23:19
by JohanRC
Jan80 wrote:The log you posted has nothing to to with Domoticz. It's all pure MySensors. See https://www.mysensors.org/download/serial_api_15
Yes that is correct, but the question was also can you show the serial log :)
Unfortunatly the Domoticz log does not show anything with "old" sketch.

But luckely for me now it works, altough I have no idea why the "old" one did not work and that kind of does bother me.

Greetz Joahn