1

This should be a common situation. I have configured a Pi with Bookworm to work headless on my WiFi and now want to move it to a different location with another LAN. I have the SSID and password, but cannot access that network from here and cannot access my own LAN from there. So if I move the pi to the other location I will not be able to access it (unless I also bring a monitor and keyboard...). So I want to add the other network to the network list of the Pi, but with the new nmcli command it only seems to allow me to add networks it can find (and raspi-config returns "There was an error" because the nmcli command it runs returns "No network with SSID 'myNetID' found").

Is there a way to add a wifi network (SSID + unencrypted password) so it can connect to it later, as was possible before by editing wpa_supplicant.conf?

2
  • Set up tethering on your phone with the remote SSID/password. Connect to that, then disable that tethering. When you take your RPI to the remote location it should just connect when it sees the SSID a second time. Commented Jun 7, 2024 at 16:39
  • I tried tethering, but I did not see my phone come up on the network list. But maybe I didn't try hard enough. Commented Jun 10, 2024 at 14:10

1 Answer 1

1

You should be able to do this by editing /etc/NetworkManager/system-connections/xxxx.nmconnection (I won't pretend this is straightforward but it can be done - I would start by copying an existing entry or creating an additional entry to existing network).

I can see no reason "nmcli command it only seems to allow me to add networks it can find". You should be able to specify a network - depends what you ACTUALLY did.

It is certainly possible because if you preconfigure in raspi-imager it sets up the network.

Running /usr/lib/raspberrypi-sys-mods/imager_custom set_wlan 'SSID' 'PSK' 'AU' should setup WiFi (you may need to generate PSK from password and change country code) but I haven't confirmed this manually.

See How do I set up networking on Raspberry Pi OS - Bookworm

There is no NEED to use Network Manager - it is simple to enable dhcpcd and use wpa_supplicant.

1
  • Thanks! Maybe the easiest way would be to set up the image using the credetials for the remote deployment wifi and then connect a keyboard and monitor to setup the 'developent' wifi and to configure the Pi. But I wonder if the remote wifi will then work or that the first boot script will also run into an error. Since the remote site is a half hour drive, I prefer not to do too many trial and error runs, so I decided to take an LCD screen and keyboard with me (i.e., the non-technical solution). Commented Jun 10, 2024 at 12:49

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.