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.