CI Workflow - Firmware Flash - Ex UNO R4 Wifi

Trying to build orchestation with multiple boards hanging off USB Hub connected to PI V

All are UNO R4 Wifi

I am trying to create full automated workflow to flash to "latest" the boards.
Trying to follow instructions: firmware flash - Arduino Firmware Uploader

I can list the board based on collected fqbn. And it lists "module" and latest version

root@triton:~#   arduino-fwuploader firmware list -b arduino:renesas_uno:unor4wifi
Board               FQBN                          Module     Version
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.1.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.3.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.4.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3 โœ” 0.5.2  

But when I go to flash it I get odd errors list the command is missing folders. And as I am doing this as root I assume this is not a permissions issue

oot@triton:~# arduino-fwuploader firmware flash -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0 -m ESP32-S3@0.5.2
Could not open uploader plugin: error getting plugin version /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0: fork/exec /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin: no such file or directory

root@triton:~# ls -alh /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin
-rwxr-xr-x 1 root root 8.1M Apr 26 11:34 /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin

Questions:

  1. when I run command "arduino-cli board list --format json" and get board "fqbn" Ex: "arduino:renesas_uno:unor4wifi" this one firmware package is all that is needed for the board. NOT different flashes for different chips on board.

  2. How do I check and or validate that arduino-fwuploader is pulled down latest firmware and is there some command i am missing to stage it to correct above flash request?

Thanks,

Hi @penguinpages.

I'm suspicious that the problem might be caused by running the command as the root user.

Do you have a specific reason why you are doing that?

Have you also tried it using a normal user account? If so, did you get the same error message when you did that?:

I tried that

ansible@triton:~ $ sudo rm -rf /tmp/fwuploader/
ansible@triton:~ $ arduino-fwuploader firmware flash -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0 -v --log-level debug
INFO[0000] arduino-fwuploader Version: 2.4.1 Commit: d945078 Date: 2023-08-31T07:43:01Z 
DEBU[0000] fqbn: arduino:renesas_uno:unor4wifi, address: /dev/ttyACM0 
INFO[0000] Checking signature                            index=/tmp/1340204342649943770/index.json signatureFile=/tmp/1340204342649943770/index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/plugin_firmware_index.json signatureFile=/tmp/fwuploader/plugin_firmware_index.json.sig trusted=true
DEBU[0000] got board: arduino:renesas_uno:unor4wifi     
DEBU[0000] Tool dependency to download                   dep="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0000] Tool release to download                      tool="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0000] upload tool downloaded in /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0 
DEBU[0000] Tool dependency to download                   dep="arduino:espflash@2.0.0"
DEBU[0000] Tool release to download                      tool="arduino:espflash@2.0.0"
DEBU[0001] upload tool downloaded in /tmp/fwuploader/tools/espflash/2.0.0 
DEBU[0001] Tool dependency to download                   dep="arduino:bossac@1.9.1-arduino5"
DEBU[0001] Tool release to download                      tool="arduino:bossac@1.9.1-arduino5"
DEBU[0001] upload tool downloaded in /tmp/fwuploader/tools/bossac/1.9.1-arduino5 
DEBU[0001] module name: ESP32-S3, firmware version: 0.5.2 
DEBU[0001] firmware file downloaded in /tmp/fwuploader/firmwares/ESP32-S3/0.5.2/ESP32-S3.bin 
Could not open uploader plugin: error getting plugin version /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0: fork/exec /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin: no such file or directory

and the tasks run within docker GitLab container so that is as UID 0. I get same error. At this point its trying to define workflow , then build into CICD.

What happens if you invoke the uno-r4-wifi-fwuploader-plugin executable directly from the terminal, as the non-root user?:

$ /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin

The expected result is that it will return the command line help for the uno-r4-wifi-fwuploader-plugin tool.

Is this by chance anything to do with this being run on PI V? where I need to pass arch parameters?

ansible@triton:~ $ /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin
-bash: /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin: cannot execute: required file not found
ansible@triton:~ $ ls -lah /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin
-rwxr-xr-x 1 root root 8.1M Apr 26 17:30 /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin

I tested it on my Raspberry Pi V, which is running Raspberry Pi OS Bookworm, and I did not experience the "fork/exec /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin: no such file or directory" or "cannot execute: required file not found" errors that you are encountering.

