jim-easterbrook / pywws

Python software for USB Wireless WeatherStations
https://pywws.readthedocs.io/
GNU General Public License v2.0
204 stars 62 forks source link

[feature] Improve detection of WS3080 #95

Closed Nightwalker-87 closed 4 years ago

Nightwalker-87 commented 4 years ago

Hi. I am facing the same issue as #49 and can reproduce the output (https://github.com/jim-easterbrook/pywws/issues/49#issue-239193494) but with a WS3080. However I can't find a solution to this currently but am somehow confident that this device will work either. IMHO the hardware is very similar or even equivalent to the WH3080. There still seems to be a problem present in the latest version. Any help appreciated. A workaround would also be helpful.

System: Debian Bullseye (testing) pywws-version: 20.1.0, build 1673 (92d8868) [installed via debian-repo] Device-ID: USBDevice(0x1941, 0x8021) Python versions: 3.8 & 3.9 (2.7 did not seem to have worked either)

See also: ad6b22fcceefb2c3209cf4ac9b2b5caa10c090a4 Note: Conversion from Python 2.x to 3.x does not seem to address encoding automatically.

ashenshugarRET commented 4 years ago

Issue #49, seems to have been caused by trying to run pywws on Mac OS X, it was fixed by switching to ubuntu.

Can you confirm which USB library you have installed on your systems, Jim's excellent readthedocs recommends libusb or pyusb before trying hidapi. Have you already tried and failed with libusb and pyusb?

Nightwalker-87 commented 4 years ago

I have both

installed which are the newest available. I'd prefer to use libusb as well. I have no clue why pywws tries to use hidapi, that was not intended. The program just came up with it. The packages

are not even installed. I haven't tried pyusb yet though.

Edit: Ah, got it! The package python3-usb did the trick:

$ sudo pywws-testweatherstation
10:59:51:pywws.logger:pywws version 20.1.0, build 1673 (92d8868)
0000 55 aa ff ff ff ff 18 01 01 12 04 18 01 01 12 04 05 00 00 30 09 00 00 00 01 00 00 8c 00 00 e4 1c 
0020 9e 27 27 26 00 00 00 00 00 00 00 20 08 30 11 59 41 23 c8 00 00 00 46 2d 2c 01 64 80 c8 00 00 00 
0040 64 00 64 80 a0 28 80 25 a0 28 80 25 00 b4 00 00 68 01 00 0a 00 f4 01 12 00 c0 c6 2d 0a 06 6c 83 
0060 0b 00 3b 0a 3c 1b 36 01 d7 00 2c 01 d2 00 2c 01 c9 00 83 00 32 00 7f 26 13 26 d3 27 72 27 1b 00 
0080 4b 00 00 00 00 00 00 00 00 00 0c 00 00 18 01 01 12 02 18 01 01 12 09 20 08 30 11 54 18 01 01 15 
00a0 03 18 01 01 12 13 20 08 30 11 43 18 01 01 12 24 18 01 01 15 13 18 01 01 12 24 20 08 29 22 21 20 
00c0 08 30 11 54 18 01 01 14 44 18 01 01 12 57 18 01 01 13 40 18 01 01 16 07 18 01 01 15 31 18 01 01 
00e0 12 05 20 08 29 22 21 18 01 01 12 00 18 01 01 12 00 18 01 01 12 00 18 01 01 12 00 19 04 25 18 03

Can one add a dependency to python3-pyusb or python3-usb1 for the debian package?

jim-easterbrook commented 4 years ago

You'd need to ask the Debian packager for that. The pywws project doesn't provide packages for any particular operating system.

jim-easterbrook commented 4 years ago

PS pywws was appearing to try and use hidapi as it couldn't find libusb.

Nightwalker-87 commented 4 years ago

You'd need to ask the Debian packager for that. The pywws project doesn't provide packages for any particular operating system.

I have submitted a request to Debian Maintainer Thorsten Alteholz referring to this ticket.

PS pywws was appearing to try and use hidapi as it couldn't find libusb.

Can you update the console output for this routine to make visible what is happening in the background, such as "Detecting pyusb" --> Found / Failed "Trying to use hidapi instead..." etc. ?

This would clearly help to improve the initial setup for users and help to detect missing libraries, bindings and modules.