From 2d87a0aeed7ebc50c7d4931c60492dfa5c00bfd5 Mon Sep 17 00:00:00 2001 From: Aria00pp <123830753+Aria00pp@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:00:33 +0330 Subject: [PATCH] Add release handoff packaging docs --- .gitignore | 6 + README.md | 34 ++++- docs/ARDUINO_CLI.md | 16 ++- docs/PACKAGING.md | 47 +++++-- docs/customer_handoff.md | 123 ++++++++++++++++--- release/README.md | 45 +++++++ release/artifacts/firmware/.gitkeep | 0 release/artifacts/windows/.gitkeep | 0 release/checklists/customer_zip_checklist.md | 65 ++++++++++ release/customer_package/.gitkeep | 0 release/scripts/build_uno_firmware_hex.sh | 25 ++++ release/scripts/build_windows_exe.ps1 | 39 ++++++ 12 files changed, 368 insertions(+), 32 deletions(-) create mode 100644 release/README.md create mode 100644 release/artifacts/firmware/.gitkeep create mode 100644 release/artifacts/windows/.gitkeep create mode 100644 release/checklists/customer_zip_checklist.md create mode 100644 release/customer_package/.gitkeep create mode 100755 release/scripts/build_uno_firmware_hex.sh create mode 100644 release/scripts/build_windows_exe.ps1 diff --git a/.gitignore b/.gitignore index f6a3e7b..8d25817 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,9 @@ __pycache__/ build/ dist/ *.spec +release/artifacts/windows/* +release/artifacts/firmware/* +release/customer_package/* +!release/artifacts/windows/.gitkeep +!release/artifacts/firmware/.gitkeep +!release/customer_package/.gitkeep diff --git a/README.md b/README.md index bac5fac..1eca856 100644 --- a/README.md +++ b/README.md @@ -98,15 +98,41 @@ Install `pyserial` when using real COM ports: python -m pip install pyserial ``` -## Portable Windows EXE packaging +## Release and customer handoff packaging -See [`docs/PACKAGING.md`](docs/PACKAGING.md). A typical PyInstaller build is: +See [`release/README.md`](release/README.md) for the proposed handoff folder structure, [`docs/PACKAGING.md`](docs/PACKAGING.md) for build details, [`docs/customer_handoff.md`](docs/customer_handoff.md) for customer instructions, and [`release/checklists/customer_zip_checklist.md`](release/checklists/customer_zip_checklist.md) before assembling a customer ZIP. + +A scripted PyInstaller build is: + +```powershell +powershell -ExecutionPolicy Bypass -File .\release\scripts\build_windows_exe.ps1 +``` + +Equivalent manual PyInstaller commands are: ```powershell -py -m pip install pyinstaller pyserial -py -m PyInstaller --noconfirm --onefile --windowed --name PortableAVRControlStudio gui\portable_avr_control_studio.py +py -m pip install --upgrade pyinstaller pyserial +py -m PyInstaller --noconfirm --onefile --windowed --name PortableAVRControlStudio --distpath release\artifacts\windows --workpath build\pyinstaller --specpath build\pyinstaller-spec gui\portable_avr_control_studio.py ``` +## Arduino Uno HEX artifact packaging + +A scripted Arduino CLI artifact build is: + +```bash +bash release/scripts/build_uno_firmware_hex.sh +``` + +Equivalent manual Arduino CLI commands are: + +```bash +arduino-cli core update-index +arduino-cli core install arduino:avr +arduino-cli compile --fqbn arduino:avr:uno --output-dir release/artifacts/firmware firmware/PortableAVRControlStudio +``` + +The expected prepared firmware artifact is `release/artifacts/firmware/PortableAVRControlStudio.ino.hex`. Keep upload as a maintainer/developer prepared-artifact workflow unless an uploader such as `avrdude` is bundled, configured, and tested with the exact target hardware and COM-port procedure. + ## Draft status and hardware-test limitation Keep the PR as a real GitHub Draft until documented checks are passing and any required AVR compile evidence is captured. No physical hardware test has been claimed in this repository; real boards, sensors, relays, buzzers, power, and enclosure hardware must be validated before customer deployment. diff --git a/docs/ARDUINO_CLI.md b/docs/ARDUINO_CLI.md index 2fc5288..4c4eeae 100644 --- a/docs/ARDUINO_CLI.md +++ b/docs/ARDUINO_CLI.md @@ -1,11 +1,23 @@ # Arduino CLI Compile Checks -Use Arduino CLI to compile the Arduino Uno / ATmega328P AVR primary target before firmware handoff: +Use Arduino CLI to compile the Arduino Uno / ATmega328P AVR primary target before firmware handoff. For a customer handoff, build into the release artifact folder: ```bash arduino-cli core update-index arduino-cli core install arduino:avr -arduino-cli compile --fqbn arduino:avr:uno firmware/PortableAVRControlStudio +arduino-cli compile --fqbn arduino:avr:uno --output-dir release/artifacts/firmware firmware/PortableAVRControlStudio +``` + +You can run the same commands through the helper script: + +```bash +bash release/scripts/build_uno_firmware_hex.sh +``` + +Expected handoff artifact: + +```text +release/artifacts/firmware/PortableAVRControlStudio.ino.hex ``` Optional compatible Nano compile check (secondary only, not required for merge): diff --git a/docs/PACKAGING.md b/docs/PACKAGING.md index 7559156..f602116 100644 --- a/docs/PACKAGING.md +++ b/docs/PACKAGING.md @@ -1,4 +1,8 @@ -# Portable Windows Packaging +# Release Packaging + +See `release/README.md` for the proposed customer handoff folder layout. Generated EXE and HEX artifacts should be staged under `release/artifacts/` and copied into `release/customer_package/` only when preparing a customer ZIP. + +## Portable Windows Packaging The GUI is a standard-library Tkinter application with optional `pyserial` support for real COM ports. @@ -17,22 +21,51 @@ py -m pip install pyserial ## Portable EXE build -A common Windows handoff package can be built with PyInstaller: +A common Windows handoff package can be built with PyInstaller. The scripted form stages the EXE under `release\artifacts\windows`: ```powershell -py -m pip install pyinstaller pyserial -py -m PyInstaller --noconfirm --onefile --windowed --name PortableAVRControlStudio gui\portable_avr_control_studio.py +powershell -ExecutionPolicy Bypass -File .\release\scripts\build_windows_exe.ps1 ``` -Copy these items into the customer handoff folder: +Equivalent manual commands are: + +```powershell +py -m pip install --upgrade pyinstaller pyserial +py -m PyInstaller --noconfirm --onefile --windowed --name PortableAVRControlStudio --distpath release\artifacts\windows --workpath build\pyinstaller --specpath build\pyinstaller-spec gui\portable_avr_control_studio.py +``` -1. `dist\PortableAVRControlStudio.exe` +Copy these items into the customer handoff folder after the build and checks pass: + +1. `release\artifacts\windows\PortableAVRControlStudio.exe` 2. `README.md` 3. `docs\PROTOCOL.md` 4. `docs\product_spec.md` 5. `docs\testing.md` 6. `docs\customer_handoff.md` 7. `docs\profiles\*.json` -8. Prepared `.hex` firmware artifacts, if firmware upload is part of the handoff +8. Prepared Arduino Uno `.hex` firmware artifacts from `release/artifacts/firmware/` The firmware upload tab is a placeholder workflow for prepared `.hex` artifacts. A production package should bundle and test the selected uploader, target MCU flags, COM-port behavior, and profile-specific firmware before presenting upload as a one-click customer feature. + + +## Arduino Uno firmware HEX artifact + +Build the prepared firmware artifact with Arduino CLI. The scripted form stages generated files under `release/artifacts/firmware`: + +```bash +bash release/scripts/build_uno_firmware_hex.sh +``` + +Equivalent manual commands are: + +```bash +arduino-cli core update-index +arduino-cli core install arduino:avr +arduino-cli compile --fqbn arduino:avr:uno --output-dir release/artifacts/firmware firmware/PortableAVRControlStudio +``` + +The expected primary HEX output is `release/artifacts/firmware/PortableAVRControlStudio.ino.hex`. Treat this as a prepared artifact for a controlled upload process; do not describe the package as a tested one-click production uploader unless the uploader is bundled and validated with the final board and profile. + +## Developer customer ZIP checklist + +Use `release/checklists/customer_zip_checklist.md` before sending a customer ZIP. It covers software checks, Uno HEX generation, staging contents, and release-claim review. diff --git a/docs/customer_handoff.md b/docs/customer_handoff.md index 2095d96..c435f47 100644 --- a/docs/customer_handoff.md +++ b/docs/customer_handoff.md @@ -1,25 +1,110 @@ -# Customer Handoff Notes +# Customer Handoff Guide -## What is included +This guide explains how a customer can run Portable AVR Control Studio with an Arduino Uno / ATmega328P AVR board and how to use demo mode when no board is connected. -- AVR firmware for the Arduino Uno / ATmega328P primary target. -- Windows-centered Tkinter GUI for runtime configuration and monitoring. -- Demo mode for simulation-only presentations. -- Hardware profile documentation for expected wiring and polarity. -- Placeholder prepared `.hex` firmware artifact workflow. +## Package contents to expect -## What must be confirmed before delivery +A prepared customer ZIP should contain: -1. Compile firmware for the Arduino Uno / ATmega328P AVR target. -2. Validate the selected hardware profile against real wiring. -3. Test relay and buzzer polarity with the final driver modules. -4. Confirm sensor scaling and thresholds with the actual sensor circuit. -5. Package the GUI as a Windows EXE and include profile/docs files. -6. Validate any firmware upload workflow with the bundled uploader and target hardware. +- `PortableAVRControlStudio.exe` — Windows desktop app. +- `firmware/PortableAVRControlStudio.ino.hex` — prepared Arduino Uno firmware artifact, if firmware delivery is included. +- `docs/` — protocol, product settings, testing notes, and hardware profile documents. +- `docs/profiles/arduino_uno_avr.json` — the default documented wiring/profile for Arduino Uno. -## Important limitations to communicate +If the ZIP does not include an uploader tool such as `avrdude` plus tested upload settings, treat the `.hex` file as a prepared firmware artifact for a developer or maintainer to upload. Do not assume the app provides validated one-click production firmware upload. -- Demo mode is simulation only and does not prove hardware behavior. -- Hardware profiles document assumptions; they do not auto-detect unknown boards or wiring. -- Firmware upload is currently a prepared-artifact placeholder unless an uploader is bundled/configured/tested. -- No physical hardware testing has been claimed in this PR. +## How to run the Windows app + +1. Extract the customer ZIP to a normal folder, for example `Documents\PortableAVRControlStudio`. +2. Open the extracted folder. +3. Double-click `PortableAVRControlStudio.exe`. +4. If Windows SmartScreen appears, review the publisher/source information from your supplier before continuing. +5. The main window should show tabs for connection, firmware, settings, live monitor, hardware profiles, diagnostics, logs, and handoff information. + +The app can be opened without an Arduino connected. Use demo mode for training or presentations when no board is available. + +## How to connect the Arduino Uno + +1. Use an Arduino Uno or compatible ATmega328P AVR board that matches the documented hardware profile. +2. Connect the Arduino Uno to the Windows PC with a USB cable that supports data, not a charge-only cable. +3. Wait for Windows to finish installing or assigning the USB serial driver. +4. Open Windows Device Manager if needed and check **Ports (COM & LPT)** for the assigned COM port, such as `COM3` or `COM7`. +5. Confirm the board wiring follows the included hardware profile before connecting relay, buzzer, sensor, or external power hardware. + +The default serial speed is `115200` baud. Unknown hardware is not auto-detected; use a documented hardware profile. + +## How to select the COM port + +1. Start `PortableAVRControlStudio.exe`. +2. Open the **Connection** area. +3. Choose the COM port assigned to the Arduino Uno, for example `COM3`. +4. Leave the baud rate at the default `115200` unless your supplier has documented a different firmware build. +5. Click the connection button. +6. Use **Ping** or **Info** if available to confirm the app receives an `OK` or firmware information response. + +If the expected COM port is missing, unplug and reconnect the USB cable, close any other serial monitor using the same port, and refresh the port list. + +## How to use demo mode + +Demo mode is for simulation only. It is useful for learning the screens and demonstrating the workflow without a real Arduino. + +1. Start the app. +2. Enable **Demo Mode** in the connection area. +3. Use the settings and monitor screens as a simulated session. +4. Do not treat demo mode behavior as proof that relay, buzzer, sensor, EEPROM, wiring, or power hardware has been validated. + +## How to read settings from the board + +Reading settings asks the connected firmware to report its current configuration. + +1. Connect to the Arduino Uno COM port. +2. Open the **Settings** area. +3. Click **Read from Board** or the equivalent settings-read button. +4. Wait for the app to fill the settings fields from the board response. +5. Review values such as device name, sensor VREF, threshold low/high, relay mode, buzzer enabled, eco mode, telemetry interval, and UI language. + +If the read fails, confirm the COM port, USB cable, firmware build, and that no other program is using the port. + +## How to send settings to the board + +Sending settings updates the running firmware configuration. A send operation by itself may not preserve settings after reset or power loss. + +1. Connect to the Arduino Uno COM port. +2. Open the **Settings** area. +3. Click **Read from Board** first so you start from the board's current values. +4. Edit the settings you want to change. +5. Check threshold order: the low threshold must be below the high threshold. +6. Click **Send Settings** or the equivalent send/apply button. +7. Confirm the app shows successful `OK` responses or no error messages. + +Only use hardware/profile settings such as pins and active-high polarity when they match the documented wiring and firmware profile. + +## How to save settings to EEPROM + +Saving to EEPROM stores accepted settings so they can survive reset or power loss. + +1. Send the desired settings to the board first. +2. Confirm the app reports success for the setting updates. +3. Click **Save to EEPROM**. +4. Wait for the save acknowledgement. +5. Optionally reset or reconnect the board and use **Read from Board** to confirm the saved values are restored. + +EEPROM persistence still requires validation on the target physical board before production deployment. + +## Firmware artifact and upload boundary + +The release package may include `firmware/PortableAVRControlStudio.ino.hex` as a prepared Arduino Uno firmware artifact. This repository documents how to build the artifact, but firmware upload should remain a maintainer/developer workflow unless the customer package also includes a tested uploader, exact command flags, target MCU settings, and COM-port procedure. + +## What still requires physical hardware validation + +Before production/customer deployment, validate these items on the actual hardware profile: + +- Arduino Uno / ATmega328P AVR board and USB serial behavior. +- Sensor wiring, sensor scaling, and measured threshold behavior. +- Relay driver wiring, relay output polarity, and load safety. +- Buzzer wiring and active-high/active-low polarity. +- EEPROM save/load behavior on the selected board. +- Firmware upload process, if upload is offered to customers. +- Power supply, enclosure, cable strain relief, and any field-installation safety requirements. + +No physical hardware testing is claimed by this repository unless separate human-provided test evidence is attached and reviewed. diff --git a/release/README.md b/release/README.md new file mode 100644 index 0000000..25e8714 --- /dev/null +++ b/release/README.md @@ -0,0 +1,45 @@ +# Release and Customer Handoff Package Proposal + +This folder is a proposed staging layout for a customer handoff ZIP. It is safe to keep in source control because generated binaries are intentionally ignored or kept out of the repository. + +## Proposed folder layout + +```text +release/ + README.md # This package-layout proposal + scripts/ + build_windows_exe.ps1 # PyInstaller command for the portable Windows app + build_uno_firmware_hex.sh # Arduino CLI command for the Uno firmware HEX artifact + artifacts/ + windows/ # Generated PortableAVRControlStudio.exe (not committed) + firmware/ # Generated Arduino Uno .hex files (not committed) + customer_package/ # Staging area for files copied into the customer ZIP + checklists/ + customer_zip_checklist.md # Developer checklist for assembling the ZIP +``` + +## Intended customer ZIP contents + +A customer ZIP should be assembled from the staging area after the documented checks pass. Recommended contents: + +```text +PortableAVRControlStudio-customer-handoff/ + PortableAVRControlStudio.exe + firmware/ + PortableAVRControlStudio.ino.hex + docs/ + customer_handoff.md + PROTOCOL.md + product_spec.md + testing.md + profiles/ + arduino_uno_avr.json + README.md +``` + +## Important release boundaries + +- The primary firmware artifact is for Arduino Uno / ATmega328P AVR using `arduino:avr:uno`. +- Firmware upload remains a prepared-artifact workflow. Do not present one-click production upload unless `avrdude` or another uploader is bundled, configured, and tested with the exact artifact, COM-port behavior, and hardware profile. +- Demo mode is simulation only. +- This repository does not claim physical hardware validation. Record any future hardware evidence outside this draft package until it is reviewed and approved for customer release notes. diff --git a/release/artifacts/firmware/.gitkeep b/release/artifacts/firmware/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/release/artifacts/windows/.gitkeep b/release/artifacts/windows/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/release/checklists/customer_zip_checklist.md b/release/checklists/customer_zip_checklist.md new file mode 100644 index 0000000..295aa12 --- /dev/null +++ b/release/checklists/customer_zip_checklist.md @@ -0,0 +1,65 @@ +# Developer Checklist: Customer ZIP Package + +Use this checklist before preparing a customer handoff ZIP for Portable AVR Control Studio. + +## 1. Confirm source and target + +- [ ] Confirm the package targets Arduino Uno / ATmega328P AVR (`arduino:avr:uno`). +- [ ] Confirm the included hardware profile is `docs/profiles/arduino_uno_avr.json` or another reviewed, documented profile. +- [ ] Confirm customer-facing runtime settings match the firmware, GUI, README, product spec, and protocol docs. + +## 2. Build and check the Windows app + +- [ ] Run the Python syntax check: + + ```bash + python -m py_compile gui/portable_avr_control_studio.py + ``` + +- [ ] Run the parser smoke check from `docs/testing.md`. +- [ ] On Windows, build the portable EXE: + + ```powershell + powershell -ExecutionPolicy Bypass -File .\release\scripts\build_windows_exe.ps1 + ``` + +- [ ] Confirm `release\artifacts\windows\PortableAVRControlStudio.exe` exists. +- [ ] Open the EXE on a Windows test machine and confirm the GUI launches. This is a software launch check only unless a real board is connected and separately recorded. + +## 3. Build the Arduino Uno firmware artifact + +- [ ] Install Arduino CLI and the `arduino:avr` core if not already installed. +- [ ] Build the Uno HEX artifact: + + ```bash + bash release/scripts/build_uno_firmware_hex.sh + ``` + +- [ ] Confirm `release/artifacts/firmware/PortableAVRControlStudio.ino.hex` exists. +- [ ] Record the Arduino CLI version and command output in maintainer notes. + +## 4. Stage the customer ZIP + +- [ ] Create or clean `release/customer_package/PortableAVRControlStudio-customer-handoff/`. +- [ ] Copy `PortableAVRControlStudio.exe` into the package root. +- [ ] Copy the Uno HEX artifact into `firmware/` inside the package. +- [ ] Copy these docs into `docs/` inside the package: + - [ ] `docs/customer_handoff.md` + - [ ] `docs/PROTOCOL.md` + - [ ] `docs/product_spec.md` + - [ ] `docs/testing.md` + - [ ] `docs/profiles/arduino_uno_avr.json` +- [ ] Copy the repository `README.md` into the package root. + +## 5. Verify customer-facing claims + +- [ ] Confirm the handoff docs do not claim physical hardware testing unless approved evidence is attached. +- [ ] Confirm demo mode is described as simulation only. +- [ ] Confirm firmware upload is described as prepared-artifact handling only unless a bundled uploader has been configured and tested. +- [ ] Confirm no unsupported automatic hardware detection claim is present. + +## 6. Final package review + +- [ ] ZIP the staged folder using a customer-visible version/date naming scheme. +- [ ] Open the ZIP and confirm the expected files are present. +- [ ] Keep the GitHub PR as Draft until Python smoke checks and Uno AVR compile checks are documented and reproducible in CI or maintainer notes. diff --git a/release/customer_package/.gitkeep b/release/customer_package/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/release/scripts/build_uno_firmware_hex.sh b/release/scripts/build_uno_firmware_hex.sh new file mode 100755 index 0000000..8712d5e --- /dev/null +++ b/release/scripts/build_uno_firmware_hex.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Build the Arduino Uno / ATmega328P AVR firmware HEX artifact with Arduino CLI. +# +# Run from the repository root on Linux/macOS/Git Bash: +# bash release/scripts/build_uno_firmware_hex.sh +# +# Output: +# release/artifacts/firmware/PortableAVRControlStudio.ino.hex + +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +output_dir="$repo_root/release/artifacts/firmware" + +mkdir -p "$output_dir" +cd "$repo_root" + +arduino-cli core update-index +arduino-cli core install arduino:avr +arduino-cli compile \ + --fqbn arduino:avr:uno \ + --output-dir "$output_dir" \ + firmware/PortableAVRControlStudio + +printf 'Built Uno HEX artifacts in: %s\n' "$output_dir" diff --git a/release/scripts/build_windows_exe.ps1 b/release/scripts/build_windows_exe.ps1 new file mode 100644 index 0000000..b0b5a1f --- /dev/null +++ b/release/scripts/build_windows_exe.ps1 @@ -0,0 +1,39 @@ +<# +Build the Portable AVR Control Studio Windows EXE with PyInstaller. + +Run from the repository root on Windows PowerShell: + powershell -ExecutionPolicy Bypass -File .\release\scripts\build_windows_exe.ps1 + +Output: + release\artifacts\windows\PortableAVRControlStudio.exe +#> + +$ErrorActionPreference = "Stop" + +$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..") +$OutputDir = Join-Path $RepoRoot "release\artifacts\windows" +$WorkDir = Join-Path $RepoRoot "build\pyinstaller" +$SpecDir = Join-Path $RepoRoot "build\pyinstaller-spec" + +New-Item -ItemType Directory -Force -Path $OutputDir | Out-Null +New-Item -ItemType Directory -Force -Path $WorkDir | Out-Null +New-Item -ItemType Directory -Force -Path $SpecDir | Out-Null + +Push-Location $RepoRoot +try { + py -m pip install --upgrade pyinstaller pyserial + py -m PyInstaller ` + --noconfirm ` + --onefile ` + --windowed ` + --name PortableAVRControlStudio ` + --distpath $OutputDir ` + --workpath $WorkDir ` + --specpath $SpecDir ` + gui\portable_avr_control_studio.py + + Write-Host "Built EXE: $OutputDir\PortableAVRControlStudio.exe" +} +finally { + Pop-Location +}