1 (edited by VITA 2017-02-17 15:27:16)

Topic: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

Hi,

I've installed OpenWRT recently on Pirelli AR422G router. It has a Wifi PCI card inserted and it works. The only thing I couldn't do is to set it in a repeater mode, that was my goal. I followed a few guides but whenever I set it up, one interface can't connect to the AP and other also does not show the Wifi SSID. So I gave up, and decided to use the inbuilt USB to plug an additional USB Wifi adapter I had laying around.

The adapter is TP-Link WN422G. I've installed the appropriate kernel modules via opkg and it seems like the USB Wifi adapter is detected.

When I try to run wifi detect > /etc/config/wireless I always only get the default radio0 which is the PCI wifi card, usb adapter does not show sad .

When I run lsusb, I can clearly see the name of the adapter, also I've looked at dmesg and It seems the USB wifi adapter is detected.

I don't have an idea how to configure it, so I would appreciate some help!

dmesg:

[    0.000000] Linux version 4.4.14 (thepeople@trabant) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 50104) ) #1 Tue Feb 14 09:18:08 UTC 2017
[    0.000000] Detected Broadcom 0x6358 CPU revision a1
[    0.000000] CPU frequency is 300 MHz
[    0.000000] 32MB of RAM installed
[    0.000000] board_bcm963xx: Boot address 0xbe000000
[    0.000000] board_bcm963xx: CFE version: 1.0.41-8.7
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0002a010 (Broadcom BMIPS4350)
[    0.000000] board: board name: DWV-S0
[    0.000000] MIPS: machine is Pirelli A226G
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] On node 0 totalpages: 8192
[    0.000000] free_area_init_node: node 0, pgdat 80402630, node_mem_map 81003de0
[    0.000000]   Normal zone: 64 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 8192 pages, LIFO batch:0
[    0.000000] Primary instruction cache 32kB, VIPT, 2-way, linesize 16 bytes.
[    0.000000] Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Memory: 26708K/32768K available (3148K kernel code, 156K rwdata, 856K rodata, 1272K init, 198K bss, 6060K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[    0.000022] sched_clock: 32 bits at 150MHz, resolution 6ns, wraps every 14316557820ns
[    0.008121] Calibrating delay loop... 299.26 BogoMIPS (lpj=598528)
[    0.046828] pid_max: default: 32768 minimum: 301
[    0.051900] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.058732] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.075614] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.089147] NET: Registered protocol family 16
[    0.113470] registering PCI controller with io_map_base unset
[    0.119420] registering PCI controller with io_map_base unset
[    0.150362] PCI host bridge to bus 0000:00
[    0.154645] pci_bus 0000:00: root bus resource [mem 0x30000000-0x37ffffff]
[    0.161736] pci_bus 0000:00: root bus resource [io  0x8000000-0x8007fff]
[    0.168641] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.175635] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.183873] pci 0000:00:01.0: [14e4:4318] type 00 class 0x028000
[    0.184970] pci 0000:00:01.0: reg 0x10: [mem 0x00000000-0x00001fff]
[    0.191806] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    0.191886] pci 0000:00:01.0: BAR 0: assigned [mem 0x30000000-0x30001fff]
[    0.199787] PCI host bridge to bus 0000:01
[    0.204056] pci_bus 0000:01: root bus resource [mem 0x38000000-0x3fffffff]
[    0.211138] pci_bus 0000:01: root bus resource [io  0x8008000-0x800ffff]
[    0.218044] pci_bus 0000:01: root bus resource [??? 0x00000000 flags 0x0]
[    0.225040] pci_bus 0000:01: No busn resource found for root bus, will use [bus 01-ff]
[    0.233312] pci 0000:01:1e.0: [14e4:6358] type 02 class 0x060700
[    0.233859] pci 0000:01:1e.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.242516] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 05
[    0.242578] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 05
[    0.242656] pci 0000:01:1e.0: BAR 10: assigned [mem 0x38000000-0x3fffffff]
[    0.249786] pci 0000:01:1e.0: BAR 7: assigned [io  0x8008000-0x80080ff]
[    0.256615] pci 0000:01:1e.0: BAR 8: assigned [io  0x8008400-0x80084ff]
[    0.263444] pci 0000:01:1e.0: CardBus bridge to [bus 02-05]
[    0.269189] pci 0000:01:1e.0:   bridge window [io  0x8008000-0x80080ff]
[    0.276009] pci 0000:01:1e.0:   bridge window [io  0x8008400-0x80084ff]
[    0.282830] pci 0000:01:1e.0:   bridge window [mem 0x38000000-0x3fffffff]
[    0.292456] clocksource: Switched to clocksource MIPS
[    0.301261] PCI: Enabling device 0000:00:01.0 (0000 -> 0002)
[    0.333540] ssb: Found chip with id 0x4318, rev 0x02 and package 0x02
[    0.340748] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x0D, vendor 0x4243)
[    0.341304] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x09, vendor 0x4243)
[    0.341852] ssb: Core 2 found: PCI (cc 0x804, rev 0x0C, vendor 0x4243)
[    0.342400] ssb: Core 3 found: PCMCIA (cc 0x80D, rev 0x07, vendor 0x4243)
[    0.386865] ssb: Sonics Silicon Backplane found on PCI device 0000:00:01.0
[    0.394783] NET: Registered protocol family 2
[    0.401830] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.409159] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.415789] TCP: Hash tables configured (established 1024 bind 1024)
[    0.422857] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.428998] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.436210] NET: Registered protocol family 1
[    0.440946] PCI: CLS 0 bytes, default 16
[    0.443385] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.497045] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.503155] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.521165] io scheduler noop registered
[    0.525284] io scheduler deadline registered (default)
[    0.533259] bcm63xx_uart.0: ttyS0 at MMIO 0xfffe0100 (irq = 10, base_baud = 1562500) is a bcm63xx_uart
[    0.542961] console [ttyS0] enabled
[    0.550143] bootconsole [early0] disabled
[    0.561055] 1e000000.nor: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022c9
[    0.571437] 1e000000.nor: Found an alias at 0x800000 for the chip at 0x0
[    0.571483] 1e000000.nor: Found an alias at 0x1000000 for the chip at 0x0
[    0.571522] 1e000000.nor: Found an alias at 0x1800000 for the chip at 0x0
[    0.571595] Amd/Fujitsu Extended Query Table at 0x0040
[    0.576928]   Amd/Fujitsu Extended Query version 1.1.
[    0.582139] 1e000000.nor: Swapping erase regions for top-boot CFI table.
[    0.589041] number of CFI chips: 1
[    0.599265] bcm63xxpart: CFE boot tag found with version 8 and board type DWV-S0
[    0.607024] 5 bcm63xxpart partitions found on MTD device 1e000000.nor
[    0.613687] Creating 5 MTD partitions on "1e000000.nor":
[    0.619164] 0x000000000000-0x000000010000 : "CFE"
[    0.627688] 0x000000010100-0x000000161af8 : "kernel"
[    0.637267] 0x000000161af8-0x0000007f0000 : "rootfs"
[    0.646747] mtd: device 2 (rootfs) set to be root filesystem
[    0.652683] 1 squashfs-split partitions found on MTD device rootfs
[    0.659068] 0x000000350000-0x0000007f0000 : "rootfs_data"
[    0.669029] 0x000000010000-0x0000007f0000 : "linux"
[    0.678508] 0x0000007f0000-0x000000800000 : "nvram"
[    0.691892] bcm63xx-spi bcm6358-spi: at [mem 0xfffe0800-0xfffe0f0b flags 0x200] (irq 9, FIFOs size 542)
[    0.711496] libphy: bcm63xx_enet MII bus: probed
[    0.776723] bcm63xx_enet bcm63xx_enet.0: attached PHY at address 1 [Broadcom BCM63XX (2)]
[    0.789585] libphy: bcm63xx_enet MII bus: probed
[    0.859305] b53_common: found switch: BCM5325, rev 0
[    0.864526] bcm63xx_enet bcm63xx_enet.1: attached PHY at address 0 [Broadcom B53 (1)]
[    0.875101] bcm63xx-wdt bcm63xx-wdt:  started, timer margin: 30 sec
[    0.889778] NET: Registered protocol family 10
[    0.910700] NET: Registered protocol family 17
[    0.915544] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    0.928730] Bridge firewalling registered
[    0.932898] 8021q: 802.1Q VLAN Support v1.8
[    0.950961] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[    0.976092] Freeing unused kernel memory: 1272K (80422000 - 80560000)
[    2.914345] init: Console is alive
[    2.918358] init: - watchdog -
[    4.575574] init: - preinit -
[    8.966752] jffs2: notice: (318) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[    8.987384] mount_root: switching to jffs2 overlay
[    9.043358] procd: - early -
[    9.046607] procd: - watchdog -
[    9.948949] procd: - ubus -
[   10.004912] random: ubusd urandom read with 38 bits of entropy available
[   10.016137] procd: - init -
[   12.136385] usbcore: registered new interface driver usbfs
[   12.142411] usbcore: registered new interface driver hub
[   12.148272] usbcore: registered new device driver usb
[   12.201779] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   12.212670] ehci-platform: EHCI generic platform driver
[   12.218358] ehci-platform ehci-platform: EHCI Host Controller
[   12.224396] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[   12.233091] ehci-platform ehci-platform: irq 18, io mem 0xfffe1300
[   12.248514] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00, overcurrent ignored
[   12.260990] hub 1-0:1.0: USB hub found
[   12.266760] hub 1-0:1.0: 1 port detected
[   12.282315] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   12.331847] uhci_hcd: USB Universal Host Controller Interface driver
[   12.349108] Loading modules backported from Linux version wt-2016-05-12-0-g7a54796
[   12.356987] Backport generated by backports.git backports-20160216-0-ge3c56e4
[   12.373777] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.404184] nf_conntrack version 0.5.0 (437 buckets, 1748 max)
[   12.490753] xt_time: kernel timezone is -0000
[   12.654206] PPP generic driver version 2.4.2
[   12.664995] NET: Registered protocol family 24
[   13.012637] usb 1-1: new high-speed USB device number 2 using ehci-platform
[   13.075216] b43-phy0: Broadcom 4318 WLAN found (core revision 9)
[   13.112504] b43-phy0: Found PHY: Analog 3, Type 2 (G), Revision 7
[   13.118832] b43-phy0: Found Radio: Manuf 0x17F, ID 0x2050, Revision 8, Version 0
[   13.138112] Broadcom 43xx driver loaded [ Features: PNL ]
[   13.388816] usbcore: registered new interface driver ath9k_htc
[   13.680896] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   27.335225] device eth1 entered promiscuous mode
[   27.351209] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   27.425190] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   29.140593] eth1: link UP - 100/full - flow control off
[   29.149117] br-lan: port 1(eth1) entered forwarding state
[   29.154813] br-lan: port 1(eth1) entered forwarding state
[   29.181032] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   31.156471] br-lan: port 1(eth1) entered forwarding state
[   32.836535] random: nonblocking pool is initialized