Can you post on pi you workflow to do firmware update on usb attached ardunio

  1. Get fqbn and serial "address"
root@triton:~# arduino-cli board list --format json
{
  "detected_ports": [
    {
      "matching_boards": [
        {
          "name": "Arduino UNO R4 WiFi",
          "fqbn": "arduino:renesas_uno:unor4wifi"
        }
      ],
      "port": {
        "address": "/dev/ttyACM0",
        "label": "/dev/ttyACM0",
        "protocol": "serial",
        "protocol_label": "Serial Port (USB)",
        "properties": {
          "pid": "0x1002",
          "serialNumber": "48CA435CF294",
          "vid": "0x2341"
        },
        "hardware_id": "48CA435CF294"
      }
  1. check available firmware
root@triton:~# arduino-fwuploader firmware list -b arduino:renesas_uno:unor4wifi
Board               FQBN                          Module     Version
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.1.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.3.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.4.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3 โœ” 0.5.2  
  1. flash board
root@triton:~# arduino-cli board list --format json |grep fqbn
          "fqbn": "arduino:renesas_uno:unor4wifi"
root@triton:~# arduino-fwuploader firmware list -b arduino:renesas_uno:unor4wifi
Board               FQBN                          Module     Version
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.1.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.3.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.4.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3 โœ” 0.5.2  

root@triton:~# arduino-fwuploader firmware flash -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0 -v --log-level debug
INFO[0000] arduino-fwuploader Version: 2.4.1 Commit: d945078 Date: 2023-08-31T07:43:01Z 
DEBU[0000] fqbn: arduino:renesas_uno:unor4wifi, address: /dev/ttyACM0 


INFO[0000] Checking signature                            index=/tmp/134020434650884569/index.json signatureFile=/tmp/134020434650884569/index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/plugin_firmware_index.json signatureFile=/tmp/fwuploader/plugin_firmware_index.json.sig trusted=true
DEBU[0000] got board: arduino:renesas_uno:unor4wifi     
DEBU[0000] Tool dependency to download                   dep="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0000] Tool release to download                      tool="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0002] upload tool downloaded in /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0 
DEBU[0002] Tool dependency to download                   dep="arduino:espflash@2.0.0"
DEBU[0002] Tool release to download                      tool="arduino:espflash@2.0.0"
DEBU[0003] upload tool downloaded in /tmp/fwuploader/tools/espflash/2.0.0 
DEBU[0003] Tool dependency to download                   dep="arduino:bossac@1.9.1-arduino5"
DEBU[0003] Tool release to download                      tool="arduino:bossac@1.9.1-arduino5"
DEBU[0003] upload tool downloaded in /tmp/fwuploader/tools/bossac/1.9.1-arduino5 
DEBU[0003] module name: ESP32-S3, firmware version: 0.5.2 
DEBU[0004] firmware file downloaded in /tmp/fwuploader/firmwares/ESP32-S3/0.5.2/ESP32-S3.bin 
Could not open uploader plugin: error getting plugin version /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0: fork/exec /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin: no such file or directory
root@triton:~# 

I also tried workflow as NON root user but same result.

ansible@triton:~ $ arduino-fwuploader firmware flash -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0 -v --log-level debug
INFO[0000] arduino-fwuploader Version: 2.4.1 Commit: d945078 Date: 2023-08-31T07:43:01Z 
DEBU[0000] fqbn: arduino:renesas_uno:unor4wifi, address: /dev/ttyACM0 
INFO[0000] Checking signature                            index=/tmp/1340204342650591422/index.json signatureFile=/tmp/1340204342650591422/index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/plugin_firmware_index.json signatureFile=/tmp/fwuploader/plugin_firmware_index.json.sig trusted=true
DEBU[0000] got board: arduino:renesas_uno:unor4wifi     
DEBU[0000] Tool dependency to download                   dep="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0000] Tool release to download                      tool="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
ERRO[0001] moving extracted archive to destination dir: destination /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0 already exists 
Error downloading tool arduino:uno-r4-wifi-fwuploader-plugin@1.0.0: moving extracted archive to destination dir: destination /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0 already exists
ansible@triton:~ $ sudo rm -rf /tmp/fwuploader/
ansible@triton:~ $ arduino-fwuploader firmware flash -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0 -v --log-level debug
INFO[0000] arduino-fwuploader Version: 2.4.1 Commit: d945078 Date: 2023-08-31T07:43:01Z 
DEBU[0000] fqbn: arduino:renesas_uno:unor4wifi, address: /dev/ttyACM0 
INFO[0000] Checking signature                            index=/tmp/134020434851127628/index.json signatureFile=/tmp/134020434851127628/index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/plugin_firmware_index.json signatureFile=/tmp/fwuploader/plugin_firmware_index.json.sig trusted=true
DEBU[0000] got board: arduino:renesas_uno:unor4wifi     
DEBU[0000] Tool dependency to download                   dep="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0000] Tool release to download                      tool="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0004] upload tool downloaded in /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0 
DEBU[0004] Tool dependency to download                   dep="arduino:espflash@2.0.0"
DEBU[0004] Tool release to download                      tool="arduino:espflash@2.0.0"
DEBU[0005] upload tool downloaded in /tmp/fwuploader/tools/espflash/2.0.0 
DEBU[0005] Tool dependency to download                   dep="arduino:bossac@1.9.1-arduino5"
DEBU[0005] Tool release to download                      tool="arduino:bossac@1.9.1-arduino5"
DEBU[0005] upload tool downloaded in /tmp/fwuploader/tools/bossac/1.9.1-arduino5 
DEBU[0005] module name: ESP32-S3, firmware version: 0.5.2 
DEBU[0006] firmware file downloaded in /tmp/fwuploader/firmwares/ESP32-S3/0.5.2/ESP32-S3.bin 
Could not open uploader plugin: error getting plugin version /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0: fork/exec /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0/uno-r4-wifi-fwuploader-plugin: no such file or directory
ansible@triton:~ $ 

When using Arduino Firmware Uploader, I don't encounter the error you are getting, but unfortunately I do encounter a different problem at a later stage in the firmware update process:

per@raspberrypi:~ $ arduino-fwuploader firmware flash -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0 -v --log-level debug
INFO[0000] arduino-fwuploader Version: 2.4.1 Commit: d945078 Date: 2023-08-31T07:42:58Z 
DEBU[0000] fqbn: arduino:renesas_uno:unor4wifi, address: /dev/ttyACM0 
INFO[0000] Checking signature                            index=/tmp/55770067919477794102364519263/index.json signatureFile=/tmp/55770067919477794102364519263/index.json.sig trusted=true
INFO[0016] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0019] Checking signature                            index=/tmp/fwuploader/plugin_firmware_index.json signatureFile=/tmp/fwuploader/plugin_firmware_index.json.sig trusted=true
DEBU[0019] got board: arduino:renesas_uno:unor4wifi     
DEBU[0019] Tool dependency to download                   dep="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0019] Tool release to download                      tool="arduino:uno-r4-wifi-fwuploader-plugin@1.0.0"
DEBU[0023] upload tool downloaded in /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0 
DEBU[0023] Tool dependency to download                   dep="arduino:espflash@2.0.0"
DEBU[0023] Tool release to download                      tool="arduino:espflash@2.0.0"
DEBU[0027] upload tool downloaded in /tmp/fwuploader/tools/espflash/2.0.0 
DEBU[0027] Tool dependency to download                   dep="arduino:bossac@1.9.1-arduino5"
DEBU[0027] Tool release to download                      tool="arduino:bossac@1.9.1-arduino5"
DEBU[0028] upload tool downloaded in /tmp/fwuploader/tools/bossac/1.9.1-arduino5 
DEBU[0028] module name: ESP32-S3, firmware version: 0.5.2 
DEBU[0030] firmware file downloaded in /tmp/fwuploader/firmwares/ESP32-S3/0.5.2/ESP32-S3.bin 
INFO[0030] Uploading firmware (try 1 of 9)              
time=2025-04-27T21:15:04.178-07:00 level=INFO msg=upload_command_sketch
time=2025-04-27T21:15:04.178-07:00 level=INFO msg="sending serial reset"
time=2025-04-27T21:15:04.683-07:00 level=INFO msg="uploading command sketch with bossac"
Erase flash

