Skip to content

Add Arduino Uno .ino / Sketch compile support via Arduino CLI - #9

Merged
Aria00pp merged 2 commits into
mainfrom
codex/add-arduino-uno-compile-support
Jun 2, 2026
Merged

Aria00pp merged 2 commits into
mainfrom
codex/add-arduino-uno-compile-support

Conversation

@Aria00pp

@Aria00pp Aria00pp commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Allow non-technical users to compile .ino files or Arduino Sketch folders for Arduino Uno / ATmega328P from the existing Firmware tab while preserving the prepared .hex upload workflow and conservative hardware-claim boundaries.
  • Provide a predictable, documented path that uses Arduino CLI (bundled under tools/arduino-cli/ or on PATH) rather than attempting any automated library resolution or source repair.
  • Keep customer packaging and release steps able to optionally include Arduino CLI tooling while avoiding committing generated toolchain or build artifacts to git.

Description

  • Added Arduino CLI discovery and helpers (ArduinoCliTool, find_arduino_cli_tool, core list/install, compile command builder), sketch preparation and validation (prepare_sketch_source, validate_sketch_compile_request), and generated-HEX location (locate_generated_hex) in gui/portable_avr_control_studio.py so the app can build Uno sketches to .hex.
  • Implemented a new Firmware tab UI section "Compile Arduino Sketch for Uno" with controls to select a .ino or sketch folder, optional output folder, Compile and Compile + Upload buttons, background compile thread, streamed Logs output, disabled buttons while running, and clear success/failure messages; on success the generated .hex is selected for upload and the existing avrdude upload flow is reused.
  • Added conservative protocol warning and missing-CLI user-facing messages, an attempt to ensure the arduino:avr core is present (with arduino-cli core list / core install), and safe handling of single .ino files by copying into a temporary sketch folder without modifying user source.
  • Updated packaging to optionally copy staged release/artifacts/windows/tools/arduino-cli/ into the customer package, and updated README, docs (docs/*), release scripts, and CI smoke checks to document Arduino CLI requirements, Uno-only scope, external-library limitations, and release/packaging instructions.

Testing

  • Ran Python syntax checks with python -m py_compile gui/portable_avr_control_studio.py release/scripts/assemble_customer_package.py and the checks passed.
  • Executed the expanded Python smoke test that exercises serial parsing, prepared .hex upload validation, Arduino CLI discovery, compile-command construction, .ino and sketch-folder acceptance, non-.ino rejection, missing-CLI error text, and custom-sketch protocol warning, and those smoke assertions passed.
  • Ran the package assembly smoke test (release/scripts/assemble_customer_package.py --no-zip) using dummy EXE/HEX/avrdude/arduino-cli staging to verify optional tools/arduino-cli/ copy behavior and the assembly logic, and it succeeded.
  • Attempted the Arduino CLI Uno compile step (arduino-cli compile --fqbn arduino:avr:uno firmware/PortableAVRControlStudio) in this environment but arduino-cli was not installed here (tooling not available), so the real compile step was not executed in this container; CI includes an AVR job that installs Arduino CLI for that check.

Codex Task

@Aria00pp Aria00pp changed the title Draft: Add Arduino Uno .ino / Sketch compile support via Arduino CLI Add Arduino Uno .ino / Sketch compile support via Arduino CLI Jun 2, 2026
@Aria00pp
Aria00pp merged commit dd6f5ff into main Jun 2, 2026
5 checks passed
@Aria00pp
Aria00pp deleted the codex/add-arduino-uno-compile-support branch June 2, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant