realtek usb wifi not connecting at boot

hi!

I’ve just installed volumio 1.1 and everything seems to work in eth environment but when I try to turn it into wifi something strange happens.

the webgui shows no wlan0 interface name and no ip (my dhcp works), I’ve tried some manual configs from shell and editing conf files:

if I setup wlan0 with

 iwconfig wlan0 essid MYSSID key MYKEY
 ifconfig wlan0 up

it gives an error about the key command but it connects without problems and everything works from wifi (it connects, take ip and I can use webgui and ssh on the wifi ip) but still no infos about wlan connection on the webgui.

if I now disconnect the eth cable even wifi stops working.

if I reboot no wifi connection is established, I have to reconnect on eth and issue the command iwconfig wlan0 essid MYSSID to restart the connection.

I think it can depend on the fact the AP (using wpa2) is not broadcasting the ssid (imperative for me) so tried this configuration:

/etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

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

and /etc/wpa_supplicant/wpa_supplicant.conf:
network={
ssid=“MYSSID”
scan_ssid=1
psk=“MYPSK”
}

saved, reboot and still no auto wifi connection.

my setup will only be useful in wifi mode so I need to manage it to work, do you know what can I try to make wlan0 connect at startup?

thank you very much!

well, I tried every kind of /etc/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf configurations I’ve found on the web, I’ve also installed wicd-curses and the only result is that I can connect to my ap only broadcasting the ssid. I really can’t figure out what’s the problem. any hint will be appreciated!

ok, it seems I’ve solved my problem, this is how:

  1. uninstalled wicd-curses with:

apt-get --purge remove wicd-curses
apt-get autoremove

  1. I’ve commented auto eth0 and iface eth0 inet dhcp from /etc/network/interfaces (no more problems with eth as I need it wifi only)

  2. added those lines to /etc/network/interfaces:

allow-hotplug wlan 0
iface wlan0 inet static
address MYIP
netmask MYNETMASK
gateway MYGATEWAY
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

(before I tried with wpa-roam instead of wpa-conf that does’t work for me, it also doesn’t work in dhcp mode for me, really don’t know why as it works perfectly when not hiding ssid)

  1. generated my wpa key with wpa_passphrase, my ap doesn’t accept the key in plain text while hiding ssid, I’ve generated my wpa_supplicant.conf with this command:

wpa_passphrase MYSSID MYKEY > /etc/wpa_supplicant/wpa_supplicant.conf

  1. added this line to /etc/wpa_supplicant/wpa_supplicant.conf:

scan_ssid=1

just before the psk= entry (doesn’t work in any other place for me)

  1. rebooted (ifdown/ifup or /etc/init.d/networking restart not working)

now my raspberry pi is automatically connecting to my hidden ssid ap at boot time!

I hope it will be usefull to someone, let me know.

It works fine. Thank you!
I lost a lot of time trying to set up a WiFi in volumio.
Your post helped me.

update: My DAC now not work :frowning:

Think you’ve got a Power Supply issue. Try with a more robust one (at least 1A). Let me know

I use Apple Ipad 2.1A power adapter, the DAC operates from its own power supply.

correct the settings , now all is well

===========================
/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 default inet dhcp

===========================
/etc/wpa_supplicant/wpa_supplicant.conf

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

network={
ssid=“ssid1”
psk=“password1”
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

network={
ssid=“ssid2”
psk=“password2”
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}