Done in 0.001 seconds
Write 46588 bytes to flash (12 pages)
[==============================] 100% (12/12 pages)
Done in 3.031 seconds

Waiting to flash the binary...
time=2025-04-27T21:15:09.058-07:00 level=INFO msg="getting firmware version"
time=2025-04-27T21:15:09.073-07:00 level=INFO msg="firmware version is > 0.1.0 using sketch"
time=2025-04-27T21:15:09.076-07:00 level=INFO msg="check if serial port has changed"
[2025-04-28T04:15:10Z INFO ] ๐Ÿš€ A new version of espflash is available: v3.3.0
[2025-04-28T04:15:10Z INFO ] Serial port: '/dev/ttyACM0'
[2025-04-28T04:15:10Z INFO ] Connecting...
Error:   ร— Main thread panicked.
  โ”œโ”€โ–ถ at espflash/src/interface.rs:70:33
  โ•ฐโ”€โ–ถ called `Result::unwrap()` on an `Err` value: UnknownModel
  help: set the `RUST_BACKTRACE=1` environment variable to display a
        backtrace.

Error: exit status 101
ERRO[0036] couldn't update firmware: exit status 3      
INFO[0036] Waiting 1 second before retrying...          
INFO[0037] Uploading firmware (try 2 of 9)              
time=2025-04-27T21:15:11.904-07:00 level=INFO msg=upload_command_sketch
time=2025-04-27T21:15:11.904-07:00 level=INFO msg="sending serial reset"
time=2025-04-27T21:15:12.408-07:00 level=INFO msg="uploading command sketch with bossac"
No device found on /dev/ttyACM0
Error: reboot mode: upload commands sketch: exit status 1