lsusb:

Bus 001 Device 002: ID 0ace:1215 ZyDAS ZD1211B 802.11g
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/etc/config/wireless:

config wifi-device  radio0
        option type     mac80211
        option channel  11
        option hwmode   11g
        option path     'pci0000:00/0000:00:01.0/ssb0:0'
        option htmode
        # REMOVE THIS LINE TO ENABLE WIFI:
        option disabled 1
 
config wifi-iface
        option device   radio0
        option network  lan
        option mode     ap
        option ssid     OpenWrt
        option encryption none

Thanks!

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

VITA wrote:

When I try to run wifi detect > /etc/config/wireless I always only get the default radio0 which is the PCI wifi card, usb adapter does not show sad .!

how about "wifi detect >> /etc/config/wireless"

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

anarchy99 wrote:
VITA wrote:

When I try to run wifi detect > /etc/config/wireless I always only get the default radio0 which is the PCI wifi card, usb adapter does not show sad .!

how about "wifi detect >> /etc/config/wireless"


I don't see how would that change the output, although I've tried it still the same thing only radio0 is there.

4 (edited by huaiamu 2017-02-16 09:39:48)

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

I have same issue. But I wrote etc/config/wireless manually. USB wifi will up after network&wifi restart.
I need to say is my connection not stable enough. So I still finding the solution on it.

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

As long as /etc/config/wireless exists "wifi detect" won't produce any output. Rename /etc/config/wireless and "wifi detect > /etc/config/wireless" should work as expected.

Linksys WRT1900ACS v1 (Shelby)  |  Linksys WRT3200ACM (Rango)

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

sera wrote:

As long as /etc/config/wireless exists "wifi detect" won't produce any output. Rename /etc/config/wireless and "wifi detect > /etc/config/wireless" should work as expected.

I've tried to remove the file first and then create it with wifi detect but still no USB adapter appears.

I will try to write the config file manually, will report what happens.

7 (edited by mk24 2017-02-16 14:35:44)

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

Does "iw list" show that you have two radios (phy0 and phy1)?

8 (edited by VITA 2017-02-17 15:34:58)

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

mk24 wrote:

Does "iw list" show that you have two radios (phy0 and phy1)?

iw list at first did not show the USB adapter (I also didn't know about that command so thanks for that), but I managed to fix the problem.

Notice how lsusb reported Zydas, and dmesg reported

usbcore: registered new interface driver ath9k_htc

It seemed weird to me that that module (driver) got loaded, so I decided to reset the router, and start over.

I've installed the usb support, and then installed kmod-zd1211rw. After that ran wifi detect > /etc/config/wireless. Everything showed up correctly and I was good to go.

The only thing that bothers me is how and why was ath9k loaded instead of zd1211 for that particular device?

If anyone wants me to write a simple guide, on how to setup and install all necessary things for TP-Link TL-WN422G Version 1 (Zydas), I can make a how to guide on the forum. (Also I'm not sure if It's allowed to write a guide there for this particular reason, as It's quite simple but yet for beginners it may be complicated).

Thanks all for helping me!

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

I also solved my problem for wifi detect doesn't show

detect function in my wifi script is wrong

detect_wireless() {
        ssid=`cat /etc/wireless/AP/AP.dat | grep SSID1 | cut -d '=' -f 2`
        cd  /sys/module/
        [ -d $module ] || return
    [ -e /etc/config/wireless ] && return
    cat <<EOF
config wifi-device      AP
        option type     AP
        option channel  30
        option country  US
        option autoch   2

config wifi-iface
        option device   AP
        option ifname   wlan0
        option network  lan
        option mode     ap
        option bssid    00:0C:43:2D:6A:40
        option ssid     $ssid
        option encryption psk2
        option key      12345678

EOF

}

mark this line and wifi detect works

    #[ -e /etc/config/wireless ] && return

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

or just do

rm /etc/config/wireless; wifi detect

I believe it's a safety net so that users would not accidentally overwrite their existing config.

11 (edited by huaiamu 2017-02-23 10:38:56)

Re: [SOLVED] OpenWRT "wifi detect" does not show my USB wifi adapter?

@stangri

I knew this. But in my situation was even it already be deleted, it still not work.

So I only can do is mark it