readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available

1,400 views
Skip to first unread message

Per Edström

unread,
Aug 15, 2013, 5:20:35 PM8/15/13
to weewx...@googlegroups.com
I installed my WMR200 on a Raspberry Pi and it worked fine for almost 24hrs. Then this:

Aug 15 13:53:10 raspberrypi weewx[2191]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available

It is the same error message that my eBox3350 says as a result why Weewx can't start properly (although it takes some 8-10hrs before it gives up). Also, the above line is also given if I stop and then start Weewx on Raspberry Pi. A reboot will make it work again.

Faulty driver?

Chris Manton

unread,
Aug 17, 2013, 10:45:47 AM8/17/13
to weewx...@googlegroups.com
When you get that message, does weewx continue to operate properly ?

This may occur when the driver goes to read data on the USB bus from the wmr200 console but there is no data.

The timeout is 15s, and depending on the number of sensors, chattiness of sensors, etc. that there could be no data for at least 15 seconds.

I could break this particular exception out into it's own handler and suppress the logging.

C
--

Per Edström

unread,
Aug 17, 2013, 2:26:41 PM8/17/13
to weewx...@googlegroups.com
Well, I'm not sure as the Raspberry Pi, which is remotely controlled, is kind of out of order right now. I can't log on to it. At the same time that I got this error on Weewx I also hade some errors on "mmc0" indicating that the mamory card/"hdd" is faulty.
Now I only get a logon promot but after the password nothing happens, so not completely dead.

I had the same issue/error on another PC as well.

Is it just a logging thing or does it mean an actual error? I.e does weewx hang waiting for something?

William Phelps

unread,
Aug 18, 2013, 11:17:26 AM8/18/13
to weewx...@googlegroups.com
I run on a Raspberry Pi with a USB serial adapter to a Davis, and I see this error sometimes. Once it happens the Pi must be rebooted, I cannot even log in to it, this error also kills the IP interface. I have not found any way around this so far. I set up a daily cron task to reboot the Pi and that helps, but it does not prevent it completely. It looks to be an error in the Raspbian kernel USB driver.

Chris Manton

unread,
Aug 18, 2013, 11:18:21 AM8/18/13
to weewx...@googlegroups.com
I've downgraded the logging level to notice, which means it still shows up in the logs but not as a logging error.

Confusingly, it prints the USB module exception string, which includes 'Error', but it's not a real error as it simply means within a given time period no data was received.

It's totally recoverable, and I see it on my system and it's been running for just over two months straight.

I run mine on a Panda, as my experience with Raspberry Pi so far has shown it's not as reliable as the Panda.  I have a RPi and I'm doing uptime testing to make sure it doesn't disappear on me over long periods (weeks).

Chris
--

Oz Greg

unread,
Aug 18, 2013, 10:59:22 PM8/18/13
to weewx...@googlegroups.com
I remember from early this year reading about a number of issue around the USB Interface causing all sorts of PI issues..  A quick google reveals a large number of posts around this problem but I had a feeling this was fixed in the later kernels but don't quote me on this but it could be worth a search to verify...

Per Edström

unread,
Aug 28, 2013, 2:59:03 PM8/28/13
to weewx...@googlegroups.com
So this..

Aug 28 20:39:40 eBox3350 weewx[6798]: wxengine: Starting up weewx version 2.4.0
Aug 28 20:39:40 eBox3350 weewx[6798]: wxengine: Station does not support reading
Aug 28 20:39:40 eBox3350 weewx[6798]: wxengine: Starting main packet loop.
Aug 28 20:49:26 eBox3350 weewx[6798]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available
Aug 28 20:49:41 eBox3350 weewx[6798]: wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No data available

..is not really a fault but more of informative that the USB-port didn't provide any data as it was expected to? Is there any way to have more debug-info? I suspect that the USB-driver/HW is not really working. Any Linux-command to trace this?

Chris Manton

unread,
Aug 28, 2013, 4:24:15 PM8/28/13
to weewx-user
You could use the linux usb debug module if built into your kernel
usbmon

Which is what I used to develop the driver.

The actual string comes out of python libraries around the USB bus.

The interesting thing about the error message is that there are two separate failures; the "could not detach" and the "no data available".

