Comments (5)
something similar happens with the te923 driver as well. during startup, the te923 driver sometimes encounters random/leftover data on the usb. the driver ignores the data, but sometimes it fails multiple times before the buffer is flushed, sometimes resulting in weewx failing to start up.
this also happens with the wmr300 driver.
need to figure out how to flush the usb to get it into a known/synchronized state.
from weewx.
no resolution yet for this, but i do have more data points and guidelines.
- when you do a usb reset, do it after you open the device (duh) but before you claim the interface. if you do a reset after you claim the interface, then you must re-claim the interface, otherwise you'll get 'no permission' or 'attempt to use device without claiming the interface'
- on fine offset ws2300 hardware, a reset is only required if you bodge the usb comms. for example, if you do a read or write with bogus preamble (in the case of this hardware, the first two bytes), the firmware gets confused and will not respond until you wait awhile or do a reset. sometimes waiting awhile does not work. so it is possible to un-wedge a ws2300 by doing a usb reset, unlike the 10xx/20xx/30xx which only un-wedge by doing a power cycle.
- behavior of the acurite hardware is not as consistent (also, i have only one model on which to test, and apparently there is significant difference in firmware between the 0103x, 02032, and 02064 models). usb reset seems to help with the 01036, but seems to cause problems with the 02032. no data yet for the 02064.
- the te932 seems to be fairly robust/repeatable wrt usb initialization. it consistently fails the first attempt to read data (the driver misses the first byte). but then works flawlessly. reset is not required, and does not eliminate the first bad read. (the te923tool seems to not have the first read problem. not sure about wview - too much overhead and complexity to test it.)
- the reset seems to make no difference on the wmr300, but that is based on a very tiny sample size - only a few days of testing, and no extensive testing of getting the firmware to lock up.
- beware of different library versions. the significant differences are in pyusb (0.4.3 vs 1.0.0) and libusb (0.x vs 1.x). my dev and testing is mostly on pyusb 0.4.3. pyusb is supposed to transparently handle differences between libusb versions, but i'm not sure that it actually does. i have only anecdotal results for this, and no comprehensive coverage of the different combinations of operating systems and library versions.
- beware localization. some of the drivers test for the 'no data' string from libusb. that code will not work as designed on systems where the libusb strings have been translated.
- there is some usb wierdness in recent versions of redhat derivatives, including fedora and centos. they do not report the usb device or bus in the driver's 'find' code, yet they seem to function properly.
unfortunately i have not yet found a solution that works across all types of hardware.
from weewx.
Sounds like we may need to write a usb shim, much like weedb, that takes care of the different versions of pyusb and acts as a repository of different reset strategies.
from weewx.
pywws has such a shim implementation. the pywws distribution includes usb implementations for ctypes_hidapi, cython_hidapi, libusb1, pyusb, and pyusb1.
in this case, the shim is more important for dealing with HID issues; a usb shim is necessary for macos, since on macos there is no reliable way to prevent the kernel from claiming HID devices.
we might be able to generalize a weeusb shim to address both the reset issues and the hid issues.
we have a bunch of working implementations for a wide variety of hardware, so that should help with the shim design :)
from weewx.
resets have no effect.
from weewx.
Related Issues (20)
- extractor noop HOT 5
- Cannot display XType in current section of Seasons skin HOT 4
- weewx netatmo driver HOT 1
- wee_import Time problem HOT 1
- Cannot use complex aggregates in plots HOT 1
- Updated Humidex Formula Environment Canada - wxformulas.py HOT 1
- In Pillow 10.0.0 Image.ANTIALIAS is replaced with Image.LANCZOS or Image.Resampling.LANCZO HOT 1
- Allow extension installer to install from pypi
- wee_extension fails if there are no line "restful_services" HOT 1
- weewx v5 restart fails on Ethernet connection - Too quick? HOT 22
- changing case of example Basic skin causes problems on weectl create station HOT 1
- v5.x - weewx.cheetahgenerator SeasonsReport runs almost 10x longer than in v4.x HOT 8
- Special characters in de.conf HOT 5
- Upgrade Google Analytics handling to use GA4 rather than deprecated UA tags HOT 4
- Reliable import project from wunderground in real time HOT 2
- [[Corrections]] doesn't work with partial packets and software record generation HOT 1
- include my patch to support time_offset within diagrams HOT 4
- `wee_database --calc-missing` needs configurable transaction size [was: stuck always on same record] HOT 18
- Separate extraction of records from accumulator from StdArchive
- rpm --import https://weewx.com/keys.html fails on RHEL9(ish) HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weewx.