WH2310 Support

401 views
Skip to first unread message

Lloyd Kinsella

unread,
Sep 19, 2016, 5:53:30 AM9/19/16
to weewx-user
Does WeeWX support the FO WH2310 yet or has anyone done any work in this area?

There was some discussion here around a rebranded Tycon variant - https://groups.google.com/d/topic/weewx-user/MlkTnmbDLOc/discussion

I recently purchased one (under the Excelvan moniker) and I'm trying to access it via USB, I've started playing with the Windows library included in the above topic and managed to dump the EEPROM but my problem with this is it ties me to Windows I'd much rather run everything over my Pi with the base station attached to it.

I'd be interesting in figuring out what commands to send to the device to replicate what the DLL is currently doing with a hope of porting it to use libusb or similar under Linux.

Lloyd Kinsella

unread,
Sep 26, 2016, 6:20:38 PM9/26/16
to weewx-user
After a lot of trial and error I've managed to replicate the calls WeatherSmart makes to the device and can pull data, at least in .NET. My Python is somewhat rusty so porting this into WeeWx might be a challenge, if anyone is interested I can supply the information and be a guinea pig.

mwall

unread,
Sep 26, 2016, 7:42:28 PM9/26/16
to weewx-user
On Monday, September 26, 2016 at 6:20:38 PM UTC-4, Lloyd Kinsella wrote:
After a lot of trial and error I've managed to replicate the calls WeatherSmart makes to the device and can pull data, at least in .NET. My Python is somewhat rusty so porting this into WeeWx might be a challenge, if anyone is interested I can supply the information and be a guinea pig.

hi lloyd,

do you mind posting your code?  or perhaps email it to me directly?  i can translate .net to python pretty easily, and perhaps between the two of us we'll get it sorted.

i have decoded some of the usb traffic, but i have been unable to get the station to respond consistently.

m

Lloyd Kinsella

unread,
Sep 27, 2016, 11:04:07 AM9/27/16
to weewx-user
Yeh I'll sort it out when I return home this eve and send you details.

Lloyd Kinsella

unread,
Sep 28, 2016, 5:15:40 AM9/28/16
to weewx-user
I'm pushed out the code to https://github.com/lkinsella/wh2310 hopefully it'll help. Any questions just ask and I'll do my best to answer them.

mwall

unread,
Oct 1, 2016, 7:02:34 PM10/1/16
to weewx-user
On Wednesday, September 28, 2016 at 5:15:40 AM UTC-4, Lloyd Kinsella wrote:
I'm pushed out the code to https://github.com/lkinsella/wh2310 hopefully it'll help. Any questions just ask and I'll do my best to answer them.

lloyd,

does your code actually work?  does it properly read current values from the station?  how often do the values change?

the docs say we should expect this for the reply to a READ_RECORD:

nbytes  value
1       READ_RECORD
1       size
x       data
1       checksum


the code you posted that reads current conditions seems a bit odd.

in the function ReadRecord(), there is a hid_write of 4 bytes with the READ_RECORD command.

then you do a PerformRead (which is a hid_read), followed by a loop that does PerformRead (additional hid_read) until you get enough bytes.

the thing that looks odd is the byte accounting from the raw reads.

in the first read, you check for a 0x01 in byte 0, payload_size in byte 1, 0x04 (READ_RECORD) in byte 2, and packet_length in byte 3.

in subsequent reads you skip bytes 0 and 1, but append the rest of the bytes to the buffer.

on the last read, you skip bytes 0 and 1, and also skip the last byte (the checksum).

is this a correct description of what ReadRecord is doing?

it seems odd that there is a 0x01 identifier followed by payload size in each packet (payload size ignored in all but the first packet), plus a READ_RECORD identifier and packet_size in the first packet, plus a checksum in the last byte of the last packet.

could you post a few raw sequences with associated decoded values so i can verify the decoding?

for example, something like this:

[
{'sequence': "01 3b 04 4a ...",
 'decoded': {{"label":"in_temp", "value":"25.1 C"}, {"label":"out_humidity", "value":"55"}, ...}
},
{'sequence': "01 45 04 39 ...",
 'decoded': {{"label":"in_temp", "value":"22.4 C"}, {"label":"out_humidity", "value":"54"}, ...}
]

when i try to run with an equivalent python implementation on linux using python-usb, i get garbage from the hardware (or my decoder is not correct).  but at least the hardware is responding now :)

also, i have had no luck reading the eeprom for station parameters and historical records.  i get the same garbage values no matter what address i request.  but that is a different topic...

m

mwall

unread,
Oct 1, 2016, 9:56:15 PM10/1/16
to weewx-user
On Wednesday, September 28, 2016 at 5:15:40 AM UTC-4, Lloyd Kinsella wrote:
I'm pushed out the code to https://github.com/lkinsella/wh2310 hopefully it'll help. Any questions just ask and I'll do my best to answer them.

lloyd,

i have a python implementation working now.  driver version 0.2.  it reads current values using logic similar to what you did in c#

https://github.com/matthewwall/weewx-wh2300

tested on a tycon tp2700

no station status or historical records yet - those require reading of the eeprom

m

Lloyd Kinsella

unread,
Oct 2, 2016, 12:46:30 PM10/2/16
to weewx...@googlegroups.com
That's great news! I'm afraid as I'm in the UK your previous query came in after I'd departed but seems you powered on through.

My code def needs tidying up just so it's clearer what envelopes are what (USB, Station etc).

I'll check out your code and have a play :)

- Lloyd
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/N8BJAYUDQ4M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Abhijit Borah

unread,
Jul 30, 2018, 11:55:44 AM7/30/18
to weewx-user
It worked for me in Bodhi Linux with WH-2301 from Mi-Sol. Feeling good. Thanks a lot.
Reply all
Reply to author
Forward
0 new messages