pywws usb.core.USBError: [Errno 110] Operation timed out

3,067 views
Skip to first unread message

Norbert JORDAN

unread,
Feb 4, 2015, 1:53:28 PM2/4/15
to py...@googlegroups.com
hm.....
i have a strange problem, using PYWWS for more than a year now and quite impressed about its stability, only updating brings from time to time issues with it...
I recently updated to the latestversion from 2015....to see if sync still works I did start the manual procedure....on my cubietruck (debian).

sudo python -m pywws.Hourly -vvv /home/cubie/weather/data

did work well, now after a few days I have the following error message....and I couldn't find a way via google to see what is going wrong all of a sudden....
pywws usb.core.USBError: [Errno 110] Operation timed out


Below the complete message that can be seen...I use the pyUSB drivers....thanks a lot for help because I would really love to see my system run smooth again. NORBERT

cubie@Cubian:~$ sudo python -m pywws.Hourly -vvv /home/cubie/weather/data
19:51:28:pywws.Logger:pywws version 15.01.0
19:51:28:pywws.Logger:Python version 2.7.3 (default, Mar 14 2014, 17:55:54)
[GCC 4.6.3]
19:51:28:pywws.WeatherStation.CUSBDrive:using pywws.device_pyusb1
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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/Hourly.py", line 111, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/pywws/Hourly.py", line 108, in main
    return Hourly(args[0])
  File "/usr/local/lib/python2.7/dist-packages/pywws/Hourly.py", line 73, in Hourly
    DataLogger(params, status, raw_data).log_data()
  File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 98, in __init__
    fixed_block = self.check_fixed_block()
  File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 113, in check_fixed_block
    fixed_block = self.ws.get_fixed_block(unbuffered=True)
  File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 605, in get_fixed_block
    self._fixed_block = self._read_fixed_block()
  File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 641, in _read_fixed_block
    result += self._read_block(mempos)
  File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 629, 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_pyusb1.py", line 102, in read_data
    result = self.dev.read(0x81, size, timeout=1200)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 670, in read
    self.__get_timeout(timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 798, in intr_read
    timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 889, in __read
    _check(retval)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb1.py", line 571, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 110] Operation timed out

Jim Easterbrook

unread,
Feb 4, 2015, 2:10:54 PM2/4/15
to py...@googlegroups.com
On 04/02/15 18:53, Norbert JORDAN wrote:
> hm.....
> i have a strange problem, using PYWWS for more than a year now and quite
> impressed about its stability, only updating brings from time to time
> issues with it...
> I recently updated to the latestversion from 2015....to see if sync
> still works I did start the manual procedure....on my cubietruck (debian).
>
> sudo python -m pywws.Hourly -vvv /home/cubie/weather/data
>
> did work well, now after a few days I have the following error
> message....and I couldn't find a way via google to see what is going
> wrong all of a sudden....
> pywws usb.core.USBError: [Errno 110] Operation timed out

Anything else changed? (Operating system upgrades sometimes affect USB
performance.)

It can be really hard to track down this sort of problem. I was getting
occasional failures on one of my Raspberry Pi's until I put a USB hub
between the Pi and the station. I can only suggest you try things like
that. And search cubietruck forums for USB tweaks to try.
--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>

Norbert JORDAN

unread,
Feb 4, 2015, 2:42:02 PM2/4/15
to py...@googlegroups.com
Thanks for the feedback - to make it worth - have not changed anything at all - maybe apt-updates - have to check this as well...but sounds not good if Jim himself does not have a clear hint....will try to find out as well in parallel when exactly it stopped tracking....so to see if it correlates with a certain apt-get update

as much as I love updating all and everything - its lot of times a nightmare and makes me busy at night....meaning any kind of update of any kind of software and hw firmware....


--
You received this message because you are subscribed to a topic in the Google Groups "pywws" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pywws/fKHM5k6Qqhc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pywws+un...@googlegroups.com.
To post to this group, send an email to py...@googlegroups.com.
Visit this group at http://groups.google.com/group/pywws.
For more options, visit https://groups.google.com/d/optout.

Norbert JORDAN

unread,
Feb 4, 2015, 3:33:50 PM2/4/15
to py...@googlegroups.com
Update from my side - as maybe others will have similar issues in future, never know....

I checked APT-GET and tried to correlate with last logging timestamp....first thought I got something ....but found out that the update via APT-get was after the last timestamp successfully logged...so a dead end.

Spent some time now with removing pyusb, reinstalling,......rebooting, shutdown, remove-usb plug...nothing...BUT now i removed the 1080er station and replaced it with my second one that is not connected via USB.....reboot....and it works.....

Jim, any idea from your experience with these cheap weather stations...never (over more than a year now) I had such behavior....will sync WU and then will reset the bad station...and hopefully it works again...but we will see....

Norbert

Jim Easterbrook

unread,
Feb 4, 2015, 5:13:54 PM2/4/15
to py...@googlegroups.com
On 04/02/15 20:33, Norbert JORDAN wrote:
>
> Spent some time now with removing pyusb, reinstalling,......rebooting,
> shutdown, remove-usb plug...nothing...BUT now i removed the 1080er
> station and replaced it with my second one that is not connected via
> USB.....reboot....and it works.....
>
> Jim, any idea from your experience with these cheap weather
> stations...never (over more than a year now) I had such behavior....will
> sync WU and then will reset the bad station...and hopefully it works
> again...but we will see....

Ah, I hadn't thought it might be a USB lockup. So long since I had one
of those now that pywws has an avoidance strategy. If a reset of the
base station sorts it out then I think that will confirm that it was a
USB lockup. Even with the avoidance strategy they can still happen.

Norbert JORDAN

unread,
Feb 6, 2015, 5:58:42 AM2/6/15
to py...@googlegroups.com
Hi Jim, again today my installation stops uploading to WUnderground...
The strange thing is that it seems to always stop working - like before arround 0:30am......(this is what the RAW log is saying).....
....I have one speculation here that could be a lead.....

Up to now I always switch OFF the router at 0:15am....by homecenter solution....to save power...this is done for multiple devices in my house....of course Cubietruck stays alive and will still log the data from the weather station....and at 6:30am continue to feed data to the www...when router is back online....

Up to now, and this worked great for long time 12+months......., it was resyncing, took several hours at WU and all was fine....but now with the 15.x.x. release of PYwws...it may be a reason....but you know better if what I write here does make any sense in terms of that you changed something related....

Could not check whether the Station is again completely broken and needs a full reset but can give more details tonight....

Norbert JORDAN

unread,
Feb 6, 2015, 6:05:06 AM2/6/15
to py...@googlegroups.com
as written above .... could check remotely ....teststation works fine....also a manual trigger (manually sync data) seems to work
What I now remember - or comes to my mind - since several days now (as I do test an installation).......I have like 3-6 reboots at the moment on my system....but use a cronjob to trigger every 20mins the process....

could it be that these reboots bring the system in a bad situation (like station hanging like last time) or this time that sync does not start anymore.....hm.

Jim Easterbrook

unread,
Feb 6, 2015, 6:15:14 AM2/6/15
to py...@googlegroups.com
On 06/02/15 10:58, Norbert JORDAN wrote:
> Hi Jim, again today my installation stops uploading to WUnderground...
> The strange thing is that it seems to always stop working - like before
> arround 0:30am......(this is what the RAW log is saying).....
> ....I have one speculation here that could be a lead.....
>
> Up to now I always switch OFF the router at 0:15am....by homecenter
> solution....to save power...this is done for multiple devices in my
> house....of course Cubietruck stays alive and will still log the data
> from the weather station....and at 6:30am continue to feed data to the
> www...when router is back online....

I hadn't really considered this sort of operation. Are you running live
logging or cron jobs? Disconnecting the network will mean that all the
internet stuff (Weather Underground, web site uploading and so on) will
take a long time as each separate one times out. If you are using cron
jobs at 10 minute intervals then it's quite possible that one is still
running when the next one starts, which might cause USB problems.
(Except that by the time the cron job starts uploading stuff it should
have finished talking to the weather station.)

If you're using live logging, have you tried experimenting with the
'asynchronous' option?
http://pythonhosted.org/pywws/en/html/guides/weather_ini.html#config-miscellaneous-system-configuration

Have you worked out how little money you save by turning off your router?

> Up to now, and this worked great for long time 12+months......., it was
> resyncing, took several hours at WU and all was fine....but now with the
> 15.x.x. release of PYwws...it may be a reason....but you know better if
> what I write here does make any sense in terms of that you changed
> something related....

I've made too many changes in the last two years to work out what might
be the problem.

Norbert JORDAN

unread,
Feb 6, 2015, 9:01:01 AM2/6/15
to py...@googlegroups.com
Jim, I knew you would come up with the question "whats the value of switching off 10W per hour"....guess from "business perspective" you will not save the world, its more my hobby to optimize these things - of course as long as no other activites like weather update suffer...which never was a problem up to now.....

And of course, for you it looks like a crazy thing.....update forced very 15mins.....and over night no update...and in the morning maybe some hickups.....but again, it never did behave like this before...I will change the cron sync to 30mins....but strange is that after the 15.x.x. update it now starts to behave that strange.....


jobs at 10 minute intervals then it's quite possible that one is still
running when the next one starts, which might cause USB problems.
(Except that by the time the cron job starts uploading stuff it should
have finished talking to the weather station.)

its 15mins, but still may be an issue now....will change it to 30mins.

Below my config - maybe you have a suggestion what to do better......also I have to do a real cronjob to catch the data from the station every 15mins....

[live]
services = ['underground_rf']
twitter = []
text = []
plot = []
yowindow =

[logged]
text = ['1hrs.txt', '6hrs.txt', '6hrs_html_cp.txt', 'forecast_icon_9am.txt']
yowindow =
services = ['underground']
twitter = []
plot = []

[hourly]
services = ['underground']
twitter = []
plot = ['24hrs_full_features.png.xml', '24hrs.png.xml', 'rose_24hrs.png.xml']
text = ['feed_hourly.xml', '24hrs.txt']
yowindow =

[12 hourly]
services = []
twitter = []
text = []
plot = []
yowindow =

[daily]
services = ['underground']
twitter = []
plot = ['7days.png.xml', '2012.png.xml', '28days.png.xml', 'rose_7days_nights.png.xml']
text = ['feed_daily.xml', 'forecast_week.txt', '7days.txt', 'allmonths.txt']
yowindow =



 
If you're using live logging, have you tried experimenting with the
'asynchronous' option?
http://pythonhosted.org/pywws/en/html/guides/weather_ini.html#config-miscellaneous-system-configuration

Have you worked out how little money you save by turning off your router?

> Up to now, and this worked great for long time 12+months......., it was
> resyncing, took several hours at WU and all was fine....but now with the
> 15.x.x. release of PYwws...it may be a reason....but you know better if
> what I write here does make any sense in terms of that you changed
> something related....

I've made too many changes in the last two years to work out what might
be the problem.
--
Jim Easterbrook                 <http://www.jim-easterbrook.me.uk/>

--
You received this message because you are subscribed to a topic in the Google Groups "pywws" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pywws/fKHM5k6Qqhc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pywws+un...@googlegroups.com.

Norbert JORDAN

unread,
Feb 6, 2015, 9:16:18 AM2/6/15
to py...@googlegroups.com
Jim, related to the message above -maybe I do anyhow something wrong here....

I do start every 15mins the hourly script.....

In the end - what I would like to have - to provide "Live" data to WU....and have the longterm logging with WU....and of course to have the normal "logging in RAW format + the local website as a backup solution if WU is not reachable....."

So in realtime - it would be nice if WU is up to date, but the rest I do not care if it is synced only once per hour or even less.....

I fear that anyhow, even if my way worked up to now, it is not the best way configured from what I tell you now....maybe you can give me some hints to improve this situation taking into account my "Router-Working hours" :-)

