ROTORGAMES
Posts: 2
Joined: Wed Jun 13, 2018 9:46 pm

multi wifi config

Wed Jun 13, 2018 10:07 pm

hi!

First Thanks!

I have a RPi0W 100% uodated, and it works ok, now Iwant to moe it to different locations and I want tha it will auto connect to my diferrent networks.

This is my wpa_supplicant file:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
	ssid="home"
	psk="X"
	key_mgmt=WPA-PSK
	id_str="rotorhome"
	priority=3
}

network={
	ssid="Orange-22BA"
	psk="X"
	key_mgmt=WPA-PSK
	id_str="rotorhome2"
}


network={
        ssid="WIFI_N"
        psk="X"
        key_mgmt=WPA-PSK
        id_str="NHOME"
	priority=2
}

network={
        ssid="phone1"
        psk="X"
        key_mgmt=WPA-PSK
        id_str="phone"
	priority=1
}
that's ok but i want set a specific config fort every network , search and I edit mi interfaces file, but my PI always say "no wireless interfaces found" without editing the file the RPi works, but if I edit the file -> error.

this is my interfaces file:

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

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 rotorhome inet static
address 192.168.1.123
gateway 255.255.255.0
netmask 192.168.1.1


iface NHOME inet static
address 192.168.1.123
gateway 255.255.255.0
netmask 192.168.1.1

iface rotorhome2 inet dhcp

iface phone inet dhcp
What is my error? I not able to see it

Thanks

klricks
Posts: 5476
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: multi wifi config

Thu Jun 14, 2018 12:32 am

In wpa_supplicant take out all the id_str=...... entries. That is not a valid command. I am not sure where that is coming from but it does not work...

To test your wpa_supplicant.conf do the following command:

Code: Select all

wpa_cli -i wlan0 reconfigure
If something is wrong then that command will return: FAIL.
If good then it will return: OK, and if the SSID and PSK are correct then the RPI will connect to the WIFI network. No reboot required.

I don't know about your interfaces file? Normally that file should not be altered and edits done to /etc/dhcpcd.conf instead.

I do DHCP MAC to IP reservations in my router which is much easier to set up, as no edits to the RPI configs are needed.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

ROTORGAMES
Posts: 2
Joined: Wed Jun 13, 2018 9:46 pm

Re: multi wifi config

Thu Jun 14, 2018 9:13 am

klricks wrote:
Thu Jun 14, 2018 12:32 am

Code: Select all

wpa_cli -i wlan0 reconfigure
My wpa_supplicant file is OK.
klricks wrote:
Thu Jun 14, 2018 12:32 am


I do DHCP MAC to IP reservations in my router which is much easier
I can't do it on some of the routers (no admin rights) , at now I only have 4 but in the future I will have about 9 and some of them i will need and specific IP config.

SurferTim
Posts: 1565
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: multi wifi config

Thu Jun 14, 2018 11:27 am

Don't use /etc/network/interfaces to set static network settings with Stretch. Use /etc/dhcpcd.conf instead.

Code: Select all

ssid firstssid
static ip_address=192.168.0.2/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8

ssid secondssid
static ip_address=192.168.1.4/24
static routers=192.168.1.1
static domain_name_servers=8.8.4.4

Return to “Troubleshooting”

Who is online

Users browsing this forum: Batunga, gkreidl, tcat and 28 guests