Modify

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#5096 closed defect (worksforme)

wireless client mode broken

Reported by: michas Owned by: developers
Priority: normal Milestone: Kamikaze 8.09.1
Component: base system Version:
Keywords: Cc:

Description

Yesterday I build a new firmware from the current 8.09 svn branch.
I set the wifi up for client mode, but openwrt didn't connect by itself. Logging in and starting "wifi" manually worked though.

After digging a while through the source I think I found the problem:

setup_interface() from /lib/network/config.sh is at least called by "wifi" and hotplug. That function effectively toggles the dhcp client on and off.

/etc/init.d/boot loads all the modules and the wl module triggers hotplug which switches dhcp on, but doesn't configure the wifi parameters. Later /etc/init.d/network calls "wifi", which configures the wifi parameter and after that calls setup_interface() which kills the dhcp daemon, hence f.e. another manual "wifi" is needed to fix things.

The easiest fix I see is telling /etc/hotplug.d/net/10-net to ignore wl*) as it does with ppp*). But I'm not sure if it leads to the correct semantics.

Attachments (0)

Change History (9)

comment:1 Changed 9 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

I believe this is fixed with r15753 & r15754. If you still have issues, please open a new ticket.

comment:2 Changed 9 years ago by hauke

  • Resolution fixed deleted
  • Status changed from closed to reopened

Bug is not closed. #5098

comment:3 Changed 9 years ago by jow

Before the mentioned change set the interface-device-network mapping was accidentally reverted by the dhcp script which rendered the wireless device unuseable with certain configurations.

However I'm unable to reproduce your problem, sorry. I tested with both brcm-2.4 and atheros builds of branches/8.09, dhcp worked just fine in both psk2 secured sta and unencrypted ad-hoc mode.

Test-Configuration is given below.

root@OpenWrt:~# cat /etc/config/network 
# Copyright (C) 2006 OpenWrt.org

config interface loopback
	option ifname	lo
	option proto	static
	option ipaddr	127.0.0.1
	option netmask	255.0.0.0

config interface lan
	option ifname	eth0
	option type 	bridge
	option proto	static
	option ipaddr	192.168.1.1
	option netmask	255.255.255.0
	
config interface wan
	option proto dhcp
config wifi-device  wifi0
	option type     atheros
	option channel  auto

	# REMOVE THIS LINE TO ENABLE WIFI:
	option disabled 0

config wifi-iface
	option device	wifi0
	option network	wan
	option mode	sta
	option ssid	xmff
	option encryption psk2
	option key ...

comment:4 Changed 9 years ago by jow

Please attach /etc/config/firewall, /etc/config/network and /etc/config/wireless together with the device you use.

comment:5 Changed 9 years ago by michas

(No akismet, this is no spam...)

The wifi-command toggles dhcp on and off, right?

/etc/init.d/boot loads the wl module, right?

When it is loaded hotplug calls addif() in /etc/hotplug.d/net/10-net, which (like "wifi") turns on dhcp. (That's the step I had to deactivate to let it work.)

After that /etc/init.d/network calls wifi, right?

That last wifi-call should deactivate dhcp again or we have some different kind of setup. :)

I have no firewall. This is network:

config 'switch' 'eth0'
	option 'vlan0' '0 1 2 3 4 5*'

config 'interface' 'loopback'
	option 'ifname' 'lo'
	option 'proto' 'static'
	option 'ipaddr' '127.0.0.1'
	option 'netmask' '255.0.0.0'

config 'interface' 'lan'
	option 'ifname' 'eth0.0'
	option 'proto' 'static'
	option 'ipaddr' '192.168.12.1'
	option 'netmask' '255.255.255.0'
	option 'dns' ''
	option 'gateway' ''

config 'interface' 'wan'
	option 'ifname' 'wl0'
	option 'proto' 'dhcp'

wireless:

config wifi-device  wl0
	option type     broadcom
	option channel  1

config wifi-iface
	option device   wl0
	option mode     sta
	option ssid     "NAME"
	option encryption wep
	option key     XXXXX

The device is an Asus500GD. Firmware compiled by myself. (I don't think I set too strange options...)

comment:6 Changed 9 years ago by florian

  • Resolution set to worksforme
  • Status changed from reopened to closed

You are missing an option network wan in your /etc/config/wireless file.

comment:7 Changed 8 years ago by sebas

I'm experiencing this bug with 8.09.1 . As explained here, applying this micro patch, the openwrt connects at boot in client mode.

root@OpenWrt:/etc/hotplug.d/net# diff -u 10-net-original  10-net
--- 10-net-original     Sun May 31 10:40:02 2009
+++ 10-net      Sat Nov 14 17:36:01 2009
@@ -6,6 +6,7 @@
        # PPP devices are configured by pppd, no need to run setup_interface here
        case "$INTERFACE" in
                ppp*) return 0;;
+               wl*) return 0;;
        esac
 
        scan_interfaces
# uname -a
Linux OpenWrt 2.4.35.4 #12 Mon Jun 1 21:52:49 UTC 2009 mips unknown

the device is a wrt54gl

comment:8 Changed 8 years ago by sebas

Actually, there is no need to hack anything...

When the ifname option is set to 'wl0' in /etc/config/network and the device is in client mode, the wifi doesn't connect automatically at boot. If you leave the ifname option set to 'eth0.1', the wifi does connect at boot.

comment:9 Changed 8 years ago by Thyzoul

Hi,
in fact I thought I had the same problem because I was having similar issues. Actually it was that I forgot to specify that my wifi "key" was ASCII. What I mean is that in your
"/etc/config/wireless" file you might have forgotten to write it in this way :

<code>

config wifi-iface

option device wl0
option network wan
option mode sta
option ssid XXX
option encryption wep
option key s:XXX

</code>
Good luck I hope this can help ;)

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.