User avatar
Pwl2
Posts: 22
Joined: Mon Mar 23, 2015 7:04 am
Location: Warwickshire

Auto selection of wireless LAN

Tue Aug 15, 2017 9:46 pm

I am new to *nix and am trying to set up jessi-lite networking. I have wired and wireless working for my home lan but need to be able to use the system via SSH in locations that I know the SSID and key for but do not have access to a screen or a keyboard to modify the interfaces file. My doze box finds the network it needs automatically and uses that. How do I set this up on Raspbian. My /etc/network/interfaces looks like this at the moment:-

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid <my SSID>
wpa-psk <my key>
Pwl2

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Auto selection of wireless LAN

Tue Aug 15, 2017 10:25 pm

Pwl2 wrote:
Tue Aug 15, 2017 9:46 pm
My /etc/network/interfaces looks like this at the moment
pls change that file back to the original

prepare a file called
wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
ssid="mySSID"
psk="myPASSWORD"
key_mgmt=WPA-PSK
}
this file is usually at
( sudo cat ) /etc/wpa_supplicant/wpa_supplicant.conf
but Raspbian / Raspbian lite / image or NOOBS version
have a trick:
if you copy that file to /boot/ the part of the SD card you see also from windows
at BOOT the RPI will find that file, copy(use) and delete it and will be online.
( that's for headless setup )

also you can pre specify several
network={}
network={
ssid="SCHOOLS NETWORK NAME"
psk="SCHOOLS PASSWORD"
id_str="school"
}

network={
ssid="HOME NETWORK NAME"
psk="HOME PASSWORD"
id_str="home"
}
so your RPI will be online at different locations using other hotspot,
still can change that file and copy to /boot/ if you need a new one.
( it's good to have a copy of it there /boot/wpa_supplicant.conf.bak )
( ok for edit this need a PC / card reader )

User avatar
Pwl2
Posts: 22
Joined: Mon Mar 23, 2015 7:04 am
Location: Warwickshire

Re: Auto selection of wireless LAN

Wed Aug 16, 2017 6:43 am

I initially used a supplicant.conf file and it did not work BUT the tutorial that I was working from was missing the "key_mgmt=WPA-PSK" line. I will try again as it is a cleaner method. Problem is your method still requires me to know where I next intend to boot from. What I am looking for is the sytem to simply detect it is a network that I have an SSID/PW pair logged and use it. No manual intervention - or am I (probably) missing something?
Pwl2

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Auto selection of wireless LAN

Wed Aug 16, 2017 6:52 am

Pwl2 wrote:
Wed Aug 16, 2017 6:43 am
where I next intend to boot from
what OSs you are using?
Pwl2 wrote:am trying to set up jessi-lite
/etc/wpa_supplicant/wpa_supplicant.conf is THE way to do it in RASPBIAN.

what means SSID / password logded?
the list of multi
network={}
in wpa_supplicant.conf
not help?

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Auto selection of wireless LAN

Wed Aug 16, 2017 6:56 am

Pwl2 wrote:
Tue Aug 15, 2017 9:46 pm
I am new to *nix and am trying to set up jessi-lite networking. I have wired and wireless working for my home lan but need to be able to use the system via SSH in locations that I know the SSID and key for but do not have access to a screen or a keyboard to modify the interfaces file. My doze box finds the network it needs automatically and uses that. How do I set this up on Raspbian. My /etc/network/interfaces looks like this at the moment:-

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid <my SSID>
wpa-psk <my key>
https://www.raspberrypi.org/documentati ... /README.md
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

User avatar
Pwl2
Posts: 22
Joined: Mon Mar 23, 2015 7:04 am
Location: Warwickshire

Re: Auto selection of wireless LAN

Wed Aug 16, 2017 7:14 am

Sorry I missread the first reply (early in the morning) . SSID/PW logged I simply meant that the system knows multiple SSID - password pairs and can select the correct one. Reading more carefully (now that I am awake and have had my morning coffee) I understand the first reply. The definition of multiple networks will do what I want.

FruitoftheLoom. Thanks for the pointer but that is the tutorial that I used which, for me, did not work. Don't know why. Checked for spelling mistakes etc.

Thanks to all. Now for some hacking.
Pwl2

Return to “Beginners”