I am preparing an RPi4 unit for use as a headless data backup server placed on a remote network and connecting via WiFi.
In order for this to work on location I need to enter the WiFi connect data into the wpa_supplicant.conf file and here is the problem:
I believe that I will not have the information until I arrive on location and then I will not be able to connect to the RPi4 until it has itself connected to the WiFi...
Similar to the Hen-and-egg problem.
Possible procedure?
I can extract the SD-card from the RPi4 and put it into a USB carrier and then use my Win10 laptop to access the boot partition on the SDcard.
So I wonder if there is something I can do to write the SSID/password info to the boot partition such that it will be transferred to /etc/wpa_supplicant/wpa_supplicant.conf file on boot, and then used to connect the WiFi?
As soon as the RPi4 has connected to a network with Internet acces I have a script on board that will post the ip address of the unit to my website where I can read it and use to connect SSH.
On a brand new install disk I know that I can create a /boot/wpa_supplicant.conf file with the WiFi settings and it will be used during the setup phase of the RPi4 to make it connect to WiFi, whereupon the file is removed from /boot by the install process. But what happens if I put such a file in a fully configured RPi4 boot partition?
Will it overwrite any existing wpa_supplicant.conf file???
In which case I hope it takes a backup first....