Problem manually starting WiFi

Issues Related to Networking (Wired and Wireless)

Moderator: Moderators

Problem manually starting WiFi

Postby BHReach » Sun Mar 06, 2011 11:13

I had a lot of trouble trying to manually configure my WiFi card.

I put the appropriate lines in

/etc/conf.d/net

However, when I ran

/etc/init.d/net.wlan0 start

it did not work. Looking at dmesg, the card would connect to my AP but something immediately disabled it.

It took several hours of research to figure out that I had to remove NetworkManager from the startup scripts. Then the wifi card would start and work correctly.

Then I discovered that

/etc/init.d/net.wlan0 restart

did not work on the 1st try. Neither did

/etc/init.d/net.wlan0 stop
/etc/init.d/net.wlan0 start

See the results of the commands below. After aborting, running

/etc/init.d/net.wlan0 start

a second time works. I have an older Gentoo installation on another computer and restart function works fine on it.

Anybody know how to fix this?

kiwi ~ # /etc/init.d/net.wlan0 stop
* Stopping sshd ... [ ok ]
* WARNING: you are stopping a boot service
* Unmounting NFS filesystems ... [ ok ]
* Bringing down interface wlan0
* Caching network module dependencies
need dbus
kiwi ~ # /etc/init.d/net.wlan0 start
* Bringing up interface wlan0
* Caching network module dependencies
need dbus
* Configuring wireless network for wlan0
* Connecting to "bingo" in managed mode (WEP Disabled) ...
cat: /sys/class/net/wlan0/carrier: Invalid argument
cat: /sys/class/net/wlan0/carrier: Invalid argument
cat: /sys/class/net/wlan0/carrier: Invalid argument
cat: /sys/class/net/wlan0/carrier: Invalid argument
cat: /sys/class/net/wlan0/carrier: Invalid argument
cat: /sys/class/net/wlan0/carrier: Invalid argument
cat: /sys/class/net/wlan0/carrier: Invalid argument
cat: /sys/class/net/wlan0/carrier: Invalid argument
^C * net.wlan0: caught SIGINT, aborting
kiwi ~ # /etc/init.d/net.wlan0 start
* Bringing up interface wlan0
* Caching network module dependencies
need dbus
* Configuring wireless network for wlan0
* Connecting to "bingo" in managed mode (WEP Disabled) ... [ ok ]
* wlan0 connected to SSID "bingo" at 00:23:69:23:72:5B
* in managed mode (WEP disabled)
* 192.168.0.20/24 ... [ ok ]
* Waiting for IPv6 addresses ...
BHReach
Growing Hen
 
Posts: 193
Joined: Thu Jan 31, 2008 20:40

Re: Problem manually starting WiFi

Postby gabvil » Mon Mar 07, 2011 0:10

BHReach wrote:It took several hours of research to figure out that I had to remove NetworkManager from the startup scripts. Then the wifi card would start and work correctly.


Hi BHReach!

Network manager in different flavours are pretty bad managing Wifi connections. Depends on drivers, if them are compiled in perfect order to pass some issues achieving connection. I know Network Manager (KDE/Gnome) isn't perfect and constantly you could have an issue with it.

Newer kernel? Atheros chipset maybe? Could you put some info regarding this on what hardware do you have? :roll:
·Intel [email protected]/2Gb Ram/160Gb/82945GZ/Sabayon Mate 13.07 x64 @work X2
·Intel [email protected]/2Gb Ram/250Gb/x3100 GM965/Sabayon Mate 13.07 x64 @lappy
·Intel [email protected]/2Gb Ram/800 Gb/Zotac 8400GS-512Mb-HDMI/Sabayon Mate 13.07 x64 @HTPC
gabvil
Growing Hen
 
Posts: 119
Joined: Tue Sep 28, 2010 22:27
Location: Canelones, Uruguay

Re: Problem manually starting WiFi

Postby BHReach » Mon Mar 07, 2011 7:48

gabvil wrote:Newer kernel? Atheros chipset maybe? Could you put some info regarding this on what hardware do you have?


uname -a

Linux kiwi 2.6.37-sabayon #1 SMP Mon Jan 17 15:48:59 UTC 2011 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4000+ AuthenticAMD GNU/Linux

lspci

...
Ethernet controller: Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)
...

Also, I noticed that stop and restart turn off sshd. Start and restart (probably because the 1st time I use restart it gets aborted, then when I run it again, sshd was not running so it does not turn it off or on) do not turn it back on. On my older Gentoo system, restart turns sshd off but turns it back on before it finishes.
BHReach
Growing Hen
 
Posts: 193
Joined: Thu Jan 31, 2008 20:40

Re: Problem manually starting WiFi

Postby gabvil » Tue Mar 08, 2011 4:30

