I've pulled my contributions on this topic into a separate thread from the original 'IOError: station is not logging data' - so as to allow Robert to continue his investigations - mine are going in a different direction :
Just to recap : I have several WH1080 clones : Maplin N96GY x2 and a Forever Speed WH1080 - in fact its a WH1080PC, as it has a wireless clock. These devices range from 2012 to 2018 - and all have different firmware numbers on startup.
They have been giving me problems of USB reading - and I am using Raspberry Pi(s) to read them. At least one appears to be 'broken' in that the Abs pressure is always zero - and even when I get it to read without pywws crashing, some of the readings are incorrect. As a side note, my old N96GY circa 2012 gives an audible 'relay click' when attaching the USB cable - the newer devices do not (making me think they're not so power hungry from the USB).
Taking the newest weather stations (Forever Speed WH1080PC) :
If I use a Raspberry Pi 2, No Powered USB hub; all seems quite stable from pywws - including LiveLogging for several hours - Hurrah !
If I take the exact same memory SIM card and place in a Raspberry pi Zero W, and adjust the cables (again, no powered USB hub to the weather station) - DataLogging is OK - although occasionally gives a similar USB error in LiveLogging or DataLogging
:
pi@PiZero-W:~ $ sudo python -m pywws.LogData -v /home/pi/weather/data
17:12:37:pywws.Logger:pywws version 17.11.0, build 1380 (b01d94a)
17:12:37:pywws.Logger:Python version 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516]
17:12:37:pywws.WeatherStation.CUSBDrive:using pywws.device_libusb1
17:12:39:pywws.DataLogger:Synchronising to weather station
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/LogData.py", line 309, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/LogData.py", line 306, in main
DataStore.data_store(root_dir)).log_data(sync=sync, clear=clear)
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/LogData.py", line 210, in log_data
for data, last_ptr, logged in self.ws.live_data(logged_only=(sync > 1)):
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/WeatherStation.py", line 440, in live_data
new_ptr = self.current_pos()
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/WeatherStation.py", line 586, in current_pos
self._read_fixed_block(0x0020), self.lo_fix_format['current_pos'])
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/WeatherStation.py", line 642, in _read_fixed_block
result += self._read_block(mempos)
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/WeatherStation.py", line 630, in _read_block
new_block = self.cusb.read_block(ptr)
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/WeatherStation.py", line 267, in read_block
return self.dev.read_data(32)
File "/usr/local/lib/python2.7/dist-packages/pywws-17.11.0-py2.7.egg/pywws/device_libusb1.py", line 100, in read_data
result = self.dev.bulkRead(0x81, size, timeout=1200)
File "/usr/lib/python2.7/dist-packages/usb1/__init__.py", line 1456, in bulkRead
transferred = self._bulkTransfer(endpoint, data, length, timeout)
File "/usr/lib/python2.7/dist-packages/usb1/__init__.py", line 1417, in _bulkTransfer
self.__handle, endpoint, data, length, byref(transferred), timeout,
File "/usr/lib/python2.7/dist-packages/usb1/__init__.py", line 133, in mayRaiseUSBError
__raiseUSBError(value)
File "/usr/lib/python2.7/dist-packages/usb1/__init__.py", line 125, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorTimeout: LIBUSB_ERROR_TIMEOUT [-7]
However, I note a couple of things: the RPi Zero has 'USB OCT' ports, rather than full-fat USB. I see in the syslog that as pywws is running the following are recorded :
Mar 5 17:12:37 PiZero-W kernel: [ 2277.664443] Indeed it is in host mode hprt0 = 00041901
Mar 5 17:12:37 PiZero-W kernel: [ 2278.016028] usb 1-1: reset low-speed USB device number 2 using dwc_otg
I am going to test two things :
- Using a powered USB hub with the PiZero (will take me a day or so to find one)
- Soak testing on the Raspberry pi 2B.
...will get back shortly..