Jim Easterbrook

unread,
Feb 6, 2015, 9:51:13 AM2/6/15
to py...@googlegroups.com
On 06/02/15 14:16, Norbert JORDAN wrote:
>
> In the end - what I would like to have - to provide "Live" data to
> WU....and have the longterm logging with WU....and of course to have the
> normal "logging in RAW format + the local website as a backup solution
> if WU is not reachable....."
>
> So in realtime - it would be nice if WU is up to date, but the rest I do
> not care if it is synced only once per hour or even less.....
>
> I fear that anyhow, even if my way worked up to now, it is not the best
> way configured from what I tell you now....maybe you can give me some
> hints to improve this situation taking into account my "Router-Working
> hours" :-)

I think the simplest way would be to have one cron job to start the
livelog daemon every morning, shortly after your router's day starts,
and a second cron job to stop the live log daemon every night, shortly
before the router is turned off.

Start the daemon:
pywws-livelog-daemon -v /home/cubie/weather/data
/home/cubie/weather/data/pywws.log start

Stop the daemon:
pywws-livelog-daemon -v /home/cubie/weather/data
/home/cubie/weather/data/pywws.log stop

The weather station's internal memory will store the night's data ready
to be collected when live logging starts in the morning.

Norbert JORDAN

unread,
Feb 6, 2015, 10:04:08 AM2/6/15
to py...@googlegroups.com
Hi Jim, that sounds very promising...
does that mean that when live logg is going on....also the longterm stuff is filled in parallel ?
I've seen that livelogging means an interval of 48secs....can this be increased to e.g. 300secs...as I like realtime...but 5mins would be more than sufficient....

