Issues with firmware/protocol after updating the OS to Ubuntu 20.04

Hi

We recently upgraded our Stretch RE1 to Ubuntu 20.04 following the instructions on: stretch_install/robot_install.md at master · hello-robot/stretch_install · GitHub

After performing REx_firmware_updater.py --install I got the following error message:

-------- FIRMWARE FLASH hello-motor-lift | Stepper.v0.2.5p1 ------------
Resetting hello-motor-lift
Looking for device hello-motor-lift on bus
Waiting for device hello-motor-lift to return to bus.
Starting programming. This will take about 5s…
Success in firmware compile
Success in firmware flash.
ls parse: Failed to match all devices for StretchSerialInfo
{‘hello-motor-lift’: {‘device’: None, ‘info’: None, ‘core’: None}}
usb.core parse: Failed to match all devices for StretchSerialInfo
Waiting for device hello-motor-lift to return to bus.
…Failure for device hello-motor-lift to return to USB bus after upload

The lift is not moving, during calibration after finishing all the steps.

I would really appreciate help in resolving this issue. Thanks a lot!

Also after completing all the installation steps mentioned at stretch_install/robot_install.md at master · hello-robot/stretch_install · GitHub and running stretch_robot_home.py, I am getting the following error:

For use with S T R E T C H (R) RESEARCH EDITION from Hello Robot Inc.

[WARNING] [head_tilt]: Dynamixel head_tilt: Servo is in single-turn mode yet has invalid homing offset of -1672.
This may cause unexpected results if not set to zero (using REx_dynamixel_jog.py)
Please contact Hello Robot support for more information
--------- Homing Head ----
--------- Homing Lift ----
Homing Lift…
Hardstop detected at motor position (rad) 115.19573974609375
Marking Lift position to 1.100038 (m)
Marking Lift position to 0.000000 (m)
Lift homing successful
--------- Homing Arm ----
Homing Arm…
Hardstop detected at motor position (rad) -0.005061604082584381
Marking Arm position to 0.000000 (m)
Arm homing successful
Moving to first hardstop…
First hardstop contact at position (ticks): 681

Homing offset was 1391
Marking current position to zero ticks
Homing offset is now 709 (ticks)

Current position (ticks): 9
Moving to calibrated zero: (rad)
Moving to first hardstop…
First hardstop contact at position (ticks): -3

Homing offset was 6322
Marking current position to zero ticks
Homing offset is now 6319 (ticks)

