USB Device couldn't be read, Operation timed out

116 views
Skip to first unread message

caleb....@gmail.com

unread,
Jul 19, 2016, 7:07:51 PM7/19/16
to OpenXC
I have been following the Getting Started guide, but have been having difficulty getting data off my openXC device.

Using the command listed in on the webpage (http://python.openxcplatform.com/en/master/tools/diag.html) results in:


openxc-diag add --message-id 0x7df --mode 0x1 --pid 0xc --frequency 1

usage: openxc-diag [-h]

                   [--usb | --serial | --bluetooth | --network | --trace TRACE_FILE]

                   [--usb-vendor USB_VENDOR] [--usb-product USB_PRODUCT]

                   [--bluetooth-address BLUETOOTH_ADDRESS]

                   [--serial-port SERIAL_PORT] [--serial-baudrate BAUDRATE]

                   [--network-host NETWORK_HOST] [--network-port NETWORK_PORT]

                   [--log-mode {off,stderr,file}] [--format {json,protobuf}]

                   --message MESSAGE --mode MODE [--bus BUS] [--pid PID]

                   [--payload PAYLOAD] [--frequency FREQUENCY]

                   {add,cancel}

openxc-diag: error: argument --message is required


I have assumed that the command has changed between what is on the webpage and what is currently available from the pip install and updated --message-id to --message:


$ openxc-diag add --message 0x7df --mode 0x1 --pid 0xc --frequency 1 --format json

Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))

Can't read from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))

Response: []

Response: [{u'success': True, u'bus': 1, u'pid': 12, u'value': 749, u'mode': 1, u'id': 2024}, {u'success': True, u'bus': 1, u'pid': 12, u'value': 749, u'mode': 1, u'id': 2025}]


Which I'll give half credit to, not clear what the operation timeout is about, but this gets it to a point where openxc-dump partly works.


When running with the emulation firmware open-xc dump seems to work fine, but when I put the default firmware on and try using openxc-dump I consistently get errors of the form:

$ openxc-dump --format json

Can't read from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))

Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))


And very occasionally (about 5% of the time) I get a different error:


openxc-dump --format json

Can't read from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))

Exception in thread Thread-2 (most likely raised during interpreter shutdown):

Traceback (most recent call last):

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner

  File "/Library/Python/2.7/site-packages/openxc/sources/base.py", line 149, in run

  File "/Library/Python/2.7/site-packages/openxc/sources/usb.py", line 75, in read_logs

  File "/Library/Python/2.7/site-packages/openxc/sources/usb.py", line 88, in _read

<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'core'



But sometimes (about 25% of the time) some data comes through before the "Operation timed out" occurs:


$ openxc-dump --format json

{"success": true, "bus": 1, "pid": 12, "value": 711.75, "mode": 1, "timestamp": 1468968769.636329, "id": 2025}

{"success": true, "bus": 1, "pid": 12, "value": 711.25, "mode": 1, "timestamp": 1468968769.640446, "id": 2024}

Can't read logs from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))

Can't read from data source -- stopping: ("USB device couldn't be read", USBError(60, 'Operation timed out'))



Not sure where to go from here to make forward progress.



Thanks,

   Caleb

Kyle Kelly

unread,
Jul 20, 2016, 10:53:00 AM7/20/16
to OpenXC
Try

$ openxc-dump --usb --format json

and the same --usb your diagnostic command. This works for me in some situations but not always. I'm beginning to think I have some type of Python path issue...that or a hardware issue.
Reply all
Reply to author
Forward
0 new messages