You could delve into the pyusb code and try to figure out exactly why this message is occurring.

The bottom line is that there is a timeout on the read which may expire under normal circumstances.
            report = self.handle.interruptRead(self.in_endpoint,
                                               WMR200_USB_FRAME_SIZE,
                                               int(self.timeout_read)*1000)




--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/PHSTvEZfApQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Per Edström

unread,
Aug 28, 2013, 5:18:23 PM8/28/13
to weewx...@googlegroups.com
I unplugged my WMR200. Started usbmon and plugged in the WMR200 again. This is the result (I found some explanation here but I still don't know what is all means https://www.kernel.org/doc/Documentation/usb/usbmon.txt) :

Some USB-info first:

T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=117/900 us (13%), #Int=  1, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0001 Rev= 2.06
S:  Manufacturer=Linux 2.6.34.10-vortex86-sg ohci_hcd
S:  Product=OHCI Host Controller
S:  SerialNumber=0000:00:0b.0
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms


T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0fde ProdID=ca01 Rev= 3.02
S:  Product=Universal Bridge
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbfs
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=1ms


fo...@eBox3350.L5E:~$ sudo cat /sys/kernel/debug/usb/usbmon/3u > /home/folke/bus3data.txt
^C
fo...@eBox3350.L5E:~$ more /home/folke/bus3data.txt
df20a600 1759748480 C Ii:3:001:1 0:128 1 = 02
df20a600 1759748524 S Ii:3:001:1 -115:128 2 <
df20a600 1759748541 C Ii:3:001:1 0:128 1 = 02
df20a600 1759748544 S Ii:3:001:1 -115:128 2 <
dffa1800 1759801819 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1800 1759801831 C Ci:3:001:0 0 4 = 01030100
dffa1800 1759801837 S Co:3:001:0 s 23 01 0010 0001 0000 0
dffa1800 1759801840 C Co:3:001:0 0 0
dffa1800 1759801846 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1800 1759801850 C Ci:3:001:0 0 4 = 01030000
dffa1800 1759831845 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1800 1759831858 C Ci:3:001:0 0 4 = 01030000
dffa1800 1759861804 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1800 1759861818 C Ci:3:001:0 0 4 = 01030000
dffa1800 1759891818 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1800 1759891830 C Ci:3:001:0 0 4 = 01030000
dffa1800 1759921842 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1800 1759921855 C Ci:3:001:0 0 4 = 01030000
dffa1800 1759921887 S Co:3:001:0 s 23 03 0004 0001 0000 0
df20a600 1759932589 C Ii:3:001:1 0:128 1 = 02
df20a600 1759932605 S Ii:3:001:1 -115:128 2 <
dffa1800 1759935251 C Co:3:001:0 0 0
dffa1380 1759988526 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1380 1759988540 C Ci:3:001:0 0 4 = 03031000
dffa1380 1760041889 S Co:3:001:0 s 23 01 0014 0001 0000 0
dffa1380 1760041901 C Co:3:001:0 0 0
dffa1380 1760041947 S Ci:3:000:0 s 80 06 0100 0000 0040 64 <
dffa1380 1760043646 C Ci:3:000:0 0 18 = 12011001 00000008 de0f01ca 02030001 0001
dffa1380 1760043675 S Co:3:001:0 s 23 03 0004 0001 0000 0
dffa1380 1760055234 C Co:3:001:0 0 0
dffa1380 1760108583 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1380 1760108596 C Ci:3:001:0 0 4 = 03031000
df20a600 1760148591 C Ii:3:001:1 0:128 1 = 02
df20a600 1760148601 S Ii:3:001:1 -115:128 2 <
dffa1380 1760161951 S Co:3:001:0 s 23 01 0014 0001 0000 0
dffa1380 1760161964 C Co:3:001:0 0 0
dffa1380 1760161975 S Co:3:000:0 s 00 05 0003 0000 0000 0
dffa1380 1760162710 C Co:3:000:0 0 0
dffa1380 1760178624 S Ci:3:003:0 s 80 06 0100 0000 0012 18 <
dffa1380 1760179720 C Ci:3:003:0 0 18 = 12011001 00000008 de0f01ca 02030001 0001
dffa1380 1760179867 S Ci:3:003:0 s 80 06 0200 0000 0009 9 <
dffa1380 1760181715 C Ci:3:003:0 0 9 = 09022200 01010080 32
dffa1380 1760181738 S Ci:3:003:0 s 80 06 0200 0000 0022 34 <
dffa1380 1760184726 C Ci:3:003:0 0 34 = 09022200 01010080 32090400 00010300 0000
dffa1380 1760184787 S Ci:3:003:0 s 80 06 0300 0000 00ff 255 <
dffa1380 1760186727 C Ci:3:003:0 0 4 = 04030904
dffa1380 1760186875 S Ci:3:003:0 s 80 06 0301 0409 00ff 255 <
dffa1380 1760189726 C Ci:3:003:0 0 34 = 22035500 6e006900 76006500 72007300 6100
dffa1800 1760195217 S Co:3:003:0 s 00 09 0001 0000 0000 0
dffa1800 1760195732 C Co:3:003:0 0 0
dffa1800 1760197364 S Co:3:003:0 s 21 0a 0000 0000 0000 0
dffa1800 1760197732 C Co:3:003:0 0 0
dffa1800 1760198005 S Ci:3:003:0 s 81 06 2200 0000 0022 34 <
dffa1800 1760200738 C Ci:3:003:0 0 34 = 0600ff09 01a10109 01150026 ff007508 95088100 09021500 26ff0075 08950891
dffa1c80 1760202834 S Ci:3:003:0 s a1 01 0100 0000 0008 8 <
dffa1c80 1760203737 C Ci:3:003:0 -32 0
dffa1500 1760214688 S Ci:3:001:0 s a3 00 0000 0001 0004 4 <
dffa1500 1760216101 C Ci:3:001:0 0 4 = 03030000
dffa1800 1760327833 S Ii:3:003:1 -115:1 8 <
dffa1800 1776243733 C Ii:3:003:1 -108:1 0
def00400 1776277046 S Co:3:003:0 s 21 09 0220 0000 0008 8 = 20000801 00000000
def00400 1776278752 C Co:3:003:0 0 8 >
def00400 1777284440 S Ii:3:003:1 -115:1 8 <
def00d80 1777367031 S Co:3:003:0 s 21 09 0220 0000 0008 8 = 01d00000 00000000
def00d80 1777369321 C Co:3:003:0 0 8 >
def00d80 1777369556 S Co:3:003:0 s 21 09 0220 0000 0008 8 = 01db0000 00000000
def00400 1777372316 C Ii:3:003:1 0:1 8 = 01d10000 00000000
def00d80 1777372336 C Co:3:003:0 0 8 >
def00400 1777372470 S Ii:3:003:1 -115:1 8 <
def00400 1777511396 C Ii:3:003:1 0:1 8 = 01d20000 00000000
def00400 1777512469 S Ii:3:003:1 -115:1 8 <
def00400 1777514394 C Ii:3:003:1 0:1 8 = 01460000 00000000
def00400 1777514634 S Ii:3:003:1 -115:1 8 <
def00400 1777516394 C Ii:3:003:1 0:1 8 = 02031600 00000000
def00400 1777516629 S Ii:3:003:1 -115:1 8 <
def00400 1777518395 C Ii:3:003:1 0:1 8 = 02100100 00000000
def00400 1777518603 S Ii:3:003:1 -115:1 8 <
def00400 1777520398 C Ii:3:003:1 0:1 8 = 02070000 00000000
def00400 1777520620 S Ii:3:003:1 -115:1 8 <
def00400 1777522398 C Ii:3:003:1 0:1 8 = 02000000 00000000
def00400 1777522603 S Ii:3:003:1 -115:1 8 <
def00400 1777524402 C Ii:3:003:1 0:1 8 = 01000000 00000000
def00400 1777526388 S Ii:3:003:1 -115:1 8 <
def00400 1777527406 C Ii:3:003:1 0:1 8 = 02040000 00000000
def00400 1777527620 S Ii:3:003:1 -115:1 8 <
def00400 1777529401 C Ii:3:003:1 0:1 8 = 03460000 00000000
def00400 1777529611 S Ii:3:003:1 -115:1 8 <
def00400 1777531402 C Ii:3:003:1 0:1 8 = 020c0100 00000000
def00400 1777531618 S Ii:3:003:1 -115:1 8 <
def00400 1777533404 C Ii:3:003:1 0:1 8 = 02010700 00000000
def00400 1777533619 S Ii:3:003:1 -115:1 8 <
def00400 1777535405 C Ii:3:003:1 0:1 8 = 020d0c00 00000000
def00400 1777535611 S Ii:3:003:1 -115:1 8 <
def00400 1777537410 C Ii:3:003:1 0:1 8 = 0215a000 00000000
def00400 1777539671 S Ii:3:003:1 -115:1 8 <
def00400 1777541413 C Ii:3:003:1 0:1 8 = 0201cc00 00000000
def00400 1777541628 S Ii:3:003:1 -115:1 8 <
def00400 1777543410 C Ii:3:003:1 0:1 8 = 0401ffd5 43000000
def00400 1777543627 S Ii:3:003:1 -115:1 8 <
def00400 1777545410 C Ii:3:003:1 0:1 8 = 02d533d5 43000000
def00400 1777545616 S Ii:3:003:1 -115:1 8 <
def00400 1777547411 C Ii:3:003:1 0:1 8 = 020400d5 43000000
def00400 1777547633 S Ii:3:003:1 -115:1 8 <
def00400 1777549412 C Ii:3:003:1 0:1 8 = 01f600d5 43000000
def00400 1777549618 S Ii:3:003:1 -115:1 8 <
def00400 1777551419 C Ii:3:003:1 0:1 8 = 02001cd5 43000000
def00400 1777553052 S Ii:3:003:1 -115:1 8 <
:
:
dffa1d80 1956882026 C Ii:3:003:1 0:1 8 = 02010102 00000000
dffa1d80 1956882257 S Ii:3:003:1 -115:1 8 <
dffa1800 1958214746 S Co:3:003:0 s 21 09 0220 0000 0008 8 = 01d00000 00000000
dffa1800 1958216782 C Co:3:003:0 0 8 >
dffa1800 1958217010 S Co:3:003:0 s 21 09 0220 0000 0008 8 = 01db0000 00000000
dffa1d80 1958219780 C Ii:3:003:1 0:1 8 = 01d10102 00000000
dffa1800 1958219797 C Co:3:003:0 0 8 >
dffa1d80 1958220272 S Ii:3:003:1 -115:1 8 <
dffa1d80 1958222778 C Ii:3:003:1 0:1 8 = 01db0102 00000000
:
:
..and so on..


Chris Manton

unread,
Aug 28, 2013, 7:48:00 PM8/28/13
to weewx-user
Hi,

I'm not sure what the end goal of this effort is.  If the USB device, the weather console, as no data ready to transfer, then it's certainly possible for the weewx driver to timeout.

The hard part is picking a timeout value that will work best for all possible installations.

Since the weather console reverts from live to logging mode on a 30s timeout, 30/2 == 15s was picked.

Weewx (and the wmr200 driver) will continue to operate indefinitely providing live data with the "no data available" logging message.

A newer driver handles this specific case by filtering the python usb exception string.

C
--



2013/8/28 Per Edström <peredst...@gmail.com>

Per Edström

unread,
Aug 30, 2013, 4:38:10 AM8/30/13
to weewx...@googlegroups.com
If "No data available" just means a timeout and that the program is not failing or stopping, then it's no worries. But when I get this I don't get the weewx to start up properly.

After I started the weewx yesterday it didn't go past the "starting main loop" and after a few hours I got:

wmr200: readDevice() USB Error Reason:could not detach kernel driver from interface 0: No such device

I don't think I've seen that one before.

Chris Manton

unread,
Aug 30, 2013, 12:24:08 PM8/30/13
to weewx-user
Do you have logs for this run ?

The problem is no data from the device within a given time period may or may not be a failure.  There is no differentiation between no data because no fresh data is available from any sensors or a more serious error occurred.

The sign of a mature driver, which this is not, is the ability to gracefully recover from a variety of failing conditions.

C
--



--
Reply all
Reply to author
Forward
0 new messages