Current position (ticks): 45
Moving to calibrated zero: (rad)
Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/lib/python3.8/threading.py”, line 932, in _bootstrap_inner
self.run()
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/robot.py”, line 86, in run
self.robot._step_sentry()
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/robot.py”, line 379, in _step_sentry
self.end_of_arm.step_sentry(self)
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/dynamixel_X_chain.py”, line 248, in step_sentry
self.motors[k].step_sentry(robot)
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_tool_share/stretch_dex_wrist/wrist_pitch.py”, line 34, in step_sentry
DynamixelHelloXL430.step_sentry(self,robot)
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/dynamixel_hello_XL430.py”, line 379, in step_sentry
self.stop_trajectory()
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/dynamixel_hello_XL430.py”, line 639, in stop_trajectory
if self.params[‘motion’][‘trajectory_vel_ctrl’]:
KeyError: ‘trajectory_vel_ctrl’
Traceback (most recent call last):
File “/home/hello-robot/.local/bin/stretch_robot_home.py”, line 17, in
r.stop()
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/robot.py”, line 196, in stop
self.devices[k].stop()
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/prismatic_joint.py”, line 42, in stop
self.motor.stop_waypoint_trajectory()
File “/home/hello-robot/.local/lib/python3.8/site-packages/stretch_body/stepper.py”, line 585, in stop_waypoint_trajectory
raise NotImplementedError(‘This method not supported for firmware on protocol {0}.’
NotImplementedError: This method not supported for firmware on protocol p1.

Thought this maybe useful.

Hi @Anant_Rai, we have recently discovered an issue with the REx_firmware_updater.py on Ubuntu 20.04, and that issue is what has impacted you here. We’re actively investigating this issue, but until then, I recommend booting back into Ubuntu 18.04 if you decided to dual boot and use the older RE1_firmware_updater.py tool to reflash the firmware. Everything will then work again in 20.04. If your 18.04 OS is no longer accessible, let me know and I’ll find another short term solution.

Hi @bshah , thanks for your response. Can you clarify more on what you mean by using ‘older RE1_firmware_updater.py tool to reflash firmware’. Do you mean to run REx_firmware_updater.py --install with firmware updater present in Ubuntu 18.04? I did dual boot so I think I can do that.

Yes @Anant_Rai, that’s correct. The firmware updater tool was renamed in its latest release, so instead of REx_firmware_updater.py, it may be RE1_firmware_updater.py.

So I tried running RE1_firmware_updater.py --install on the older Ubuntu 18.04, and found out that --install is not a recognized argument. I then tried running RE1_firmware_updater.py --update instead and that gives some error and warning messages at start and a final message of System is up to date. No updates to be done.

Am I doing something incorrectly? I wasn’t able to find any documents online mentioning how to update/ reflash the firmware using the RE1_firmware_updater.py command.

EDIT:
Correction-
Changed RE1_migrate_params.py to RE1_firmware_updater.py

Full message I get after running RE1_firmware_updater.py --update :

Message

[ERROR] [wacc]: Port /dev/hello-wacc is busy. Check if another Stretch Body process is already running
[WARNING] [wacc]: Unable to open serial port for device /dev/hello-wacc
[ERROR] [wacc]: Port /dev/hello-wacc is busy. Check if another Stretch Body process is already running
[WARNING] [wacc]: Unable to open serial port for device /dev/hello-wacc
[ERROR] [hello-motor-lift]: Port /dev/hello-motor-lift is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-lift]: Unable to open serial port for device /dev/hello-motor-lift
[ERROR] [hello-motor-lift]: Port /dev/hello-motor-lift is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-lift]: Unable to open serial port for device /dev/hello-motor-lift
[ERROR] [pimu]: Port /dev/hello-pimu is busy. Check if another Stretch Body process is already running
[WARNING] [pimu]: Unable to open serial port for device /dev/hello-pimu
[ERROR] [pimu]: Port /dev/hello-pimu is busy. Check if another Stretch Body process is already running
[WARNING] [pimu]: Unable to open serial port for device /dev/hello-pimu
[ERROR] [hello-motor-arm]: Port /dev/hello-motor-arm is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-arm]: Unable to open serial port for device /dev/hello-motor-arm
[ERROR] [hello-motor-arm]: Port /dev/hello-motor-arm is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-arm]: Unable to open serial port for device /dev/hello-motor-arm
[ERROR] [hello-motor-left-wheel]: Port /dev/hello-motor-left-wheel is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-left-wheel]: Unable to open serial port for device /dev/hello-motor-left-wheel
[ERROR] [hello-motor-left-wheel]: Port /dev/hello-motor-left-wheel is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-left-wheel]: Unable to open serial port for device /dev/hello-motor-left-wheel
[ERROR] [hello-motor-right-wheel]: Port /dev/hello-motor-right-wheel is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-right-wheel]: Unable to open serial port for device /dev/hello-motor-right-wheel
[ERROR] [hello-motor-right-wheel]: Port /dev/hello-motor-right-wheel is busy. Check if another Stretch Body process is already running
[WARNING] [hello-motor-right-wheel]: Unable to open serial port for device /dev/hello-motor-right-wheel
Cloning latest version of Stretch Firmware to /tmp/stretch_firmware_update_20220926141034
############## Currently Installed Configuration ##############
------------ HELLO-WACC ------------
Device not found
------------ HELLO-MOTOR-LIFT ------------
Device not found
------------ HELLO-PIMU ------------
Device not found
------------ HELLO-MOTOR-ARM ------------
Device not found
------------ HELLO-MOTOR-LEFT-WHEEL ------------
Device not found
------------ HELLO-MOTOR-RIGHT-WHEEL ------------
Device not found

