I am running a Raspberry Pi 3 Model B using a freshly installed Raspberry OS (Debian 12 (bookworm)) and want to use it to provide a WiFi hotspot. This should be possible according to a tutorial on the Raspberry Pi website¹. All that is needed is a single NetworkManager command:
# On Raspberry Pi: sudo nmcli dev wifi hotspot ifname wlan0 ssid MyPiHotspot password MyVerySecurePassword However, this does not work using the internal WiFi (wlan0). While the SSID is broadcast, connecting to it using any other device fails with a “wrong password” error and repeatedly asks for it. This happens regardless of whether I try to initiate the connection via GUI or nmcli. Here a quick capture of the failed connection attempt with nmcli.
# On my normal laptop: sudo nmcli dev wifi connect MyPiHotspot --ask Push of the WPS button on the router or a password is required to access the wireless network 'MyPiHotspot'. Password (802-11-wireless-security.psk): ******************** Passwords or encryption keys are required to access the wireless network 'MyPiHotspot'. Password (802-11-wireless-security.psk): ******************** Passwords or encryption keys are required to access the wireless network 'MyPiHotspot'. Password (802-11-wireless-security.psk): ******************** Passwords or encryption keys are required to access the wireless network 'MyPiHotspot'. Password (802-11-wireless-security.psk): ******************** Passwords or encryption keys are required to access the wireless network 'MyPiHotspot'. Password (802-11-wireless-security.psk): ******************** Passwords or encryption keys are required to access the wireless network 'MyPiHotspot'. Password (802-11-wireless-security.psk): Everything, however, works flawlessly when I use an external WiFi dongle (and replace the wlan0 with wlan1 in the command). Other than that, I did not change any settings whatsoever.
Contents of /etc/NetworkManager/system-connections/Hotspot.nmconnection (auto-generated by the nmcli dev wifi hotspot ... command):
[connection] id=Hotspot uuid=a58d13bb-4d84-4b20-8bea-7b061c73ed0c type=wifi autoconnect=false interface-name=wlan1 [wifi] mode=ap ssid=MyPiHotspot [wifi-security] group=ccmp; key-mgmt=wpa-psk pairwise=ccmp; proto=rsn; psk=MyVerySecurePassword [ipv4] method=shared [ipv6] addr-gen-mode=default method=ignore [proxy] As said, this works. Only when replacing this with wlan0, it doesn't work.
Using internal WiFi to connect to some other WiFi works flawlessly. So the internal WiFi is not (completely) broken.
sudo journalctl -u NetworkManager -f does not log anything at all when I try to connect to the WiFi, but that seems to be standard. sudo dmesg -w on the Rasppberry Pi also does not output anything when trying to connect from another device, but that also seems standard.
What might cause this issue? Is my WiFi chip partially broken on the hardware side and I should just give up? Or is this fixable (preferably using software)?
Update: Interestingly enough, using hostapd seems like it might work. I haven't finished manually configuring DHCP, DNS and forwarding; but the WiFi hotspot is running on the Pi with the built-in interface, and I can connect to it using another device.
Further reading
- Host a Wi-Fi hotspot with a Raspberry Pi · raspberrypi.com
- Create wireless access point and share internet connection with nmcli · unix.stackexchange.com
- Five commenters mentioning that the
nmclicommand does not work for them, but for the majority it seems to work
- Five commenters mentioning that the
- Raspberry Pi Hotspot/Access Point not working, no connection whatsoever · raspberrypi.stackexchange.com
- Problem there seems to be at a later stage (devices seem to be able to connect to the Pi, they just can't get internet)
- Turn Your Raspberry Pi into an Access Point (Bookworm ready) · raspberrytips.com
- Uses
hostapdto host the hotspot
- Uses
wlan0works on my Pi!wlan0. I just mentioned the dongle to rule out the possibility that the configuration is broken; because this exact same configuration works with the dongle.sudo nmcli con modify Hotspot 802-11-wireless.band bg) did not have any effect. When no IP address is given, NetworkManager defaults to allocating IPs from the10.42.0.0/24subnet. Just to be safe, I also specified and IP range explicitly, but to no avail.