Just to be sure - by cronjob you mean system cronjob, not the "new" PYWWS internal stuff...

Regards
Norbert

Jim Easterbrook

unread,
Feb 6, 2015, 11:08:41 AM2/6/15
to py...@googlegroups.com
On 06/02/15 15:04, Norbert JORDAN wrote:
> Hi Jim, that sounds very promising...
> does that mean that when live logg is going on....also the longterm
> stuff is filled in parallel ?

Yes, it does everything 'hourly' logging does plus 'live' (48 seconds
interval) stuff if you want it.

> I've seen that livelogging means an interval of 48secs....can this be
> increased to e.g. 300secs...as I like realtime...but 5mins would be more
> than sufficient....

Things in the [live] section of weather.ini are done at 48 second
intervals, things in the [logged] section are done at your logging
interval, things in [hourly] are done every hour.

> Just to be sure - by cronjob you mean system cronjob, not the "new"
> PYWWS internal stuff...

Yes. A 'cron' entry in weather.ini isn't able to cause pywws to run (or
do anything else) if pywws isn't running.

Norbert JORDAN

unread,
Feb 6, 2015, 3:37:58 PM2/6/15
to py...@googlegroups.com
Thanks Jim, just tried the live-command (really nice...updates quite fast).....one more question, as you already said below....it does this every 48secs....is there any chance to change this to e.g. every 5mins?

