1

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

  1. Host a Wi-Fi hotspot with a Raspberry Pi · raspberrypi.com
  2. Create wireless access point and share internet connection with nmcli · unix.stackexchange.com
    • Five commenters mentioning that the nmcli command does not work for them, but for the majority it seems to work
  3. 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)
  4. Turn Your Raspberry Pi into an Access Point (Bookworm ready) · raspberrytips.com
    • Uses hostapd to host the hotspot
4
  • If you are relying on device enumeration allocating an interface to your dongle you are asking for trouble. Enable predictable network interface names. wlan0 works on my Pi! Commented Feb 17 at 23:20
  • 1
    You don't seem to have allocated any IP addresses or specified a band. Commented Feb 17 at 23:24
  • Admittedly, predictable network interface names would be better, yes. However, for this question, I don't believe I am relying on device enumeration. When I physically unplug the dongle, the Pi has only one WiFi device left, which I presume will always be 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. Commented Feb 17 at 23:25
  • I am afraid setting a band (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 the 10.42.0.0/24 subnet. Just to be safe, I also specified and IP range explicitly, but to no avail. Commented Feb 17 at 23:34

1 Answer 1

0

Having recently gone through the mounds of tutorials on the internet (for which I found no single post that did the trick for me), I figured out how to make the default NetworkManager on Bookworm do what I wanted without needing hostapd, wicd, custom netmasq configurations, or any of the other recommendations that are out there.

In the end, I made 2 tutorials... one for WPA2 and one for WPA3.

Just looking at your config file, I notice that

  1. there's no MAC address identified,
  2. the radio band is not specified, and
  3. key-mgmt should be "sae" (unless you're targeting WPA/WPA2. If you are trying to target WPA2, you should change your proto to "wpa" and then make sure to hash your password into a 64 character hex key.)

At any rate, in the event that you never found a solution to get your hotspot working, take a look at the links above.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.