-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caught error while communicating with device #11
Comments
Can you run again with '--verbose' command line arg and reply with output?
|
Yes, fails everytime. I just tried with my desktop (also Ubuntu 12.04) and it seemed to work just fine. Here's the verbose log: |
Here's the verbose log: sudo ant-downloader --verbose |
hmm, I did manage to get it say something along the lines of "Connected by no data to retrieve", but that too was ended by an exception and " ValueError: need more than 1 value to unpack". Unfortunately I don't have the log for that as the buffer was set too low. |
And now I managed to get "Device has data".. but it still fails. sudo ant-downloader --verbose |
An IOError is being raised, but it contains only one value, not two. If you want to continue to debug this issue further, get the "ioerror" then run ./python-ant-downloader.py And report back with whatever exception you get. FYI, someone else just mentions that in newer versions of udev the Regards, |
Thanks for the udev advice! |
Here I'm running the ioerror-branch a number of times: am@janne-ThinkPad-X61s: |
Hey, I'd love to help debug further (looks like maybe I have a totally different issue) (running Ubuntu 12.04, just plugged the ANT+ USB stick in, nothing else is using it)... $ git checkout ioerror
$ ./ant-downloader.py I get the following:
Update
|
Root cause is probably: Found device with vid(0x0fcf) pid(0x1008), but interface already claimed. This means some other software has claimed exclusive access to the USB If you were previously a user of "gant", it required to do something like Assuming above doesn't work. What kernel are you running? Stock ubuntu, or Regards, On Sun, Jan 6, 2013 at 5:49 PM, Jonathan Zacsh [email protected]:
|
Ah, yes the udev rule was my problem. Thanks. (Note: I have a Garmin 405) With "Force send" (in Settings > ANT+ > computer) set to "off", I got:
note: that setting seems to turn it self off every time I the watch goes to sleep With Force Send turned back on, it works! Full output here: https://gist.github.com/4471080 |
Sounds like all is working well then. The watch will normally only transmit runs that have never been sent to the Sorry about the exception/error at the end of program (its harmless), i was Regards, On Sun, Jan 6, 2013 at 6:41 PM, Jonathan Zacsh [email protected]:
|
Actually this particular branch and this particular attempt was the only one I got to work. I tried this because the master branch was failing to work for me (comments in other bugs). I'm happy to debug that exception for you and help you finish up this branch, if you like. Is that the purpose of this branch? To fix that particular exception? |
Sorry for very slow reply. I've tried to cleanup the fix and merge to master. If someone wants to confirm that this is fixed in lastest master I can close this issue. I'm trying to close out bugs and push a new stable version to pypi. Basically issues here is: when pyusb raise an IOError it always provides an errno and message. I need to unpack these values from the IOError to know if the error was raised simply due to a timeout. But, on some hardware/software IOError is not un-packable. (I've never been able to create issue on any hardware I have access to.) I've just updated code to assume that an unpackable IOError is a timeout. This should probably fix the issue, but I can't test. Its a less than perfect solution since there's a chance of the code getting stuck in a loop. |
Hey braiden, not sure if this is related to this particular bug, so feel free to just put this in another issue: |
Moved to #44. If you're still having issues you can reply there: If you've never paired the watch with the software, the watch needs to be awake. Press a button on the watch to make sure its not sleeping, and run my program again. Once you start downloading the watch should beep and ask you to confirm connection. Once paring is complete, you don't need to wake watch anymore. |
Trying to connect to my 405cx with Ubuntu 12.04. Installed the packages as described in the installation procedure, packets gotten from Ubuntu-repo. python-ant-downloader from branch.
I had worse luck before connecting my 405cx to windows and upgrading the software (as well as setting the correct time) (batteries been dead for ages).
This the log I get now (ran with 'sudo ant-downloader' as there seems to be a permission issue with the udev-way):
[MainThread] 2012-03-18 19:10:25,335 DEBUG Executing Command. RESET_SYSTEM()
[Thread-1] 2012-03-18 19:10:25,340 DEBUG Processing reply. STARTUP_MESSAGE(startup_message=0)
[MainThread] 2012-03-18 19:10:25,342 DEBUG Executing Command. REQUEST_MESSAGE(channel_number=0, msg_id=84)
[Thread-1] 2012-03-18 19:10:25,344 DEBUG Processing reply. CAPABILITIES(max_channels=8, max_networks=3, standard_opts=0, advanced_opts1=186, advanced_opts2=54)
[MainThread] 2012-03-18 19:10:25,346 DEBUG Executing Command. REQUEST_MESSAGE(channel_number=0, msg_id=62)
[Thread-1] 2012-03-18 19:10:25,349 DEBUG Processing reply. VERSION(ant_version='AJK1.04RAF\x00')
[MainThread] 2012-03-18 19:10:25,352 DEBUG Executing Command. REQUEST_MESSAGE(channel_number=0, msg_id=97)
[Thread-1] 2012-03-18 19:10:25,354 DEBUG Processing reply. SERIAL_NUMBER(serial_number=1502931)
[MainThread] 2012-03-18 19:10:25,356 DEBUG Device Capabilities: CAPABILITIES(max_channels=8, max_networks=3, standard_opts=0, advanced_opts1=186, advanced_opts2=54)
[MainThread] 2012-03-18 19:10:25,356 DEBUG Device ANT Version: VERSION(ant_version='AJK1.04RAF\x00')
[MainThread] 2012-03-18 19:10:25,356 DEBUG Device SN#: SERIAL_NUMBER(serial_number=1502931)
[MainThread] 2012-03-18 19:10:25,357 INFO Searching for ANT devices.
[MainThread] 2012-03-18 19:10:25,357 DEBUG Executing Command. RESET_SYSTEM()
[Thread-1] 2012-03-18 19:10:25,359 DEBUG Processing reply. STARTUP_MESSAGE(startup_message=32)
[MainThread] 2012-03-18 19:10:25,362 DEBUG Executing Command. SET_NETWORK_KEY(network_number=0, network_key='\xa8\xa4#\xb9\xf5^c\xc1')
[Thread-1] 2012-03-18 19:10:25,364 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=70, msg_code=0)
[MainThread] 2012-03-18 19:10:25,367 DEBUG Executing Command. ASSIGN_CHANNEL(channel_number=0, channel_type=0, network_number=0)
[Thread-1] 2012-03-18 19:10:25,369 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=66, msg_code=0)
[MainThread] 2012-03-18 19:10:25,372 DEBUG Executing Command. SET_CHANNEL_ID(channel_number=0, device_number=0, device_type_id=0, trans_type=0)
[Thread-1] 2012-03-18 19:10:25,374 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=81, msg_code=0)
[MainThread] 2012-03-18 19:10:25,377 DEBUG Executing Command. SET_CHANNEL_PERIOD(channel_number=0, messaging_period=4096)
[Thread-1] 2012-03-18 19:10:25,379 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=67, msg_code=0)
[MainThread] 2012-03-18 19:10:25,381 DEBUG Executing Command. SET_CHANNEL_SEARCH_TIMEOUT(channel_number=0, search_timeout=255)
[Thread-1] 2012-03-18 19:10:25,383 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=68, msg_code=0)
[MainThread] 2012-03-18 19:10:25,387 DEBUG Executing Command. SET_CHANNEL_RF_FREQ(channel_number=0, rf_freq=50)
[Thread-1] 2012-03-18 19:10:25,389 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=69, msg_code=0)
[MainThread] 2012-03-18 19:10:25,393 DEBUG Executing Command. SET_SEARCH_WAVEFORM(channel_number=0, waveform=83)
[Thread-1] 2012-03-18 19:10:25,395 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=73, msg_code=0)
[MainThread] 2012-03-18 19:10:25,399 DEBUG Executing Command. OPEN_CHANNEL(channel_number=0)
[Thread-1] 2012-03-18 19:10:25,401 DEBUG Processing reply. CHANNEL_EVENT(channel_number=0, msg_id=75, msg_code=0)
[MainThread] 2012-03-18 19:10:25,407 DEBUG Executing Command. ReadData(channel_number=0)
[Thread-1] 2012-03-18 19:10:25,409 DEBUG Processing reply. CHANNEL_STATUS(channel_number=0, channel_status=2)
[Thread-1] 2012-03-18 19:10:25,914 ERROR Caught Exception handling message, session closing.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 777, in loop
for cmd in self.core.recv():
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 505, in recv
except IOError as (err, msg):
ValueError: need more than 1 value to unpack
[MainThread] 2012-03-18 19:10:26,409 WARNING Caught error while communicating with device, will retry.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/main.py", line 83, in downloader
include_devices_with_no_data=args.force or not args.daemon)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 277, in search
beacon = Beacon.unpack(self.channel.recv_broadcast(timeout=timeout - time.time()))
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 862, in recv_broadcast
return self._session._send(ReadData(self.channel_number, RecvBroadcastData), timeout=timeout).data
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 648, in _send
raise AntError("Session closed.")
AntError: Session closed.
[MainThread] 2012-03-18 19:10:26,410 INFO Searching for ANT devices.
[MainThread] 2012-03-18 19:10:26,411 DEBUG Executing Command. RESET_SYSTEM()
[MainThread] 2012-03-18 19:10:26,411 WARNING Caught error while communicating with device, will retry.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/main.py", line 83, in downloader
include_devices_with_no_data=args.force or not args.daemon)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 275, in search
self._open_antfs_search_channel()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 411, in _open_antfs_search_channel
self.ant_session.reset_system()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 566, in reset_system
self._send(ResetSystem(), timeout=.5, retry=5)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 648, in _send
raise AntError("Session closed.")
AntError: Session closed.
[MainThread] 2012-03-18 19:10:26,411 INFO Searching for ANT devices.
[MainThread] 2012-03-18 19:10:26,412 DEBUG Executing Command. RESET_SYSTEM()
[MainThread] 2012-03-18 19:10:26,412 WARNING Caught error while communicating with device, will retry.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/main.py", line 83, in downloader
include_devices_with_no_data=args.force or not args.daemon)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 275, in search
self._open_antfs_search_channel()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 411, in _open_antfs_search_channel
self.ant_session.reset_system()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 566, in reset_system
self._send(ResetSystem(), timeout=.5, retry=5)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 648, in _send
raise AntError("Session closed.")
AntError: Session closed.
[MainThread] 2012-03-18 19:10:26,413 INFO Searching for ANT devices.
[MainThread] 2012-03-18 19:10:26,413 DEBUG Executing Command. RESET_SYSTEM()
[MainThread] 2012-03-18 19:10:26,413 WARNING Caught error while communicating with device, will retry.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/main.py", line 83, in downloader
include_devices_with_no_data=args.force or not args.daemon)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 275, in search
self._open_antfs_search_channel()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 411, in _open_antfs_search_channel
self.ant_session.reset_system()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 566, in reset_system
self._send(ResetSystem(), timeout=.5, retry=5)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 648, in _send
raise AntError("Session closed.")
AntError: Session closed.
[MainThread] 2012-03-18 19:10:26,417 DEBUG Executing Command. RESET_SYSTEM()
[MainThread] 2012-03-18 19:10:26,417 WARNING Failed to cleanup resources on exist.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/main.py", line 115, in downloader
try: host.close()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/antfs.py", line 241, in close
self.ant_session.close()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 554, in close
self.reset_system()
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 566, in reset_system
self._send(ResetSystem(), timeout=.5, retry=5)
File "/usr/local/lib/python2.7/dist-packages/python_ant_downloader-12.03.25-py2.7.egg/antd/ant.py", line 648, in _send
raise AntError("Session closed.")
AntError: Session closed.
The text was updated successfully, but these errors were encountered: