bewest / insulaudit

hacking diabetes: open source driver to audit medical devices
https://github.com/bewest/insulaudit
MIT License
57 stars 12 forks source link

Having trouble when using a USB hub. #6

Closed bustavo closed 10 years ago

bustavo commented 10 years ago

I have successfully ran decoding_carelink connecting the Carelink USB directly on the Beaglebone Black USB port.

Since I want to add Wifi connectivity to the device, I added a USB Hub where I am connecting the WIFI dongle & the Carelink.

I have successfully connected to WIFI ( proving that the hub is okay with the Beaglebone? ) but the Carelink seems to stop working.

I've tried on 2 different hubs with the same result but wanted to see if someone knew something about it before going looking for a different USB Hub.

Hub 1: Steren 4 port mini USB HUB

Hub 2: iConcepts 75053 USB HUB

I run: dmesg | grep ttyUSB ./insert.sh python decocare/stick.py /dev/ttyUSB0

I get the following output:

INFO:main:howdy! I'm going to take a look at your carelink usb stick. INFO:link:Link opened serial port: Serial(port='/dev/ttyUSB0', baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=0.5, xonxoff=False, rtscts=False, dsrdtr=False) INFO:main:PROCESS:OPEN:0.181 INFO:main:PROCESS:START:2.266:ProductInfo:0x04 INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] processing ProductInfo:0x04) INFO:main:send_force_read: attempt 0/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 1/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 2/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 3/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 4/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

CRITICAL:main:FAILED TO DOWNLOAD ANYTHING, after 4 expected:64 INFO:main:process zero length READ, try once more sleep .010 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

ERROR:main:ACK is zero bytes! INFO:main:failed:(0): ACK is 0 bytes:

INFO:main:PROCESS:OPEN:7022.939 INFO:main:PROCESS:START:7027.636:ProductInfo:0x04 INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] processing ProductInfo:0x04) INFO:main:send_force_read: attempt 0/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 1/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 2/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 3/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 4/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

CRITICAL:main:FAILED TO DOWNLOAD ANYTHING, after 4 expected:64 INFO:main:process zero length READ, try once more sleep .010 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

ERROR:main:ACK is zero bytes! INFO:main:failed:(1): ACK is 0 bytes:

INFO:main:PROCESS:OPEN:14049.786 INFO:main:PROCESS:START:14054.395:ProductInfo:0x04 INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] processing ProductInfo:0x04) INFO:main:send_force_read: attempt 0/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 1/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 2/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 3/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 4/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

CRITICAL:main:FAILED TO DOWNLOAD ANYTHING, after 4 expected:64 INFO:main:process zero length READ, try once more sleep .010 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

ERROR:main:ACK is zero bytes! INFO:main:failed:(2): ACK is 0 bytes:

INFO:main:test fetching product info Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] INFO:main:PROCESS:START:21080.874:ProductInfo:0x04 INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] processing ProductInfo:0x04) INFO:main:send_force_read: attempt 0/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 1/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 2/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 3/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:send_force_read: attempt 4/5 send command, read until we get something within some timeout INFO:main:link Stick transmit[None] reader[None] download_i[False] status[None] poll_size[None] poll_i[None] command[ProductInfo:0x04:size(64)] sending ProductInfo:0x04) INFO:root:usb.write.len: 3 0000 0x04 0x00 0x00 ... DEBUG:main:sleeping 0.001 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

INFO:main:zero length READ, try once more sleep .250 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

CRITICAL:main:FAILED TO DOWNLOAD ANYTHING, after 4 expected:64 INFO:main:process zero length READ, try once more sleep .010 INFO:root:usb.read.len: 0 INFO:root:usb.read.raw:

ERROR:main:ACK is zero bytes! Traceback (most recent call last): File "stick.py", line 886, in log.info(pformat(stick.product_info( ))) File "stick.py", line 508, in product_info return self.query(ProductInfo) File "stick.py", line 502, in query return self.process( ) File "stick.py", line 489, in process ack, response = self.command.respond(raw) File "stick.py", line 65, in respond raise AckError("ACK is 0 bytes:\n%s" % lib.hexdump(raw)) errors.AckError: ACK is 0 bytes:

bustavo commented 10 years ago

Update. I went and bought a different USB hub and got it working! ( ATIVA 3 port hub ) http://www.officedepot.com/a/products/545553/Office-Depot-Brand-3-Port-USB/

I looked for one that had the least amount of ports / no LEDs / 5v - 500mA output

So it seems that not all USB hubs work correctly for the Beaglebone. I think it confirms my hypothesis that it has something to do with power output capabilities.