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 192.168.10.0/24

Static gateway is:

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

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

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

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/master/dietpi.txt#L7.

Although, we could probably tweak that a bit.

this should do it?
https://github.com/Fourdee/DietPi/commit/92a028ef4b82c80b12ed1b8a4baa675c1609906b

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 :slight_smile: