USBErrorIO: LIBUSB_ERROR_IO is being logged

607 views
Skip to first unread message

Jason Wheatley

unread,
Jun 6, 2016, 12:39:04 PM6/6/16
to pywws
Hi everyone,

Just set up my weather station again with Raspberry PI after failure of SD and house move.

Used a fresh install of Raspian Jessite Lite.


Keep getting the following messages logged: -

2016-06-06 17:25:13:pywws.LiveLog:LIBUSB_ERROR_IO [-1]
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 265, in read_block
    if not self.dev.write_data(buf):
  File "/usr/local/lib/python2.7/dist-packages/pywws/device_libusb1.py", line 130, in write_data
    0x200, 0, str_buf, timeout=50)
  File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 1331, in controlWrite
    sizeof(data), timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 1310, in _controlTransfer
    mayRaiseUSBError(result)
  File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 121, in mayRaiseUSBError
    raiseUSBError(value)
  File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 117, in raiseUSBError
    raise STATUS_TO_EXCEPTION_DICT.get(value, USBError)(value)
USBErrorIO: LIBUSB_ERROR_IO [-1]

I installed the USB library by following the instruction sin the link above i.e. pip install libusb1

If anyone could throw any light on this I'd be most grateful.


Cheers,

Jason

Jim Easterbrook

unread,
Jun 6, 2016, 12:48:38 PM6/6/16
to py...@googlegroups.com
On 06/06/16 17:39, Jason Wheatley wrote:
>
> Keep getting the following messages logged: -
>
> / File
> "/usr/local/lib/python2.7/dist-packages/pywws/device_libusb1.py", line
> 130, in write_data/
> / 0x200, 0, str_buf, timeout=50)/
> / File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 1331, in
> controlWrite/
> / sizeof(data), timeout)/
> / File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 1310, in
> _controlTransfer/
> / mayRaiseUSBError(result)/
> / File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 121, in
> mayRaiseUSBError/
> / raiseUSBError(value)/
> / File "/usr/local/lib/python2.7/dist-packages/usb1.py", line 117, in
> raiseUSBError/
> / raise STATUS_TO_EXCEPTION_DICT.get(value, USBError)(value)/
> /USBErrorIO: LIBUSB_ERROR_IO [-1]/
>
> I installed the USB library by following the instruction sin the link
> above i.e. *pip install libusb1*

Did you also install libusb using apt-get install?

> If anyone could throw any light on this I'd be most grateful.

I assume you're getting the same errors with pywws-testweatherstation.
Check your user has permission to access the weather station's USB port
(which may require a udev rule) although usually that gives a more
helpful error message.

Otherwise try adding / removing various USB related bits to your
/boot/cmdline.txt. Debugging Pi USB problems is easier than it was, but
still seems to involve guess work.
--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>

Jason Wheatley

unread,
Jun 9, 2016, 4:41:21 PM6/9/16
to pywws
Thanks for reply Jim. Apologies for not reporting back sooner.

I wasn't getting errors with the discrete test. Strange!!! 

Anyhow unplugged station, re-booted and then plugged back in and all's been well so far.

Have Twitter problems now but will start a new post for that.


Thanks again for your help.

Jason
Reply all
Reply to author
Forward
0 new messages