User avatar
Sierra_Angel
Posts: 2
Joined: Fri Nov 01, 2013 9:57 am

Problems with wpa_supplicant

Fri Nov 01, 2013 10:35 am

I want to use multiple wifi's but it doesn't want to work for me. I already checked several posts here and in other forums to try to solve my problem, but none worked out for me.

Code: Select all

ifup wlan0
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
wpa_supplicant: /sbin/wpa_cli daemon failed to start
run-parts: /etc/network/if-up.d/wpasupplicant exited with return code 1
This only happens when I use this setting in /etc/network/interfaces

Code: Select all

nano /etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface default inet dhcp

allow-hotplug wlan0

auto wlan0
iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa-roam.conf
iface wifi_id_1 inet dhcp
iface wifi_id_2 inet dhcp

Code: Select all

nano /etc/wpa_supplicant/wpa-roam.conf
update_config=1
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

network={
        ssid="wifi1"
        scan_ssid=1
        psk="pass1"
        proto=WPA RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        auth_alg=OPEN
        id_str="wifi_id_1"
}

network={
        ssid="wifi2"
        scan_ssid=1
        psk="pass2"
        proto=WPA RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        auth_alg=OPEN
        is_str="wifi_id_2"
}
With this it works, but I don't want to make changes manually each time I want to use another accesspoint

Code: Select all

nano /etc/network/interfaces
auto lo
iface lo inet loopback

iface eth0 inet dhcp
iface default inet dhcp

allow-hotplug wlan0

auto wlan0
iface wlan0 inet dhcp
wpa-ssid "wifi1"
wpa-psk pass1

#wpa-ssid "wifi2"
#wpa-psk pass2

Code: Select all

lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 001 Device 005: ID 04b4:6830 Cypress Semiconductor Corp. CY7C68300A EZ-USB AT2 USB 2.0 to ATA/ATAPI

Code: Select all

lsmod
Module                  Size  Used by
fuse                   69438  3
snd_bcm2835            16432  0
snd_pcm                77728  1 snd_bcm2835
snd_page_alloc          5169  1 snd_pcm
snd_seq                53482  0
snd_seq_device          6462  1 snd_seq
snd_timer              20110  2 snd_pcm,snd_seq
snd                    58744  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
8192cu                490361  0
leds_gpio               2243  0
led_class               3570  1 leds_gpio
ums_cypress             2666  0

Code: Select all

ifconfig -a
eth0      Link encap:Ethernet  Hardware Adresse b8:27:eb:1c:41:3c
          inet Adresse:192.168.0.2  Bcast:192.168.0.255  Maske:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX packets:20235 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8756 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:8967078 (8.5 MiB)  TX bytes:1098751 (1.0 MiB)

lo        Link encap:Lokale Schleife
          inet Adresse:127.0.0.1  Maske:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metrik:1
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0
          RX bytes:2304 (2.2 KiB)  TX bytes:2304 (2.2 KiB)

wlan0     Link encap:Ethernet  Hardware Adresse 00:87:25:24:96:66
          inet Adresse:192.168.0.6  Bcast:192.168.0.255  Maske:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX packets:2745 errors:0 dropped:3075 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:2921620 (2.7 MiB)  TX bytes:998 (998.0 B)
So the dongle seem to work. I'm new to Unix/Linux systems, so I'm pretty helpless now :cry:

User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Re: Problems with wpa_supplicant

Fri Nov 01, 2013 11:32 am

I presume you only have one WiFi dongle, so that means you can only connect to one of the networks at once. You want a simple way to switch between these, without having to edit the wpa supplicant config file each time. Correct?

There is a GUI based wpa supplicant tool when you run startx that makes this much easier than directly editing the config files - simply use it to connect to however many networks you may use. It then has a drop down box to allow you to switch between networks as needed.
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

User avatar
Sierra_Angel
Posts: 2
Joined: Fri Nov 01, 2013 9:57 am

Re: Problems with wpa_supplicant

Sat Nov 02, 2013 4:33 pm

I want to use my Raspberry as portable NAS drive and want it to connect to a AP automaticly on bootup. So I don't need a screen or keyboard to connect to a AP. Maybe with the option that it become an AP itself when there is no AP to connect to

pjc123
Posts: 913
Joined: Thu Mar 29, 2012 3:37 pm
Contact: Website

Re: Problems with wpa_supplicant

Sat Nov 02, 2013 11:41 pm

Is this a typo in your config file or your post? The wpa_supplicant file in particular is not forgiving at all if you have typos or incorrect parameters. Everything else is pretty much the same as my working config files which automatically connect to different access points using a headless pi.

is_str="wifi_id_2"

should be

id_str="wifi_id_2"

As a side note, if you want to default to connecting to an open wifi like Mickey D's for example, you can add the following to the end of the wpa_supplicant file:

network={
ssid=""
key_mgmt=NONE
}
My Raspberry Pi Project Page:
https://www.flaminghellmet.com/launch/

Return to “Troubleshooting”