# update on ipw3945d to 1.7.22-r4 -> device down [SOLVED]

## gerste

Hello,

I have an Thinkpad X60s with the Intel Pro/Wireless 3045ABG device.

I read all the other threads about the ipw3945 driver and daemon. I often had problems with it before and could solve them, but now I'm really stuck.

(I made the big mistake to do a update on my world set..., I saw that the init script was also updated, but as I never made a change there, so I updated it with etc-update.)

Emerge update on world updated the ipw3945d-1.7.22-r3 to -r4. Afterwards my wireless device never came up again.

I tried all the tips. "rmmod" (or use modprobe)  all the modules (ipw3945, ieee80211_*) and load them in several orders again. Starting the daemon by script or hand. The device never comes up again.

There is one strange thing now. I removed ipw3945 and ieee* from /etc/modules.autoload.d/kernel2.6 . Then "modules-update". Made sure ipw3945d is not started with the rc.

Now I rebooted and wanted to enable it all by hand again. When I rebooted, lsmod told me, that all modules are already present. Why is that? I cannot find any place where the system is told to load them at boot time (please tell me if I missed something). When I remove and reload them and then start the daemon, the device is not present. Although the daemon isn't triggering any error.

Can someone tell me how I can fix this problem and why the modules are loaded without my knowledge where and why?

I also downgraded to the -r3 version again. But that didn't fix the problem. The init script wasn't change. As I thought there may be the error, I unmerged, deleted the init script and emerged the old version again. But the script looked like the new one again. I will try downgrading to 1.7.18 to check this out. 

Thx in advance and sorry for the bad english.

UPDATE:

Downgraded to 1.7.18. The scripts cannot be used anymore, because this version is not emerged with an init script anyway. When the daemon gets started by hand the device comes back. Unfortunately I cannot bring up /etc/init.d/net.eth1. I can scan the APs but cannot log in.

Message: "Error for wireless request "Set Encode" (8B2A)"

I know this error from before and hope to be able to solve it soon (reboot did not help). At least my device is not broken  :Wink: Last edited by gerste on Fri Jan 05, 2007 2:24 pm; edited 1 time in total

----------

## Fran

I had problems with -r4 due to some permission issues with the pid file. The daemon is run with uid ipw3945d and /var/run can only be touched by root. So I chowned ipw3945d:root /var/run/ipw3945d/ and changed /etc/conf.d/ipw3945d to this:

```
ARGS="--timeout=-1 --quiet --pid-file=/var/run/ipw3945d/ipw3945d.pid"
```

Now everything works ok.

----------

## gerste

Ok, I will try this and post if I succeed.

Thank you for the fast first suggestion.

----------

## jasn

My situation was similarly caused by upgrading to ipw3945d-1.7.22-r4. To set this up, I have had no problems with my Intel 3945 WiFi until this last upgrade of ipw3945d. My initial installation on this laptop started with gentoo-sources 2.6.19, ipw3945-1.0.5, ipw3945d-1.7.18 and upgraded through 2.6.19-r2, ipw3945-1.1.3, ipwd3945-1.7.22-r3 with no issues. Once I upgraded to ipwd3945d-1.7.22-r4 I got the boot message stating that eth1 did not exist.

Playing around with ipw3945d, I discovered the message stating that it couldn't start. Obviously at this point rmmod ipw3945 and then modprobe ipw3945, wasn't getting me anywhere, with the daemon refusing to load. So not knowing what Fran knew, I downgraded to ipw3945d-1.7.22-r3 only to find out that my prior "good" config wouldn't work anymore. I still got the eth1 does not exist message on boot, but at least I could manually kick start my WiFi, by simply rmmod ipw3945 and modprobe ipw3945, once my system was up. I was even going to include the commands in my local.start file, until Fran's post. Following the instructions there I re-emerged ipw3945d-1.7.22-r4, changed the permissions and edited the ipw3945d configuration file, and everything now loads just like it used to. (Thank you..)