[...]

Explanation of Error

The problem is that Arduino Firmware Uploader uses version 2.0.0 of the espflash tool. That version of the tool has a dependency on version 0.14.1 of the RPPAL Rust library, which doesn't have support for the Raspberry Pi 5 (the "UnknownModel" error you see in the arduino-fwuploader output is referring to the Raspberry Pi model):

https://github.com/arduino/arduino-fwuploader/blob/2.4.1/docs/plugins.md#espflash-panic-unknownmodel

The RPPAL dependency was removed in espflash 3.0.0, making it compatible with the RPi 5. Unfortunately, I didn't find any simple way to trick Arduino Firmware Uploader into using espflash 3.0.0 instead of the version 2.0.0 it is configured to use.

Workaround

The Arduino developers are tracking the task of updating the version of espflash used by Arduino Firmware Uploader here, but for now I think the best way to move forward is to abandon the use of Arduino Firmware Uploader and instead perform the update by using espflash directly.

Overview

There are two distinct operations that must be performed in order to update the UNO R4 WiFi's bridge module firmware:

  1. Put the bridge module into boot mode.
  2. Flash the firmware to the bridge module.

espflash performs the second of these operations, but unfortunately I did not find a way to use that tool to accomplish the first. So we need to use a different tool for this purpose. Arduino provides such a tool: unor4wifi-reboot.

Procedure

I'll provide instructions you can follow to update the firmware via this approach:

A. Obtain espflash

  1. Click the following link to open the release page for the latest version of the espflash tool in your web browser:
    https://github.com/esp-rs/espflash/releases/latest
  2. Click the "espflash-aarch64-unknown-linux-gnu.zip" download link under the "Assets" section of the release page.
    Your web browser will start a file download.
  3. Wait for the downloads to finish.
  4. Extract the downloaded file.

B. Obtain Bridge Module Firmware

  1. Click the following link to open the release page for the latest version of the firmware in your web browser:
    https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest
  2. Click the "unor4wifi-update-linux.zip" download link under the "Assets" section of the release page:
    Your web browser will start a file download.
  3. Wait for the downloads to finish.
  4. Extract the downloaded file.

C. Obtain unor4wifi-reboot

