setup: robust uuidgen install on Trixie + XBee-PRO 900 family support - #75
Merged
Merged
Conversation
Two independent field-reported failures in sparrow_setup.sh:
1. install_uuidgen() ran `apt install uuid-runtime` unconditionally and
died with a cryptic 'no installation candidate' error on one Trixie
Pi whose sources.list was misconfigured (missing 'main' component or
wrong suite). Guarded the install with an if-branch, added a targeted
diagnostic that points the operator at the exact sources.list entry
they need. Also verified against a healthy Trixie install (192.168.1.233)
that uuid-runtime is still the canonical package on Trixie — util-linux
does NOT ship uuidgen, contra a common misconception.
2. xbee_configure.py hardcoded `AT BR=1` (RF data rate), which is only a
valid command on XBee SX 868. On XBee-PRO 900 / 900HP the RF rate is
fixed by the firmware image loaded on the module (Digi ships separate
10kbps / 200kbps builds), so the module returns ERROR and the setup
dies mid-config. Added a --family {868,900} flag to xbee_configure.py
that skips the BR command on 900-family modules. Added a matching
XBEE_FAMILY prompt in sparrow_setup.sh (zenity + terminal fallback +
env override for headless runs). Default stays 868, so existing 868
builds see zero behavioral change.
Fix 2 empirically validated end-to-end on an XBee-PRO 900HP (S3B, HV=234B,
VR=8075) connected to my Windows laptop: --family 900 completed cleanly
(BR skipped, all other AT commands applied), post-write verify at 115200
baud confirmed AP=1 CE=0 BD=7 ID=1234 NI=SPARROW_MASTER all persisted.
There was a problem hiding this comment.
Pull request overview
This PR addresses two field-reported setup/configuration failures by improving uuidgen installation diagnostics on Debian (incl. Trixie) and adding explicit support for XBee-PRO 900/900HP modules by skipping the unsupported AT BR command.
Changes:
- Harden
install_uuidgen()insparrow_setup.shto avoid cryptic aborts and provide targeted APT sources diagnostics. - Add
XBEE_FAMILYprompt/env override in the setup script and thread it into the XBee configuration step. - Extend
xbee_configure.pywith--family {868,900}and skip theBRcommand for the 900 family.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
sparrow/xbee_configure.py |
Adds XBee family selection and conditional BR handling for 900/900HP modules. |
setup script/sparrow_setup.sh |
Improves uuidgen install robustness/diagnostics and prompts for XBee family before running configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Federico Alves (urucoder)
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent field-reported failures in
sparrow_setup.shon a fresh SPARROW build; both fixes bundled here because they land in the same script.Fix 1 —
install_uuidgen()cryptic failure on TrixieThe operator hit
E: Package 'uuid-runtime' has no installation candidatemid-setup and had no way to know what went wrong. Root cause: their Pi's/etc/apt/sources.listis misconfigured (most likely missing themaincomponent or set to the wrong suite).uuid-runtimeis the canonical package foruuidgenon all current Debian releases (verified on a working Trixie Pi at 192.168.1.233 —dpkg -S /usr/bin/uuidgenreturnsuuid-runtime, andutil-linuxdoes not shipuuidgen).Changes:
apt install uuid-runtimewith anifsoset -euo pipefaildoesn't abort before we log a diagnostic.sources.listline the operator likely needs.command_exists uuidgenat the end andreturn 1if still missing — script fails cleanly with the operator seeing full context instead of a cryptic apt message.Fix 2 — XBee-PRO 900 support (
AT BRbug)The same operator's XBee radio caused
xbee_configure.pyto die with[ERROR] ATBR1 failed, response: 'ERROR'. Root cause:BR(RF data rate) is only a valid AT command on the XBee SX 868 family. On XBee-PRO 900 / 900HP the RF rate is fixed by the firmware image loaded on the module (Digi ships separate 10 kbps / 200 kbps builds), soAT BRreturnsERROR. All other AT commands the script uses (AP,CE,BD,ID,NI) are portable across families.Changes:
sparrow/xbee_configure.py: new--family {868,900}CLI arg. Whenfamily=900, theBRcommand is skipped with an INFO log; everything else runs identically.setup script/sparrow_setup.sh: newprompt_xbee_family()called beforerun_xbee_configure_if_needed()(only when ROBIN is in use). Uses_yesno(zenity or terminal). Honors anXBEE_FAMILY=868|900env var for headless / re-runs. Threads--family "\${XBEE_FAMILY:-868}"into the python invocation.868— existing SPARROW builds see zero behavioral change.Test plan
bash -n setup\ script/sparrow_setup.sh— passes.python -m py_compile sparrow/xbee_configure.py— passes.--family 900on real hardware: an XBee-PRO 900HP (S3B,HV=234B,VR=8075) attached to a Windows laptop via COM4. Full write completed cleanly (`Skipping BR: RF rate is fixed by firmware on XBee-PRO 900 family.`), then re-opened at 115200 baud and verifiedAP=1 CE=0 BD=7 ID=1234 NI=SPARROW_MASTERall persisted through the flash write.--family 868(the default) still sendsAT BR=1— the historical code path is untouched.prompt_xbee_family()env override and the_yesnofallback ordering.sudo ./sparrow_setup.shshould now prompt for family, accept "900", complete without theATBR1error.