How Do I Change Wifi Settings? Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
opticyclic

How Do I Change Wifi Settings?

Post by opticyclic »

As per the instructions, I flashed the image and put the wifi info (including gateway and static IP) in the dietpi.txt.
My PiZero started and connected to my wifi and I was able to connect over ssh.

However, when I go to a different house the PiZero doesn't connect because the wifi details are different.

I took the sdcard out and put it in my laptop and changed the details in the dietpi.txt then put it back and started the PiZero.
However, it still wouldn't connect to the wifi.

At least, I couldn't connect to it over ssh using the static ip I assigned and I couldn't see it on the network with

Code: Select all

sudo nmap -sP 192.168.10.0/24
Static gateway is:

Code: Select all

route -n|grep UG|awk '{print $2}'
192.168.10.1
Is there something else I need to do to change wifi details?
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: How Do I Change Wifi Settings?

Post by Fourdee »

opticyclic wrote:I took the sdcard out and put it in my laptop and changed the details in the dietpi.txt then put it back and started the PiZero.
However, it still wouldn't connect to the wifi.
Hi,

The WiFi settings in dietpi.txt are only applied during 1st run setup. After that point, you would need to change details with dietpi-config, or, edit /etc/network/interfaces on the ext4 2nd parition.

Simple solution:
- Plug in HDMI + Keyboard
- run dietpi-config > networking: adapters > change WiFi settings there
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
opticyclic

Re: How Do I Change Wifi Settings?

Post by opticyclic »

It is probably worth adding a line at the top of the file saying that the details are only read once on first boot.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: How Do I Change Wifi Settings?

Post by Fourdee »

opticyclic wrote:It is probably worth adding a line at the top of the file saying that the details are only read once on first boot.
Already exists: https://github.com/Fourdee/DietPi/blob/ ... tpi.txt#L7.

Although, we could probably tweak that a bit.

this should do it?
https://github.com/Fourdee/DietPi/commi ... 5c1609906b
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
opticyclic

Re: How Do I Change Wifi Settings?

Post by opticyclic »

That should drum it home!
I feel like the word only should be in there though.
e.g.
All settings below will be applied on the 1st boot of DietPi. ONCE ONLY.
or
All settings below will ONLY be applied on the 1st boot of DietPi.
Not that it matters too much. I'm just being picky :)
Post Reply