Skip to content

Make windows-arm.cmd find the carrier or say why it cannot - #59

Open
yassinsolim wants to merge 1 commit into
feature/arm-startup-and-launchersfrom
fix/windows-carrier-detect
Open

yassinsolim wants to merge 1 commit into
feature/arm-startup-and-launchersfrom
fix/windows-carrier-detect

Conversation

@yassinsolim

@yassinsolim yassinsolim commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Makes scripts\windows-arm.cmd find the carrier by itself, or say why it cannot. Stacked on #57, which introduces the Windows launcher, so the base is that branch; when #57 is merged with a merge commit and its branch deleted, GitHub retargets this PR to main.

The problem

On a Windows laptop the launcher gave up after saying almost nothing: the bridge runs in its own window, which closes with it, so the operator saw only "The carrier bridge is not ready. Plug in only the carrier, or run python -m ...". The bridge also took only an official Arduino (by USB vendor ID). A clone board has its own USB-serial chip, which does not carry Arduino's ID, so it was never found.

The change

  • Clone boards: when no Arduino is found, the bridge takes the only USB serial port, and says so. With several candidates it never guesses and names them.
  • Say why: the bridge writes what it says to %TEMP%\waybionic-carrier-bridge.log (--log-file), and when it does not start the launcher prints the last lines of it, for example which COM ports Windows lists, before the error.
  • Name the port: scripts\windows-arm.cmd COM5 (or WAYBIONIC_CARRIER=COM5) skips the search, for a laptop with several serial devices. The .cmd now passes its arguments on.
  • docs/operator_guide.md describes the above and no longer says "Arduinos" where USB serial devices are meant.

5 files, +154 / -39. Most of it is in carrier_relay.py and its tests.

How it was tested

  • test_carrier_relay.py covers the detection rules (official board first, the only serial port as a fallback, no guessing between several, the log file), and the teleop suite passed when this was written (989 tests). test_flake8.py and test_pep257.py pass.
  • The launcher's failure path was dry-run under PowerShell 7 on macOS.

Not tested, please check on a Windows laptop with the carrier

CI does not cover the .cmd/.ps1, and this commit has not been run on Windows with a real board. The launcher before this change (96e9d77, in #57) is what has been run on a Windows laptop. Please try, in this order:

  1. Only the carrier plugged in: it should come up as before.
  2. A clone board only, if anyone has one: the bridge should say it took the only USB serial port.
  3. Nothing plugged in: after about a minute it should print what the bridge said, then the error.
  4. Two serial devices plugged in: it should refuse to guess and print the ports; windows-arm.cmd COM5 should then work.

The script is run by Windows PowerShell 5.1 (powershell.exe in the .cmd), not PowerShell 7, so 1 to 4 also check that nothing in it needs the newer one.

The bridge only took an official Arduino and, when it found none, the launcher gave up after saying nothing, because the bridge's own window closes with it. A clone board has its own USB-serial chip, so the bridge now also takes the only USB serial port, and says so, and never guesses between several. It writes what it says to a log file, which the launcher prints when the bridge does not start, and the launcher takes an optional port: windows-arm.cmd COM5.
Copilot AI balanced review requested due to automatic review settings November 14, 2026 10:52
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8755bda6-35e1-47b3-a059-e8bcb8b93a51

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Windows launcher passes the log-file path without literal quotes, so spaces in %TEMP% split it into multiple Python arguments, preventing startup and leaving only an unhelpful “(nothing)” message.

1 open issue
What changed in this PR

Improves the Windows real-arm launcher introduced in #57 so it can detect clone carriers and show useful diagnostics when startup fails.

Changes:

  • Adds a single-USB-serial-port fallback while refusing ambiguous selections.
  • Supports an explicit COM port and displays relay logs on startup failure.
  • Expands detection and logging tests and updates operator instructions.
File Description
waybionic_teleop/​waybionic_teleop/​carrier_relay.py Adds clone detection, descriptive port messages, and file logging.
waybionic_teleop/​test/​test_carrier_relay.py Covers detection and logging; handles partial socket reads.
scripts/​windows-arm.ps1 Accepts a carrier port and displays relay logs on failure.
scripts/​windows-arm.cmd Forwards arguments to the PowerShell launcher.
docs/​operator_guide.md Documents automatic detection, failure diagnostics, and explicit port selection.

Review effort: Balanced

Comment thread scripts/windows-arm.ps1
# The bridge also writes what it says here, so that this script can show it if the bridge fails.
$bridgeLog = Join-Path $env:TEMP 'waybionic-carrier-bridge.log'
Remove-Item $bridgeLog -ErrorAction SilentlyContinue
$bridgeArguments = @('-m', 'waybionic_teleop.carrier_relay', '--log-file', $bridgeLog)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants