Skip to content

setup, discover --save: save the LAN address or usb, not the USB link - #35

Merged
wardviaene merged 1 commit into
mainfrom
setup-prefer-lan
Oct 15, 2026
Merged

wardviaene merged 1 commit into
mainfrom
setup-prefer-lan

Conversation

@wardviaene

Copy link
Copy Markdown
Member

Problem

Found on 2026-10-15 while onboarding benchpod-baea06 (firmware 3.9.0, on USB and on the LAN at 192.168.1.220) with benchpod setup from v0.7.0:

  • Step 1 reported only network 10.237.8.85:8080: mDNS hears the pod on every interface, and preferredPodIP picks the USB network link address.
  • Step 5 saved 10.237.8.85:8080 as the default connection, and the next steps printed pytest --benchpod-connection=10.237.8.85.

That address only works while the pod is plugged into this computer. A tester who sets up at a desk and then moves the pod to Ethernet in a lab gets a broken default. discover --save already mapped a USB-link address to usb, but it also ignored the LAN address when the pod had one.

Rule

The saved default connection (savedConnection) is:

  1. the pod's Ethernet or Wi-Fi address when it has one (from mDNS on a non-USB interface, or from the console's status);
  2. else usb for a pod reached only on its USB link (10.237.0.0/16), which re-detects on any port and falls back to the console when Wi-Fi turns USB networking off;
  3. else the address as it is.

A --connection passed to setup is saved as given (usb:<name> is kept instead of plain usb). Setup still drives the pod over the USB link during the run; only the saved value and the pytest hint change.

Changes

  • discoveredPod.lanAddr: the first non-USB-link IPv4 that mDNS returned. discover shows it in the health line (LAN address 192.168.1.220:8080).
  • saveTarget (discover --save) and setup step 5 both use savedConnection.
  • Setup step 1 says USB network 10.237.8.85:8080, network 192.168.1.220:8080. Step 2 no longer calls the USB link "on the network": a USB-only pod is fine for this computer, and setup says how to add Ethernet or Wi-Fi for other machines and CI. Step 5 explains why it saves usb.
  • Help text for setup and discover, plus the README, are updated. The public docs (getting started, CLI page, CLI reference) are updated in embeddedci-server main.

Tests

go test ./cmd/... passes. There are new unit tests for savedConnection, lanPodIP, the LAN-over-link preference in saveTarget, setup saving the LAN address, usb, and explicit connections, and mergeSetupPods keeping the LAN address. These are host-only tests; nothing was run on the bench pod.

internal/fwrefusals fails locally because it reads the sibling firmware checkout, which is on another branch. That failure is unrelated to this change.

🤖 Generated with Claude Code

On firmware 3.9.0 a pod plugged in over USB is also heard over mDNS on its
USB network link (10.237.x.y), and discovery prefers that address to drive it.
setup saved it as the default connection and printed it in the pytest hint,
so a pod set up at a desk broke once it moved to Ethernet in a lab.

Discovery now keeps the pod's Ethernet/Wi-Fi address next to the link one.
The saved default is that LAN address when there is one, else `usb` for a
pod only on its USB link (it re-detects on any port), else the address as
is. setup saves an explicit --connection as given, says why it saves `usb`,
and no longer calls the USB link "on the network". discover shows the LAN
address in its health line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit 1b74ea3 into main Oct 15, 2026
2 checks passed
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.

1 participant