WiFi madness...

After lots of trial and error, and reading through, and piecing together bits from lots of other posts, I finally have a configuration that almost works to get my Beagleboard connected to the WiFi network with WPA2. This is the piece of my /etc/network/interfaces file that makes it all work:

iface wlan0 inet static

address 192.168.1.44

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1

dns-nameservers 8.8.8.8

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan0

I want to run with a static IP address. The wpa_supplicant configures and attaches to the network correctly in this setup….HOWEVER, the IP address never gets assigned. If I do it by hand after the fact everything works fine. I think it is a chicken-egg problem. What do I need to do to get the wpa_supplicant to configure first, then assign the IP address once it is completed?

Thanks,

-Ted

I have:

auto wlan0
iface wlan0 inet static
        address 192.168.55.100
        netmask 255.255.255.0
        gateway 192.168.55.1
        mode managed
        channel 1
        wpa-essid YourNetworkESSIDhere
        wpa-psk YourWiFiWPAPasswordHere

  This works reliably everytime. I'm using a LinkSys WUSB54GC (rt73 based)
WiFi b/g dongle.

  I'm going to add:

        dns-nameservers 8.8.8.8
        dns-nameservers 8.8.4.4

  and see if this works to always have my DNS servers set on boot.

  8-Dale

Dale,

Thanks for the quick reply. I tried your configuration. It is nice in that
I can get rid of the external wpa_supplicant.conf file, but I still have my
same problem. It definitely seems like a timing problem....like it takes a
little bit for the WiFi USB adapter to associate, yet the script pushes on
anyway, and tries to assign an IP address to the interface before the
association is complete. I can see during the boot, the line:

[ 1085.870147] ADDRCONF(NETDEV_UP): wlan0: link is not ready
And then a little while later...much beyond the point where the IP should be
assigned:
[ 1090.369476] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

I am using a TrendNet USB WiFi adapter, which is based on the RealTek
RTL8187B_WLAN.

Is there any kind of an option I can put in the interfaces file to cause it
to wait for the adaptor to try to associate first?

Thanks,

-Ted

Dale,

It definitely seems like a timing problem.... like it takes a
little bit for the WiFi USB adapter to associate, yet the script pushes on
anyway, and tries to assign an IP address to the interface before the
association is complete.

  If you are using static IP as I am, then the address will be assigned
before the adapter associates with the AP because it doesn't need to get an
address via DHCP. Timing does seem to be the culprit here, unfortunately, and
a problem that may not be easily fixable. Wireless and Linux are sometimes hit
or miss situations and you might have to go through a few to find one with a
compatible chipset. Also, check to be sure your kernel has the proper driver
built for the adapter.

I can see during the boot, the line:

[ 1085.870147] ADDRCONF(NETDEV_UP): wlan0: link is not ready
And then a little while later...much beyond the point where the IP should
be assigned:
[ 1090.369476] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

  I see this behavior also. I get a couple "wlan0: link is not ready" and
then there is a pause before I get the "wlan0: link becomes ready" message and
then the link is fully up and active with its IP address. The time to properly
associate with the AP may vary with the adapter. I'm fortunate that my
adapter associates pretty fast. :slight_smile:

I am using a TrendNet USB WiFi adapter, which is based on the RealTek
RTL8187B_WLAN.

  I'm not familiar with this one. I stick with Cisco/LinkSys because they
usually just work and work well. :slight_smile: Does it require firmware?

Is there any kind of an option I can put in the interfaces file to cause it
to wait for the adaptor to try to associate first?

  At this time, I don't know of any command to insert a delay. My adapter
just comes up like it should with IP and route ready to go after just a short
pause to the link becoming ready. I wish I could help more on this.

  8-Dale

I did a lot of reading about NetworkManager configuration....it is
definitely some kind of a driver issue with the device I think.
NetworkManager is supposed to only configure the IP address, when any
adapter signals it is connected and ready....so, you can plug-and-play a
network adapter, or a cable to the Ethernet. The WiFi adapter isn't sending
the appropriate signal to indicate it is up. Just fiddling with nmcli shows
this.

I am going to try a different adapter and see if I can get better results.

Thanks again for all your help, and insight Dale. Much appreciated!

Thanks,

-Ted

I did a lot of reading about NetworkManager configuration....it is
definitely some kind of a driver issue with the device I think.

  So far, the Raylink (rt73, etc) chipset adapters seem to be the most
reliable. My WUSB54GC connects first time everytime on boot and doesn't lose
connection as far as I can tell.

NetworkManager is supposed to only configure the IP address, when any
adapter signals it is connected and ready....so, you can plug-and-play a
network adapter, or a cable to the Ethernet. The WiFi adapter isn't
sending the appropriate signal to indicate it is up. Just fiddling with
nmcli shows this.

  It may just be a timing issue. Your adapter may just take longer than the
driver is expecting to become ready.

I am going to try a different adapter and see if I can get better results.

  Try to get something rt73 based if you can. These have been the most
reliable for me so far. Since I am putting a Beagle on my robot, having
reliable WiFi is extremely important to me. :slight_smile: I don't want my robot to have
to be tethered to access the network or be accessible from it.

Thanks again for all your help, and insight Dale. Much appreciated!

  I'm glad to help, anytime! :smiley:

  8-Dale

I finally ended up solving ALL my problems with both the WiFi drivers not
working, as well as my Serial-to-USB device not working, by just ditching
Angstrom and switching to Ubuntu on the Beagleboard. I wish I had done this
days ago. It was a snap to get going, and all my driver problems magically
went away. Both devices which didn't work at all under Angstrom are working
great now.

Thanks again for all your help.

-Ted

I finally ended up solving ALL my problems with both the WiFi drivers not
working, as well as my Serial-to-USB device not working, by just ditching
Angstrom and switching to Ubuntu on the Beagleboard.

  Interesting. I am going to have to check Ubuntu out for Beagle then. I
just have go get some more SD cards. I think I will get some micro-SD cards
so I can use them on a Beagle-xM when I get one. I have an adapter to make
them work in full size SD card slots.

I wish I had done this days ago. It was a snap to get going, and all my
driver problems magically went away. Both devices which didn't work at all
under Angstrom are working great now.

  Good to hear you solved your problems! I am finding that I need to
occasionally restart networking on my Beagle C3 because I lose access to it
from the rest of my network. Odd, but true.

Thanks again for all your help.

  Anytime. :smiley:

  8-Dale