Error in flasher_linux script while updating herelink firmware

Hi.
We are trying to update there herelink firmware, following this guide: https://docs.cubepilot.org/user-guides/herelink/herelink-user-guides/upgrading-firmware
In the Controller Upgrade section (step 3), when running the application.
We are on ubuntu 20.04

`Extracting package...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19/19 [00:08<00:00,  2.27it/s]
Successfully extracted package
Flashing Unit...
DO NOT DISCONNECT!!
Traceback (most recent call last):
  File "usb1/__init__.py", line 178, in create_initialised_buffer
TypeError: memoryview: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "flasher.py", line 276, in <module>
  File "flasher.py", line 139, in flash_all
  File "flasher.py", line 194, in flash_img
  File "adb/fastboot.py", line 289, in FlashFromFile
  File "adb/fastboot.py", line 325, in Download
  File "adb/fastboot.py", line 137, in HandleDataSending
  File "adb/fastboot.py", line 197, in _Write
  File "adb/common.py", line 175, in BulkWrite
  File "usb1/__init__.py", line 1388, in bulkWrite
  File "usb1/__init__.py", line 182, in create_initialised_buffer
TypeError: string argument without an encoding
[24065] Failed to execute script 'flasher' due to unhandled exception!`

Hey Everyone,

I just tried updating the firmware too and got the exact same error on Ubuntu 18.04

Looking for Device
Found Unit Type:  remoteunit


Downloading required package...
Latest remoteunit release: FRU01220618
Downloading Latest Release from  https://herelinkfw.cubepilot.org/remoteunit-FRU01220618.tar.gz
Package already downloaded!
Successfully download package
Extracting package...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 19/19 [00:09<00:00,  1.97it/s]
Successfully extracted package
Flashing Unit...
DO NOT DISCONNECT!!
Traceback (most recent call last):
  File "usb1/__init__.py", line 178, in create_initialised_buffer
TypeError: memoryview: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "flasher.py", line 276, in <module>
  File "flasher.py", line 139, in flash_all
  File "flasher.py", line 194, in flash_img
  File "adb/fastboot.py", line 289, in FlashFromFile
  File "adb/fastboot.py", line 325, in Download
  File "adb/fastboot.py", line 137, in HandleDataSending
  File "adb/fastboot.py", line 197, in _Write
  File "adb/common.py", line 175, in BulkWrite
  File "usb1/__init__.py", line 1388, in bulkWrite
  File "usb1/__init__.py", line 182, in create_initialised_buffer
TypeError: string argument without an encoding

Hi guys,

Any solution for this issue yet?

@Michael_Oborne @philip

Same problem here. Looks like the flasher contains Python code for Python 2.7 but it gets executed with Python3.

Something like this should not happen in 2022…

The flasher_win also does not work under Windows 10 - just silently terminates without error message.

Update:
For those, who have the same problems with flasher_linux, at least I can describe how you can get the Windows version (flasher_win) running. This is, how I succeeded:

Download this:
SDK Platform Tools: Notas da versão do SDK Plataform Tools  |  Desenvolvedores Android  |  Android Developers
Google USB Drivers: Get the Google USB Driver  |  Android Developers

The Google USB drivers can be installed by double-clicking the .inf file. The SDK platform tools have no installer. You have to include the path to the folder into your system PATH environment variable.

After this, you should start flasher_win with “run as administrator”.

Next problem will be, getting the product key as the updated firmware requires an activation (via a router that lets the radio controller lease an IP in the range 192.168.1.x :frowning:

I can not remember any other firmware update procedure that put so many bars in the way…

1 Like

yep, it sucks… you can thank pad practices from our competitors on this… we had no intention of putting up barriers such as registration, but unfortunatly, we got blindsided by chinese clones stealing our system designs and had to put these measures in place to protect the very small market we have.

it is what it is unfortunatly, and we do keep making it easier as time goes on.

This works well. Thanks.

Is there any solution to fixing this in Ubuntu 22? I’ve tried killing the adb server, disconnecting, reconnecting, revoking usb permissions, re-authorizing usb debugging, re-installing adb and fastboot. What else can I try? I still get the following error.

Traceback (most recent call last):
File “flasher.py”, line 287, in
File “flasher.py”, line 147, in flash_all
File “flasher.py”, line 202, in flash_img
File “adb/fastboot.py”, line 289, in FlashFromFile
File “adb/fastboot.py”, line 325, in Download
File “adb/fastboot.py”, line 137, in HandleDataSending
File “adb/fastboot.py”, line 197, in _Write
File “adb/common.py”, line 175, in BulkWrite
File “usb1/init.py”, line 1388, in bulkWrite
File “usb1/init.py”, line 182, in create_initialised_buffer
TypeError: string argument without an encoding
[4637] Failed to execute script ‘flasher’ due to unhandled exception!