# Wireless gets no ip [Solved - Changed driver]

## Sedrik

Hi guys

I have a broadcom 43225 using the broadcom-sta driver (have tried with the in kernel ones too) and it gets no ip from dhcp. We have around 10 other devices that works fine on the network (among others the wired interface on the laptop).

How can I start debugging this? I feel lost.

Thanks

----------

## NeddySeagoon

Sedrik,

Make the problem space as small as possible. To get an IP, everything else must work, the wireless must associate, negiotiate crypto and be able to broadcast over the network link to find your dhcp server and get a response.

So what can we do to simplify the problem?

The first step is to turn off encryption on the access point, then that doesn't have to work.  It also allows the use of iwconfig from wireless-tools and ifconfig to set up the wireless elements of the interface, then assign a static IP, just for testing. This assumes that its a link level problem you have.

Does your wireless interface appear in 

```
ifconfig -a
```

if not, you have a kernel problem and need to fix that first.

Thats the general ideas.  For specifics, what does 

```
iwconfig
```

 show?

Are there any firmware messages in dmesg?

----------

## Sedrik

Hi NeddySeagoon

Thanks for the reply, sorry for the lack of information in my first message.

The network is associated

```
Series9 sedrik # wpa_cli status

Selected interface 'eth1'

bssid=00:18:e7:ea:d2:7b

ssid=eve-gate

id=2

mode=station

pairwise_cipher=TKIP

group_cipher=TKIP

key_mgmt=WPA2-PSK

wpa_state=COMPLETED

ip_address=169.254.128.2
```

This is what I get from dhcp

```
Series9 sedrik # dhcpcd -k eth1

dhcpcd[8181]: sending signal 1 to pid 21620

dhcpcd[8181]: waiting for pid 21620 to exit

Series9 sedrik # dhcpcd eth1

dhcpcd[8291]: version 5.5.6 starting

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation

dhcpcd[8291]: eth1: broadcasting for a lease

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation

dhcpcd[8291]: eth1: no IPv6 Routers available

dhcpcd[8291]: timed out

dhcpcd[8291]: allowing 8 seconds for IPv4LL timeout

dhcpcd[8291]: eth1: probing for an IPv4LL address

dhcpcd[8291]: eth1: checking for 169.254.42.28

dhcpcd[8291]: eth1: using IPv4LL address 169.254.42.28

dhcpcd[8291]: forked to background, child pid 9395
```

iwconfig

```
Series9 sedrik # iwconfig 

lo        no wireless extensions.

eth1      IEEE 802.11abg  ESSID:"eve-gate"  

          Mode:Managed  Frequency:2.432 GHz  Access Point: 00:18:E7:EA:D2:7B   

          Tx-Power=200 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality=57/70  Signal level=-53 dBm  

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

sit0      no wireless extensions.

eth0      no wireless extensions.
```

scan_results from wpa_cli

```
> scan_results

bssid / frequency / signal level / flags / ssid

00:18:e7:ea:d2:7b   2432   203   [WPA-PSK-TKIP][WPA2-PSK-TKIP][ESS]   eve-gate
```

From what I can see I should have no trouble getting the ip.

Thanks for the help

----------

## Sedrik

Bump.

I have been playing around a bit with this today and is able to get an ip if I turn off encryption completely. All ideas would be great!

----------

## NeddySeagoon

Sedrik,

Well, the obvious one first.  Is the crypto key the same at vith ends?

----------

## Sedrik

 *NeddySeagoon wrote:*   

> Sedrik,
> 
> Well, the obvious one first.  Is the crypto key the same at vith ends?

 

Yes, it would not associate with the network if it wasn't right?

----------

## ultraslinky

```
dhcpcd[8291]: eth1: probing for an IPv4LL address 

dhcpcd[8291]: eth1: checking for 169.254.42.28 

dhcpcd[8291]: eth1: using IPv4LL address 169.254.42.28
```

I had this problem also. Try starting dhcpcd with the "--noipv4ll" flag! It should give you a regular ip address.

----------

## NeddySeagoon

ultraslinky,

dhcpcd should only fall bacl to a IPv4 Link Local address when trying to get an address for a dhcp server has failed.

Do you have an agressive timeout set in /etc/conf.d/net for the wireless network ?

----------

## ultraslinky

Neddy, Actually i have no timeout set at all in /etc/conf.d/net, just the dhcpcd flags i just wrote above. I get a Local Link address about 1 every 4 times i connect, if i don't use that option to avoid it. That is, at my home router, my friend's router, my university router, it can happen anywhere so definitely not a router / dhcp server problem. I have no idea what causes it but it is fixed with that option  :Smile: 

----------

