Skip to main content
replaced http://raspberrypi.stackexchange.com/ with https://raspberrypi.stackexchange.com/
Source Link

recently I got my WiFi connection running for my home network. Next step was to improve my script and make it possible to access multiple WiFi networks without always changing my /etc/network/interfaces. Also I want all to have a static IP for each of these networks. Therefore I changed my code quiet a bit.

As a role model served the best rated answer of an older post (wifi setup for multiple networks)an older post (wifi setup for multiple networks). It seemed to be quiet sweet, due to I'm just starting using the Raspberry and in consequence of my researches, I was able to understand there everything.

So I did the following:

/etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
   ssid="SCHOOLS NETWORK NAME"
   psk="SCHOOLS PASSWORD"
   id_str="school"
}

network={
   ssid="HOME NETWORK NAME"
   psk="HOME PASSWORD"
   id_str="home"
}

/etc/network/interfaces:

   auto lo

   iface lo inet loopback
   iface eth0 inet dhcp


   allow-hotplug wlan0
   iface wlan0 inet manual
   wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf


   iface school inet static
   address static.school.address
   gateway school.gateway.address
   netmask school.netmask.address

   iface home inet static
   address static.home.address
   gateway home.gateway.address
   netmask home.netmask.address

I searched a lot of posts and googled and tried now for a couple of hours (if not even days) but didn't find a solution. My first guess was that the whitespaces in my SSID cause problems, but therefore I use " " (also tried using ' '). Same with my password, where a # appears, but I hope I solved that problem by simply having the PW/SSID in quotation marks. I didn't really find a solution for my problem, but I'm sure some of you can help me. Thanks in advance

recently I got my WiFi connection running for my home network. Next step was to improve my script and make it possible to access multiple WiFi networks without always changing my /etc/network/interfaces. Also I want all to have a static IP for each of these networks. Therefore I changed my code quiet a bit.

As a role model served the best rated answer of an older post (wifi setup for multiple networks). It seemed to be quiet sweet, due to I'm just starting using the Raspberry and in consequence of my researches, I was able to understand there everything.

So I did the following:

/etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
   ssid="SCHOOLS NETWORK NAME"
   psk="SCHOOLS PASSWORD"
   id_str="school"
}

network={
   ssid="HOME NETWORK NAME"
   psk="HOME PASSWORD"
   id_str="home"
}

/etc/network/interfaces:

   auto lo

   iface lo inet loopback
   iface eth0 inet dhcp


   allow-hotplug wlan0
   iface wlan0 inet manual
   wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf


   iface school inet static
   address static.school.address
   gateway school.gateway.address
   netmask school.netmask.address

   iface home inet static
   address static.home.address
   gateway home.gateway.address
   netmask home.netmask.address

I searched a lot of posts and googled and tried now for a couple of hours (if not even days) but didn't find a solution. My first guess was that the whitespaces in my SSID cause problems, but therefore I use " " (also tried using ' '). Same with my password, where a # appears, but I hope I solved that problem by simply having the PW/SSID in quotation marks. I didn't really find a solution for my problem, but I'm sure some of you can help me. Thanks in advance

recently I got my WiFi connection running for my home network. Next step was to improve my script and make it possible to access multiple WiFi networks without always changing my /etc/network/interfaces. Also I want all to have a static IP for each of these networks. Therefore I changed my code quiet a bit.

As a role model served the best rated answer of an older post (wifi setup for multiple networks). It seemed to be quiet sweet, due to I'm just starting using the Raspberry and in consequence of my researches, I was able to understand there everything.

So I did the following:

/etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
   ssid="SCHOOLS NETWORK NAME"
   psk="SCHOOLS PASSWORD"
   id_str="school"
}

network={
   ssid="HOME NETWORK NAME"
   psk="HOME PASSWORD"
   id_str="home"
}

/etc/network/interfaces:

   auto lo

   iface lo inet loopback
   iface eth0 inet dhcp


   allow-hotplug wlan0
   iface wlan0 inet manual
   wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf


   iface school inet static
   address static.school.address
   gateway school.gateway.address
   netmask school.netmask.address

   iface home inet static
   address static.home.address
   gateway home.gateway.address
   netmask home.netmask.address

I searched a lot of posts and googled and tried now for a couple of hours (if not even days) but didn't find a solution. My first guess was that the whitespaces in my SSID cause problems, but therefore I use " " (also tried using ' '). Same with my password, where a # appears, but I hope I solved that problem by simply having the PW/SSID in quotation marks. I didn't really find a solution for my problem, but I'm sure some of you can help me. Thanks in advance

Source Link
user28969
user28969

Multiple WiFi-Connections with static IP

recently I got my WiFi connection running for my home network. Next step was to improve my script and make it possible to access multiple WiFi networks without always changing my /etc/network/interfaces. Also I want all to have a static IP for each of these networks. Therefore I changed my code quiet a bit.

As a role model served the best rated answer of an older post (wifi setup for multiple networks). It seemed to be quiet sweet, due to I'm just starting using the Raspberry and in consequence of my researches, I was able to understand there everything.

So I did the following:

/etc/wpa_supplicant/wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
   ssid="SCHOOLS NETWORK NAME"
   psk="SCHOOLS PASSWORD"
   id_str="school"
}

network={
   ssid="HOME NETWORK NAME"
   psk="HOME PASSWORD"
   id_str="home"
}

/etc/network/interfaces:

   auto lo

   iface lo inet loopback
   iface eth0 inet dhcp


   allow-hotplug wlan0
   iface wlan0 inet manual
   wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf


   iface school inet static
   address static.school.address
   gateway school.gateway.address
   netmask school.netmask.address

   iface home inet static
   address static.home.address
   gateway home.gateway.address
   netmask home.netmask.address

I searched a lot of posts and googled and tried now for a couple of hours (if not even days) but didn't find a solution. My first guess was that the whitespaces in my SSID cause problems, but therefore I use " " (also tried using ' '). Same with my password, where a # appears, but I hope I solved that problem by simply having the PW/SSID in quotation marks. I didn't really find a solution for my problem, but I'm sure some of you can help me. Thanks in advance