Skip to content

FUG-83: derive AP SSID + mDNS/DHCP hostname from the configured device name - #56

Merged
fughilli merged 2 commits into
mainfrom
agent/fug-83-ap-name-and-hostname-should-matc
Aug 7, 2026
Merged

fughilli merged 2 commits into
mainfrom
agent/fug-83-ap-name-and-hostname-should-matc

Conversation

@issuefleet

@issuefleet issuefleet Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What

The device name the user configures now drives the soft-AP SSID and the
device hostname, as requested in FUG-83.

  • AP SSID → <name>-AP (was hardcoded ledmapper). SSIDs allow spaces, so
    the display name is used verbatim, capped to the 32-byte SSID limit.
  • Hostname → a DNS-label-safe slug of the name, so <name>.local resolves
    over mDNS. Slugging keeps [A-Za-z0-9], collapses any other run to a single
    -, and trims — e.g. Led Widget A1B2C3 → Led-Widget-A1B2C3, and a simple
    TestWidget stays TestWidget. Empty/all-symbol names fall back to
    ledmapper.

So a device named TestWidget advertises the TestWidget-AP soft-AP and
answers to TestWidget.local, matching the issue's example.

How

  • Brought up the IDF mDNS responder (mdns_init + mdns_hostname_set +
    mdns_instance_name_set with the friendly display name + a lightweight
    _http._tcp service) so <name>.local resolves on both the STA and soft-AP
    interfaces. The espressif__mdns component is already in the SDK.
  • Set the STA and soft-AP DHCP hostnames (WiFi.setHostname /
    WiFi.softAPsetHostname) so the router/DHCP leases also show the name.
  • The wss cert SAN now carries <name>.local (instead of the previously
    hardcoded ledmapper.local) so https://<name>.local validates.
  • Live rename (set_device_name → poll_device_rename) recomputes the
    SSID + hostname, reconfigures the soft-AP (while it's still up), re-points the
    mDNS hostname/instance, and forces a cert re-issue so the new .local lands
    in the SAN.
  • setup() is reordered so the device name is resolved before WiFi comes up
    (the SSID + hostname must be known at WiFi.mode/softAP/begin time);
    g_cert_ip moved up so the rename path can reset it.

Verification

  • bazel build -c opt //firmware/player_app:esp32c6 — passes, produces
    esp32c6.bin. This is the real gate: it confirms the mDNS component both
    compiles (header + matching signatures) and links into the image
    (-lespressif__mdns is in the SDK's link recipe; the symbols resolve).
  • Static check of the fetched SDK confirmed the WiFi hostname APIs and the four
    mDNS functions exist with the signatures used.

Not yet exercised on real hardware (no HITL access from this worktree);
suggest a quick DUT check that the AP shows as <name>-AP and <name>.local
resolves after a join + after a rename.

Notes

mDNS adds a small always-resident cost. The device already tears the soft-AP
down after a LAN join to free heap for the ~17 KB TLS handshake buffer; the
mDNS responder is comparatively light, but worth watching on a real DUT that
the wss handshake still has headroom.

Closes-Linear: FUG-83 (https://linear.app/fughilli/issue/FUG-83/ap-name-and-hostname-should-match-configured-name)

Claude Agent and others added 2 commits August 6, 2026 21:42
…e name

The soft-AP SSID was hardcoded "ledmapper" and there was no mDNS/hostname
at all — only a hardcoded "ledmapper.local" baked into the wss cert SAN.

Derive both from the user-configured device name:
- AP SSID = "<name>-AP" (SSIDs allow spaces; capped to the 32-byte limit).
- hostname = a DNS-label-safe slug of the name (keep [A-Za-z0-9], collapse
  other runs to '-', trim) so <hostname>.local resolves, e.g.
  "Led Widget A1B2C3" -> "Led-Widget-A1B2C3", "TestWidget" -> "TestWidget".

Bring up the IDF mDNS responder (hostname + friendly instance name + a
_http._tcp service) so <hostname>.local resolves; set the STA/AP DHCP
hostnames too; and use <hostname>.local (not the hardcoded string) in the
wss cert SAN so https://<name>.local matches. A live rename reconfigures the
AP SSID, hostnames and mDNS, and forces a cert re-issue.

setup() is reordered so the device name is resolved before WiFi comes up;
g_cert_ip is relocated so the rename path can reset it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
FUG-83 AP name and hostname should match configured name

When the user configures the device name, that name should also be used for the AP and the hostname (for mDNS).

E.g. if the device name is TestWidget, the AP should be TestWidget-AP and the hostname should be TestWidget.local.

Review in Linear

@github-actions

github-actions Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-07 04:45 UTC

@fughilli
fughilli merged commit 0555fa1 into main Aug 7, 2026
9 checks passed
issuefleet Bot pushed a commit that referenced this pull request Aug 7, 2026
The rebase onto #56 (FUG-83) removed kApSsid (now the derived g_ap_ssid) and
added per-name hostnames + mDNS to the soft-AP bring-up. The re-onboarding
watchdog's enter_onboarding still called WiFi.softAP(kApSsid, ...) — now mirror
the initial bring-up: setHostname + softAPsetHostname + softAP(g_ap_ssid) +
mdns_begin_or_update, so a LAN-loss re-provisioning surface is identical to a
fresh boot's.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
issuefleet Bot pushed a commit that referenced this pull request Aug 9, 2026
The rebase onto #56 (FUG-83) removed kApSsid (now the derived g_ap_ssid) and
added per-name hostnames + mDNS to the soft-AP bring-up. The re-onboarding
watchdog's enter_onboarding still called WiFi.softAP(kApSsid, ...) — now mirror
the initial bring-up: setHostname + softAPsetHostname + softAP(g_ap_ssid) +
mdns_begin_or_update, so a LAN-loss re-provisioning surface is identical to a
fresh boot's.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
HITL — 4d57ace7 Deployed Aug 7, 2026 by issuefleet[bot] via hitl-e2e #70
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