How Do I Change Wifi Settings?

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

sudo nmap -sP

Static gateway is:

route -n|grep UG|awk '{print $2}'

Is there something else I need to do to change wifi details?


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

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:

Although, we could probably tweak that a bit.

this should do it?

That should drum it home!
I feel like the word only should be in there though.

All settings below will be applied on the 1st boot of DietPi. ONCE ONLY.


All settings below will ONLY be applied on the 1st boot of DietPi.

Not that it matters too much. I’m just being picky :slight_smile: