OpenWrt support for TP-Link Deco M4R

Hello Gentlemen,
I have sitting in front or me a M4V3EU with an attached serial interface and I have built Oklona's branch successfully. I had a quick look at the M4 boot log and the partition layout is a bit more complicated than what is stored in the M5 dts file. Can anyone offer me guidance on the structure of the dts please? The M5 init-ramfs gets as far as loading the kernel and then it hangs so I am hopeful! Any help would be appreciated.

OK, I was looking in the wrong place. I have now matched the partition layout to what the original boot log indicated. Let's see what happens.

There is a slight difference in the layout and interestingly both rootfs partitions are a different size:

Creating 16 MTD partitions on "spi0.0":
0x000000000000-0x000000030000 : "0:SBL1"
0x000000030000-0x000000040000 : "0:BOOTCONFIG"
0x000000040000-0x000000050000 : "0:MIBIB"
0x000000050000-0x000000060000 : "0:BOOTCONFIG1"
0x000000060000-0x0000000c0000 : "0:QSEE"
0x0000000c0000-0x0000000d0000 : "0:CDT"
0x0000000d0000-0x0000000e0000 : "0:DDRPARAMS"
0x0000000e0000-0x0000000f0000 : "0:APPSBLENV"
0x0000000f0000-0x000000170000 : "0:APPSBL"
0x000000170000-0x000000180000 : "0:ART"
0x000000180000-0x000000240000 : "OPAQUE"
0x000000240000-0x000000560000 : "0:HLOS"
0x000000560000-0x000000fa0000 : "0:rootfs"
0x000000fa0000-0x000001020000 : "0:APPSBL_1"
0x000001020000-0x000001340000 : "1:HLOS"
0x000001340000-0x000002000000 : "1:rootfs"

rootfs0 is 0xa40000 and rootfs1 is 0xcc0000 long

EUREKA!
That was easier than I thought. At least it's booting but I still have some work to do! Initial attempts to load the image at 0x80800000 failed but I noticed if you typed tftpboot by itself, it defaulted to 0x84000000

(IPQ40xx) # tftpboot 0x84000000 initramfs-kernel.bin
eth0 PHY0 Down Speed :10 Half duplex
eth0 PHY1 Down Speed :10 Half duplex
eth0 PHY2 Down Speed :10 Half duplex
eth0 PHY3 Down Speed :10 Half duplex
eth0 PHY4 up Speed :1000 Full duplex
Using eth0 device
TFTP from server 192.168.0.2; our IP address is 192.168.0.1
Filename 'initramfs-kernel.bin'.
Load address: 0x84000000
Loading: #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 #################################################################
	 ##
