The use case is this: the Pi will periodically ping my server. If it gets the go-ahead, it will perform some action using a relay. Otherwise it'll remain dormant.

I need to install multiple RP3s at multiple locations. I don't know what the WiFi passwords are until I get there and I'd rather not lug around an entire set of screen+mouse+keyboard.

Can't SSH into it until it's connected to the WiFi though.

What's the easiest way to have the Pi connect to an unfamiliar network without a screen/keyboard?

I was thinking maybe I can save the network name / pass in a USB file and, on boot, if there's no internet, check USBs for these files and attempt a connection.

The downside is that I'll have to have one USB per "installed" Pi.

I'm puzzled. Any ideas?


I think your idea is fine. Just copy the credentials from the USB to the Pi with a script, and then you can remove the USB.

One way to do it would be to

  1. Check if there is an USB mounted
  2. If so, copy the WiFi credentials from the USB

Put this in your crontab under the directive @reboot, and you should be fine. You edit your crontab with the command sudo crontab -e.

Even better would be to run the script to copy the credentials every time you mount a USB. You can create a udev-rule for this. Check this question over at AskUbuntu for examples.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.