I have a raspberry pi that I take around the country with me when I visit various family members. I'd like to be able to configure the Pi to connect automatically to the various wifi networks at each location rather than having to do this manually each time.
The Pi runs Raspbian and headless so the configuration would need to be done from the command line.
My /etc/network/interfaces file typically looks like this:
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet static
address 192.168.0.41
netmask 255.255.255.0
gateway 192.168.0.254
wpa-ssid "MyHomeSSID"
wpa-psk "MyHomePassword"I like to use static IPs as I often need to SSH into the Pi for various reasons, but I'm happy to give this up if there's a good reason to (i.e. easier to configure and still easy to access via SSH)
I could probably knock up a script in python to do this, but I suspect there is a more correct way of doing this!
Any comments/solutions would be greatly appreciated.