I knew this was coming!
The cc33xx is so new, we have out of tree drivers on their 3rd revision, so i didn’t want to enable this out of the box…
Okay, so here is what my plan was for easy out of box hotspot: (mirrors what we did on the BeaglePlay, and older am335x devcies)…
In the fat partition, hostapd_file is the magic variable…
voodoo@beagley-ai:~$ cat /boot/firmware/sysconf.txt | grep hostapd
# hostapd_file - Set a configuration for hostapd https://wiki.gentoo.org/wiki/Hostapd
#hostapd_file=SoftAp0.conf
I have an BeaglePlay example under /boot/firmware/services/SoftAp0.conf
voodoo@beagley-ai:~$ cat /boot/firmware/services/SoftAp0.conf
interface=SoftAp0
ssid=BeagleBone-WiFi
# 1=wpa, 2=wep, 3=both
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
wpa_passphrase=BeagleBone
# a simply means 5GHz
# g simply means 2.4GHz band
hw_mode=g
# the channel to use
channel=1
# limit the frequencies used to those allowed in the country
#ieee80211d=1
# the country code
#country_code=US
# 802.11n support
ieee80211n=1
# QoS support, also required for full speed on 802.11n/ac/ax
wmm_enabled=1
macaddr_acl=0
ignore_broadcast_ssid=0
logger_syslog=-1
logger_syslog_level=2
So let’s test it out…
First let’s patch: /etc/udev/rules.d/81-add-SoftAp0-interface.rules
this will bring up SoftAp0 (ifconfig -a) node…
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan[0-9]", DRIVERS=="iwlwifi" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type managed"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan[0-9]", DRIVERS=="wl18xx_driver" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type managed"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="mlan[0-9]", DRIVERS=="mwifiex_pcie" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type __ap"
voodoo@beagley-ai:~$ udevadm info /sys/class/net/wlan0
P: /devices/platform/bus@f0000/fa20000.mmc/mmc_host/mmc2/mmc2:0001/mmc2:0001:2/>
M: wlan0
R: 0
U: net
T: wlan
I: 5
E: DEVPATH=/devices/platform/bus@f0000/fa20000.mmc/mmc_host/mmc2/mmc2:0001/mmc2>
E: SUBSYSTEM=net
E: DEVTYPE=wlan
E: INTERFACE=wlan0
E: IFINDEX=5
E: USEC_INITIALIZED=18298133
E: ID_NET_NAMING_SCHEME=v253
E: ID_NET_NAME_MAC=wlx3468b58e284f
E: ID_OUI_FROM_DATABASE=Texas Instruments
E: ID_MM_CANDIDATE=1
E: ID_PATH=platform-fa20000.mmc-platform-cc33xx.7.auto
E: ID_PATH_TAG=platform-fa20000_mmc-platform-cc33xx_7_auto
E: ID_NET_DRIVER=cc33xx_driver
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/80-iwd.link
E: ID_NET_NAME=wlan0
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/wlan0
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan[0-9]", DRIVERS=="iwlwifi" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type managed"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan[0-9]", DRIVERS=="wl18xx_driver" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type managed"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan[0-9]", DRIVERS=="cc33xx_driver" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type managed"
SUBSYSTEM=="net", ACTION=="add", KERNEL=="mlan[0-9]", DRIVERS=="mwifiex_pcie" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type __ap"
Uhoh…
voodoo@beagley-ai:~$ journalctl | grep SoftAp0
Jun 22 12:59:17 beagley-ai sudo[1754]: voodoo : TTY=ttyS2 ; PWD=/home/voodoo ; USER=root ; COMMAND=/usr/bin/nano /etc/udev/rules.d/81-add-SoftAp0-interface.rules
Jun 22 13:00:07 beagley-ai iwd[737]: udev interface=SoftAp0 ifindex=6
Jun 22 13:00:07 beagley-ai systemd-networkd[540]: SoftAp0: Configuring with /etc/systemd/network/SoftAp0.network.
Jun 22 13:00:07 beagley-ai systemd-networkd[540]: SoftAp0: Link UP
Jun 22 13:00:07 beagley-ai (udev-worker)[460]: wlan0: Process '/sbin/iw dev wlan0 interface add SoftAp0 type managed' failed with exit code 233.
Supported interface modes:
* managed
* AP
* AP/VLAN
* monitor
* mesh point
* P2P-client
* P2P-GO
* P2P-device
let’s try __ap mode
Jun 22 13:03:04 beagley-ai systemd-networkd[540]: SoftAp0: Configuring with /etc/systemd/network/SoftAp0.network.
Jun 22 13:03:04 beagley-ai systemd-networkd[540]: SoftAp0: Link UP
Jun 22 13:03:04 beagley-ai (udev-worker)[495]: wlan0: Process '/sbin/iw dev wlan0 interface add SoftAp0 type __ap' failed with exit code 233.
no dice… well ti has new firmware 1.0.0.4 vs 1.0.02 let’s see what that fixes…
Building with 1.0.0.4 firwmare: bb-wl18xx-firmware (1.20240622.0) (5af2a8c2) · Commits · BeagleBoard.org / repos-arm64 · GitLab
Okay, let’s update:
sudo apt update
sudo apt-get upgrade -yq
voodoo@beagley-ai:~$ sudo apt-get upgrade -yq
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
The following packages will be upgraded:
bb-wl18xx-firmware firefox-nightly
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 64.4 MB of archives.
After this operation, 20.5 kB disk space will be freed.
Get:2 https://packages.mozilla.org/apt mozilla/main arm64 firefox-nightly arm64 129.0a1~20240621215457 [63.5 MB]
Get:1 https://debian.beagle.cc/arm64 bookworm/main arm64 bb-wl18xx-firmware all 1.20240622.0-0~bookworm+20240622 [866 kB]
Fetched 64.4 MB in 4s (15.2 MB/s)
(Reading database ... 128764 files and directories currently installed.)
Preparing to unpack .../firefox-nightly_129.0a1~20240621215457_arm64.deb ...
Unpacking firefox-nightly (129.0a1~20240621215457) over (129.0a1~20240621100955) ...
Preparing to unpack .../bb-wl18xx-firmware_1.20240622.0-0~bookworm+20240622_all.deb ...
Unpacking bb-wl18xx-firmware (1.20240622.0-0~bookworm+20240622) over (1.20240515.0-0~bookworm+20240515) ...
Setting up bb-wl18xx-firmware (1.20240622.0-0~bookworm+20240622) ...
bb-wl18xx-firmware: [wl18xx-fw-4-8.9.0.0.83.bin] was set in /etc/default/bb-wl18xx-fw
'/usr/lib/firmware/ti-connectivity/git/wl18xx-fw-4-8.9.0.0.83.bin' -> '/usr/lib/firmware/ti-connectivity/wl18xx-fw-4.bin'
update-initramfs: deferring update (trigger activated)
Setting up firefox-nightly (129.0a1~20240621215457) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for initramfs-tools (0.142) ...
update-initramfs: Generating /boot/initrd.img-6.1.80-ti-arm64-r57
Scanning processes...
Scanning processor microcode...
Scanning linux images...
Running kernel seems to be up-to-date.
The processor microcode seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
Now let’s update the /boot/firmware/initrd.img (don’t want it loading the old 1.0.0.3 firmware
sudo cp -v /boot/initrd.img-`uname -r` /boot/firmware/initrd.img
voodoo@beagley-ai:~$ sudo cp -v /boot/initrd.img-`uname -r` /boot/firmware/initrd.img
'/boot/initrd.img-6.1.80-ti-arm64-r57' -> '/boot/firmware/initrd.img'
ti sneaky, firmware is under wlcore:
voodoo@beagley-ai:~$ dmesg | grep wlcore: | grep version
[ 42.953371] wlcore: Wireless driver version 1.7.0.114
[ 42.953843] wlcore: Wireless firmware version 1.7.0.130
[ 42.953863] wlcore: Wireless PHY version 1.2.36.5.22.66
going to add that to beagle-version too… bb-beagle-version (1.20240622.0) (3131fc8b) · Commits · BeagleBoard.org / repos-arm64 · GitLab
Nope no dice with new firmware
voodoo@beagley-ai:~$ journalctl | grep SoftAp0
Jun 22 13:30:55 beagley-ai iwd[689]: udev interface=SoftAp0 ifindex=6
Jun 22 13:30:55 beagley-ai systemd-networkd[539]: SoftAp0: Configuring with /etc/systemd/network/SoftAp0.network.
Jun 22 13:30:55 beagley-ai systemd-networkd[539]: SoftAp0: Link UP
Jun 22 13:30:55 beagley-ai (udev-worker)[492]: wlan0: Process '/sbin/iw dev wlan0 interface add SoftAp0 type managed' failed with exit code 233.
Okay, now we’ve got progress…
voodoo@beagley-ai:~$ journalctl | grep SoftAp0
Jun 22 14:33:54 beagley-ai iwd[693]: udev interface=SoftAp0 ifindex=5
Jun 22 14:33:54 beagley-ai systemd-networkd[547]: SoftAp0: Configuring with /etc/systemd/network/SoftAp0.network.
Jun 22 14:33:54 beagley-ai systemd-networkd[547]: SoftAp0: Link UP
iwd was stealing my inteface… told it to ignore it… wiphy.c: add cc33xx_driver to driver_info to stop iwd from re-create the netdev (2f58a008) · Commits · BeagleBoard.org / Iwd · GitLab
Now let’s patch: /etc/udev/rules.d/82-SoftAp0-start-hostpad.rules
SUBSYSTEM=="net", KERNEL=="SoftAp0", DRIVERS=="iwlwifi", TAG+="systemd", ENV{SYSTEMD_WANTS}="hostapd@SoftAp0.service"
SUBSYSTEM=="net", KERNEL=="SoftAp0", DRIVERS=="mwifiex_pcie", TAG+="systemd", ENV{SYSTEMD_WANTS}="hostapd@SoftAp0.service"
SUBSYSTEM=="net", KERNEL=="SoftAp0", DRIVERS=="wl18xx_driver", TAG+="systemd", ENV{SYSTEMD_WANTS}="hostapd@SoftAp0.service"
SUBSYSTEM=="net", KERNEL=="SoftAp0", DRIVERS=="iwlwifi", TAG+="systemd", ENV{SYSTEMD_WANTS}="hostapd@SoftAp0.service"
SUBSYSTEM=="net", KERNEL=="SoftAp0", DRIVERS=="mwifiex_pcie", TAG+="systemd", ENV{SYSTEMD_WANTS}="hostapd@SoftAp0.service"
SUBSYSTEM=="net", KERNEL=="SoftAp0", DRIVERS=="wl18xx_driver", TAG+="systemd", ENV{SYSTEMD_WANTS}="hostapd@SoftAp0.service"
SUBSYSTEM=="net", KERNEL=="SoftAp0", DRIVERS=="cc33xx_driver", TAG+="systemd", ENV{SYSTEMD_WANTS}="hostapd@SoftAp0.service"
sudo update-initramfs -uk `uname -r`
sudo cp -v /boot/initrd.img-`uname -r` /boot/firmware/initrd.img
Okay, that’s now looking good…
voodoo@beagley-ai:~$ journalctl | grep SoftAp0
Jun 22 14:41:48 beagley-ai iwd[695]: udev interface=SoftAp0 ifindex=5
Jun 22 14:41:48 beagley-ai systemd-networkd[533]: SoftAp0: Configuring with /etc/systemd/network/SoftAp0.network.
Jun 22 14:41:48 beagley-ai systemd-networkd[533]: SoftAp0: Link UP
Jun 22 14:41:48 beagley-ai systemd[1]: Condition check resulted in sys-subsystem-net-devices-SoftAp0.device - /sys/subsystem/net/devices/SoftAp0 being skipped.
Jun 22 14:41:48 beagley-ai systemd[1]: hostapd@SoftAp0.service - Access point and authentication server for Wi-Fi and Ethernet (SoftAp0) was skipped because of an unmet condition check (ConditionFileNotEmpty=/etc/hostapd/SoftAp0.conf).
So let’s modify /boot/firmware/services/SoftAp0.conf
voodoo@beagley-ai:~$ cat /boot/firmware/services/SoftAp0.conf
interface=SoftAp0
ssid=BeagleY-AI-WiFi
# 1=wpa, 2=wep, 3=both
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
wpa_passphrase=BeagleBone
# a simply means 5GHz
# g simply means 2.4GHz band
hw_mode=g
# the channel to use
channel=1
# limit the frequencies used to those allowed in the country
ieee80211d=1
# the country code
country_code=US
# 802.11n support
ieee80211n=1
# QoS support, also required for full speed on 802.11n/ac/ax
wmm_enabled=1
macaddr_acl=0
ignore_broadcast_ssid=0
logger_syslog=-1
logger_syslog_level=2
and set it for auto-configuration… (goal is just for end users to copy teh file…)
voodoo@beagley-ai:~$ cat /boot/firmware/sysconf.txt | grep hostapd
# hostapd_file - Set a configuration for hostapd https://wiki.gentoo.org/wiki/Hostapd
hostapd_file=SoftAp0.conf
sudo reboot
Checking bbbio-set-sysconf to see if it did it’s job:
voodoo@beagley-ai:~$ journalctl | grep bbbio-set-sysconf
Jun 22 14:41:42 beagley-ai systemd[1]: Starting bbbio-set-sysconf.service - BeagleBoard Set up system configuration...
Jun 22 14:41:43 beagley-ai bbbio-set-sysconf[745]: Reading the system configuration settings from /boot/firmware/sysconf.txt
Jun 22 14:41:43 beagley-ai bbbio-set-sysconf[753]: Reading the system configuration settings from /boot/firmware/sysconf.txt
Jun 22 14:41:43 beagley-ai systemd[1]: bbbio-set-sysconf.service: Deactivated successfully.
Jun 22 14:41:43 beagley-ai systemd[1]: Finished bbbio-set-sysconf.service - BeagleBoard Set up system configuration.
Jun 22 14:45:44 beagley-ai systemd[1]: Starting bbbio-set-sysconf.service - BeagleBoard Set up system configuration...
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[724]: Reading the system configuration settings from /boot/firmware/sysconf.txt
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[730]: Reading the system configuration settings from /boot/firmware/sysconf.txt
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[736]: Setting up hostapd with 'SoftAp0.conf'
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[749]: Setting up hostapd with 'SoftAp0.conf'
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[772]: **********************************************
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[784]: **********************************************
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[789]: Rebooting after setting up sysconf.txt options
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[797]: Rebooting after setting up sysconf.txt options
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[800]: **********************************************
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[804]: **********************************************
Jun 22 14:45:47 beagley-ai systemd[1]: bbbio-set-sysconf.service: Deactivated successfully.
Jun 22 14:45:47 beagley-ai systemd[1]: Stopped bbbio-set-sysconf.service - BeagleBoard Set up system configuration.
Jun 22 14:46:18 beagley-ai systemd[1]: Starting bbbio-set-sysconf.service - BeagleBoard Set up system configuration...
Jun 22 14:46:19 beagley-ai bbbio-set-sysconf[742]: Reading the system configuration settings from /boot/firmware/sysconf.txt
Jun 22 14:46:19 beagley-ai bbbio-set-sysconf[755]: Reading the system configuration settings from /boot/firmware/sysconf.txt
Jun 22 14:46:19 beagley-ai systemd[1]: bbbio-set-sysconf.service: Deactivated successfully.
Jun 22 14:46:19 beagley-ai systemd[1]: Finished bbbio-set-sysconf.service - BeagleBoard Set up system configuration.
Checking hostapd service
voodoo@beagley-ai:~$ journalctl | grep hostapd
Jun 22 14:45:15 beagley-ai systemd[1]: Removed slice system-hostapd.slice - Slice /system/hostapd.
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[736]: Setting up hostapd with 'SoftAp0.conf'
Jun 22 14:45:45 beagley-ai bbbio-set-sysconf[749]: Setting up hostapd with 'SoftAp0.conf'
Jun 22 14:46:24 beagley-ai systemd[1]: Created slice system-hostapd.slice - Slice /system/hostapd.
Jun 22 14:46:24 beagley-ai systemd[1]: Starting hostapd@SoftAp0.service - Access point and authentication server for Wi-Fi and Ethernet (SoftAp0)...
Jun 22 14:46:24 beagley-ai (hostapd)[1061]: hostapd@SoftAp0.service: Referenced but unset environment variable evaluates to an empty string: DAEMON_OPTS
Jun 22 14:46:24 beagley-ai hostapd[1061]: SoftAp0: interface state UNINITIALIZED->COUNTRY_UPDATE
Jun 22 14:46:24 beagley-ai hostapd[1061]: SoftAp0: interface state COUNTRY_UPDATE->ENABLED
Jun 22 14:46:24 beagley-ai hostapd[1061]: SoftAp0: AP-ENABLED
Jun 22 14:46:24 beagley-ai systemd[1]: Started hostapd@SoftAp0.service - Access point and authentication server for Wi-Fi and Ethernet (SoftAp0).
Checking SoftAp0 Interface:
voodoo@beagley-ai:~$ sudo ifconfig -a SoftAp0
SoftAp0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.1 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::3468:b5ff:fe8e:2850 prefixlen 64 scopeid 0x20<link>
ether 36:68:b5:8e:28:50 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 57 bytes 11122 (10.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
But uhoh… wlan0… lost ip… i’m still on eth0 atleast… trying sudo dhclient wlan0
voodoo@beagley-ai:~$ sudo ifconfig -a wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::3668:b5ff:fe8e:284f prefixlen 64 scopeid 0x20<link>
ether 34:68:b5:8e:28:4f txqueuelen 1000 (Ethernet)
RX packets 2 bytes 282 (282.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 8900 (8.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
My phone see’s it, but internally, lots of:
Jun 22 14:54:47 beagley-ai hostapd[1065]: SoftAp0: STA 86:6d:e7:95:96:0c IEEE 802.11: authenticated
Jun 22 14:54:47 beagley-ai hostapd[1065]: SoftAp0: STA 86:6d:e7:95:96:0c IEEE 802.11: associated (aid 1)
Jun 22 14:54:47 beagley-ai hostapd[1065]: SoftAp0: STA 86:6d:e7:95:96:0c RADIUS: starting accounting session 94E5DF2C7E08A296
Jun 22 14:54:47 beagley-ai hostapd[1065]: SoftAp0: STA 86:6d:e7:95:96:0c WPA: pairwise key handshake completed (RSN)
Jun 22 14:55:05 beagley-ai hostapd[1065]: SoftAp0: STA 86:6d:e7:95:96:0c IEEE 802.11: disassociated
Jun 22 14:55:06 beagley-ai hostapd[1065]: SoftAp0: STA 86:6d:e7:95:96:0c IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
and will not just stay connected…
okay, rerying the not-as cool __ap
option:
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan[0-9]", DRIVERS=="cc33xx_driver" \
RUN+="/sbin/iw dev %k interface add SoftAp0 type __ap"
We get both interfaces now:
voodoo@beagley-ai:~$ sudo ifconfig -a SoftAp0
SoftAp0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.1 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::3468:b5ff:fe8e:2850 prefixlen 64 scopeid 0x20<link>
ether 36:68:b5:8e:28:50 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 69 bytes 12768 (12.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
voodoo@beagley-ai:~$ sudo ifconfig -a wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.76 netmask 255.255.252.0 broadcast 192.168.3.255
inet6 fd67:8008:348d:efe5:3668:b5ff:fe8e:284f prefixlen 64 scopeid 0x0<global>
inet6 fe80::3668:b5ff:fe8e:284f prefixlen 64 scopeid 0x20<link>
ether 34:68:b5:8e:28:4f txqueuelen 1000 (Ethernet)
RX packets 330 bytes 75633 (73.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 90 bytes 24589 (24.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I can ping my phone now…
voodoo@beagley-ai:~$ ping 192.168.8.205
PING 192.168.8.205 (192.168.8.205) 56(84) bytes of data.
64 bytes from 192.168.8.205: icmp_seq=1 ttl=64 time=62.2 ms
64 bytes from 192.168.8.205: icmp_seq=2 ttl=64 time=28.2 ms
64 bytes from 192.168.8.205: icmp_seq=3 ttl=64 time=14.8 ms
64 bytes from 192.168.8.205: icmp_seq=4 ttl=64 time=30.8 ms
Regards,