rpi-imager icon indicating copy to clipboard operation
rpi-imager copied to clipboard

[FEATURE]: Wifi hotspot configuration

Open user706 opened this issue 1 month ago • 4 comments

Ah no, forget it. I just realized that the SSID etc. is to connect to a hotspot, and not to have the RPI itself open up a hotspot.

The details below are about having the pi act as a hotspot.

So this is not a bug. If it is anything, then perhaps a feature-request, to be able to configure the Rpi to act as a hotspot (Details how to do this, are below)

click here for details ### What happened?

Hi,

I used the rpi-imager customization to set a wifi access point (hotspot) with these details:

  • ssid: MyHotspot
  • password: mypass
  • hidden: false

Then created the image (using Raspberry Pi OS Lite trixie 64 bit), for a Rpi 5.

Problem is this: There is no wifi hotspot.

Problem is that this file was created: /etc/NetworkManager/system-connections/preconfigured.nmconnection

with this buggy content:

[connection]
id=preconfigured
uuid=eee818b9-03af-4fcb-98b9-20016f0d3abf
type=wifi
[wifi]
mode=infrastructure                # wrong, should be:   mode=ap
ssid=MyHotspot
hidden=false
[ipv4]
method=auto                        # wrong, should be:   method=shared
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
[wifi-security]
key-mgmt=wpa-psk
psk=b0c64329843248732048320498320  # wrong, was set to   psk=mypass

The comments show what is wrong.

If I correct the file /etc/NetworkManager/system-connections/preconfigured.nmconnection, by using the 3 fixes in the comments above, followed by:

sudo systemctl restart NetworkManager.service
sudo nmcli con reload
sleep 5
nmcli con show   # now I can see it working

then I can see the hotspot appear, and can connect to it.

Version

1.9.6

What host operating system were you using?

Debian and derivatives (eg Ubuntu)

Host OS Version

Ubuntu

Selected OS

Raspberry Pi OS Lite trixie 64 bit

Which Raspberry Pi Device are you using?

Raspberry Pi 5, 500, and Compute Modules 5

What kind of storage device are you using?

microSD Card in an internal reader

OS Customisation

  • [ ] Yes, I was using OS Customisation when the bug occurred.

Relevant log output


user706 avatar Oct 14 '25 09:10 user706

Thanks for the update, @user706

I've modified the issue to look more like a feature request, and it's certainly something I'll consider.

@paulober Do you know if netplan supports WiFi SoftAP configuration? Or would we need to do something more exotic?

tdewey-rpi avatar Oct 17 '25 12:10 tdewey-rpi

@paulober Do you know if netplan supports WiFi SoftAP configuration? Or would we need to do something more exotic?

It does support ap mode operation because we use NetworkManager as backend.

paulober avatar Oct 17 '25 12:10 paulober

Great.

Here are some basic settings one might want to consider (I'm sure there are more)

[connection]
id=preconfigured
uuid=eee818b9-03af-4fcb-98b9-20016f0d3abf
type=wifi
[wifi]
mode=ap                  # ap for access-point, i.e. hotspot
ssid=MyHotspot
hidden=false
[ipv4]
method=shared            # !
#address1=10.0.0.1/24    # this might be a good idea. See below
[ipv6]
addr-gen-mode=default
method=auto
[proxy]
[wifi-security]
key-mgmt=wpa-psk
psk=mypass                # !

If I do not include the line address1=10.0.0.1/24, then I'm a bit blind as to the wlan0 ip address of the pi. I need to somehow connect to it, e.g. over ethernet, and then call up ip a. Could then show something like 10.42.0.1/24, meaning I'd connect to the pi with command ssh [email protected].

So if you do a frontend for this feature, please consider to have a (possibly optional) setting address1, since this is a great way to then predictably have the wlan0 ip address to your own wish e.g. 10.0.0.1/24 (if address1=10.0.0.1/24).

Then I can always predictably connect to the pi, via wifi, using:

ssh [email protected]    # ip always 10.0.0.1 if set accordingly via:     address1=10.0.0.1/24

Note that under [wifi], there are other interesting settings such as band and channel (link1 link2)

user706 avatar Oct 17 '25 13:10 user706

So if you do a frontend for this feature, please consider to have a (possibly optional) setting address1, since this is a great way to then predictably have the wlan0 ip address to your own wish e.g. 10.0.0.1/24 (if address1=10.0.0.1/24).

Then I can always predictably connect to the pi, via wifi, using:

ssh [email protected]    # ip always 10.0.0.1 if set accordingly via:     address1=10.0.0.1/24

As a curiosity - is there any reason Avahi/mDNS would be insufficient for this?

ssh pi@$hostname.local

If that was sufficient, configuring the subnet could be deferred to an expert user at a later time - and while we might default to a given private range, we would select one that would be unlikely to clash with common home network and corporate networking schemes (eg, 172.16.0.0/12, which I very rarely see during my travels)

tdewey-rpi avatar Oct 17 '25 14:10 tdewey-rpi