######### Currently Available Versions of Stretch Firmware on GitHub ##########
---- HELLO-WACC ----
Wacc.v0.0.1p0
Wacc.v0.1.0p1
Wacc.v0.2.0p1
Wacc.v0.2.1p1
Wacc.v0.2.2p1
---- HELLO-MOTOR-LIFT ----
Stepper.v0.0.1p0
Stepper.v0.0.2p0
Stepper.v0.0.3p0
Stepper.v0.0.4p0
Stepper.v0.1.0p1
Stepper.v0.2.0p1
Stepper.v0.2.1p1
Stepper.v0.2.2p1
Stepper.v0.2.3p1
Stepper.v0.2.4p1
Stepper.v0.2.5p1
---- HELLO-PIMU ----
Pimu.v0.0.1p0
Pimu.v0.1.0p1
Pimu.v0.2.0p1
Pimu.v0.2.1p1
Pimu.v0.2.2p1
Pimu.v0.2.3p1
Pimu.v0.2.4p1
---- HELLO-MOTOR-ARM ----
Stepper.v0.0.1p0
Stepper.v0.0.2p0
Stepper.v0.0.3p0
Stepper.v0.0.4p0
Stepper.v0.1.0p1
Stepper.v0.2.0p1
Stepper.v0.2.1p1
Stepper.v0.2.2p1
Stepper.v0.2.3p1
Stepper.v0.2.4p1
Stepper.v0.2.5p1
---- HELLO-MOTOR-LEFT-WHEEL ----
Stepper.v0.0.1p0
Stepper.v0.0.2p0
Stepper.v0.0.3p0
Stepper.v0.0.4p0
Stepper.v0.1.0p1
Stepper.v0.2.0p1
Stepper.v0.2.1p1
Stepper.v0.2.2p1
Stepper.v0.2.3p1
Stepper.v0.2.4p1
Stepper.v0.2.5p1
---- HELLO-MOTOR-RIGHT-WHEEL ----
Stepper.v0.0.1p0
Stepper.v0.0.2p0
Stepper.v0.0.3p0
Stepper.v0.0.4p0
Stepper.v0.1.0p1
Stepper.v0.2.0p1
Stepper.v0.2.1p1
Stepper.v0.2.2p1
Stepper.v0.2.3p1
Stepper.v0.2.4p1
Stepper.v0.2.5p1

############## Recommended Firmware Updates ##############
HELLO-WACC | No device available
HELLO-MOTOR-LIFT | No device available
HELLO-PIMU | No device available
HELLO-MOTOR-ARM | No device available
HELLO-MOTOR-LEFT-WHEEL | No device available
HELLO-MOTOR-RIGHT-WHEEL | No device available

############## Targeted Firmware Updates ##############
HELLO-WACC | No target available
HELLO-MOTOR-LEFT-WHEEL | No target available
HELLO-MOTOR-RIGHT-WHEEL | No target available
HELLO-MOTOR-LIFT | No target available
HELLO-PIMU | No target available
HELLO-MOTOR-ARM | No target available
System is up to date. No updates to be done

Hi @Anant_Rai, you shouldn’t need to run the RE1_migrate_params.py tool at all. The REx/1_firmware_updater.py tool is the only tool you’ll need to run on Ubuntu 18.04 to reflash the firmware. If the --install flag is not available with the firmware updater tool, we will need to upgrade to a newer version of the tool. On Ubuntu 18.04, you may use the following command to upgrade the package the tool is included in:

python -m pip install -U hello-robot-stretch-factory

I also recommend confirming that xbox teleop is not running in the background before reflashing the firmware. The steps to do so are available here.