Maybe something related to the AP and the ath5k module could be the reason.
I have a 5007EG from Atheros and a Linksys router (WRT-320n). Several hours searching for the reason for the constant drop of my connection. I give a chance to the router that was failing in the connection establishment. Ath5k/Ath9k is really mature but not enough to achieve stability. Kernel is the correct one in this case. Do you have madwifi? Could you find something about "ath5k" on /var/log/messages.

Append here the result of this:

Code: Select all
tail -f /var/log/messages > test_ath5k.txt


Should tell us in the moment of giving the start/restart/stop of this module the behaviour on this while you run the script.

Maybe your router have a log that could give you the clue.

Kind regards.
·Intel [email protected]/2Gb Ram/160Gb/82945GZ/Sabayon Mate 13.07 x64 @work X2
·Intel [email protected]/2Gb Ram/250Gb/x3100 GM965/Sabayon Mate 13.07 x64 @lappy
·Intel [email protected]/2Gb Ram/800 Gb/Zotac 8400GS-512Mb-HDMI/Sabayon Mate 13.07 x64 @HTPC
gabvil
Growing Hen
 
Posts: 119
Joined: Tue Sep 28, 2010 22:27
Location: Canelones, Uruguay

Re: Problem manually starting WiFi

Postby adsicks » Tue Mar 08, 2011 5:52

I always ditch Network Manager and go with WICD. Never had a problem once I did that. Even get wireless when I boot with just a command shell...
adsicks
Simple Hen
 
Posts: 56
Joined: Mon Jan 19, 2009 18:18
Location: Rush Springs, OK USA

Re: Problem manually starting WiFi

Postby Fitzcarraldo » Tue Mar 08, 2011 6:23

^Funny, with me it's the opposite: I don't have trouble with NetworkManager on three machines (two laptops and one nettop), but Wicd has not worked (see, e.g., SL 5.4 E17 Spin x86: WiFi (Wicd) problem [Solved]).

I've just upgraded to NetworkManager 0.8.2-r9 via Portage on my main laptop (it's not yet in the Entropy repository but will no doubt be soon), so perhaps that might help any folk who have trouble with NetworkManager.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7984
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Problem manually starting WiFi

Postby BHReach » Tue Mar 08, 2011 10:41

gabvil wrote:Maybe something related to the AP and the ath5k module could be the reason.
I have a 5007EG from Atheros and a Linksys router (WRT-320n). Several hours searching for the reason for the constant drop of my connection. I give a chance to the router that was failing in the connection establishment. Ath5k/Ath9k is really mature but not enough to achieve stability. Kernel is the correct one in this case. Do you have madwifi? Could you find something about "ath5k" on /var/log/messages.

Append here the result of this:

Code: Select all
tail -f /var/log/messages > test_ath5k.txt


Should tell us in the moment of giving the start/restart/stop of this module the behaviour on this while you run the script.

Maybe your router have a log that could give you the clue.

Kind regards.


madwifi is not installed.

Here is the contents of that file:

Apr 1 11:09:10 kiwi sshd[9775]: Received signal 15; terminating.
Apr 1 11:09:11 kiwi avahi-daemon[7270]: Withdrawing address record for 192.168.0.20 on wlan0.
Apr 1 11:09:11 kiwi avahi-daemon[7270]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.20.
Apr 1 11:09:11 kiwi avahi-daemon[7270]: Interface wlan0.IPv4 no longer relevant for mDNS.
Apr 1 11:09:11 kiwi kernel: [ 1525.058086] wlan0: deauthenticating from 00:23:69:23:72:5b by local choice (reason=3)
Apr 1 11:09:11 kiwi kernel: [ 1525.062192] cfg80211: Calling CRDA to update world regulatory domain
Apr 1 11:09:11 kiwi avahi-daemon[7270]: Interface wlan0.IPv6 no longer relevant for mDNS.
Apr 1 11:09:11 kiwi avahi-daemon[7270]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::202:6fff:fe5a:b45c.
Apr 1 11:09:11 kiwi avahi-daemon[7270]: Withdrawing address record for fe80::202:6fff:fe5a:b45c on wlan0.
Apr 1 11:09:33 kiwi /etc/init.d/net.wlan0[10263]: Failed to configure wireless for wlan0
Apr 1 11:09:33 kiwi /etc/init.d/net.wlan0[10100]: ERROR: net.wlan0 failed to start
Apr 1 11:09:49 kiwi /etc/init.d/net.wlan0[10434]: Failed to configure wireless for wlan0
Apr 1 11:09:49 kiwi /etc/init.d/net.wlan0[10271]: ERROR: net.wlan0 failed to start
Apr 1 11:10:01 kiwi cron[10603]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 1 11:10:03 kiwi /etc/init.d/net.wlan0[10617]: Failed to configure wireless for wlan0
Apr 1 11:10:03 kiwi /etc/init.d/net.wlan0[10442]: ERROR: net.wlan0 failed to start
Apr 1 11:10:17 kiwi /etc/init.d/net.wlan0[10788]: Failed to configure wireless for wlan0
Apr 1 11:10:17 kiwi /etc/init.d/net.wlan0[10625]: ERROR: net.wlan0 failed to start
Apr 1 11:10:40 kiwi /etc/init.d/net.wlan0[10796]: net.wlan0: caught SIGINT, aborting
Apr 1 11:10:43 kiwi kernel: [ 1617.571869] ADDRCONF(NETDEV_UP): wlan0: link is not ready
Apr 1 11:10:44 kiwi kernel: [ 1618.781837] wlan0: authenticate with 00:23:69:23:72:5b (try 1)
Apr 1 11:10:44 kiwi kernel: [ 1618.784472] wlan0: authenticated
Apr 1 11:10:44 kiwi kernel: [ 1618.784493] wlan0: associate with 00:23:69:23:72:5b (try 1)
Apr 1 11:10:44 kiwi kernel: [ 1618.787377] wlan0: RX AssocResp from 00:23:69:23:72:5b (capab=0x401 status=0 aid=3)
Apr 1 11:10:44 kiwi kernel: [ 1618.787380] wlan0: associated
Apr 1 11:10:44 kiwi kernel: [ 1618.788531] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Apr 1 11:10:45 kiwi avahi-daemon[7270]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.20.
Apr 1 11:10:45 kiwi avahi-daemon[7270]: New relevant interface wlan0.IPv4 for mDNS.
Apr 1 11:10:45 kiwi avahi-daemon[7270]: Registering new address record for 192.168.0.20 on wlan0.IPv4.
Apr 1 11:10:46 kiwi avahi-daemon[7270]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::202:6fff:fe5a:b45c.
Apr 1 11:10:46 kiwi avahi-daemon[7270]: New relevant interface wlan0.IPv6 for mDNS.
Apr 1 11:10:46 kiwi avahi-daemon[7270]: Registering new address record for fe80::202:6fff:fe5a:b45c on wlan0.*.
Apr 1 11:10:55 kiwi kernel: [ 1629.122019] wlan0: no IPv6 routers present
Apr 1 11:20:01 kiwi cron[11341]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 1 11:30:01 kiwi cron[11371]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 1 11:40:01 kiwi cron[11396]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 1 11:50:01 kiwi cron[11410]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 1 12:00:01 kiwi cron[11431]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 1 12:00:01 kiwi cron[11432]: (root) CMD (rm -f /var/spool/cron/lastrun/cron.hourly)
Apr 1 12:10:01 kiwi cron[11444]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Apr 1 12:13:00 kiwi pulseaudio[11510]: ratelimit.c: 2 events suppressed
Apr 1 12:15:00 kiwi avahi-daemon[7270]: Withdrawing address record for 192.168.0.20 on wlan0.
Apr 1 12:15:00 kiwi avahi-daemon[7270]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.20.
Apr 1 12:15:00 kiwi avahi-daemon[7270]: Interface wlan0.IPv4 no longer relevant for mDNS.
Apr 1 12:15:00 kiwi kernel: [ 5474.281975] wlan0: deauthenticating from 00:23:69:23:72:5b by local choice (reason=3)
Apr 1 12:15:00 kiwi kernel: [ 5474.288180] cfg80211: Calling CRDA to update world regulatory domain
Apr 1 12:15:00 kiwi avahi-daemon[7270]: Interface wlan0.IPv6 no longer relevant for mDNS.
Apr 1 12:15:00 kiwi avahi-daemon[7270]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::202:6fff:fe5a:b45c.
Apr 1 12:15:00 kiwi avahi-daemon[7270]: Withdrawing address record for fe80::202:6fff:fe5a:b45c on wlan0.
Apr 1 12:15:40 kiwi /etc/init.d/net.wlan0[11930]: Failed to configure wireless for wlan0
Apr 1 12:15:40 kiwi /etc/init.d/net.wlan0[11767]: ERROR: net.wlan0 failed to start
Apr 1 12:16:53 kiwi /etc/init.d/net.wlan0[11947]: net.wlan0: caught SIGINT, aborting
Apr 1 12:17:10 kiwi kernel: [ 5604.501914] ADDRCONF(NETDEV_UP): wlan0: link is not ready
Apr 1 12:17:11 kiwi kernel: [ 5605.711839] wlan0: authenticate with 00:23:69:23:72:5b (try 1)
Apr 1 12:17:11 kiwi kernel: [ 5605.713399] wlan0: authenticated
Apr 1 12:17:11 kiwi kernel: [ 5605.713421] wlan0: associate with 00:23:69:23:72:5b (try 1)
Apr 1 12:17:11 kiwi kernel: [ 5605.715482] wlan0: RX AssocResp from 00:23:69:23:72:5b (capab=0x401 status=0 aid=3)
Apr 1 12:17:11 kiwi kernel: [ 5605.715486] wlan0: associated
Apr 1 12:17:11 kiwi kernel: [ 5605.716621] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Apr 1 12:17:12 kiwi avahi-daemon[7270]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.20.
Apr 1 12:17:12 kiwi avahi-daemon[7270]: New relevant interface wlan0.IPv4 for mDNS.
Apr 1 12:17:12 kiwi avahi-daemon[7270]: Registering new address record for 192.168.0.20 on wlan0.IPv4.
Apr 1 12:17:13 kiwi avahi-daemon[7270]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::202:6fff:fe5a:b45c.
Apr 1 12:17:13 kiwi avahi-daemon[7270]: New relevant interface wlan0.IPv6 for mDNS.
Apr 1 12:17:13 kiwi avahi-daemon[7270]: Registering new address record for fe80::202:6fff:fe5a:b45c on wlan0.*.
Apr 1 12:17:22 kiwi kernel: [ 5616.290017] wlan0: no IPv6 routers present
------

