Raspbian - How to connect to multiple wifi networks

Today, I have configured my raspberry to connect at boot to the HotSpot Wifi of my phone if it is available. If not, It will connect to my home wifi

To do this, you need to edit the wpa_supplicant.conf file:

 sudo nano /etc/wpa_supplicant/wpa_supplicant.conf  

And you must add a second block "network":

 country=GB  
 ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev  
 update_config=1  
 network={  
     ssid="my home network"  
     psk="password"  
     scan_ssid=1  
     priority=0  
     id_str="Home"  
 }  
 network={  
     ssid="my phone network"  
     psk="mot de passe"  
     scan_ssid=1  
     priority=1  
     id_str="Phone"  
 }  

You must add in each block :

  • Scan_ssid = 1 to search the wifi network
  • Priority = 1 to select by default the network that has the highest priority
  • Id_str = "xxx" to give a name to the network (may be optional?)

Now when I am outside, I can connect my QuadCopter ROZETTA on the wifi of my phone. Then I open an ssh session with the Android app ConnectBot


Commentaires

Posts les plus consultés de ce blog

Attiny13A sleep mode

Esp-01 deep sleep mode

Install and configure OpenVPN on OSMC