Jim Easterbrook

unread,
Feb 7, 2015, 4:30:38 AM2/7/15
to py...@googlegroups.com
On 06/02/15 20:37, Norbert JORDAN wrote:
> Thanks Jim, just tried the live-command (really nice...updates quite
> fast).....one more question, as you already said below....it does this
> every 48secs....is there any chance to change this to e.g. every 5mins?

What is it doing every 48 seconds? If your [live] section of weather.ini
is empty it should not do anything until a 'logged' record is due.

Joakim Thulin

unread,
Feb 15, 2015, 5:34:41 AM2/15/15
to py...@googlegroups.com
Good morning,
I got the same errors this morning, did an apt-get update and an apt-get upgrade. After that the USB-connection stopped working. I am using live logging on an RPi from a WH2080.

lsusb says this:
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1941:8021 Dream Link WH1080 Weather Station / USB Missile Launcher

my live-log show this:
2015-02-15 11:22:15:pywws.Logger:pywws version 15.01.0
2015-02-15 11:22:39:root:[Errno None] Förbindelsen dog ut (timeout)

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pywws/livelogdaemon.py", line 109, in main runner.do_action()
  File "/usr/local/lib/python2.7/dist-packages/daemon/runner.py", line 189, in do_action func(self)
  File "/usr/local/lib/python2.7/dist-packages/daemon/runner.py", line 134, in _start self.app.run()
  File "/usr/local/lib/python2.7/dist-packages/pywws/livelogdaemon.py", line 75, in run LiveLog(self.data_dir)
  File "/usr/local/lib/python2.7/dist-packages/pywws/LiveLog.py", line 71, in LiveLog datalogger = DataLogger(params, status, raw_data)

  File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 98, in __init__ fixed_block = self.check_fixed_block()
  File "/usr/local/lib/python2.7/dist-packages/pywws/LogData.py", line 113, in check_fixed_block fixed_block = self.ws.get_fixed_block(unbuffered=True)
  File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 605, in get_fixed_block self._fixed_block = self._read_fixed_block()
  File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 641, in _read_fixed_block result += self._read_block(mempos)
  File "/usr/local/lib/python2.7/dist-packages/pywws/WeatherStation.py", line 629, 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_pyusb1.py", line 102, in read_data result = self.dev.read(0x81, size, timeout=1200)
  File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 918, in read self.__get_timeout(timeout))
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 507, in intr_read timeout)
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 562, in __read timeout
  File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py", line 380, in _check raise USBError(errmsg, ret)