done
Bytes transferred = 9560496 (91e1b0 hex)
(IPQ40xx) # bootm
## Booting kernel from FIT Image at 84000000 ...
   Using 'config@1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  ARM OpenWrt Linux-5.15.123
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x840000e4
     Data Size:    9539729 Bytes = 9.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80208000
     Entry Point:  0x80208000
     Hash algo:    crc32
     Hash value:   2c406a1f
     Hash algo:    sha1
     Hash value:   e5f8c2233a287fac7e6e71b3b937397c5a2ec3b2
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Flattened Device Tree from FIT Image at 84000000
   Using 'config@1' configuration
   Trying 'fdt-1' FDT blob subimage
     Description:  ARM OpenWrt tplink_deco-m4-v3 device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x849192b4
     Data Size:    18870 Bytes = 18.4 KiB
     Architecture: ARM
     Hash algo:    crc32
     Hash value:   bf7ec192
     Hash algo:    sha1
     Hash value:   82f540ba3902bf8343794c924223a94ca7f7181b
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x849192b4
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 862a7000, end 862ae9b5 ... OK
ipq: fdt fixup unable to find compatible node
Device nand0 not found!
eth0 MAC Address from ART is not valid
eth1 MAC Address from ART is not valid
Using machid 0x8010001 from environment

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.123 (kfs@locarno.local) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 12.3.0 r23001+330-38c150612c) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Wed Aug 9 12:35:21 2023
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TP-Link Deco M4V3
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x0000000087dfffff]
[    0.000000]   node   0: [mem 0x0000000087e00000-0x0000000087ffffff]
[    0.000000]   node   0: [mem 0x0000000088000000-0x000000008fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000] percpu: Embedded 11 pages/cpu s16268 r8192 d20596 u45056
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line:  root=/dev/mtdblock16
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 232888K/262144K available (6519K kernel code, 608K rwdata, 1668K rodata, 14336K init, 240K bss, 29256K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 48.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb11fd3bfb, max_idle_ns: 440795203732 ns
[    0.000001] sched_clock: 56 bits at 48MHz, resolution 20ns, wraps every 4398046511096ns
[    0.000024] Switching to timer-based delay loop, resolution 20ns
[    0.000317] Calibrating delay loop (skipped), value calculated using timer frequency.. 96.00 BogoMIPS (lpj=480000)
[    0.000345] pid_max: default: 32768 minimum: 301
[    0.001238] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001268] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.002812] CPU: Testing write buffer coherency: ok
[    0.003265] qcom_scm: convention: smc legacy
[    0.004470] Setting up static identity map for 0x80300000 - 0x8030003c
[    0.004640] rcu: Hierarchical SRCU implementation.
[    0.005224] smp: Bringing up secondary CPUs ...
[    0.008620] smp: Brought up 1 node, 4 CPUs
[    0.008658] SMP: Total of 4 processors activated (384.00 BogoMIPS).
[    0.008673] CPU: All CPU(s) started in SVC mode.
[    0.015056] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.015220] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.015254] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.015615] pinctrl core: initialized pinctrl subsystem
[    0.017657] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.018030] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.019363] thermal_sys: Registered thermal governor 'step_wise'
[    0.019791] cpuidle: using governor ladder
[    0.019853] cpuidle: using governor menu
[    0.045053] cryptd: max_cpu_qlen set to 1000
[    0.049643] usbcore: registered new interface driver usbfs
[    0.049720] usbcore: registered new interface driver hub
[    0.049781] usbcore: registered new device driver usb
[    0.049868] pps_core: LinuxPPS API ver. 1 registered
[    0.049884] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.049919] PTP clock support registered
[    0.052085] clocksource: Switched to clocksource arch_sys_counter
[    0.053333] NET: Registered PF_INET protocol family
[    0.053551] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.054311] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.054364] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.054388] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.054434] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.054490] TCP: Hash tables configured (established 2048 bind 2048)
[    0.054630] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.054703] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.055037] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.055094] PCI: CLS 0 bytes, default 64
[    0.058860] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.065155] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.065193] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.204323] bam-dma-engine 8e04000.dma: num-channels unspecified in dt
[    0.204361] bam-dma-engine 8e04000.dma: num-ees unspecified in dt
[    0.205212] tcsr 194b000.tcsr: setting usb hs phy mode select = e700e7
[    0.205341] tcsr 1953000.ess_tcsr: setting ess interface select = 0
[    0.205476] tcsr 1949000.tcsr: setting wifi_glb_cfg = 41000000
[    0.205577] tcsr 1957000.tcsr: setting wifi_noc_memtype_m0_m2 = 2222222
[    0.205916] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.206614] msm_serial 78af000.serial: msm_serial: detected port #0
[    0.206671] msm_serial 78af000.serial: uartclk = 1843200
[    0.206730] 78af000.serial: ttyMSM0 at MMIO 0x78af000 (irq = 34, base_baud = 115200) is a MSM
[    0.206770] msm_serial: console setup on port #0
[    0.746027] printk: console [ttyMSM0] enabled
[    0.751313] msm_serial 78b0000.serial: msm_serial: detected port #1
[    0.755016] msm_serial 78b0000.serial: uartclk = 1843200
[    0.761106] 78b0000.serial: ttyMSM1 at MMIO 0x78b0000 (irq = 35, base_baud = 115200) is a MSM
[    0.767008] msm_serial: driver initialized
[    0.780935] loop: module loaded
[    0.782150] spi_qup 78b5000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[    0.784701] spi-nor spi0.0: gd25q256 (32768 Kbytes)
[    0.790262] 16 fixed-partitions partitions found on MTD device spi0.0
[    0.794845] Creating 16 MTD partitions on "spi0.0":
[    0.801387] 0x000000000000-0x000000030000 : "0:SBL1"
[    0.806707] 0x000000030000-0x000000040000 : "0:BOOTCONFIG"
[    0.811825] 0x000000040000-0x000000050000 : "0:MIBIB"
[    0.817204] 0x000000050000-0x000000060000 : "0:BOOTCONFIG1"
[    0.822351] 0x000000060000-0x0000000c0000 : "0:QSEE"
[    0.827637] 0x0000000c0000-0x0000000d0000 : "0:CDT"
[    0.832916] 0x0000000d0000-0x0000000e0000 : "0:DDRPARAMS"
[    0.837378] 0x0000000e0000-0x0000000f0000 : "0:APPSBLENV"
[    0.842962] 0x0000000f0000-0x000000170000 : "0:APPSBL"
[    0.848424] 0x000000170000-0x000000180000 : "0:ART"
[    0.853383] 0x000000180000-0x000000240000 : "OPAQUE"
[    0.858271] 0x000000240000-0x000000560000 : "0:HLOS"
[    0.863574] 0x000000560000-0x000000fa0000 : "0:rootfs"
[    0.868279] 0x000000fa0000-0x000001020000 : "0:APPSBL_1"
[    0.873266] 0x000001020000-0x000001340000 : "1:HLOS"
[    0.878783] 0x000001340000-0x000002000000 : "1:rootfs"
[    0.967796] i2c_dev: i2c /dev entries driver
[    0.968054] i2c_qup 78b7000.i2c: using default clock-frequency 100000
[    0.973994] sdhci: Secure Digital Host Controller Interface driver
[    0.977484] sdhci: Copyright(c) Pierre Ossman
[    0.983586] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.451320] lp5521 0-0032: device detection err: -5
[    1.451725] lp5521: probe of 0-0032 failed with error -5
[    1.474707] NET: Registered PF_INET6 protocol family
[    1.476665] Segment Routing with IPv6
[    1.478848] In-situ OAM (IOAM) with IPv6
[    1.482582] NET: Registered PF_PACKET protocol family
[    1.486682] 8021q: 802.1Q VLAN Support v1.8
[    1.491338] Registering SWP/SWPB emulation handler
[    1.550008] Freeing unused kernel image (initmem) memory: 14336K
[    1.626230] Run /init as init process
[    2.114980] init: Console is alive
[    2.115374] init: - watchdog -
[    2.127132] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.368831] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    2.368914] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    2.373499] xhci-hcd xhci-hcd.0.auto: hcc params 0x0228f665 hci version 0x100 quirks 0x0000000002010010
[    2.380888] xhci-hcd xhci-hcd.0.auto: irq 71, io mem 0x08a00000
[    2.390395] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    2.396135] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    2.401632] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    2.412709] hub 1-0:1.0: USB hub found
[    2.415819] hub 1-0:1.0: 1 port detected
[    2.419924] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.424233] hub 2-0:1.0: USB hub found
[    2.431696] hub 2-0:1.0: 1 port detected
[    2.435800] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    2.439316] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 3
[    2.444904] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220f665 hci version 0x100 quirks 0x0000000002010010
[    2.452234] xhci-hcd xhci-hcd.1.auto: irq 72, io mem 0x06000000
[    2.461688] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    2.467505] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 4
[    2.473016] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[    2.482712] hub 3-0:1.0: USB hub found
[    2.487163] hub 3-0:1.0: 1 port detected
[    2.491272] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.495569] hub 4-0:1.0: USB hub found
[    2.503075] hub 4-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    2.508488] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.518790] init: - preinit -
[    2.806653] random: jshn: uninitialized urandom read (4 bytes read)
/bin/board_detect: /etc/board.d/02_network: line 110: syntax error: unexpected ")" (expecting ";;")
[    2.889698] random: jshn: uninitialized urandom read (4 bytes read)
[    2.907229] random: jshn: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    5.257370] procd: - early -
[    5.257630] procd: - watchdog -
[    5.813170] procd: - watchdog -
[    5.816854] procd: - ubus -
[    5.869130] random: ubusd: uninitialized urandom read (4 bytes read)
[    5.870081] random: ubusd: uninitialized urandom read (4 bytes read)
[    5.874918] random: ubusd: uninitialized urandom read (4 bytes read)
[    5.885539] procd: - init -
Please press Enter to activate this console.
[    6.351893] kmodloader: loading kernel modules from /etc/modules.d/*
[    6.361135] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[    6.361188] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[    6.367344] urngd: v1.0.2 started.
[    6.458014] PPP generic driver version 2.4.2
[    6.458175] random: crng init done
[    6.459171] NET: Registered PF_PPPOX protocol family
[    6.461364] random: 27 urandom warning(s) missed due to ratelimiting
[    7.442360] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[    7.442433] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[    7.455148] ath10k_ahb a000000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[    7.482680] ath10k_ahb a000000.wifi: Loading BDF type 0
[    7.491254] ath10k_ahb a000000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000,variant=TP-Link_Deco_M5 from ath10k/QCA4019/hw1.0/board-2.bin
[    7.692250] ath10k_ahb a000000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[    7.692314] ath10k_ahb a000000.wifi: failed to fetch board file: -12
[    7.700695] ath10k_ahb a000000.wifi: could not probe fw (-12)
[    8.613806] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[    8.613876] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[    8.627643] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[    8.654144] ath10k_ahb a800000.wifi: Loading BDF type 0
[    8.663220] ath10k_ahb a800000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000,variant=TP-Link_Deco_M5 from ath10k/QCA4019/hw1.0/board-2.bin
[    8.878868] ath10k_ahb a800000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[    8.878942] ath10k_ahb a800000.wifi: failed to fetch board file: -12
[    8.887404] ath10k_ahb a800000.wifi: could not probe fw (-12)
[    8.903215] kmodloader: done loading kernel modules from /etc/modules.d/*

BusyBox v1.36.1 (2023-08-07 15:48:08 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 23.05-SNAPSHOT, r23001+335-38c150612c
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#

I'm gonna quit for the night but it has been an interesting journey so far and just so there is no confusion, this is a M4R V3 EU or M4 V3 EU model.

Tomorrow is another day. Any suggestions on how to proceed most welcome.

2 Likes

That does sound like the initramfs firmware you modified from the M5 is working? If so then congratulations.

Next step would be to test if you can use the exploit for all versions: OpenWrt support for TP-Link Deco M4R - #172 by naf

And apply it like in my instructions to load your initramfs without having to use the bootloader prompt: OpenWrt support for TP-Link Deco M4R - #144 by bobthebuilder

But I have no clue about these ARM devices regarding the flash layout. So no clue if flashing the sysupgrade version would soft-brick your device if you made a mistake.

You should probably backup the whole flash from the bootloader before you write anything to it.

this is a M4R V3 EU or M4 V3 EU model.

Your flash layout looks exactly like the flash layout that murraydr44 posted here: OpenWrt support for TP-Link Deco M4R - #233 by murraydr44

And he has the US version. So I'm guessing that it doesn't matter whether you try to flash a US or EU version with your firmware. It's likely that the versions simply have different power outputs for wifi since the US allows more in the 2.4GHz band.

1 Like

Hello,

I have succeeded in setting up three Deco M4R V2s, running OpenWrt 22.03.5. However, I've encountered something weird. After configuring the AP (only done one out of three), the LED on the top starts flashing between green, white, yellow and blue. I reset, and set it up again and this time it's flashing between yellow and blue. Before setting it up, it's solid green after it has finished booting. There are no LED configuration I've done, e.g. 'uci show system | grep "system.led"' doesn't show anything, nor does simply doing "uci show system.led".

I'm not sure when in the process it happens either. I'm mostly following the guide over here: https://openwrt.org/docs/guide-user/network/wifi/dumbap with some minor touches. I'm using a script to set up everything, so it should in theory be identical setups. I've uploaded the script to pastebin: https://pastebin.com/y4KvYMdV (Password: 9pRN26RUWx (Not sure why I added it with that ¯\_(ツ)_/¯)). It's a pretty cobbled together thing, so it's likey not the prettiest or most functional thing about.

I'm gonna go reset the configured device once more and test commands individually, but in the meantime, if anyone comes across this and knows what's causing the LED activity, please do tell. I'll edit this comment, if that's possible, if I figure out what's causing it.

e1: So I was a smoothbrain and forgot to post while I worked. Still, I have at least found one part. Flashing between green and blue seems to be caused by network activity of some kind. It only happened once one of the radios (Qualcomm Atheros QCA9886 802.11acn) were enabled and had an associated wlan active. Stopping the wifi in LuCI stops the green-to-blue flashing loop. Not sure about the yellow and white one though.

e2: And green-yellow seems to be dedicated to the Qualcomm Atheros QCA9560 802.11bgn. When both it and the other radio are active with their own individual SSIDs, it starts flashing green-white, green-yellow and occasionally green-blue... No idea why it does that by default or why the colors are as they are though ¯\_(ツ)_/¯ it's hella annoying when it's dark in the room though lol. Guess I'll just have to set up some LED configuration after all.

e3: Oh, wait, I think I'm just blind. The color choices seem to be set by default somewhere, don't know where, but I think I'm just blind. I even checked there earlier (╯°□°)╯︵ ┻━┻. Though, 2.4G is certainly not red.
image

The bootloader flashes a fast green and the kernel flashes a slow green. Once the system is booted, the defaults take over.

The three defaults are as in your screenshot and are set via the .dts file.

The LED has red, green and blue, so if you see yellow then red and green are on at the same time and if you see pink then red and blue are on at the same time. White means all three are on at the same time. Just like with any screen like from a laptop or a TV or a phone.

So wlan2g is definitely red, but because green is on all the time, you think wlan2g is yellow.


If you want the colors to react to something else then you need to specifically set that in System->LED configuration.

I have all three set to "Trigger: none" because I don't want to have a lightshow in the middle of the night or while watching a movie.

But for people setting up their devices for the first time it's a helpful indicator.

Thanks for the reply, I had to work on other things yesterday but I went back to this today. Thinking that the router needed something newer than what is in 23.05, I re-applied all my patches to master but unfortunately the result is the same. I have no network ports whatsoever. Two things stick out which I am going to investigate tomorrow:

/bin/board_detect: line 10: Unsupported: not found
I believe, meaning that it is not picking up any default definition of ports at all.

2

Wifi not coming up and this occurs in the log for both devices.

[    0.000000] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[    0.000000] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[    0.000000] ath10k_ahb a000000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[    0.000000] ath10k_ahb a000000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000,variant=TP-Link_Deco_M5 from ath10k/QCA4019/hw1.0/board-2.bin
[    0.000000] ath10k_ahb a000000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[    0.000000] ath10k_ahb a000000.wifi: failed to fetch board file: -12
[    0.000000] ath10k_ahb a000000.wifi: could not probe fw (-12)

One thing that is puzzling me though is where does the calibration-data file come from? For instance, oolong has board-tplink_deco-m5.qca4019 which is specifically related to the M5 but I don't know where it came from. I did notice that on my router, /dev/mtd9 (ART) has very similar contents. I wonder if you know anything about this subject.

I'm sadly not going to be much help with this. I got the M4R V2 running by scratching my head a lot and looking at the sources of other devices like the Archer C6 V2 and the TL-WA1201 V2 because those use the same chips as the M4R V2. And it was sheer luck that I noticed that the mainboard layout of the V3 looks like that of the M5. Beyond that I've got no clue what's going on and can merely explain why the RGB LED will light up yellow or white.

I would probably go through the post of the M5 and look at the different github links and pullrequest those guys did: IPQ4019: Adding support for TP-Link Deco M5

The pull request from GoliathLabs includes things like these that sound like what you might need:

$(eval $(call generate-ipq-wifi-package,tp-link_deco_m5_eu_v3.0,TP-Link Deco M5 EU v3.0))

ucidef_set_interfaces_lan_wan "eth0" "eth1"

caldata_extract "0:ART" 0x1000 0x2f20

But that's just me tapping in the dark.

That might be just what I need to look at! Thanks.

By the way I haven't abandoned these routers but unfortunately I am in a different country to them until mid-december when I will attack them with new vigour. Meantime I am keeping an eye on any posts that might be relevant.

2 Likes

I check in occasionally here and on IPQ4019: Adding support for TP-Link Deco M5 because I have 2 of each - so an eventual switch to openwrt would (I assume) best be done on all devices simultaneously

Thank you all for this topic and flashing instruction! i was able to flash OpenWRT to two of my Deco M4R.
But i need some help connecting them together. the setup i want achieve is following:
main OpenWRT router with 4 vlans -> Deco 1 takes all 4 vlans on port 1 and has wireless for each of them -> Deco 2 takes all vlans from port 2 of Deco 1 and creates wireless for each of them. the first step is working, but the problem is connection to second deco.
Maybe some one can suggest some solution for this? my network setup on both Decos is following:

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

config globals 'globals'
	option ula_prefix 'fd87:4b32:9325::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth0.1'
	list ports 'eth0.4'
	list ports 'eth0.5'
	list ports 'eth0.99'

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option device 'br-lan.1'
	option ipaddr '192.168.0.1'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option vid '1'
	option ports '0t 3'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0t 3t 5t'
	option vid '99'

config bridge-vlan
	option device 'br-lan'
	option vlan '1'
	list ports 'eth0:t'
	list ports 'eth0.1:u*'
	list ports 'eth0.99:t'

config bridge-vlan
	option device 'br-lan'
	option vlan '99'
	list ports 'eth0:t'
	list ports 'eth0.1:t'
	list ports 'eth0.99:u*'

config interface 'IoT'
	option device 'br-lan.99'
	option proto 'dhcp'
	option defaultroute '0'

config bridge-vlan
	option device 'br-lan'
	option vlan '4'
	list ports 'eth0:t'
	list ports 'eth0.1:t'
	list ports 'eth0.4:u*'
	list ports 'eth0.99:t'

config interface 'Guest'
	option proto 'dhcp'
	option device 'br-lan.4'
	option defaultroute '0'

config device
	option name 'wlan0'

config interface 'Main'
	option proto 'dhcp'
	option device 'br-lan.5'
	option defaultroute '0'

config bridge-vlan
	option device 'br-lan'
	option vlan '5'
	list ports 'eth0:t'
	list ports 'eth0.1:t'
	list ports 'eth0.5:u*'
	list ports 'eth0.99:t'

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '5'
	option ports '0t 3t 5t'

config switch_vlan
	option device 'switch0'
	option vlan '4'
	option ports '0t 3t 5t'
	option vid '4'

You should probably ask this in the "Installing and Using OpenWrt" Forum. Both your Decos have OpenWrt on them now, so there is no special config only Deco M4R owners would know.

Looking at my network config, I can't see a single "config bridge-vlan". And I've got 3 bridges that bridge 3 VLANs to different SSIDs.

Did you write this yourself or is this a config backup?

I have two M4R v2 and I tried everything to use them as dumb wireless AP with 5 VLANs and an Archer C6 v3 as the main router (all of them on 23.05.2). How did you setup your VLANs? Could post it like you did with the network setup?

That too is a question for the "Installing and Using OpenWrt" forum: https://forum.openwrt.org/c/general/6

And the newest firmware I'm using on my Decos is still 22.03, so not sure if anything changed between that and 23.05.

But in short what I did:

  1. Add a bridge device per VLAN in Network->Interfaces->Devices
  2. Create interfaces in Network->Interfaces and use the corresponding bridge as the device
  3. Create SSIDs in Network->Wireless that use that bridge/interface as their network
  4. Set the VLANs in Network->Switch to tagged for the CPU. And if you want to use the same VLANs on a connected openwrt device then also set them tagged on the port that is connected to that other device.

Thanks, mate. I'll try this. Regarding the mentioned forum I searched there many times and didn't find anything that worked for me.

You do know that you can just create a new post there, right?

Yes, mate. But I also know you have 3 M4R v2. I've was able to install openwrt on my 2 M4R v2 thanks to your tutorial and setup the ipv4 wan interface because of your setup guide. When you posted above that used them as dumb wireless ap with vlans I thought asking you directly how do you setup yours because I know it would worked flawless as the wan setup. But thanks anyway. I'll keep searching in the Installing and Using OpenWrt section.

Cheers.

You asked and I answered with what I did.

1 Like

Hi,
I have a deco m4 v4 and i want to install openwrt. What i did:

  • set a static IP of 192.168.0.2 on your computer.
  • entering to 192.168.0.1 into my deco
  • flash with M4R-2.0-SP1-up-ver1-4-3-P1[20210326-rel08810]-debug.bin

after this my deco don`t reboot and i can not telnet to 192.168.0.1 ...
What i need to do more ?

P.s.
i am on this step:

  • Unplug your router and turn it upside down. Using a long and thin object
    like a SIM unlock tool, press and hold the reset button on the router and
    replug it. Keep holding it until the LED flashes yellow.
    This is DONE

  • Open 192.168.0.1. You should see the bootloader recovery's webpage.
    Choose the debug firmware that you downloaded and flash it.
    This is DONE with M4R-2.0-SP1-up-ver1-4-3-P1[20210326-rel08810]-debug.bin

Wait until the
router reboots (at this stage you can remove the static IP).
After flash deco never reboot; i wait 15 min and nothing happened ...

P.s.2
I try to tfpt but nothing works...

i have only web-uboot

Thank you !

You've got a V4, so use the firmware for the V4 and not some debug firmware for the V2.

Hi bobthebuilder

I did not find nothing about V4 .... someone say i can use an old version but is not working .... Also i try to reflash with an official version and is the same; is not restarting after upload, and is not say flash is complete, just the bar to 100% and nothing more after. I can try to do something else but i need some instructions, i can solder (is easy) or else.

Thank you
Florin