Network Configuration & Service Discovery
Sources:
Documentation/source/MDNS_IMPLEMENTATION_SUMMARY.mdDocumentation/source/MDNS_LIFECYCLE_AND_SHUTDOWN.mdDocumentation/source/MULTI_IP_MDNS_ENHANCEMENT.mdDocumentation/source/MULTI_IP_TYPE_LABELING.mdDocumentation/source/TTL_AND_SHUTDOWN_IMPLEMENTATION_SUMMARY.mdDocumentation/source/NETWORK_FALLBACK_IMPLEMENTATION.mdDocumentation/source/DIAGNOSTIC_SCRIPTS_README.md
Connecting to an Accordion Device
Every Accordion device has a static IP address configured during provisioning. If a DHCP server is available on the network, the device also picks up a DHCP address. Both addresses are active simultaneously.
| Method | Example |
|---|---|
| By static IP | http://192.168.0.222:5000 |
| By DHCP IP | http://192.168.0.55:5000 |
| By mDNS hostname | http://agent64.local:5000 |
Default WebApi port: 5000
mDNS / Bonjour Service Discovery
Accordion devices advertise themselves on the LAN using mDNS/DNS-SD (the same protocol used by Apple Bonjour and Avahi on Linux). No configuration is required on the client side — any device on the same LAN subnet will see the advertisement automatically.
Service Record
| Field | Value | Example |
|---|---|---|
| Service type | _accordion._tcp.local |
— |
| Instance name | {ControllerType}-{Hostname} |
AGENTQ2-agent64 |
| Port | 10000 (hardware manager) |
— |
TXT Record Metadata
controller=AGENTQ2 # or AGENTMINI, Undefined
fw_version=<firmware>
app_version=<assembly version>
hostname=<machine name>
user=<username>
started=<ISO 8601 timestamp>
mode=normal # or programming
port_app_module=10000
port_channel_config=10001
port_resource_values=10002
port_telemetry=10003
Lifetime & Re-announcement
| Parameter | Value |
|---|---|
| TTL | 4500 seconds (75 minutes) |
| Re-announcement interval | ~37.5 minutes (TTL/2, automatic) |
| Shutdown behaviour | Sends TTL=0 goodbye packets immediately |
The mDNS record remains live indefinitely while the device is running. When the application shuts down gracefully, it sends goodbye packets (TTL=0) so clients immediately remove the device from their cache.
Implementation Note
The mDNS library used is Makaretu.Dns.Multicast. The advertiser lives in HAL/MdnsAdvertiser.cs and is started by ApplicationEngine after all modules are loaded.
Dual-Connection Network Fallback
A single NetworkManager connection cannot simultaneously support DHCP and manual static IP fallback. The solution is two connections per interface with different autoconnect priorities.
Connection Pair
| Connection Name | Method | Priority | Purpose |
|---|---|---|---|
ESharp-eth0-DHCP |
auto (DHCP) |
100 (high) | Primary — DHCP + static side-by-side when DHCP succeeds |
ESharp-eth0-Direct |
manual (static) |
10 (low) | Fallback — static IP only, no gateway |
Failover Timeline
0 s → NetworkManager tries ESharp-eth0-DHCP (priority 100)
0–10 s → DHCP request in progress (10-second timeout)
10 s → If DHCP fails, connection marked as failed
10–12 s → NetworkManager activates ESharp-eth0-Direct (priority 10)
12 s → Device reachable at static IP
Previous behaviour required 100+ seconds (multiple 25 s DHCP retry cycles). The new design reduces failover to 10–12 seconds.
Dual-Address Mode
When DHCP succeeds, the device has two active IP addresses simultaneously:
- Static IP (e.g.
192.168.0.222) — always present, known ahead of time - DHCP IP (e.g.
192.168.0.55) — dynamic, obtained from DHCP server
This allows both IT-managed networks (where DHCP is expected) and direct-connect benches (where static is required) to work without reconfiguration.
boot.config Parameters
dhcpTimeoutSeconds: 10
dhcpPriority: 100
directPriority: 10
Diagnostic Tools
Shell scripts in ../../scripts/ (relative to repo root):
| Script | Purpose |
|---|---|
quick-network-check.sh |
Color-coded status: connections, IPs, gateway, DNS, health |
capture-network-diagnostics.sh |
21-section full diagnostic log dump (timestamped) |
test-mdns-discovery.sh |
Test that mDNS service advertisement is visible |
test-mdns-shutdown.sh |
Test graceful shutdown goodbye packet behavior |
check-mdns.sh |
Quick mDNS status check |
show-all-ips.sh |
Display all configured IP addresses and their type (static/DHCP) |
IP Type Labeling
The diagnostic tools and mDNS TXT records label each IP address as:
- static — manually configured in
boot.config - DHCP — dynamically assigned by DHCP server
This labeling is visible in the TXT record metadata and in the show-all-ips.sh output.