## cach0rr0

 *Sedrik wrote:*   

> Bump.
> 
> I have been playing around a bit with this today and is able to get an ip if I turn off encryption completely. All ideas would be great!

 

broadcom-sta requires a bunch of rubbish enabled in the kernel to do crypto, that other wireless drivers do not

and the ebuild for it doesnt die (grrrrr) if those config options are not set

namely, the LIB80211 bits and bobs 

relevant snip from the ebuild:

```

    if kernel_is ge 2 6 33; then

        CONFIG_CHECK="${CONFIG_CHECK} LIB80211 WIRELESS_EXT CFG80211_WEXT WEXT_PRIV ~!MAC80211"

        ERROR_WEXT_PRIV="Starting with 2.6.33, it is not possible to set WEXT_PRIV directly. We recommend to set another symbol selecting WEXT_PRIV, for example, PRISM54, IPW2200 and so on. See Bug #248450 comment#98."

```

SO...it's time to edit your kernel config, hit the /forwardslash to search, type in:

LIB80211 - find and enable as module

WIRELESS_EXT - cannot be directly enabled. Enable HOSTAP which will enable this

WEXT_PRIV - cannot be directly enabled. Enable HOSTAP which will enable this

MAC80211 - make sure this is DISabled

HOSTAP - this actually selects WEXT_PRIV and WIRELESS_EXT; see the error message in the snip above for why you have to enable something you don't realistically even use. 

enabled

```

  │ Symbol: LIB80211 [=m]

  │ Type  : tristate

  │ Prompt: Common routines for IEEE802.11 drivers

  │   Defined at net/wireless/Kconfig:135

  │   Depends on: NET [=y] && WIRELESS [=y]

  │   Location:

  │     -> Networking support (NET [=y])

  │       -> Wireless (WIRELESS [=y])

```

disabled

```

  │ Symbol: MAC80211 [=n]

  │ Type  : tristate

  │ Prompt: Generic IEEE 802.11 Networking Stack (mac80211)

  │   Defined at net/mac80211/Kconfig:1

  │   Depends on: NET [=y] && WIRELESS [=y] && CFG80211 [=m]

  │   Location:

  │     -> Networking support (NET [=y])

  │       -> Wireless (WIRELESS [=y])

```

enabled

```

 Symbol: HOSTAP [=m]

  │ Type  : tristate

  │ Prompt: IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)

  │   Defined at drivers/net/wireless/hostap/Kconfig:1

  │   Depends on: NETDEVICES [=y] && WLAN [=y]

  │   Location:

  │     -> Device Drivers

  │       -> Network device support (NETDEVICES [=y])

  │         -> Wireless LAN (WLAN [=y])

```

You will also note HOSTAP not only selects WIRELESS_EXT and WEXT_PRIV, which you need, but also the LIB80211 crypto pieces, which you need  

```

  Selects: WIRELESS_EXT [=n] && WEXT_SPY [=n] && WEXT_PRIV [=n] && CRYPTO [=y] && CRYPTO_ARC4 [=y] && CRYPTO_ECB [=y] && CRYPTO_AES [=y] && CRYPTO_MICHAEL_MIC [=y] && \    │  

  │ CRYPTO_ECB [=y] && CRC32 [=y] && LIB80211 [=m] && LIB80211_CRYPT_WEP [=n] && LIB80211_CRYPT_TKIP [=m] && LIB80211_CRYPT_CCMP [=n]

```

This is just one of the fun stupid things you're stuck dealing with using broadcom-sta  :Smile: 

and one of the reasons using the in-kernel open source driver is highly preferable if possible (see: here)

Either way, with those bits enabled/disabled accordingly, a rebuilt and reinstalled kernel (plus modules), you should be able to connect to encrypted AP's

----------

## Gusar

The 43225 is supported by b43 and brcmsmac, so no need to mess with broadcom-sta.

----------

## Sedrik

Is there anything else you need to enable?

I have switched to the b43 drivers in kernel, I have the b43-firmware package unmasked and installed but still I am unable to authenticate with the network.

----------

## Sedrik

After some more debugging I have gotten the card to connect to the network but the connection is dropped every 500s because it fails to receive probe responses.

I see alot of TKIP messages before the Probe log in dmesg, anyone that knows what might be up (I checked my kernel and TKIP is active)?

----------

## NeddySeagoon

Sedrik,

Please post your /etc/init.d/net file.  The 

```
dhcpcd[8291]: version 5.5.6 starting 

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation 

dhcpcd[8291]: eth1: broadcasting for a lease 

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation 

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation 

dhcpcd[8291]: eth1: sending IPv6 Router Solicitation 

dhcpcd[8291]: eth1: no IPv6 Routers available 

dhcpcd[8291]: timed out 
```