With my prior problem, and forum searching that led me to the long ipw3945 thread, I even followed the instructions logics posted there on page 20, and got the git sources for ipw3945 and patched my kernel tree, so now I'm running ipw3945d-1.7.22-r4 with the 1.1.4 ipw3945. So far, so good..

----------

## gerste

Ok. Thx jasn and Fran for your help. I made some steps to the goal of reactivating my wireless device.

I followed your tips and have now ipw3945-1.1.3 and ipw3945d-1.7.22-r4 running. The device is now available.

But another problem came up.

I'm at home now and have an 128bit WEP encrypted wireless network and hidden ESSID. It's the same type of network at work, despite that I'm working with static IPs here. 

Now when I boot up my laptop the daemon is started without problems in runlevel 3.

Then I want to bring up eth1 by hand with "/etc/init.d/net.eth1 start".

```
 

* Caching service dependencies ...                                                   [ ok ]

 * Starting eth1

 *   Configuring wireless network for eth1

 *     eth1 connected to ESSID "Olymp" at 00:0F:3D:09:43:77

 *     in managed mode on channel 10 (WEP enabled - open)

 *   Configuration not set for eth1 - assuming DHCP

 *   Bringing up eth1

 *     dhcp

 *       Running dhcpcd ...

Error, terminating on signal 2                                                        [ !! ]

 * ERROR:  net.eth1 caught an interrupt

```

The termination was caused by me, because running dhcpcd is just not defined in the specifications of eth1 for the essid of my network, and it just never stop alone. Here my /etc/conf.d/net and /etc/conf.d/wireless settings. I didn't touch the files all the time, despite for changes to the keys and names I don't want to show here  :Wink: . Also I always have to change, when I'm at home and at the office, the essid_eth1 settings and so on, because of bugs also mentioned in the forums... 

But here is the configuration for being at home:

```

/etc/conf.d/net

-----------------

config_eth0=( "192.168.0.109 netmask 255.255.255.0 brd 192.168.0.255" )

routes_eth0=( "default gw 192.168.0.1" )

modules=( "iwconfig" )

/etc/conf.d/wireless

-----------------------

essid_000f3d094377="Home"

essid_eth1=( "Home" )

preferred_aps_eth1=( "Home" )

associate_order_eth1="preferredonly"

associate_timeout_eth1="5"

iwconfig_eth1=""

#iwpriv_eth1=( "set_power 7" )

key_Office="s:1234567890123 enc open" # Work

config_Office=( "dhcp" )

dhcpcd_Office="-t 4"

key_Home="s:abcdefghijklm enc open" # Home

config_Home=( "192.168.0.110 netmask 255.255.255.0 brd 192.168.0.255" )

routes_Home=( "default gw 192.168.0.1" )

channel_Home="10"

/etc/conf.d/ipw3945d

------------------------

# /etc/conf.d/ipw3945d: config file for /etc/init.d/ipw3945d

# Arguments to be passed to ipw3945d. See 'ipw3945d --help' for more

# information.

ARGS="--timeout=-1 --quiet --pid-file=/var/run/ipw3945d/ipw3945d.pid"

```

