Skip to content

Commit bced26c

Browse files
committed
Merge branch 'avah/wifi6' into robocup_2026
2 parents 9f1fe5d + 23c6b81 commit bced26c

1 file changed

Lines changed: 41 additions & 3 deletions

File tree

src/software/embedded/ansible/tasks/setup_wifi_6e.yml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@
3232
# The 6 GHz network uses WPA3-SAE (mandatory on 6 GHz). We render a NetworkManager
3333
# keyfile (0600, root) instead of `nmcli ... psk=...` so the passphrase never
3434
# appears on a command line or in playbook output. A higher autoconnect priority
35-
# than the imager-provisioned connection makes the robot prefer 6E when available
36-
# and fall back to the existing network if 6 GHz is ever unreachable.
35+
# than the imager-provisioned connection makes the robot prefer 6E on the AX210.
36+
# The imager WiFi 5 connection is separately pinned to the built-in radio (see the
37+
# next task) so it can never autoconnect on the tri-band AX210 and hijack the 6E
38+
# interface; the robot still falls back to WiFi 5 on the built-in card when 6 GHz
39+
# is unreachable.
3740
- name: Install the WiFi 6E (WPA3-SAE) NetworkManager connection
3841
become: true
3942
become_method: ansible.builtin.sudo
@@ -47,11 +50,46 @@
4750
tags:
4851
- setup_wifi_6e
4952

53+
# The imager-provisioned WiFi 5 connection has no interface binding, so it can
54+
# autoconnect on the tri-band AX210 (tbotswifi6) and hijack the 6E radio whenever
55+
# the 6 GHz network is momentarily unavailable, leaving tbotswifi6 associated to
56+
# the WiFi 5 SSID. Pin every non-mezz WiFi connection to the built-in WiFi 5 radio
57+
# (tbotswifi5) so the AX210 stays exclusively on the 6E network and WiFi 5 only
58+
# ever runs on the built-in card. (Connection names containing ':' are not handled
59+
# - none of ours do.)
60+
- name: Pin the WiFi 5 connection(s) to the tbotswifi5 interface
61+
become: true
62+
become_method: ansible.builtin.sudo
63+
ansible.builtin.shell:
64+
executable: /bin/bash
65+
cmd: |
66+
set -euo pipefail
67+
changed=0
68+
wifi_conns="$(nmcli -t -f NAME,TYPE connection show \
69+
| awk -F: '$2 == "802-11-wireless" { print $1 }')"
70+
while IFS= read -r name; do
71+
if [ -z "$name" ] || [ "$name" = "{{ wifi_6e_ssid }}" ]; then
72+
continue
73+
fi
74+
current="$(nmcli -g connection.interface-name connection show "$name" || true)"
75+
if [ "$current" != "tbotswifi5" ]; then
76+
nmcli connection modify "$name" connection.interface-name tbotswifi5
77+
changed=1
78+
fi
79+
done <<< "$wifi_conns"
80+
if [ "$changed" -eq 1 ]; then
81+
echo CHANGED
82+
fi
83+
register: wifi5_pin
84+
changed_when: "'CHANGED' in wifi5_pin.stdout"
85+
tags:
86+
- setup_wifi_6e
87+
5088
- name: Reload NetworkManager connections
5189
become: true
5290
become_method: ansible.builtin.sudo
5391
ansible.builtin.command: nmcli connection reload
54-
when: wifi_6e_conn is changed
92+
when: wifi_6e_conn is changed or wifi5_pin is changed
5593
changed_when: false
5694
tags:
5795
- setup_wifi_6e

0 commit comments

Comments
 (0)