I'm using Rpi 3b+ and every time I carry it to any location, I have to attach it to the HDMI screen and enter the wifi credential, How can I set up a Pendrive so when I plugged in the Pendrive(for creating a notepad etc) it will automatically be connected to wifi?
Two ways I can think of:
First way does not need the Pendrive but is a bit of a clat:
I would set the Pi up to be an access point using WiFi Connect from Balena. Then when you power on the Pi you can use anything to connect to its access point and give it the locations WiFi details. Just before you leave, reset the Pi to use the WiFi connect at the next boot.
The second way using the pen drive:
- Find the ID of the pen drive (either partition or unique ID)
- Add a line in FSTAB to mount the pen drive with the nofail option
- Add a start-up script (cron @reboot) to check if the wpa_supplicant file is in the mount location
- If found MOVE it /boot and reboot the Pi
- Wait till the Pi reboots and you can find it
You could add a status LED (maybe a multi-colour one) to show you what is happening or pop a small OLED display (The Pi Hut has this tiny one) on the GPIO
Make sure you have a unique system name for your Pi - networks get upset when two machines are called the same :)