says you did not get s dhcp offer message.

The timeout is 60 seconds by defualt but it can easility be shortened to the point where the timeout expires before a lease is offered.

Is there anything usefull in the router logs ?

----------

## Sedrik

Router logs says nothing interesting.

This is what dmesg says

```
[    7.551001] b43-phy0: Loading firmware version 666.2 (2011-02-23 01:15:07)

[    7.551022] bcma: Switched to core: 0x800

[    7.551034] bcma: Switched to core: 0x812

[    7.582908] b43-phy0 debug: Chip initialized

[    7.583103] b43-phy0 debug: 64-bit DMA initialized

[    7.583121] b43-phy0 debug: QoS disabled

[    7.583817] b43-phy0 debug: Wireless interface started

[    7.583888] b43-phy0 debug: Adding Interface type 2

[    7.585714] ADDRCONF(NETDEV_UP): wlan0: link is not ready

[    9.245886] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 1/3)

[    9.445631] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 2/3)

[    9.645605] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 3/3)

[    9.845576] wlan0: direct probe to 00:18:e7:ea:d2:7b timed out

[   20.545497] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 1/3)

[   20.745255] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 2/3)

[   20.945153] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 3/3)

[   21.145144] wlan0: direct probe to 00:18:e7:ea:d2:7b timed out

[   31.846124] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 1/3)

[   32.045849] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 2/3)

[   32.245752] wlan0: direct probe to 00:18:e7:ea:d2:7b (try 3/3)

[   32.445806] wlan0: direct probe to 00:18:e7:ea:d2:7b timed out
```

I dont have a init.d/net, did you perhaps mean conf.d/net?

```
cat /etc/conf.d/net

modules_eth0="ifplugd"

config_eth0="dhcp"

modules_wlan0="wpa_supplicant"

config_wlan0="dhcp"

#wpa_supplicant_eth1="-DBroadcom"
```

----------

## cach0rr0

any particular reason you opted for b43 instead of brcmsmac ?

b43 was bad news in the past. may have gotten better. the flavor of the day seems to be brcmsmac

----------

## Sedrik

I have never heard of bscmsmac before and have only had experience with broadcom-sta and the b43 drivers.

I looked at bscmsmac and the configuration says BCMA [=y]=n. I checked for BCMA support and it is activated but the options does not appear in the wireless driver section.

How do I enable it so that I can try that driver?

```
Symbol: BRCMSMAC [=n]                                                                                                                          │  

  │ Type  : tristate                                                                                                                               │  

  │ Prompt: Broadcom IEEE802.11n PCIe SoftMAC WLAN driver                                                                                          │  

  │   Defined at drivers/net/wireless/brcm80211/Kconfig:4                                                                                          │  

  │   Depends on: NETDEVICES [=y] && WLAN [=y] && PCI [=y] && MAC80211 [=y] && BCMA [=y]=n                                                         │  

  │   Location:                                                                                                                                    │  

  │     -> Device Drivers                                                                                                                          │  

  │       -> Network device support (NETDEVICES [=y])                                                                                              │  

  │         -> Wireless LAN (WLAN [=y])                                                                                                            │  

  │   Selects: BRCMUTIL [=n] && FW_LOADER [=y] && CRC_CCITT [=n] && CRC8 [=n] && CORDIC [=n]

 Symbol: BCMA [=y]                                                                                                                              │  

  │ Type  : tristate                                                                                                                               │  

  │ Prompt: BCMA support                                                                                                                           │  

  │   Defined at drivers/bcma/Kconfig:9                                                                                                            │  

  │   Depends on: BCMA_POSSIBLE [=y]                                                                                                               │  

  │   Location:                                                                                                                                    │  

  │     -> Device Drivers                                                                                                                          │  

  │       -> Broadcom specific AMBA

```

*Edit

It would seem that brcmsmac gives me a kernel panic when loading. How can I debugg the errors I have for b43?

----------

## leiking

your dhcpcd doesnot manage the interface wlan0

----------

## Sedrik

 *leiking wrote:*   

> your dhcpcd doesnot manage the interface wlan0

 

It does see my conf.d/net config posted earlier.

----------

## Sedrik

Finally got bcmmsmac up and running. The part I was completley oblivious to was that I had to download the firmware seperately.

Also, when I activated the HOSTAP option I got a kernel panic so avoid that.

Thanks for the support all, you rule!

*edit: Here are the firmware installation instructions http://linuxwireless.org/en/users/Drivers/brcm80211

----------

## Gusar

There's a simpler way to get the firmware:

```
emerge linux-firmware
```

----------