Unfortunately Arduino does not provide precompiled builds of unor4wifi-reboot for Linux ARM hosts, so it is necessary to build it from source. This tool is written in the Go programming language, which makes it fairly easy to build.

  1. Install the Go programming language:
    https://go.dev/dl/
    โ“˜ You are welcome to install Go any way you like, including via package managers like APT and Snap.
  2. Open a command line terminal in any convenient folder where your user account has write permissions.
  3. Type the following at the command prompt:
    git clone --recurse-submodules=unor4wifi-reboot/hid https://github.com/arduino/uno-r4-wifi-usb-bridge
    
  4. Press the Enter key.
  5. Wait for the clone operation to finish successfully.
  6. Type the following at the command prompt:
    cd uno-r4-wifi-usb-bridge/unor4wifi-reboot/
    
  7. Press the Enter key.
  8. Type the following at the command prompt:
    cd uno-r4-wifi-usb-bridge/unor4wifi-reboot/
    
  9. Press the Enter key.
  10. Type the following at the command prompt:
    go build
    
  11. Press the Enter key.
  12. Wait for the process to finish successfully.

D. Update Firmware

  1. Connect the UNO R4 WiFi board to your computer with a USB cable.
  2. Type the following at the command prompt:
    WORKING_FOLDER="$HOME/Downloads"
    
    โ“˜ This assumes your web browser is configured to download files to the ~/Downloads folder, and that you extracted the downloaded files in that folder. If you extracted the downloaded files to a different location, then adjust this command accordingly.
  3. Press the Enter key.
  4. Type the following at the command prompt of the terminal you opened while performing the "C. Obtain unor4wifi-reboot" procedure:
    ./unor4wifi-reboot && sleep 1 && "$WORKING_FOLDER/espflash" write-bin --baud 115200 --port /dev/ttyACM0 0x0 "$WORKING_FOLDER"/unor4wifi-update-linux/firmware/UNOR4-WIFI-S3-*.bin
    
    โ“˜ I found that a delay is required between invoking the unor4wifi-reboot and espflash commands in order to give the board time to go into boot mode and the operating system to recognize the new USB device. I arbitrarily chose a delay of 1 s. If you are trying to make the process as efficient as possible, you might find you can reduce the duration of that delay.
  5. Press the Enter key.
  6. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this:
    Chip type:         esp32s3 (revision v0.1)
    Crystal frequency: 40MHz
    Flash size:        8MB
    Features:          WiFi, BLE
    MAC address:       dc:54:75:c4:c6:54
    [00:00:15] [========================================]      826/826     0x0
    
  7. Disconnect the USB cable of the UNO R4 WiFi board from your computer.
    :red_exclamation_mark: It is essential to perform this step.
  8. Connect the UNO R4 WiFi board to your computer with the USB cable again.

Please let me know if you have any questions or problems while following those instructions.

1 Like

Great detail and thanks for update.

At this juncture I just have two boards with more in phase II where full orchestration will be critical, so , as the team has this issue already in 3.x scope, I will just use manual flash step for now.

I figured the flash would have two seperate stages as there are two chips. Good to know the main arduinio flash workflow will do both, so once 3.x drops, it will do both and I don't have to keep returning to that topic.

As for my error vs your "works on my machine :slight_smile: " I will return to this thread when 3.x drops and track that thread noted.

Thanks for postings.

1 Like

I am building a workflow to manage my various boards. One of my roles (using ansible) is to check current board firmware and compare to latest and if needed upgrade.

The CI workflow is done from Raspberry Pi V. Below is my playbook but it needs some help as a couple tasks are not completing correctly.

ansible/roles/arduino-firmware/tasks/main.yaml

I will post role to form for others to use once I debug:

Current issue:

root@triton:/tmp# arduino-fwuploader firmware list -b arduino:renesas_uno:unor4wifi -v
INFO[0000] arduino-fwuploader Version: 2.4.1 Commit: d945078 Date: 2023-08-31T07:42:58Z 
ERRO[0000] stat /tmp: no such file or directory         
Can't load package index: stat /tmp: no such file or directory

I would have expected it would query for available firmware and return values I can then parse for second task: {{ adress }} is an ansible fact already set for tty of the target Serial number/board.

  - name: Flash firmware if update is needed
    ansible.builtin.command: "{{ fwuploader_bin_path }} firmware flash -b {{ hostvars[tabletop_number].fqbn }} -a /dev/{{ address }}"
    when: not fw_already_current
    register: fw_flash_result

I was baslining as root but yes. task is run as user ansible.

I realize it is creating director /tmp/fwuploader/

And if it is created in my pet baseline as root it blocks ansible from running task as the folder exists.

So that part was user error once I realized it was creating that folder.

Now next step I think is handling if reboot required.