USBError: [Errno None] Förbindelsen dog ut (timeout)

I've done a shutdown of the RPi, I've restarted the WH2080, but still no working USB-connection. I think this morning apt-get update included an update of Python.

Do you have any ideas on what's going on?

Cheers, Joakim

Jim Easterbrook

unread,
Feb 15, 2015, 6:25:00 AM2/15/15
to py...@googlegroups.com
On 15/02/15 10:34, Joakim Thulin wrote:
> Good morning,
>
> I got the same errors this morning, did an apt-get update and an apt-get
> upgrade. After that the USB-connection stopped working. I am using live
> logging on an RPi from a WH2080.
>
> File "/usr/local/lib/python2.7/dist-packages/pywws/device_pyusb1.py",
> line 102, in read_data result = self.dev.read(0x81, size, timeout=1200)
> File "/usr/local/lib/python2.7/dist-packages/usb/core.py", line 918,
> in read self.__get_timeout(timeout))
> File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
> line 507, in intr_read timeout)
> File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
> line 562, in __read timeout
> File "/usr/local/lib/python2.7/dist-packages/usb/backend/libusb0.py",
> line 380, in _check raise USBError(errmsg, ret)
> USBError: [Errno None] Förbindelsen dog ut (timeout)
>
> I've done a shutdown of the RPi, I've restarted the WH2080, but still no
> working USB-connection. I think this morning apt-get update included an
> update of Python.
>
> Do you have any ideas on what's going on?

Raspberry Pi USB can often be a problem. There are various things you
can try.

1/ different Python USB library - 'sudo pip install libusb1'
2/ put a USB hub between the Pi and the weather station
3/ experiment with kernel USB module config - edit /boot/cmdline.txt and
insert 'dwc_otg.fiq_split_enable=0' at the start of the line. (Or remove
it if it's already there.) You can also try 'dwc_otg.speed=1' to force
USB into 1.1 mode (12Mbps) but this will also slow down ethernet.

http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=53832

Joakim Thulin

unread,
Feb 15, 2015, 9:29:28 AM2/15/15
to py...@googlegroups.com
Thanks a lot, it apparantly was a USB-problem, the pi-user lost access to the USB-port. Following this guide solved the problem for me


During these desperate morning hours, I even reinstalled pywws on a brand new RPi2, just in case
Reply all
Reply to author
Forward
0 new messages