With the latest version, the tool is called REx_firmware_updater.py, so the command to reflash the firmware is:

REx_firmware_updater.py --install

Sorry, my bad. I meant RE1_firmware_updater.py instead of RE1_migrate_params.py. Edited the post to correct that. Thanks for explanation. I will try the above steps.

1 Like

So I first ran python -m pip install -U hello-robot-stretch-factory and then did REx_firmware_updater.py --install (I also stopped xbox teleop before doing this). I got the following message:

Please run tool RE1_migrate_params.py before continuing. For more details, see forum[dot]hello-robot[dot]com/t/425

As suggested, I first ran RE1_migrate_params.py :

output

############## Migrating stretch-re1-1039 ###############
Checking parameters at: /home/hello-robot/stretch_user/stretch-re1-1039

Migration is required for robot stretch-re1-1039. Proceed? [y/N]: y
Migration complete. Starting validation…
Warning. Parameter base.contact_thresh_N dropped
Warning. Parameter base.contact_thresh_max_N dropped
Warning. Parameter robot.log_to_console dropped
Warning. Value change in hello-motor-lift.gains.pos_near_setpoint_d from 0.5 to 6.0
Warning. Value change in wrist_yaw.motion.slow.vel from 1.0 to 0.75
Warning. Value change in wrist_yaw.motion.slow.accel from 4.0 to 1.5
Warning. Value change in wrist_yaw.motion.default.vel from 3.0 to 2.0
Warning. Value change in wrist_yaw.motion.default.accel from 8.0 to 3.0
Warning. Value change in wrist_yaw.motion.max.vel from 8 to 6.0
Warning. Value change in wrist_yaw.motion.max.accel from 12 to 10
Warning. Value change in wrist_yaw.motion.fast.vel from 5.0 to 2.5
Warning. Value change in wrist_yaw.motion.fast.accel from 10.0 to 5.0
Warning. Value change in wrist_yaw.motion.trajectory_max.accel_r from 16.0 to 3.0
Warning. Value change in wrist_yaw.motion.trajectory_max.vel_r from 8.0 to 3.0
Warning. Value change in hello-motor-left-wheel.gains.pos_near_setpoint_d from 0.5 to 1.0
Warning. Value change in hello-motor-arm.gains.pos_near_setpoint_d from 0.5 to 2.0
Warning. Value change in hello-motor-right-wheel.gains.pos_near_setpoint_d from 0.5 to 1.0
Validation check: Dropped 3, Changed 14
Validation check should report 0 warnings. Reported total of 17
Use new parameters for robot stretch-re1-1039? [y/N]: y
Backing up /home/hello-robot/stretch_user/stretch-re1-1039/stretch_re1_user_params.yaml to stretch_re1_user_params.migration_backup.20220926143923.yaml
[sudo] password for hello-robot:
Backing up /home/hello-robot/stretch_user/stretch-re1-1039/stretch_re1_factory_params.yaml to stretch_re1_factory_params.migration_backup.20220926143931.yaml
Robot stretch-re1-1039 now configured to use latest parameter format

, followed up by REx_firmware_updater.py --install to get tho following messages and errors:

Collecting information…

WARNING:---------------------------------------------------------------------------------
WARNING: Compatible version of arduino_cli not installed.
Requires version 0.24.0. Installed version of 0.18.3
Install now? [y/N]: y
Installing in /home/hello-robot/.local/bin/
ARCH=64bit
OS=Linux
Using curl as download tool
Downloading downloads[dot]arduino[dot]cc/arduino-cli/arduino-cli_0.24.0_Linux_64bit[dot]tar[dot]gz

A new release of Arduino CLI is available: 0.24.0 → 0.27.1
arduino[dot]github[dot]io/arduino-cli/latest/installation/#latest-packages
arduino-cli Version: 0.24.0 Commit: c1b10f56 Date: 2022-06-22T10:09:11Z installed successfully in /home/hello-robot/.local/bin/
Config file already exists, use --overwrite to discard the existing one.
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Platform arduino:samd@1.6.21 already installed
######################################## Recommended Firmware Updates ########################################

