Linux Firmware Update

Topics relating to online racing and training with 3rd party software.
Post Reply
linuxFTW
Paddler
Posts: 2
Joined: February 1st, 2022, 7:48 pm

Linux Firmware Update

Post by linuxFTW » February 1st, 2022, 7:58 pm

In order to update the firmware of the Concept2 devices you need to install the official Update Utility which is not available for Linux. The official utility only grabs the firmware files and puts them in a folder. You don't need a utility for that if you are willing to update via USB stick. I found out how to get the official firmware so that you fellow Linux users can update your machines too :-)
You can find it here: https://github.com/pentamassiv/Concept2LinuxUpdater

wivku
Paddler
Posts: 21
Joined: December 19th, 2014, 12:03 pm

Re: Linux Firmware Update

Post by wivku » February 2nd, 2022, 6:04 pm

Thanks for sharing. Be aware: in your script the versions are hardcoded (and outdated).
It is safest to do what the Concept2 Utility does: get a list of most recent firmwares, and then get each of those.
See below for the script I use (it requires curl, jq, 7z)

Note: I have not included the token that is needed to get the list of files from the Concept2 site.
To get that one, here's a hint: use e.g. https://mitmproxy.org/ and run Concept2 Utility.

Code: Select all

#!/bin/bash

UNZIP="/usr/local/bin/7z"
JQ="/usr/local/bin/jq"

DESTINATION=$HOME/Downloads/Concept2/Firmware

mkdir -p $DESTINATION
cd $DESTINATION

#TOKEN="Authorization: Basic ..." # <<< you will have to figure out how to get that token
FILES=$(curl -s "https://tech.concept2.com/api/firmware/latest" -H "$TOKEN" | $JQ -r '.data[] | select(.status == "public") | .files[0].name' | paste -s -d, -)

curl -s -O "https://firmware.concept2.com/files/{$FILES}"

$UNZIP e -y "*.7z" > /dev/null
BTW if you prefer to use your hardcoded list of (outdated) files, here is the more compact version:

Code: Select all

FILES="pm3_euro_R108B000.7z, pm3a_eurochinese_R332B000.7z, pm3aski_eurochinese_R732B000.7z, pm4_eurochinese_R029B000.7z, pm4a_eurochinese_R332B000.7z, pm4aski_eurochinese_R732B000.7z, pm5_eurochinesebin_pub_secure_R032B000.7z, pm5_zhjakobin_pub_secure_R032B000.7z, pm5ski_eurochinesebin_pub_secure_R732B000.7z, pm5ski_zhjakobin_pub_secure_R732B000.7z, pm5v2_eurochinesebin_pub_secure_R171B000.7z, pm5v2_zhjakobin_pub_secure_R171B000.7z, pm5v2bk_eurochinesebin_pub_secure_R329B000.7z, pm5v2bk_zhjakobin_pub_secure_R329B000.7z, pm5v2ski_eurochinesebin_pub_secure_R871B000.7z, pm5v2ski_zhjakobin_pub_secure_R871B000.7z"

curl -O "https://firmware.concept2.com/files/{$FILES}"
Last edited by wivku on February 2nd, 2022, 6:51 pm, edited 3 times in total.

wivku
Paddler
Posts: 21
Joined: December 19th, 2014, 12:03 pm

Re: Linux Firmware Update

Post by wivku » February 2nd, 2022, 6:46 pm

and for fun, here's a way to display the summary as a table:

Code: Select all

#!/bin/bash

#TOKEN="Authorization: Basic ..." # <<< you will have to figure out how to get that token
curl -s "https://tech.concept2.com/api/firmware/latest" -H "$TOKEN" | jq -r '.data[] | [.status, .machine, .release_date, .short_description, .files[0].name] | @tsv'

Code: Select all

public	rower	2012-11-01	PM3 Version 108 (for PM3s Mfg. 2003- August 2008)	pm3_euro_R108B000.7z
public	rower	2012-11-01	PM4 Version 29 (for PM4s Mfg. 2005-June 2008)	pm4_eurochinese_R029B000.7z
public	rower	2018-07-24	PM3 Version 332	pm3a_eurochinese_R332B000.7z
public	rower	2018-07-24	PM4 Version 332.000	pm4a_eurochinese_R332B000.7z
public	skierg	2018-07-24	PM4 SkiErg Version 732.000	pm4aski_eurochinese_R732B000.7z
public	skierg	2018-07-24	PM3 SkiErg Version 732.000	pm3aski_eurochinese_R732B000.7z
public	rower	2021-12-20	PM5v1 Version 32.000	pm5_eurochinesebin_pub_secure_R032B000.7z
beta	rower	2022-01-27	PM5v1 Version 32.001	pm5_eurochinesebin_beta_secure_R032B001.7z
public	skierg	2021-12-20	PM5v1 Version 732.000	pm5ski_eurochinesebin_pub_secure_R732B000.7z
beta	skierg	2022-01-27	PM5v1 Version 732.001	pm5ski_eurochinesebin_beta_secure_R732B001.7z
public	rower	2021-12-23	PM5v2 Version 171.000	pm5v2_eurochinesebin_pub_secure_R171B000.7z
public	skierg	2021-12-23	PM5v2 Version 871.000	pm5v2ski_eurochinesebin_pub_secure_R871B000.7z
public	bike	2021-12-23	PM5v2 Version 329.000	pm5v2bk_eurochinesebin_pub_secure_R329B000.7z
public	rower	2021-12-23	PM5v3 Version 210.000	pm5v3_allbin_pub_secure_R210B000.7z
public	skierg	2021-12-23	PM5v3 Version 910.000	pm5v3ski_allbin_pub_secure_R910B000.7z
public	bike	2021-12-23	PM5v3 Version 361.000	pm5v3bk_allbin_pub_secure_R361B000.7z
beta	bike	2022-01-20	PM5v5 Version 400.008	pm5v5bk_eurochinesebin_beta_secure_R400B008.7z
beta	skierg	2022-01-20	PM5v5 Version 950.007	pm5v5ski_eurochinesebin_beta_secure_R950B008.7z
beta	rower	2022-01-20	PM5v5 Version 250.008	pm5v5_eurochinesebin_beta_secure_R250B008.7z