Did something change in the specification for the settings (I don't think so. Still searching for the error I made.) or why does /etc/init.d/net.eth1 not find my old settings anymore?

----------

## gerste

I just noticed after a reboot, when I check net.eth1 for status, I get the message, that it is still "starting". After a while it is stated as stopped. The settings are the following then. In ifconfig the device is down. For iwconfig the settings seem to be made.

```

          IEEE 802.11g  ESSID:"Home5"

          Mode:Managed  Frequency:2.457 GHz  Access Point: 00:0F:3D:09:43:77

          Bit Rate:54 Mb/s   Tx-Power:15 dBm

          Retry limit:15   RTS thr:off   Fragment thr:off

          Encryption key:xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx   Security mode:open

          Power Management:off

          Link Quality=93/100  Signal level=-40 dBm  Noise level=-112 dBm

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

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

```

The wireless device is up, at full power  :Wink: . The key seems to be correct. Mac Address of the AP, too.

But strange for me is the ESSID:"Home5". The essid is "Home" and not "Home5"! Where does he get this essid with the "5" from?

If I want to start net.eth1, now, it wants to get an IP using dhcpcd again.

I just want to add, that it is possible to scan for APs using "iwlist eth1 scanning". My network is found as "<hidden>". So it is available.

----------

## gerste

I copied all settings from /etc/conf.d/wireless to /etc/conf.d/net. So the information is doubled. As I hoped and suspected, after a reboot, I'm logged in into my home network right from the start.

But I still don't know why the information in /etc/conf.d/wireless is disgarded. Also the ESSID is still "Home5" and not "Home".

I checked my router and the ESSID used is "Home". Think that's kinda funny, but I would really like to know why it is that way.

----------

## gerste

Today morning after a new reboot, it didn't work again and dhcpd is trying to get an ip and fails. It works on random basis. That's really annoying.

----------

## gerste

Ok that seems to be a bug for me. After I moved all settings from /etc/conf.d/wireless to /etc/conf.d/net I had also to switch my settings for Work and Home. 

When I bring the system up, the settings for iwconfig are correct but the settings for ifconfig (static IP...) are always taken from the first configuration.

```

 This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=( "192.168.0.109 netmask 255.255.255.0 brd 192.168.0.255" )

routes_eth0=( "default gw 192.168.0.1" )

# WIRELESS

# --------

modules_eth1=( "iwconfig" )

essid_000f3d094377="Home"

essid_eth1=( "Home" )

preferred_aps_eth1=( "Home" )

associate_order_eth1="preferredonly"

associate_timeout_eth1="5"

iwconfig_eth1=""

#iwpriv_eth1=( "set_power 7" )

key_Home="s:abcdefghijklm enc open" # Home

config_Home=( "192.168.0.110 netmask 255.255.255.0 brd 192.168.0.255" )

routes_Home=( "default gw 192.168.0.1" )

channel_Home="10"

                  /\

                 |  |

     SWITCHED BLOCKS

                 |  |

                  \/

key_Office="s:1234567890123 enc open" # Work

config_Office=( "dhcp" )

dhcpcd_Office="-t 4"

```

What I would have to test now, is if I have to switch back at my Office. Unfortunately (or luckily) I can do this soonest after Xmas.

If so, iwconfig would have become even more uncomfortable, as it already was. As long as it worked I didn't mind. Also wpa_supplicant  didn't work at all on my machine...

Have a nice Christmas!

----------

## gerste

Just noticed, after another bootup it doesn't work again. Same error. Maybe I should switch the configs again?  :Sad: 

For me this is just random behavior. Maybe I should never switch of my laptop, when it's working.

----------

## goofy22

 *Fran wrote:*   

> I had problems with -r4 due to some permission issues with the pid file. The daemon is run with uid ipw3945d and /var/run can only be touched by root. So I chowned ipw3945d:root /var/run/ipw3945d/ and changed /etc/conf.d/ipw3945d to this:
> 
> ```
> ARGS="--timeout=-1 --quiet --pid-file=/var/run/ipw3945d/ipw3945d.pid"
> ```
> ...

 

Hola!

Just wanted to tell that this worked on my laptop! I had the system running and sleeping with suspend2, and after a reboot the wlan didn't come up. But now it works again :)

Thanks Fran & others.

----------

## DirtyHairy

I suppose I can't really help you with your other troubles, but I just upgraded today to the latest ipw3945 and ieee80211 ebuilds, and despite wireless (with WPA via wpa_supplicant) working fine, iwconfig shows me an additional character at the end of the essid which varies between different connects. I'm very sure that this is just a harmless bug about one character too much being copied somewhere in the driver code from A to B...

About the other stuff: you should try configuring everything manually with iwconfig, ifconfig and route to make sure it isn't the gentoo init scripts messing it up somewhere. If this works, you can at least be sure your hardware is working OK and eventually create a script which configures the network.

----------

## gerste

Ok, I wrote this tiny script to check if I can bring up the device by hand. I emptied my /etc/conf.d/wireless and no access data for iwconfig is present. In /etc/conf.d/net the only option set to use is"iwconfig".

```

#!/bin/bash

/etc/init.d/ipw3945d stop

rmmod ipw3945

modprobe ipw3945

/etc/init.d/ipw3945d start

sleep 5

DEV="eth1"

ESSID="<ESSID>"

KEY="<KEY> enc open"

ENC="enc open"

CHANNEL="10"

MODE="Managed"

AP="<MAC>"

TXP="5"

POWER="7"

IP="<IP>"

GW="192.168.0.1"

iwpriv $DEV set_power $POWER

iwconfig $DEV txpower $TXP

iwconfig $DEV essid $ESSID nick $ESSID key $KEY mode $MODE channel $CHANNEL ap $AP

sleep 1

ifconfig $DEV $IP netmask 255.255.255.0

route add default gw $GW dev $DEV

```

This is working. Crucial seems the "sleep 5" after inserting the ipw3945 module into the kernel and starting up the daemon. Even with 3 seconds set, the settings to iwconfig sometimes fail and my node tries to connect to any other network despite mine in my area. I think I read something about these latencies before in the forum and I would say that these may also cause the problems with my startup scripts. Maybe I should try out wpa_supplicant again.

----------

## gerste

Ok I tried out wpa_supplicant again. At home it was working fine. Unfortunately I got a little problem at work now.

Remember: Both networks are WEP open, only Home is static IP and Office is dhcp.

/etc/conf.d/net

```

modules=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dwext"

associate_timeout_wlan=60

config_Home=( "192.168.0.110 netmask 255.255.255.0 broadcast 192.168.0.255" )

routes_Home=( "default gw 192.168.0.1" )

config_Office=( "dhcp" )

dhcpcd_Office="-t 4"

```

/etc/wpa_supplicant/wpa_supplicant.conf

```

# The below line not be changed otherwise we refuse to work

ctrl_interface=/var/run/wpa_supplicant

# Ensure that only root can read the WPA configuration

ctrl_interface_group=0

# Let wpa_supplicant take care of scanning and AP selection

ap_scan=1

# Whether to allow wpa_supplicant to update (overwrite) configuration

update_config=0

# EAP fast re-authentication

fast_reauth=1

#HOME

network={

  ssid="Home"

  scan_ssid=1

  mode=0

  key_mgmt=NONE

  wep_key0="<KEY>"

  wep_tx_keyidx=0

  priority=6

}

# OFFICE

network={

  ssid="Office"

  scan_ssid=1

  mode=0

  key_mgmt=NONE

  wep_key1="<KEY>"

  wep_tx_keyidx=0

  priority=7

}

```

I use this script to bring up the device.

```

#!/bin/bash

/etc/init.d/ipw3945d stop

rmmod ipw3945

modprobe ipw3945

/etc/init.d/ipw3945d start

sleep 5

DEV="eth1"

TXP="5"

POWER="7"

iwpriv $DEV set_power $POWER

iwconfig $DEV txpower $TXP

```

At home it connects correctly. At my office all settings to iwconfig are done, despite the WEP key. DHCPCD is not started. If I give "iwconfig eth1 key s:<KEY> enc open" and then start "dhcpcd eth1" the key is set and I get my IP. The device is usable now. What is wrong with my settings that this is not done automatically?

----------

## gerste

Never mind the last post. I just checked that the key number for my key at the Office should be 0 and not 1 in wpa_supplicant.conf

wep_key1="<KEY>" => wep_key0="<KEY>"

and miraculously it worked. 

Thx to all who helped me. Topic is solved now.

----------

