ubiquity_motor icon indicating copy to clipboard operation
ubiquity_motor copied to clipboard

Firmware update script py3 conversion

Open JanezCim opened this issue 3 years ago • 4 comments

Trying to solve #149

I added .encode() because i was experiencing:

raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
TypeError: unicode strings are not supported, please encode to bytes: "b'

But then I added Int() because:

  File "/home/ubuntu/catkin_ws/src/ubiquity_motor/scripts/upgrade_firmware.py", line 233, in send
    chr((len(self.out) / 1) % 256),
TypeError: integer argument expected, got float

And now im getting:

  File "/home/ubuntu/catkin_ws/src/ubiquity_motor/scripts/upgrade_firmware.py", line 261, in send
    raise Exception("Packet did not start with valid start byte, instead: " + cstr(start_byte) + " -- header: " + cstr(header))
Exception: Packet did not start with valid start byte, instead: <class 'bytes'> -> b'~' -- header: <class 'bytes'> -> b'~<0\x00'
 

and I cant solve it. Do you have any ideas how to go around this @rohbotics? I maybe going at it from a totally wrong angle?

JanezCim avatar Sep 15 '21 12:09 JanezCim

Rohan has been converting the firmware upgrade script for a few weeks now. This is a duplicate issue of some other issue.

mjstn avatar Sep 16 '21 20:09 mjstn

yes you mean #149 , but this is a draft PR, not an issue, here im trying to colaborate with rohan to actually solve it. And as far as I could see there was no branch to this goal. I got myself into this because im working on OTA update for Noetic and this script first needs to work in order for that to work.

JanezCim avatar Sep 17 '21 06:09 JanezCim

just FYI on ota_update this has been kindof patched here https://github.com/UbiquityRobotics/ota_update/pull/13 by simply installing python2 onto the same system. This is a very bad solution long term, but for now it works. When Firmware update script gets updated to py3, this should immediately be fixed also on ota_update repo

JanezCim avatar Dec 23 '21 12:12 JanezCim

This py2 hack is now also planned on being used in firmware images in https://github.com/UbiquityRobotics/pi_image2 so when py3 conversion is done, someone should also check to update the commands there

JanezCim avatar Mar 03 '22 09:03 JanezCim