AdeV73
Posts: 6
Joined: Wed Nov 28, 2012 8:42 pm

Pi B+ not starting WLAN0

Sat Mar 21, 2015 5:35 pm

Hi,

I've just set up a shiny new Pi B+ as a web kiosk, using kweb3. Following the various instructions around the place, I finally added the line "xinit /home/pi/kiosk" to rc.local to boot the Pi into the web browser when it powers up. This all works brilliantly.

Until now, I've been connecting to the Pi (via SSH) using a wireless LAN adapter. This has also worked fine, until I added that line to rc.local; now, the Pi boots OK, goes to the kiosk, but it doesn't connect to the network. If I plug a LAN cable in, it's all great. From an SSH console, I see that wlan0 is there but hasn't got an IP address. I can do sudo ifdown wlan0 then sudo ifup wlan0, and after about 2 seconds, wlan0 gets an IP address & I can, once again, access the network.

Any ideas what I'm doing wrong? Do I need to stick a delay in the boot script to give wlan0 time to come up, before it fires up the X server?

My kiosk file is as follows:

Code: Select all

#!/bin/sh
xset -dpms
xset s off
xset s noblank
unclutter &
matchbox-window-manager &
kweb3 -JEKHCA+-zbhrqfpoklgtjneduwxy http://my.url/here
rc.local is now:

Code: Select all

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

sudo xinit ./home/pi/kiosk &

exit 0
The WLAN adapter is some generic thing from Farnell, bought at the same time I bought the Pi.

Cheers!
Ade.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi B+ not starting WLAN0

Sat Mar 21, 2015 7:34 pm

What's in /etc/network/interfaces?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

AdeV73
Posts: 6
Joined: Wed Nov 28, 2012 8:42 pm

Re: Pi B+ not starting WLAN0

Sun Mar 22, 2015 1:45 pm

Hi,

/etc/networking/interfaces:

Code: Select all

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:

Code: Select all

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

network={
        ssid="Our SSID"
        psk="our password"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        auth_alg=OPEN
}
Cheers!
Ade.

Bananaguns
Posts: 83
Joined: Sun Mar 01, 2015 9:59 pm

Re: Pi B+ not starting WLAN0

Sun Mar 22, 2015 1:49 pm

Try adding

Code: Select all

auto wlan0
To the top of /etc/network/interfaces. Im pretty sure thats what worked for me.

AdeV73
Posts: 6
Joined: Wed Nov 28, 2012 8:42 pm

Re: Pi B+ not starting WLAN0

Sun Mar 22, 2015 5:47 pm

Thanks - I'll give that a go on Monday when I'm back in the office.

Cheers,
Ade.

AdeV73
Posts: 6
Joined: Wed Nov 28, 2012 8:42 pm

Re: Pi B+ not starting WLAN0

Mon Mar 23, 2015 12:04 pm

Adding auto wlan0 didn't fix it; so I cheated and added the following to rc.local, before the xinit line:

Code: Select all

sudo ifdown wlan0
sudo ifup wlan0

sleep 20
Job done :)

Return to “Troubleshooting”