USB timeout issues with a raspberry pi Zero W

454 views
Skip to first unread message

Erik Nilsson

unread,
Apr 11, 2017, 5:56:22 AM4/11/17
to pywws
I'm trying to run a Pi Zero W with a 1080 station but it has issues with timing out on the USB interface.
pywws.LiveLog do not run very long. Most of the time it doesnot even read anything from the station before it timeout.

Currently running pywws 16.12.0 and python 2.7.9 and tried both pyusb and libusb1 with timeout issues. I have alos played with the timeout value in device_libusb1.py without any noticable diffrency

07:19:36:pywws.WeatherStation.CUSBDrive:using pywws.device_libusb1 >> USBErrorTimeout: LIBUSB_ERROR_TIMEOUT [-7]
08:02:12:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb >> USBError: Connection timed out


I have been running this station connected to a Raspberry Pi 2 for a really long time (and still doing it) without these issues so I know the station itself is working.

The main diffrence with the two systems are the diffrent pi hardware. I'm guessing the USB interface are different.

Has anyone else tried the Zero with any luck!?

Regards,
Erik

-------------------------------------------------
pi@zero:~/applic/data $ sudo python -m pywws.LiveLog -vvv /home/pi/applic/data
11:53:41:pywws.Logger:pywws version 16.12.0, build 1367 (e917ba9)
11:53:41:pywws.Logger:Python version 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2]
11:53:41:pywws.WeatherStation.CUSBDrive:using pywws.device_libusb1
11:53:43:pywws.Calib:Using default calibration
11:53:43:pywws.weather_station:read period 15
11:53:43:pywws.weather_station:delay 6, pause 14.8574
11:53:58:pywws.weather_station:avoid 6.66291088318
11:54:04:pywws.weather_station:avoid 1.81050577903
11:54:06:pywws.weather_station:live_data new data
11:54:06:pywws.Tasks.RegularTasks:Templating pywws.txt
11:54:06:pywws.Tasks.RegularTasks:Templating domoticz.txt
11:54:06:pywws.weather_station:delay 7, pause 39.1877
11:54:46:pywws.weather_station:delay 7, pause 0.5
11:54:46:pywws.weather_station:avoid 7.78004233523
11:54:55:pywws.LiveLog:LIBUSB_ERROR_TIMEOUT [-7]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 80, in LiveLog
logged_only=(not tasks.has_live_tasks())):
File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 256, in live_data
for data, ptr, logged in self.ws.live_data(logged_only=logged_only):
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 440, in live_data
new_ptr = self.current_pos()
File "/usr/local/lib/python2.7/dist-packages/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/WeatherStation.py", line 642, in _read_fixed_block
result += self._read_block(mempos)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 630, in _read_block
new_block = self.cusb.read_block(ptr)
File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 267, in read_block
return self.dev.read_data(32)
File "/usr/local/lib/python2.7/dist-packages/pywws/device_libusb1.py", line 100, in read_data
result = self.dev.bulkRead(0x81, size, timeout=1200)
File "/usr/local/lib/python2.7/dist-packages/usb1/__init__.py", line 1519, in bulkRead
transferred = self._bulkTransfer(endpoint, data, length, timeout)
File "/usr/local/lib/python2.7/dist-packages/usb1/__init__.py", line 1480, in _bulkTransfer
self.__handle, endpoint, data, length, byref(transferred), timeout,
File "/usr/local/lib/python2.7/dist-packages/usb1/__init__.py", line 133, in mayRaiseUSBError
__raiseUSBError(value)
File "/usr/local/lib/python2.7/dist-packages/usb1/__init__.py", line 125, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
USBErrorTimeout: LIBUSB_ERROR_TIMEOUT [-7]

Nathan van Dael

unread,
Jun 18, 2017, 1:07:03 PM6/18/17
to pywws
Hi Erik,

I'am facing the same problems. The main difference between the two versions are the USB port.
The Raspberry Zero (W) having a OTG port, that gives the raspberry or the weather station also power.
You'll get overvoltage in the weather station, which is not protected against likely.
Soon I want to try to cut the + 5V in the USB cable, see if that helps.
For now I have a USB hub between (normal USB A connector), the voltage does not pass through.

Nathan

Op dinsdag 11 april 2017 11:56:22 UTC+2 schreef Erik Nilsson:

Wilfried Brunner

unread,
Jan 16, 2018, 11:24:26 AM1/16/18
to pywws
Hi Erik,

I am searching for how many days already to find a solution to send my weatherdata from my WH1080 direktly to my domoticz. While searching the Internet i found this thread and in your log i can see you are useing a templatefile called "domoticz.txt". Did you find a way to send the data directly to domoticz? I expected already that it must be possible with JSON but i didn't find a solution for now. Maybe you can help me.

I am using a Raspberry Pi 3 and the pywws is sending my weatherdata to weather Underground. Then i retrieve the weatherdata with a API-Key to my domoticz. Of yours it would be better to retrieve it directly from my raspberry and not going the detour thru Internet.

Another way would be to buy a Transmitter for 868 MHz but there is no garantee that it will Support the right protocoll.
I was also thinking to install domoticz on the same raspberry where i have the pywws running and to communicate with domoticz directly via USB to the Interface of the weatherstation. But i think it will not work.

I would be very happy if you can help me!

regards,
Willy
Reply all
Reply to author
Forward
0 new messages