Some value errors when running garminsync.py

Bug #154081 reported by marbud
2
Affects Status Importance Assigned to Milestone
garmin-sync
Fix Released
Undecided
Unassigned

Bug Description

When i try the GarminSync software out i get:

marbud@pest:~/Desktop/garmin-sync-0.2$ PYTHONPATH=/usr/share/python-support/python-elementtree:/usr/share/python-support/python-pyusb:/usr/share/pycentral/python-serial/site-packages/ sudo ./garminsync.py
Traceback (most recent call last):
  File "./garminsync.py", line 367, in <module>
    exit_value = garmin_sync.run()
  File "./garminsync.py", line 359, in run
    link = garmin.USBLink()
  File "/home/marbud/Desktop/garmin-sync-0.2/garmin.py", line 1627, in __init__
    packet = ''.join(chr(b) for b in packet)
  File "/home/marbud/Desktop/garmin-sync-0.2/garmin.py", line 1627, in <genexpr>
    packet = ''.join(chr(b) for b in packet)
ValueError: chr() arg not in range(256)

Probably something with my setup, but i just can't figure it out.. If i print out the "packet" contents before the join(chr(b) for b in backet) line, i get negative numers in the end...

Revision history for this message
marbud (marbud) wrote :

System: Ubuntu 7.10.
Device: Forerunner 305.

Revision history for this message
marbud (marbud) wrote :

I added some debug output.. I uploaded the changes.

Now i get the following output:

marbud@pest:~/Desktop/garmin-sync-0.2$ sudo python2.4 ./garminsync.py
sent ['\x00', '\x00', '\x00', '\x00', '\x05', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00']
sent ['\x00', '\x00', '\x00', '\x00', '\x10', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00']
read 0,0,0,0,6,0,0,0,4,0,0,0,24,-25,-f,-3b
Traceback (most recent call last):
  File "./garminsync.py", line 367, in ?
    exit_value = garmin_sync.run()
  File "./garminsync.py", line 359, in run
    link = garmin.USBLink()
  File "/home/marbud/Desktop/garmin-sync-0.2/garmin.py", line 1630, in __init__
    packet = ''.join(chr(b) for b in packet)
  File "/home/marbud/Desktop/garmin-sync-0.2/garmin.py", line 1630, in <generator expression>
    packet = ''.join(chr(b) for b in packet)
ValueError: chr() arg not in range(256)

Revision history for this message
Björn Tillenius (bjornt) wrote :

Sorry for taking so long to fix this. I've now released 0.3, which should fix this problem. If you have any other problems, please file a new bug, providing the output of './garmin-sync -d usb.packet'.

Changed in garmin-sync:
status: New → Fix Released
Revision history for this message
marbud (marbud) wrote :

Thanks!

Now my Forerunner305 syncs with only some minor warnings.

I thought the output might be of interest for you so here is the warnings:

marbud@pest:~/Desktop/garmin-sync-0.3$ sudo ./garmin-sync
/home/marbud/Desktop/garmin-sync-0.3/newstruct.py:40: DeprecationWarning: struct integer overflow masking is deprecated
  return apply(struct.pack, tuple(args))
/home/marbud/Desktop/garmin-sync-0.3/newstruct.py:40: DeprecationWarning: 'B' format requires 0 <= number <= 255
  return apply(struct.pack, tuple(args))

After that, it works just fine.

Regards
Martin Budsjö

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.