I have an issue with the Raspberry Pi Compute Module 4 configured as an access point (AP), that it will not show up on a WiFi scan from external devices. I'm using an older Debian Bullseye OS image but I can reproduce it with a recent Raspberry Pi OS lite image on a Pi 400. After power on, I run hostapd to start the AP on wlan1. The AP will show up on an AP scan from my Windows laptop. Then I stop hostapd, and configure a station on wlan0 with wpa_supplicant. I stop wpa_supplicant and restart hostapd. There is no difference with hostapd debug output between the working and non-working cases. And iw indicates transmit power. But the AP does not show up on a WiFi scan. I am unable to re-establish the AP unless I repower the unit.
The CM4 has a stripped down OS image without NetworkManager that I built locally with pi-gen.
Here is how to reproduce the problem with a Pi 400.
1. Load OS Lite on the Pi 400. Power up and do any initial configuration.
2. Log in and give root a password. Then re-login as root to make things simpler.
3. Update apt and install hostapd "apt install hostapd".
4. Disable NetworkManager, hostapd and wpa_supplicant.
systemctl disable NetworkManager
systemctl disable hostapd
systemctl disable wpa_supplicant
5. Reboot and log in as root. You should have a system with no active networking but eth0 and wlan0 interfaces available.
6. Create the wlan1 interface:
iw dev wlan0 interface add wlan1 type __ap
7. Create /etc/hostapd/hostapd.conf:8. Create /etc/wpa_supplicant/wpa_supplicant.conf:9. Start the AP, "systemctl start hostapd". The station IM-TEST will show up on an external WiFi scan. You can connect to it, but you won't be served an IP address.
10. Stop the AP "systemctl stop hostapd". Wait for it to disappear from the WiFi scan.
11. Start the station: "wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0". You won't get an IP address because the DHCP client isn't running.
12. Stop the station: "wpa_cli terminate".
13. Start the AP again, "systemctl start hostapd". All indications from the Pi is that the AP is active, but it never shows up on a WiFi scan.
The problem seem to manifest itself after running wpa_supplicant on wlan0. Note that the AP and station are never running at the same time. I can also stop and start the AP without a problem.
Does anyone have an idea on how to fix this problem? The CM4 is installed in an industrial device and the Linux partition is almost full, so the simpler the solution the better.
The CM4 has a stripped down OS image without NetworkManager that I built locally with pi-gen.
Here is how to reproduce the problem with a Pi 400.
1. Load OS Lite on the Pi 400. Power up and do any initial configuration.
2. Log in and give root a password. Then re-login as root to make things simpler.
3. Update apt and install hostapd "apt install hostapd".
4. Disable NetworkManager, hostapd and wpa_supplicant.
systemctl disable NetworkManager
systemctl disable hostapd
systemctl disable wpa_supplicant
5. Reboot and log in as root. You should have a system with no active networking but eth0 and wlan0 interfaces available.
6. Create the wlan1 interface:
iw dev wlan0 interface add wlan1 type __ap
7. Create /etc/hostapd/hostapd.conf:
Code:
interface=wlan1ctrl_interface=/var/run/hostapddriver=nl80211ssid=IM-TESThw_mode=gchannel=6wpa=2wpa_key_mgmt=WPA-PSKwpa_pairwise=TKIPrsn_pairwise=CCMPwpa_passphrase=12345678country_code=USieee80211n=1ieee80211ac=1wmm_enabled=1wme_enabled=1auth_algs=1ignore_broadcast_ssid=0ht_capab=[HT40][SHORT-GI-20]max_num_sta=255
Code:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1country=USap_scan=1network={ ssid="<a local ssid>" psk="<password>"}
10. Stop the AP "systemctl stop hostapd". Wait for it to disappear from the WiFi scan.
11. Start the station: "wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0". You won't get an IP address because the DHCP client isn't running.
12. Stop the station: "wpa_cli terminate".
13. Start the AP again, "systemctl start hostapd". All indications from the Pi is that the AP is active, but it never shows up on a WiFi scan.
The problem seem to manifest itself after running wpa_supplicant on wlan0. Note that the AP and station are never running at the same time. I can also stop and start the AP without a problem.
Does anyone have an idea on how to fix this problem? The CM4 is installed in an industrial device and the Linux partition is almost full, so the simpler the solution the better.
Statistics: Posted by murrellr — Wed Dec 18, 2024 7:25 pm