I don't think it is a faulty wifi driver. I found this link https://bugzilla.novell.com/show_bug.cgi?id=637183#c5 which caused me to do more testing.

If I run

/etc/init.d/net.wlan0 stop/start or restart

cat: /sys/class/net/wlan0/carrier: Invalid argument

is repeated 10 times then the command aborts with an error.

If I let the command terminate on its own, and run the command again it aborts with an error again; however, if I interrupt the command before it terminates with ^c, the next time I run the command, wlan0 comes up OK. Once wlan0 is up, there are no stability issues, it is rock solid and runs for days with no issues.

I monitored /sys/class/net/wlan0/carrier while running the commands and when wlan0 is up, it has a 1 in it; however, when wlan0 is down, it is empty causing the cat error.

I think this is an issue of incorrect communication with the hardware. Either the wifi card is being put in a dormant state and then not being correctly awoken or the start/restart script has a bug in it checking the carrier file before the wifi card is up under some circumstances. Somehow aborting the command changes something and wlan0 starts.

I have always used iwconfig with wifi. wpa_supplicant is an alternative. Do you know if it does a better job talking to the hardware?
BHReach
Growing Hen
 
Posts: 193
Joined: Thu Jan 31, 2008 20:40

Re: Problem manually starting WiFi

Postby Fitzcarraldo » Tue Mar 08, 2011 11:06

gabvil wrote:Maybe something related to the AP and the ath5k module could be the reason.
I have a 5007EG from Atheros and a Linksys router (WRT-320n). Several hours searching for the reason for the constant drop of my connection. I give a chance to the router that was failing in the connection establishment. Ath5k/Ath9k is really mature but not enough to achieve stability. Kernel is the correct one in this case.

One of my laptops has a Linksys CardBus Wireless card with the Atheros AR2413 chip and is running SL using the ath5k module and NetworkManager (back-end) with the nm-applet (front-end), and it works fine -- no stability issues at all -- although I had to lower the MTU. See the post Re: How do I get wireless D-Link DWA-645 working? for details. I cannot comment on the ath9k module, though, as I don't have a machine with an Atheros controller chip that requires the ath9k module.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7984
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Problem manually starting WiFi

Postby Fitzcarraldo » Sun Mar 20, 2011 10:34

My nettop has an Atheros wireless adapter using the AR9285 chip and ath9k module. It also works fine, with no stability problems. I did not need to change the MTU for that.

Code: Select all
# lspci | grep Wireless
02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
#
# lsmod | grep ath
ath9k                  58009  0
mac80211              139290  1 ath9k
ath9k_common            1266  1 ath9k
ath9k_hw              219028  2 ath9k,ath9k_common
ath                     9931  2 ath9k,ath9k_hw
cfg80211               95273  3 ath9k,mac80211,ath


Both my Gateway laptop using ath5k module and my nettop using the ath9k module use NetworkManager. The laptop uses nm-applet (in E17) as the front-end to NetworkManager (DHCP network). The nettop uses KNetworkManager and the Network Management Plasma applet (KDE) as the front-end to NetworkManager (DHCP network). No need to do any manual editing of /etc/conf.d/net to get either working. My main laptop also uses NetworkManager and the Network Management Plasma applet (KDE) as the front-end to NetworkManager (DHCP and static IP networks, all configured from the GUI). So there is no need to edit files from the command line.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7984
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom


Return to Networking and Wireless

Who is online

Users browsing this forum: No registered users and 1 guest