Tools Reference
Top level
| Script | Purpose |
|---|---|
build.sh [clean] [--preset name] [--production] | The build entry point; assembles configuration layers, supports custom CMake presets (ble, st7789), and enforces production preconditions |
flash.sh [--preset name] [port] | idf.py flash, default port /dev/ttyACM0 |
monitor.sh [--preset name] [port] | Serial console with backtrace decoding |
tools/
| Script | Purpose |
|---|---|
prepare_sd_card_data.sh --check|--rename PATH | Validate an SD card layout against the library rules; --rename fixes fixable names in place |
import_quran_android_timings.py | Converts Quran Android SQLite timing databases (<reciter>.db) and JSONs to Safi's optimized .atb binary format and archives |
download_reciter.sh | Downloads whole Quran recitations (EveryAyah or mp3quran) into sd_card_data/ with automatic .atb timing compilation |
generate_https_certs.sh | Development self-signed TLS certificate and key into littlefs_data/certs/ (10 years, CN safi.local) |
generate_production_certs.sh | Per-device certificate and key, written outside the git tree (provisioning) |
generate_lvgl_fonts.sh | Regenerates the merged Arabic+Latin LVGL fonts (the pipeline); output is committed C |
nvs_mass_provisioning.py | CSV manifest to per-device NVS partition images (provisioning) |
provision_device.sh | One device end to end: flash, seed, verify |
production_preflight.sh | Refuses production flashing unless the gates and key material check out |
hil/run_device_tests.sh [port] | Hardware-in-the-loop runner: on-target Unity suite, stdio gate, dev-firmware restore (testing) |
font_converter.py | Legacy TTF-to-bitmap converter kept for the pre-LVGL display stack's history; superseded by generate_lvgl_fonts.sh |
Hardware
Not build scripts, but the reproducible command lines behind the hardware chapters.
| Command | Purpose |
|---|---|
kicad-cli pcb export gerbers/drill ..., kicad-cli sch export pdf, kicad-cli ... export bom | Regenerate the fabrication outputs (gerbers, drill, BOM, CPL, STEP, schematic PDF) into hardware/pcb/exports/; the exact invocations live in hardware/pcb/README.md |
flatpak run --command=freecadcmd org.freecad.FreeCAD hardware/enclosure/safi_enclosure.py | Headless FreeCAD run that rebuilds the printable enclosure STEP and STL from the parametric script |
Documentation site
| Command | Purpose |
|---|---|
cd safi-docs && npm run start | Live-reload docs authoring |
npm run build | Production build, both locales, broken links fatal |
npm run diagrams | Re-export draw.io sources to SVG via docker (style guide) |
npm run write-translations -- --locale ar | Regenerate Arabic chrome translation JSON |