TASK [arduino-firmware : Debug firmware list output] ***************************
ok: [triton] => {
    "fw_available.stdout": "Board               FQBN                          Module     Version\nArduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.1.0  \nArduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.0  \nArduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.1  \nArduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.3.0  \nArduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.4.1  \nArduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3 โœ” 0.5.2  "
}
TASK [arduino-firmware : Set firmware status] **********************************
ok: [triton]
TASK [arduino-firmware : Log current firmware status] **************************
skipping: [triton]
TASK [arduino-firmware : Flash firmware if update is needed] *******************
fatal: [triton]: FAILED! => {"changed": true, "cmd": ["/usr/local/bin/arduino-fwuploader", "firmware", "flash", "-b", "arduino:renesas_uno:unor4wifi", "-a", "/dev//dev/ttyACM1"], "delta": "0:00:09.484174", "end": "2025-06-08 11:15:31.896375", "msg": "non-zero return code", "rc": 1, "start": "2025-06-08 11:15:22.412201", "stderr": "Error: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps", "stderr_lines": ["Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps", "Error: reboot mode: upload commands sketch: opening port at 1200bps"], "stdout": "", "stdout_lines": []}
...ignoring
TASK [arduino-firmware : Log firmware flash result] ****************************
ok: [triton] => {
    "fw_flash_result": {
        "changed": true,
        "cmd": [
            "/usr/local/bin/arduino-fwuploader",
            "firmware",
            "flash",
            "-b",
            "arduino:renesas_uno:unor4wifi",
            "-a",
            "/dev//dev/ttyACM1"
        ],
        "delta": "0:00:09.484174",
        "end": "2025-06-08 11:15:31.896375",
        "failed": true,
        "msg": "non-zero return code",
        "rc": 1,
        "start": "2025-06-08 11:15:22.412201",
        "stderr": "Error: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps\nError: reboot mode: upload commands sketch: opening port at 1200bps",
        "stderr_lines": [
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps",
            "Error: reboot mode: upload commands sketch: opening port at 1200bps"
        ],
        "stdout": "",
        "stdout_lines": []
    }
}

Point of order, are firmware states on arduino boards such that there are a lot of releases, or image based on features needed for tasks? I have this within check each time I push a sketch, but maybe I need to break this out as CI step to run manual.

You can see the history of firmware releases here:

Note that the releases with a -rc suffix are "release candidates", which were made only for the purpose of beta testing. So these should not be considered when evaluating the historical release cycle for this firmware.

Another thing to consider is that typically there will be a higher frequency of firmware releases soon after a product is released compared to later when the product has become more mature.

Trying to define workflow that checks if new Arduinio R4 Wifi needs firmware upgrade.

I can't seem to find any command to query current firmware load. And details I get back seem to not correlate with what website has posted. According to the searches I have done Arduinio UNO R4 Wifi fqbn: "arduino:renesas_uno:unor4wifi"

arduino-cli board list --format json
{
  "detected_ports": [
    {
      "matching_boards": [
        {
          "name": "ESP32 Family Device",
          "fqbn": "esp32:esp32:esp32_family",
          "is_hidden": true
        }
      ],
      "port": {
        "address": "/dev/ttyACM0",
        "label": "/dev/ttyACM0",
        "protocol": "serial",
        "protocol_label": "Serial Port (USB)",
        "properties": {
          "pid": "0x1001",
          "serialNumber": "48:C---C:F2:94",
          "vid": "0x303a"
        },
        "hardware_id": "48:C---:F2:94"
      }
    },
    {
      "matching_boards": [
        {
          "name": "ESP32 Family Device",
          "fqbn": "esp32:esp32:esp32_family",
          "is_hidden": true
        }
      ],
      "port": {
        "address": "/dev/ttyACM1",
        "label": "/dev/ttyACM1",
        "protocol": "serial",
        "protocol_label": "Serial Port (USB)",
        "properties": {
          "pid": "0x1001",
          "serialNumber": "24:--3:65:A4",
          "vid": "0x303a"
        },
        "hardware_id": "24:--3:65:A4"
      }
    },
    {
      "port": {
        "address": "/dev/ttyAMA10",
        "label": "/dev/ttyAMA10",
        "protocol": "serial",
        "protocol_label": "Serial Port",
        "properties": {}
      }
    }
  ]
}

Maybe though I am thinking of this wrong, that like a standard server board this would be flash firmware for BMC or RAID (in case of secondary chip on R4 wifi), but maybe this is wrong.

I assumed I would build CI worklow:

  1. Install tools
  2. Download latest firmware
  3. Define in code
  4. Define task that queries board if not = defined version in code then flash, otherwise skip
  5. Push sketch to board as seperate task

ansible/inventories/production/hosts.yaml

        t01:
          SN: 24EC---A4
          ip_address: 172.16.100.121
          mac_address: 24:----65:a4
          ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
          fqbn: "arduino:renesas_uno:unor4wifi"

I use this to set fact.

And so long as i have installed "arduino-fwuploader " and then run a download of firmware for board:

arduino-cli core install arduino:renesas_uno
Platform arduino:renesas_uno@1.4.1 already installed
ansible@triton:~ $ arduino-fwuploader firmware list -b arduino:renesas_uno:unor4wifi
Board               FQBN                          Module     Version
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.1.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.2.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.3.0  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3   0.4.1  
Arduino UNO R4 WiFi arduino:renesas_uno:unor4wifi ESP32-S3 โœ” 0.5.2 

But I see no command to check "current version" on the board. And I download version but not seeing command to flash

ansible@triton:~ $ arduino-fwuploader firmware get-version -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0
Error downloading tool arduino:uno-r4-wifi-fwuploader-plugin@1.0.0: moving extracted archive to destination dir: destination /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0 already exists

I really don't want to run flash on firmware each sketch push, so I am trying to define means to do this within CI workflow properly

The command is arduino-fwuploader firmware get-version:

https://arduino.github.io/arduino-fwuploader/latest/commands/arduino-fwuploader_firmware_get-version/

It seems that you did find the command to get the version after all. It looks like your system is in some strange state that blocks the installation of the tool dependency this command requires. Run the following command:

rm --recursive /tmp/fwuploader/tools/uno-r4-wifi-fwuploader-plugin/1.0.0

then try running the arduino-fwuploader firmware get-version command again. Hopefully it will be successful this time.

The only way to determine which version of firmware is installed is by uploading a program to the board which reads the firmware version and then prints that version to serial. This is the source code of the binary that arduino-fwuploader firmware get-version will upload to the board in order to get the version:

I have merged your forum topics due to them having too much overlap on the same subject matter @penguinpages.

In the future, please only create one topic for each distinct subject matter and be careful not to cause them to converge into parallel discussions.

The reason is that generating multiple forum topics on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Thanks in advance for your cooperation.

Thanks for response and help.

I think two issues exist. I have workflow running via ansible in docker container which is why tasks are as root.

  1. I have many other tasks that run "become" and for this workflow I can remove that at playbook level or for these specific tasks.

  2. I think I need to vet out workflow of firmware evaluation. If each time compile and upload sketch happens I get firmware output I can set fact from that to call firmware flash update needed notification then enable update next cycle. But this may be a Raspberry Pi V issue.


