Skip to content
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

Firmware update script py3 conversion #152

Draft
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

JanezCim
Copy link
Contributor

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 JanezCim changed the title Innitial firmware file py3 conversion Firmware update script py3 conversion Sep 15, 2021
@mjstn
Copy link
Contributor

mjstn commented Sep 16, 2021

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

@JanezCim
Copy link
Contributor Author

JanezCim commented Sep 17, 2021

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
Copy link
Contributor Author

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
Copy link
Contributor Author

JanezCim commented Mar 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants