Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using Ångström Linux on BeagleBoard-xM. I have installed a RTL8188SU USB Wi-Fi adapter and configured it properly. But it doesn't connect automatically even though I have marked the interface as auto in /etc/network/interfaces file. My /etc/network/interfaces file is seen below (only wlan0 settings pasted):

auto wlan0
iface wlan0 inet static
    address 192.168.2.50
    netmask 255.255.255.0
    gateway 192.168.2.1
    wireless_mode managed
    wireless_essid MY NETWORK ESSID
    wireless_key   MY_PASS

And here is the output of ifconfig command after system boot:

root@beagleboard:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1632 (1.5 KiB)  TX bytes:1632 (1.5 KiB)

wlan0     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet6 addr: fe80::2e0:4cff:fe03:cbb1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:241 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

As you can see, there is no inet connection on interface wlan0. When I type ifdown wlan0 and ifup wlan0 consecutively, the wireless connection can be established successfully according to interface settings. The output of ifconfig after restarting wlan0 is shown below:

wlan0     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet addr:192.168.2.50  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:974 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I want my wireless connection to be established automatically on system boot (and preferably after replugging Wi-Fi adapter). Is there anything that I am missing to do so?

EDIT:

I have traced boot log and seen a message that is complaining about setting ESSID:

Error for wireless request "Set ESSID" (8B1A) :
    SET failed on device wlan0 ; Operation not permitted.

However, I haven't realized the source of the problem. After the system boot I can establish connection by restarting networking.

share|improve this question

3 Answers 3

After a lot of head scratching and trying various 'answers' from searches, this link pointed me in the right direction.

http://octopusprotos.com/?p=37

share|improve this answer
1  
Can you pull some of that content into your A? If that link goes away your A becomes useless to anyone that may traipse across this in the future. –  slm Feb 8 at 1:13

Like this? Feels like plaugerism but hey ho

I like to setup any embedded project with ethernet a static IP so I can ssh into it easily. WiFI is preferred over wired so I can make my project mobile. The great part of doing this was that the BBB didn’t need drivers to work with the Edimax USB WiFi module I have. This is the same one that is often used with the Raspberry Pi. Angstrom to their credit (and some times detriment) is great at keeping up with the latest revisions of packages and drivers.

I first tried to go through the network manager that comes with Angstrom, Connman. Connman was able to setup the WiFi for DHCP no problem. Where it fell down was that it didn’t seem to be able to bring the interface up on boot, nor was it able to configure it with a static IP. I tried to achieve this both through the GUI as well through writing a Connman config file for the wireless interface. So I gave up on Connman. It’s not ready for primetime. Some will argue that Ubuntu’s adoption of it validates it’s readiness. But those of us who’ve suffered through years of poor network managers on Ubuntu know better than to accept that. BUt more to the point, the BBB is an embedded system not a laptop. It shouldn’t be concerned with a GUI interface that let’s a user on the go frequently reconfigure the wireless interface. I plan on building this into something and I want the interfaces to come up reliably the same way every time.

So I decided to get back to basics. First, I needed Connman out of the way. You can disable it like this:

$ systemctl disable connman.service

Next I needed to write a interfaces file to configure both the wired and wireless interfaces.

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.xxx
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.xxx,8.8.8.8

iface usb0 inet static
address 192.168.10.xxx
netmask 255.255.255.0
gateway 192.168.10.1
dns-nameservers 192.168.10.1,8.8.8.8

auto wlan0
iface wlan0 inet static
address 192.168.0.xx
netmask 255.255.255.0
gateway 192.168.0.xxx
dns-nameservers 192.168.0.1,8.8.8.8
wireless_mode managed
wireless_essid NAME_OF_AP
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

If you are using encryption on your wireless (and you should) then you’ll want a wpa_supplicant file to help you connect. You’ll need a passkey for this file. YOu can get that for your network like this:

$ wpa_passphrase

Just copy and paste the output into your wpa_supplicant file (/etc/wpa_supplicant.conf). It should look something like this:

ap_scan=2

network={
ssid=
proto=WPA RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk=Big long string of hex number
}

Finally, Angstrom doesn’t use init.d so we need more than just auto wlan0 in the interface file to get the interfaces up at boot time. Angstrom is using systemd instead on init. I read that for backwards compatibility systemd will run scripts in the init.d folder, but this didn’t seem to be the case. Regardless, it seems to make sense just to go with the new systemd way of things. So I wrote a quick service configuration to bring up the interfaces on boot. It lives in /etc/systemd/system/net.service.

Here is the contents of the service file:

[Unit]
Description=Network interfaces
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-wlan0.device
After=sys-subsystem-net-devices-wlan0.device

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c "sleep 5;ifup wlan0"
ExecStop=/bin/sh -c "ifdown wlan0"

[Install]
WantedBy=multi-user.target

This brings WiFi up after the driver is loaded but before the network target (most anything that would use the network).

To enable it to be run on boot just do:

$ systemctl enable net.service

That does it. WiFi comes up with a static IP on boot. I can ssh into the BBB and mount drives remotely.

share|improve this answer

or better here from my own notes....

  1. Disable connman:

    # systemctl disable connman.service
    
  2. $ cat > /etc/network/interfaces <<EOF
    auto lo
    iface lo inet loopback
    
    auto eth0
    iface eth0 inet static
    address 192.168.0.99
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 192.168.0.1
    
    iface usb0 inet static
    address 192.168.7.2
    netmask 255.255.255.0
    gateway 192.168.7.1
    dns-nameservers 192.168.7.1
    
    iface wlan0 inet static
    address 192.168.0.98
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 192.168.0.1
    wireless_mode managed
    wireless_essid “VM275247-2G”
    wpa-driver wext
    wpa-conf /etc/wpa_supplicant.conf
    pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
    post-down killall -q wpa_supplicant
    EOF
    
  3. Create resolv.conf

    $ cat >/etc/resolv.conf <<EOF
    search local
    nameserver 192.168.0.1
    EOF
    
  4. Create wpa_supplicant.conf with password

    $ cat >/etc/wpa_supplicant.conf <<EOF
    ap_scan=2
    
    network={
    ssid="VM275247-2G"
    proto=WPA RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP TKIP
    group=CCMP TKIP
    psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx1
    }
    EOF
    
  5. Create service for Wi-Fi

    $ cat >/etc/systemd/system/net.service <<EOF
    [Unit]
    Description=Network interfaces
    Wants=network.target
    Before=network.target
    BindsTo=sys-subsystem-net-devices-wlan0.device
    After=sys-subsystem-net-devices-wlan0.device
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/sh -c "sleep 5;ifup wlan0"
    ExecStop=/bin/sh -c "ifdown wlan0"
    
    [Install]
    WantedBy=multi-user.target
    EOF
    
  6. Enable systemctl

    # systemctl enable net.service
    
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.