uGateway: WiFi Settings not Sticking

The Wifi guide gets it up and working but I think its not quite there. But it might be just me being a Raspberry Pi newbie.

[edit] Manually adding credentials from the desktop works & it remembers between reboots. Also, the SD card image supplied to me has been set up with 4 partitions including a Recovery in addition to the Boot one and what appears to be 2 linux partitions … so I am not sure if that is muddying the waters.

It will work as advertised once but it does “consume” the wifi file (ie appears to delete the file wpa_supplicant.conf after booting) and it wont remember your wifi credentials next time you power up (unless of course you recreate the file again). Now this could be because I have not changed the default password yet.

Is there any secrets to making this great headless wifi solution stick so you only have to do this once and then power on to whatever wifi’s the Raspberry Pi has been given access?


I had this same issue myself, a quick google found me the following:

The removal of the ssh and wpa_supplicant.conf files on boot is normal. Once the RPi boots, everything should be persistent and the network and ssh available on subsequent boots. If you want to keep copies “just in case”, you can create a .zip archive of those files in /boot and it will not be removed.

As to your wireless network not being recognized, it sounds like you’re using raspbian stretch. Try adding the follwing lines to the top of your wpa_supplicant.conf :

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Change US to your 2 character country code. From what I’ve read, the ctrl_interface line is the real trick, but the others are recommended.

From here: wifi - Raspberry Pi Zero W keeps deleting wpa_supplicant.conf and ssh file - Raspberry Pi Stack Exchange

Hope this helps!


Just realised this is also included in the Tutorial right here on CEs own website :slight_smile: :

Thanks @Arnold16700. I sort of nutted through what was going on but being unfamiliar with the Raspberry Pi platform and I didn’t gleam the additional steps from the tutorial I guess, it was a good learning experience. I just thought I would mention it so others wouldn’t fall into the same blunder.

1 Like

Glad you got it sorted!

Hi Peter,

I decided to double check ouruGateway Wifi Setup Guide that you were following after reading your post.

It is normal for your card to have multiple partitions, just ignore all of them but the boot partition.

When you create a wpa_supplicant.conf file in the boot partition, it will be consumed when you boot up the Pi next, however, the wifi settings should be saved even upon consecutive boots.

When I tested it this morning on a fresh image it worked as expected, and retained the WIFI settings after rebooting. I used the code provided within the tutorial, only changing “MyWiFiNetwork” to our actual WIFI name (case sensitive), and “aVeryStrongPassword” to our password.

Changing the password on the Pi should not affect your ability to make changes or save settings in relation to your wifi.

I hope that helps clear things up! Glad you got it to work!