Re: [weewx-user] WMR300: Wrong wind direction

2016-09-22 Thread Miguel Iniesta
I will follow your instructions and let you know.

Thank you very much.

 

> miguel,
>
> nice catch!  that is some code leftover from decoding the wmr300 data 
> packets.
>
> please try the attached wmr300-0.12rc1.py - move aside your existing 
> wmr300.py and put a copy of 0.12rc1 in its place, then restart weewx.
>
> m
>
> m 
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] WMR300: Wrong wind direction

2016-09-21 Thread mwall
On Wednesday, September 21, 2016 at 5:37:27 AM UTC-4, Miguel Iniesta wrote:
>
>
> Hello Andrew,
>
> I have found the method "_extract_heading" (WMR 300 driver v0.10) is doing 
> an arithmetic average to get the winDir compass direction.
> Can this method be the cause of the wrong directions?
>>
>>
>>>
miguel,

nice catch!  that is some code leftover from decoding the wmr300 data 
packets.

please try the attached wmr300-0.12rc1.py - move aside your existing 
wmr300.py and put a copy of 0.12rc1 in its place, then restart weewx.

m

m 

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#!/usr/bin/env python
# Copyright 2015 Matthew Wall
# See the file LICENSE.txt for your rights.
#
# Credits:
# Thanks to Benji for the identification and decoding of 7 packet types
#
# Thanks to Eric G for posting USB captures and providing hardware for testing
#   https://groups.google.com/forum/#!topic/weewx-development/5R1ahy2NFsk
#
# Thanks to Zahlii
#   https://bsweather.myworkbook.de/category/weather-software/
#
# No thanks to oregon scientific - repeated requests for hardware and/or
# specifications resulted in no response at all.

# TODO: battery level for each sensor
# TODO: signal strength for each sensor
# TODO: altitude
# TODO: archive interval

"""Driver for Oregon Scientific WMR300 weather stations.

Sensor data transmission frequencies:
  wind: 2.5 to 3 seconds
TH: 10 to 12 seconds
  rain: 20 to 24 seconds

The station supports 1 wind, 1 rain, 1 UV, and up to 8 temperature/humidity
sensors.

Sniffing USB traffic shows all communication is interrupt.  The endpoint
descriptors for the device show this as well.  Response timing is 1.

The station ships with "Weather OS PRO" software for windows.  This was used
for the USB sniffing.

Internal observation names use the convention name_with_specifier.  These are
mapped to the wview or other schema as needed with a configuration setting.
For example, for the wview schema, wind_speed maps to windSpeed, temperature_0
maps to inTemp, and humidity_1 maps to outHumidity.

Message types -

packet types from station:
57 - station type/model; history count
41 - ACK
D2 - history; 128 bytes
D3 - temperature/humidity/dewpoint; 61 bytes
D4 - wind; 54 bytes
D5 - rain; 40 bytes
D6 - pressure; 46 bytes
DB - forecast; 32 bytes
DC - temperature/humidity ranges; 62 bytes

packet types from host:
A6 - heartbeat
41 - ACK
65 - ? each of these is ack-ed by the station
cd - ? start history request? last two bytes are one after most recent read
35 - ? finish history request? last two bytes are latest record count
72 - ?
73 - ?

notes:
WOP sends A6 message every 20 seconds
WOP requests history at startup, then again every 120 minutes
each A6 is followed by a 57 from the station
each data packet D* from the station is followed by an ack packet 41 from host
D2 (history) records are recorded every minute
D6 (pressure) packets seem to come every 15 minutes (900 seconds)
4,5 of 7x match 12,13 of 57


Message field decodings ---

Values are stored in 1 to 3 bytes in big endian order.  Negative numbers are
stored as Two's Complement (if the first byte starts with F it is a negative
number).

no data:
 7f ff

values for channel number:
0 - console sensor
1 - sensor 1
2 - sensor 2
...
8 - sensor 8

values for trend:
0 - steady
1 - rising
2 - falling

bitwise transformation for compass direction:
1000    = NNW
0100    = NW
0010    = WNW
0001    = W
 1000   = WSW
 0100   = SW
 0010   = SSW
 0001   = S
  1000  = SSE
  0100  = SE
  0010  = ESE
  0001  = E
   1000 = ENE
   0100 = NE
   0010 = NNE
   0001 = N 

values for forecast:
0x08 - cloudy
0x0c - rainy
0x1e - partly cloudy
0x0e - partly cloudy at night
0x70 - sunny
0x00 - clear night


Message decodings -

message: ACK
byte hex dec description decoded value
 0   41  A   acknowledgement ACK
 1   43  C
 2   4b  K
 3   73
 4   e5
 5   0a
 6   26
 7   0e
 8   c1

examples:
 41 43 4b 73 e5 0a 26 0e c1
 41 43 4b 65 19 e5 04


message: station info
byte hex dec description decoded value
 0   57  W   station typeWMR300
 1   4d  M
 2   52  R
 3   33  3
 4   30  0
 5   30  0
 6   2c  ,
 7   41  A   station model   A002
 8   30  0
 9   30  0
10   32  2
11   2c  ,
12   0e
13   c1
14   00
15   00
16   2c  ,
17   67  lastest history record  26391 (0x67 0x17)
18   17
19   2c  ,
20   4b
21   2c 

Re: [weewx-user] WMR300: Wrong wind direction

2016-09-21 Thread Andrew Milner
Yes, I see what you mean!!  Seems as though compass is the only reading 
that does this averaging - I wonder why, unless it is to dampen down an 
oscillating vane??!!!  
You could see if this is the cause of the problems - as a workaround - by 
just returning the last value and not doing the average.  
See what that gives you!!  
You can verify the driver is the cause if you can manipulate the weather 
vane by hand rather than waiting for the wind to be in the right direction 
and have debug =1 so you can see the loop records output by the driver as 
you manually move the vane beween 330, 0, 30




On Wednesday, 21 September 2016 12:37:27 UTC+3, Miguel Iniesta wrote:

>
> Hello Andrew,
>
> I have found the method "_extract_heading" (WMR 300 driver v0.10) is doing 
> an arithmetic average to get the winDir compass direction.
> Can this method be the cause of the wrong directions?
>
> Cheers.
>
> On Tuesday, September 20, 2016 at 8:47:27 AM UTC+2, Andrew Milner wrote:
>>
>> I think you are going to have to run with debug=1 and see what data is in 
>> the LOOP and REC records.  Is the REC coming from the station, or being 
>> generated by weewx software?  As far as I can see from a quick look through 
>> weewx code it sure seems as though Tom is handling wind\Dir correctly as 
>> vectors - and I am sure we would all have had issues like you if it had 
>> been a flaw within weewx itself - which kind of leaves the WMR300 driver or 
>> the station doing some form of averaging.  
>>
>> You could also try record_generation = software to see if it 
>> changes/removes the problem.
>>
>>
>>
>> On Tuesday, 20 September 2016 09:06:56 UTC+3, Miguel Iniesta wrote:
>>
>>> Hello Andrew,
>>>
>>> Currently, I don´t have remote access to the server. I will test it as 
>>> soon as I can.
>>> Just one question, as current winDir will continue getting wrong values, 
>>> this fix is a partial solution to the issue, isn't it?
>>>
>>> Thank you very much.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] WMR300: Wrong wind direction

2016-09-21 Thread Miguel Iniesta

Hello Andrew,

I have found the method "_extract_heading" (WMR 300 driver v0.10) is doing 
an arithmetic average to get the winDir compass direction.
Can this method be the cause of the wrong directions?

Cheers.

On Tuesday, September 20, 2016 at 8:47:27 AM UTC+2, Andrew Milner wrote:
>
> I think you are going to have to run with debug=1 and see what data is in 
> the LOOP and REC records.  Is the REC coming from the station, or being 
> generated by weewx software?  As far as I can see from a quick look through 
> weewx code it sure seems as though Tom is handling wind\Dir correctly as 
> vectors - and I am sure we would all have had issues like you if it had 
> been a flaw within weewx itself - which kind of leaves the WMR300 driver or 
> the station doing some form of averaging.  
>
> You could also try record_generation = software to see if it 
> changes/removes the problem.
>
>
>
> On Tuesday, 20 September 2016 09:06:56 UTC+3, Miguel Iniesta wrote:
>
>> Hello Andrew,
>>
>> Currently, I don´t have remote access to the server. I will test it as 
>> soon as I can.
>> Just one question, as current winDir will continue getting wrong values, 
>> this fix is a partial solution to the issue, isn't it?
>>
>> Thank you very much.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] WMR300: Wrong wind direction

2016-09-20 Thread Andrew Milner
I think you are going to have to run with debug=1 and see what data is in 
the LOOP and REC records.  Is the REC coming from the station, or being 
generated by weewx software?  As far as I can see from a quick look through 
weewx code it sure seems as though Tom is handling wind\Dir correctly as 
vectors - and I am sure we would all have had issues like you if it had 
been a flaw within weewx itself - which kind of leaves the WMR300 driver or 
the station doing some form of averaging.  

You could also try record_generation = software to see if it 
changes/removes the problem.



On Tuesday, 20 September 2016 09:06:56 UTC+3, Miguel Iniesta wrote:

> Hello Andrew,
>
> Currently, I don´t have remote access to the server. I will test it as 
> soon as I can.
> Just one question, as current winDir will continue getting wrong values, 
> this fix is a partial solution to the issue, isn't it?
>
> Thank you very much.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] WMR300: Wrong wind direction

2016-09-20 Thread Miguel Iniesta
Hello Andrew,

Currently, I don´t have remote access to the server. I will test it as soon 
as I can.
Just one question, as current winDir will continue getting wrong values, 
this fix is a partial solution to the issue, isn't it?

Thank you very much.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] WMR300: Wrong wind direction

2016-09-19 Thread Andrew Milner
Tom, the standard skin seems to have an aggregate_type = none in the image 
section header which covers the day plot and aggregate_type = avg for the 
week images header - which clearly wont work for the winddir for reasons 
you gave.  I am baffled in that the original plot appeared to be a day 
plot, so should have had no aggregate.

Miguel - try and set aggregate_type = none for the daily winddir plot and 
see if it makes a difference.



On Monday, 19 September 2016 22:00:49 UTC+3, Miguel Iniesta wrote:

> Hello Tom,
>
> This plot has not been customized. It is the original wind dir plot from 
> skin.conf.
>
> [[[daywinddir]]]
> # Hardwire in the y-axis scale for wind direction
> yscale = 0.0, 360.0, 45.0
> windDir
>
> Therefore, the problem is that the value of $current.windDir corresponds 
> to the arithmetic average of all the compass wind direction over each 
> archive interval, while we expect the vector averaged wind speed. Is it 
> correct?
> In that case, it would be very useful to change it.
> Please, let me know if I can help.
>
>
> Thank you very much.
>
> On Sunday, September 18, 2016 at 8:35:03 PM UTC+2, Tom Keffer wrote:
>>
>> ​Hello, Miguel
>>
>> Are you using an aggregation type of 'average' for your plot?​ If so, the 
>> average of, say, 355 and 005 will be 180, not 0 as one might expect.
>>
>> -tk
>>
>>
>> On Sun, Sep 18, 2016 at 9:45 AM, Miguel Iniesta  wrote:
>>
>>>
>>> Hello,
>>>
>>> WMR 300
>>> weewx v3.5.0 driver 0.10
>>>
>>> There seems to be an error with wind direction in range about 330 - 30.
>>> Yesterday 17/9/2016 about 18 h., I observed that while wind direction 
>>> (station display and sensor) was N weewx recorded S.
>>> Afterwards, when wind direction changed to NW (under 330), weewx wind 
>>> direction record became correct.
>>>
>>> Unfortunately At this time of year, I can monitor the station just for 
>>> some hours a week.
>>>
>>> Regards,
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to weewx-user+...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] WMR300: Wrong wind direction

2016-09-19 Thread Miguel Iniesta
Hello Tom,

This plot has not been customized. It is the original wind dir plot from 
skin.conf.

[[[daywinddir]]]
# Hardwire in the y-axis scale for wind direction
yscale = 0.0, 360.0, 45.0
windDir

Therefore, the problem is that the value of $current.windDir corresponds to 
the arithmetic average of all the compass wind direction over each archive 
interval, while we expect the vector averaged wind speed. Is it correct?
In that case, it would be very useful to change it.
Please, let me know if I can help.


Thank you very much.

On Sunday, September 18, 2016 at 8:35:03 PM UTC+2, Tom Keffer wrote:
>
> ​Hello, Miguel
>
> Are you using an aggregation type of 'average' for your plot?​ If so, the 
> average of, say, 355 and 005 will be 180, not 0 as one might expect.
>
> -tk
>
>
> On Sun, Sep 18, 2016 at 9:45 AM, Miguel Iniesta  > wrote:
>
>>
>> Hello,
>>
>> WMR 300
>> weewx v3.5.0 driver 0.10
>>
>> There seems to be an error with wind direction in range about 330 - 30.
>> Yesterday 17/9/2016 about 18 h., I observed that while wind direction 
>> (station display and sensor) was N weewx recorded S.
>> Afterwards, when wind direction changed to NW (under 330), weewx wind 
>> direction record became correct.
>>
>> Unfortunately At this time of year, I can monitor the station just for 
>> some hours a week.
>>
>> Regards,
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to weewx-user+...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.