Hello. Sorry if this has been asked before, I couldn't find similar questions.
I'm doing a research project and creating a simple box with wi-fi monitoring capabilities based upon a TL-MR3020v3 device. I attached 2 additional wi-fi dongles to it (namely, Asus N10 Nano) through a USB-hub, so that now I have 3 wi-fi adapters working simultaneously. I configured all of them to operate in monitor mode, set the desired channels via the /etc/config/wireless
configuration file and I can't seem to get channels actually applied to the hardware after rebooting the device. I'm using OpenWRT SNAPSHOT r12222-35ab804ea7
(built my own image with support for USB and rtl8192cu).
Here's the contents of the /etc/config/wireless
file:
config wifi-device 'radio0'
option type 'mac80211'
option channel '6'
option hwmode '11g'
option path 'platform/10300000.wmac'
option htmode 'HT20'
option disabled '0'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'wifi'
option mode 'monitor'
option encryption 'none'
config wifi-device 'radio1'
option type 'mac80211'
option channel '1'
option hwmode '11g'
option path 'platform/101c0000.ehci/usb1/1-1/1-1.1/1-1.1:1.0'
option htmode 'HT20'
option disabled '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'wifi'
option mode 'monitor'
option encryption 'none'
config wifi-device 'radio2'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option path 'platform/101c0000.ehci/usb1/1-1/1-1.4/1-1.4:1.0'
option htmode 'HT20'
option disabled '0'
config wifi-iface 'default_radio2'
option device 'radio2'
option network 'wifi'
option mode 'monitor'
option encryption 'none'
This configuration was generated using wifi config
and then slightly modified to suit my needs: all wifi-devices set to monitor mode and the channels set to: 1, 6 and 11. wlan1
and wlan2
are the 2 Asus N10 Nano (rtl8192cu) and wlan0
is the built-in wi-fi (MediaTek MT7628NN).
Here's the output of the iwconfig
command after rebooting the device:
lo no wireless extensions.
br-lan no wireless extensions.
wlan2 IEEE 802.11 Mode:Monitor Frequency:2.412 GHz Tx-Power=20 dBm
RTS thr=2347 B Fragment thr:off
Power Management:off
wlan0 IEEE 802.11 Mode:Monitor Frequency:2.412 GHz Tx-Power=18 dBm
RTS thr:off Fragment thr:off
Power Management:off
eth0 no wireless extensions.
wlan1 IEEE 802.11 Mode:Monitor Frequency:2.412 GHz Tx-Power=20 dBm
RTS thr=2347 B Fragment thr:off
Power Management:off
Please note how the 3 interfaces have the same frequency: 2.412 GHz
.
I also ran iwinfo
which gave me the following interesting output (the hardware mentioned in each interface entry is somehow the same for all 3!):
wlan0 ESSID: unknown
Access Point: 50:D4:F7:<redacted>:18
Mode: Monitor Channel: 1 (2.412 GHz)
Tx-Power: 18 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7628 14C3:0004 [MediaTek MT76x8] <------- THIS
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
wlan1 ESSID: unknown
Access Point: 04:D9:F5:<redacted>:FA
Mode: Monitor Channel: 1 (2.412 GHz)
Tx-Power: 20 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7628 14C3:0004 [MediaTek MT76x8] <------- THIS
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy1
wlan2 ESSID: unknown
Access Point: 04:D9:F5:<redacted>:FB
Mode: Monitor Channel: 1 (2.412 GHz)
Tx-Power: 20 dBm Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7628 14C3:0004 [MediaTek MT76x8] <------- THIS
TX power offset: none
Frequency offset: none
Supports VAPs: no PHY name: phy2
(I redacted a part of MAC addresses to hide full addresses but still show they're correct and differ from each other; the 2 asus devices' addresses differ in only 1 hex digit).
dmesg
output:
[ 0.000000] Linux version 4.14.169 (xxx) (gcc version 8.3.0 (OpenWrt GCC 8.3.0 r12222-35ab804ea7)) #0 Wed Feb 12 21:15:14 2020
[ 0.000000] Board has DDR2
[ 0.000000] Analog PMU set to hw control
[ 0.000000] Digital PMU set to hw control
[ 0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[ 0.000000] MIPS: machine is TP-Link TL-MR3020 v3
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 04000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] On node 0 totalpages: 16384
[ 0.000000] free_area_init_node: node 0, pgdat 80495070, node_mem_map 81000040
[ 0.000000] Normal zone: 144 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 16384 pages, LIFO batch:3
[ 0.000000] random: get_random_bytes called from start_kernel+0x98/0x4a0 with crng_init=0
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16240
[ 0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 58696K/65536K available (3656K kernel code, 180K rwdata, 860K rodata, 1184K init, 203K bss, 6840K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 256
[ 0.000000] intc: using register map from devicetree
[ 0.000000] CPU Clock: 580MHz
[ 0.000000] timer_probe: no matching timers found
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[ 0.000009] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[ 0.007542] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[ 0.073491] pid_max: default: 32768 minimum: 301
[ 0.078197] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.084545] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.097173] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.106673] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.112653] pinctrl core: initialized pinctrl subsystem
[ 0.118686] NET: Registered protocol family 16
[ 0.149197] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.154791] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.160365] mt7621_gpio 10000600.gpio: registering 32 gpios
[ 0.170696] clocksource: Switched to clocksource MIPS
[ 0.176746] NET: Registered protocol family 2
[ 0.181797] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.188489] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.194673] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.200927] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.206525] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.212929] NET: Registered protocol family 1
[ 0.217104] PCI: CLS 0 bytes, default 32
[ 0.220800] Crashlog allocated RAM at address 0x3f00000
[ 0.227576] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[ 0.240323] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.245956] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.268253] io scheduler noop registered
[ 0.272050] io scheduler deadline registered (default)
[ 0.277789] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[ 0.285054] console [ttyS0] disabled
[ 0.288490] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
[ 0.297274] console [ttyS0] enabled
[ 0.304265] bootconsole [early0] disabled
[ 0.313596] spi-mt7621 10000b00.spi: sys_freq: 193333333
[ 0.333268] m25p80 spi0.0: s25fl064k (8192 Kbytes)
[ 0.338179] 4 fixed-partitions partitions found on MTD device spi0.0
[ 0.344640] Creating 4 MTD partitions on "spi0.0":
[ 0.349507] 0x000000000000-0x000000020000 : "boot"
[ 0.355287] 0x000000020000-0x0000007c0000 : "firmware"
[ 0.363501] 2 tplink-fw partitions found on MTD device firmware
[ 0.369514] Creating 2 MTD partitions on "firmware":
[ 0.374624] 0x000000000000-0x000000181235 : "kernel"
[ 0.380562] 0x000000181238-0x0000007a0000 : "rootfs"
[ 0.386452] mtd: device 3 (rootfs) set to be root filesystem
[ 0.393925] 1 squashfs-split partitions found on MTD device rootfs
[ 0.400200] Creating 1 MTD partitions on "rootfs":
[ 0.405123] 0x0000004fedc8-0x00000061edc8 : "rootfs_data"
[ 0.411516] 0x0000007c0000-0x0000007d0000 : "config"
[ 0.417333] 0x0000007d0000-0x000000800000 : "factory"
[ 0.424007] libphy: Fixed MDIO Bus: probed
[ 0.440939] rt3050-esw 10110000.esw: link changed 0x00
[ 0.447746] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[ 0.457143] NET: Registered protocol family 17
[ 0.461804] 8021q: 802.1Q VLAN Support v1.8
[ 0.476925] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[ 0.490573] Freeing unused kernel memory: 1184K
[ 0.495205] This architecture does not have kernel memory protection.
[ 2.236061] init: Console is alive
[ 2.239789] init: - watchdog -
[ 2.442408] random: fast init done
[ 4.361042] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 4.568422] usbcore: registered new interface driver usbfs
[ 4.574152] usbcore: registered new interface driver hub
[ 4.579642] usbcore: registered new device driver usb
[ 4.620804] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 4.636807] SCSI subsystem initialized
[ 4.645962] ehci-platform: EHCI generic platform driver
[ 4.661618] phy phy-10120000.usbphy.0: remote usb device wakeup disabled
[ 4.668417] phy phy-10120000.usbphy.0: UTMI 16bit 30MHz
[ 4.673738] ehci-platform 101c0000.ehci: EHCI Host Controller
[ 4.679595] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[ 4.687760] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[ 4.720719] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[ 4.728072] hub 1-0:1.0: USB hub found
[ 4.732377] hub 1-0:1.0: 1 port detected
[ 4.739926] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 4.748014] ohci-platform: OHCI generic platform driver
[ 4.753641] ohci-platform 101c1000.ohci: Generic Platform OHCI controller
[ 4.760557] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[ 4.768711] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[ 4.845760] hub 2-0:1.0: USB hub found
[ 4.850051] hub 2-0:1.0: 1 port detected
[ 4.857114] uhci_hcd: USB Universal Host Controller Interface driver
[ 4.871787] usbcore: registered new interface driver usb-storage
[ 4.878863] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 4.888687] init: - preinit -
[ 5.562589] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 5.961422] hub 1-1:1.0: USB hub found
[ 5.967345] hub 1-1:1.0: 4 ports detected
[ 6.079160] random: procd: uninitialized urandom read (4 bytes read)
[ 6.301175] usb 1-1.1: new high-speed USB device number 3 using ehci-platform
[ 6.800816] usb 1-1.3: new high-speed USB device number 4 using ehci-platform
[ 7.025960] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[ 7.041531] scsi host0: usb-storage 1-1.3:1.0
[ 7.199201] usb 1-1.4: new high-speed USB device number 5 using ehci-platform
[ 7.222828] rt3050-esw 10110000.esw: link changed 0x00
[ 8.092096] scsi 0:0:0:0: Direct-Access SanDisk' Cruzer Fit 1.00 PQ: 0 ANSI: 6
[ 8.103916] sd 0:0:0:0: [sda] 31260672 512-byte logical blocks: (16.0 GB/14.9 GiB)
[ 8.113379] sd 0:0:0:0: [sda] Write Protect is off
[ 8.118255] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[ 8.119377] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 8.139801] sda: sda1
[ 8.146877] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 10.645392] rt3050-esw 10110000.esw: link changed 0x01
[ 11.653557] mount_root: loading kmods from internal overlay
[ 11.702049] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[ 11.710576] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[ 12.315802] jffs2: notice: (440) jffs2_build_xattr_subsystem: complete building xattr subsystem, 7 of xdatum (0 unchecked, 4 orphan) and 16 of xref (4 dead, 0 orphan) found.
[ 12.332344] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[ 12.345328] block: extroot: not configured
[ 12.417916] jffs2: notice: (438) jffs2_build_xattr_subsystem: complete building xattr subsystem, 7 of xdatum (0 unchecked, 4 orphan) and 16 of xref (4 dead, 0 orphan) found.
[ 12.790592] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[ 12.802727] block: extroot: not configured
[ 12.808559] mount_root: switching to jffs2 overlay
[ 12.847553] overlayfs: upper fs does not support tmpfile.
[ 12.859411] urandom-seed: Seeding with /etc/urandom.seed
[ 13.063348] procd: - early -
[ 13.066485] procd: - watchdog -
[ 13.899006] procd: - watchdog -
[ 13.904718] procd: - ubus -
[ 14.070392] random: ubusd: uninitialized urandom read (4 bytes read)
[ 14.088221] random: ubusd: uninitialized urandom read (4 bytes read)
[ 14.100848] random: ubusd: uninitialized urandom read (4 bytes read)
[ 14.114268] procd: - init -
[ 15.495474] kmodloader: loading kernel modules from /etc/modules.d/*
[ 15.598947] usbcore: registered new interface driver cdc_wdm
[ 15.612142] Loading modules backported from Linux version v5.4-rc8-0-gaf42d3466bdc
[ 15.619826] Backport generated by backports.git v5.4-rc8-1-0-g368e8c51
[ 15.658879] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[ 15.722345] xt_time: kernel timezone is -0000
[ 15.767398] urngd: v1.0.2 started.
[ 15.773061] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 15.870424] mt76_wmac 10300000.wmac: ASIC revision: 76280001
[ 16.037366] random: crng init done
[ 16.040866] random: 6 urandom warning(s) missed due to ratelimiting
[ 17.262821] mt76_wmac 10300000.wmac: Firmware Version: 20151201
[ 17.268840] mt76_wmac 10300000.wmac: Build Time: 20151201183641
[ 17.310707] mt76_wmac 10300000.wmac: firmware init done
[ 17.482818] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 17.550265] rtl8192cu: Chip version 0x10
[ 17.656742] rtl8192cu: Board Type 0
[ 17.663745] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
[ 17.729356] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[ 17.736494] ieee80211 phy1: Selected rate control algorithm 'rtl_rc'
[ 17.741958] rtl8192cu: Chip version 0x10
[ 17.872742] rtl8192cu: Board Type 0
[ 17.880972] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
[ 17.890778] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
[ 17.897892] ieee80211 phy2: Selected rate control algorithm 'rtl_rc'
[ 17.899233] usbcore: registered new interface driver rtl8192cu
[ 17.930822] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 18.730845] jffs2: Erase at 0x00110000 failed immediately: errno -22
[ 26.594416] br-lan: port 1(eth0) entered blocking state
[ 26.599731] br-lan: port 1(eth0) entered disabled state
[ 26.605409] device eth0 entered promiscuous mode
[ 26.625381] br-lan: port 1(eth0) entered blocking state
[ 26.630762] br-lan: port 1(eth0) entered forwarding state
[ 31.284444] rtl8192cu: MAC auto ON okay!
[ 31.368872] rtl8192cu: Tx queue select: 0x05
[ 33.450975] rtl8192cu: MAC auto ON okay!
[ 33.508741] rtl8192cu: Tx queue select: 0x05
and lsusb
:
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 004: ID 0781:5571
Bus 001 Device 003: ID 0b05:17ba
Bus 001 Device 002: ID 05e3:0608
Bus 002 Device 001: ID 1d6b:0001
Bus 001 Device 005: ID 0b05:17ba
I researched a bit and found that I can actually set correct channel via the iwconfig
or iw
commands. Also, setting channel via wireless config doesn't work even if there's no Asus N10 device attached to the box.
So the question is: am I missing something or doing something wrong? Or is it the software that misbehaves? Could it be a bug somewhere in UCI, mac80211 driver or anywhere else in OpenWRT?
Please help. Thank you in advance.