linuxFTW
Paddler
Posts: 2
Joined: February 1st, 2022, 7:48 pm

Re: Linux Firmware Update

Post by linuxFTW » February 3rd, 2022, 9:41 pm

Thank you for the feedback. That was great!

I did not know about mitmproxy. I gave it a try and used it to extract the token. Worked like a charm. I then stored the token as a secret on Github and created an Action that is scheduled to run once a day and use the "secret" token to check for new firmwares. If there is a new firmware available, the Action will automatically update the hardcoded links of the script. This way the token is not published on the repo, but users still get all updates as soon as they become available (and they pull the new script).
This should be much better now than my previous version. Feel free to make more suggestions. If you'd like to be credited somehow, let me know how you'd like me to do that
B)

wivku
Paddler
Posts: 21
Joined: December 19th, 2014, 12:03 pm

Re: Linux Firmware Update

Post by wivku » February 4th, 2022, 7:17 am

Nice. In that case: instead of using Actions to generate new update.sh script you could consider saving the list of files in e.g. files.json
And let the update script point to the Github location (and as a fallback the local -possibly outdated- local version of that JSON file).

Code: Select all

FILES=$(curl -f -s https://raw.githubusercontent.com/pentamassiv/Concept2LinuxUpdater/main/files.json || cat files.json)
This way the client does not have to do a git pull to get updated firmware files before running update.sh.
(note regarding the readme: for git pull the repo location is not needed if you are in the repo directory)

wivku
Paddler
Posts: 21
Joined: December 19th, 2014, 12:03 pm

Re: Linux Firmware Update

Post by wivku » February 4th, 2022, 11:17 am

BTW I have expanded + published the script I originally wrote for myself:
https://github.com/wivaku/getConcept2Firmwares

Intended for people that don't mind figuring out the authorization token themselves.
Feel free to copy/paste from that one if you like, no credit is needed.

Features:
- parameter: download public or (only) beta firmwares
- parameter: destination (e.g. directly to the USB stick)
- parameter: which monitor to use (default: pm5, which is actually the only useful one)
- deletes old files in the destination (similar to how Concept2 Utility works)
- firmwares intended for internal use are excluded

c488
Paddler
Posts: 1
Joined: May 16th, 2024, 3:43 pm

Re: Linux Firmware Update

Post by c488 » May 16th, 2024, 3:52 pm

You absolutely can use wine. You do not need a windows virtualbox.
This is pretty simple for your average linux user.

Partition a 16GB flash drive with FAT32. Use the partition manager in your OS is the easiest way, or you can use fdisk and mkfs.

Once you have an MBR FAT32 (ID is 0b in fdisk) , following the instructions, plug that into your rower first.

It will "initialize" the drive -- you will enter a username on the screen to name your 'logbook', and it will create a directory structure on the drive:

Concept2>
DiagLog
Firmware
Logbook
Special
Getting Started.html

Now, run the Concept 2 Utility exe downloaded from the website using wine.

> wine <name of concept2 executable>

Click update firmware, choose your PM version, and then plug in the rower initialized drive, and mount the drive to the OS. Once the utility sees a new drive mounted, it will look for the above structure on it. If you did not initialize with the rower, it will claim you formatted the drive incorrectly.

Once you insert initialized usb drive you can click download firmware, and itll grab the latest set. It will report back "Files installed!" and you can go plug this back into the rower.

I used a Fedora based distro with wine-9.7 (Staging)

Hope this helps.

Tsnor
10k Poster
Posts: 1145
Joined: November 18th, 2020, 1:21 pm

Re: Linux Firmware Update

Post by Tsnor » May 16th, 2024, 10:07 pm

Years ago the windows utility was the only way to load firmware. So linux users needed a solution like the ones in this thread.

Now that ergdata updates PM5 firmware over bluetooth Linux users with a phone/table that can run ergdata should be all set without needing windows, wine or the Concept 2 Utility.

@c488 - super clear description of how to load pm firmware using a usb drive, linux and wine. nice.

Post Reply