ansible@triton:~ $ sudo rm -rf /tmp/fwuploader/
ansible@triton:~ $ arduino-cli board list --format json 
{
  "detected_ports": [
    {
      "matching_boards": [
        {
          "name": "ESP32 Family Device",
          "fqbn": "esp32:esp32:esp32_family",
          "is_hidden": true
        }
      ],
      "port": {
        "address": "/dev/ttyACM0",
        "label": "/dev/ttyACM0",
        "protocol": "serial",
        "protocol_label": "Serial Port (USB)",
        "properties": {
          "pid": "0x1001",
          "serialNumber": "48:CA:43:5C:F2:94",
          "vid": "0x303a"
        },
        "hardware_id": "48:CA:43:5C:F2:94"
      }
    },
    {
      "matching_boards": [
        {
          "name": "ESP32 Family Device",
          "fqbn": "esp32:esp32:esp32_family",
          "is_hidden": true
        }
      ],
      "port": {
        "address": "/dev/ttyACM1",
        "label": "/dev/ttyACM1",
        "protocol": "serial",
        "protocol_label": "Serial Port (USB)",
        "properties": {
          "pid": "0x1001",
          "serialNumber": "24:EC:4A:23:65:A4",
          "vid": "0x303a"
        },
        "hardware_id": "24:EC:4A:23:65:A4"
      }
    },
    {
      "port": {
        "address": "/dev/ttyAMA10",
        "label": "/dev/ttyAMA10",
        "protocol": "serial",
        "protocol_label": "Serial Port",
        "properties": {}
      }
    }
  ]
}
ansible@triton:~ $ arduino-cli core install arduino:renesas_uno
Platform arduino:renesas_uno@1.4.1 already installed
ansible@triton:~ $ arduino-fwuploader firmware get-version -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM1 -v
INFO[0000] arduino-fwuploader Version: 2.4.1 Commit: d945078 Date: 2023-08-31T07:42:58Z 
INFO[0000] Checking signature                            index=/tmp/55770067919477794102240996521/index.json signatureFile=/tmp/55770067919477794102240996521/index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/package_index.json signatureFile=/tmp/fwuploader/package_index.json.sig trusted=true
INFO[0000] Checking signature                            index=/tmp/fwuploader/plugin_firmware_index.json signatureFile=/tmp/fwuploader/plugin_firmware_index.json.sig trusted=true
time=2025-06-09T15:10:58.577-04:00 level=INFO msg=upload_command_sketch
time=2025-06-09T15:10:58.577-04:00 level=INFO msg="sending serial reset"
time=2025-06-09T15:10:59.087-04:00 level=INFO msg="uploading command sketch with bossac"
No device found on /dev/ttyACM1
Error: exit status 1
Couldn't get firmware version: exit status 3

ansible@triton:~ $ arduino-fwuploader firmware get-version -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM1
No device found on /dev/ttyACM1
Error: exit status 1
Couldn't get firmware version: exit status 3
ansible@triton:~ $ arduino-fwuploader firmware get-version -b arduino:renesas_uno:unor4wifi -a /dev/ttyACM0
No device found on /dev/ttyACM0
Error: exit status 1
Couldn't get firmware version: exit status 3

I assume I also am correct in UNO R4 Wifi fqbn : arduino:renesas_uno:unor4wifi

because Serial scan notes board as "esp32:esp32:esp32_family"

After you update the firmware on the UNO R4 WiFi board, it is left in a state where its serial port is identified as an ESP32 board. After updating the firmware, it is essential to power cycle the board (by disconnecting the USB cable from the board, then connecting the cable again) in order to put it back into the ordinary operating mode.

Ah.. So to get firmware to show shift i need power cycle the arduinos.

The arduinios in my case are hanging off serial USB hub from pi V in remote site :stuck_out_tongue:

So to get state change on firmware, I have to reboot pi.

ansible@triton:~ $ arduino-cli board list --format json 
{
  "detected_ports": [
    {
      "matching_boards": [
        {
          "name": "Arduino UNO R4 WiFi",
          "fqbn": "arduino:renesas_uno:unor4wifi"
        }
      ],
      "port": {
        "address": "/dev/ttyACM0",
        "label": "/dev/ttyACM0",
        "protocol": "serial",
        "protocol_label": "Serial Port (USB)",
        "properties": {
          "pid": "0x1002",
          "serialNumber": "48CA435CF294",
          "vid": "0x2341"
        },
        "hardware_id": "48CA435CF294"
      }
    },
    {
      "matching_boards": [
        {
          "name": "Arduino UNO R4 WiFi",
          "fqbn": "arduino:renesas_uno:unor4wifi"
        }
      ],
      "port": {
        "address": "/dev/ttyACM1",
        "label": "/dev/ttyACM1",
        "protocol": "serial",
        "protocol_label": "Serial Port (USB)",
        "properties": {
          "pid": "0x1002",
          "serialNumber": "24EC4A2365A4",
          "vid": "0x2341"
        },
        "hardware_id": "24EC4A2365A4"
      }
    },
    {
      "port": {
        "address": "/dev/ttyAMA10",
        "label": "/dev/ttyAMA10",
        "protocol": "serial",
        "protocol_label": "Serial Port",
        "properties": {}
      }
    }
  ]
}

Oh boy.. that was not workflow I was expecting, but makes sense now. It needs to reinitialize with new firmware and to do that it need power state change on USB bus if that is power source. Long term will be power via barrel connector so I may need to shift my ideas there.

Thanks. Let me do some more testing.