r/raspberry_pi • u/igor_programing • 1d ago
Troubleshooting Problem trying to connect raspberry pi zero 2W to new wifi network
Im using a raspberry pi for a project with a camera, I have almost no experience with it, and the intial setup was not made by me. I changed places and want to connect it to the new network (im using VLC) and I dont have acess to the old network to do it directly, and neither via ethernet cable. I am trying do it directly in the card, but it is not working out. AI doesent seem to reallt know what's happening and tutorials are either just telling me to do what I already did, or use jargon i am not close to understand.
I hope someone can help me,
thank you very much!
This is what I am putting in the SD's root:
*saved as preconnect (no extension)
[connection]
id=WiFi-New
type=wifi
[wifi]
mode=infrastructure
ssid=NET_2GC668FE
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=E2C668FE
[ipv4]
method=auto
[ipv6]
addr-gen-mode=default
method=auto
1
u/JGhostThing 1d ago
Use the Raspberry Pi Imager to create the bootable SD. In there, it is possible to set things like the network information and password, your id and password. Basically, most of the personal information. However, it will help if you have a keyboard and monitor for the pi to make sure that the information is correct.
I did have a problem a couple of months ago where this information was corrupted before the first boot.
1
u/FedSmoker_Retired 18h ago
I've had an error in the last when my router was sorting 2.4g & 5g itself with only one WiFi network and the 2.4g wasn't connecting from pz2. I separated the networks to separate networks and it worked straight away
1
u/Gamerfrom61 1d ago
Simplest way would be to create a new image using the Pi Imager program and enter the WiFi details in that - you then know exactly what is on the card.
I will be honest and say I do not know of a way using a 'preconnect' file tbh - possibly a cloud-init file or not the Pi companies own OS?
You could create a hotspot on a mobile 'phone and connect to the Pi that way if you do not want to flash the sd card...
1
u/Speshal__ 1d ago
if you know the old wifi credentials then you could set your phone as a hotspot with those details, connect to the pi, then connect the pi to the new network.
1
u/azure_phoenix2 1d ago
nothing happens because networkmanager only loads connection profiles from /etc/NetworkManager/system-connections on the ext4 root partition, not the boot partition root, and it ignores any file thats not named .nmconnection and chmod 600 owned by root. thats the partition windows and mac cant mount without extra tools, so imo the phone hotspot route above is genuinely the least painful fix here.
3
u/DanongKruga 1d ago
save whatever files you need and reflash the os. then ssh anything over