DEVICE | INSTALLED | RECOMMENDED | ACTION

HELLO-WACC | Wacc.v0.0.1p0 | Wacc.v0.2.2p1 | Upgrade recommended
HELLO-MOTOR-LIFT | Stepper.v0.2.5p1 | Stepper.v0.2.5p1 | At most recent version
HELLO-PIMU | Pimu.v0.0.1p0 | Pimu.v0.2.4p1 | Upgrade recommended
HELLO-MOTOR-ARM | Stepper.v0.0.4p0 | Stepper.v0.2.5p1 | Upgrade recommended
HELLO-MOTOR-LEFT-WHEEL | Stepper.v0.0.4p0 | Stepper.v0.2.5p1 | Upgrade recommended
HELLO-MOTOR-RIGHT-WHEEL | Stepper.v0.0.4p0 | Stepper.v0.2.5p1 | Upgrade recommended

########################################## UPDATING FIRMWARE TO… ###########################################
HELLO-WACC | Upgrading to Wacc.v0.2.2p1
HELLO-MOTOR-LEFT-WHEEL | Upgrading to Stepper.v0.2.5p1
HELLO-MOTOR-RIGHT-WHEEL | Upgrading to Stepper.v0.2.5p1
HELLO-MOTOR-LIFT | Reinstalling Stepper.v0.2.5p1
HELLO-PIMU | Upgrading to Pimu.v0.2.4p1
HELLO-MOTOR-ARM | Upgrading to Stepper.v0.2.5p1

WARNING: (1) Updating robot firmware should only be done by experienced users
WARNING: (2) Do not have other robot processes running during update
WARNING: (3) Leave robot powered on during update
WARNING: (4) Ensure Lift has support clamp in place
WARNING: (5) Lift may make a loud noise during programming. This is normal.

Proceed with update?? [y/N]: y
-------- FIRMWARE FLASH hello-wacc | Wacc.v0.2.2p1 ------------
File 94-hello-usb.rules missing from UDEV. Installing now.
Resetting hello-wacc
Looking for device hello-wacc on bus
Waiting for device hello-wacc to return to bus.
Starting programming. This will take about 5s…
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Success in firmware compile
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
Error initializing instance: Error loading hardware platform: discovery builtin:mdns-discovery not found
discovery builtin:serial-discovery process not started: communication out of sync, expected ‘hello’, received ‘error’
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb53ae6]

goroutine 1 [running]:
github[dot]com/arduino/arduino-cli/cli/arguments.(*Port).GetPort(0x16560a0, 0xc000388ea0, 0x1f)
/home/build/cli/arguments/port.go:134 +0x5c6
github[dot]com/arduino/arduino-cli/cli/arguments.CalculateFQBNAndPort(0x16560a0, 0x0, 0xc0002a7c78, 0xc0000bd480)
/home/build/cli/arguments/fqbn.go:97 +0x193
github[dot]com/arduino/arduino-cli/cli/upload.runUploadCommand(0xc00037ef00, {0xc0002c62a0, 0x1, 0x7})
/home/build/cli/upload/upload.go:105 +0x23f
github[dot]com/spf13/cobra.(*Command).execute(0xc00037ef00, {0xc0002c6230, 0x7, 0x7})
/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x5f8
github[dot]com/spf13/cobra.(*Command).ExecuteC(0xc000287180)
/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
github[dot]com/spf13/cobra.(*Command).Execute(…)
/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
main.main()
/home/build/main.go:31 +0x77
Firmware flash. Failed to upload to ttyACM5

Hi @Anant_Rai, thank you attaching the logs from these commands. Based on the output you’re getting, I recommend that we meet on a support call to debug the issue on the robot live. Please send a email to support@hello-robot.com and we’ll schedule the support call.

Will do. Thanks again for the help.