Adding OpenWrt support for DIR-3060

I have a DIR-3060. i had it running as an access point in my home network top-level managed by openwrt. the DIR-3060 wifi performance was very fast and very strong. of course i want it to run openwrt also....

I just opened up the case on the DIR-3060 .
so far -
serial access is at 57600/N/8/1, not 115200 baud.

no pings are recevied from 192.168.0.1 or 192.168.1.1 during the boot process until the decrypted full image has substantially loaded. this wil be difficult to figure out i'm afraid.

The router U-boot cannot be interrupted from the serial console as far as I can tell.
one image decrypts, another image loads, and then there is this menu:

Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   2: Load system code then write to Flash via TFTP. 
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   6: System Enter UBoot to Update Img or Bin. 
   7: Load Boot Loader code then write to Flash via Serial. 
   9: Load Boot Loader code then write to Flash via TFTP. 
default: 3

the full boot log is posted below.
dir3060 bootlog

the system boot can be interrupted to get a 'failsafe' openwrt prompt by pressing f - enter- later on in the boot.
i have the failsafe log posted below also.
dir3060 fialsafe boot log

in failsafe mode, no lan ports are active and the busybox verion of ifconfig seems hobbled enough to prevent lan port configuration.

the mtd map is shown

Creating 10 MTD partitions on "MT7621-NAND":
0x000000000000-0x000007f80000 : "ALL"
0x000000000000-0x000000080000 : "Bootloader"
0x000000080000-0x000000100000 : "Config"
0x000000100000-0x000000140000 : "Factory"
0x000000140000-0x000000180000 : "Config2"
0x000000180000-0x000002980000 : "Kernel"
0x000002980000-0x000004980000 : "Private"
0x000004980000-0x000007180000 : "Kernel2"
0x000007180000-0x000007780000 : "mydlink"
0x000007780000-0x000008080000 : "Reserved"
mtd: partition "Reserved" extends beyond the end of device "MT7621-NAND" -- size truncated to 0x800000
[mtk_nand] probe successfully!

finally, the u-boot console commands and default enviroment are shown below.

4: System Enter Boot Command Line Interface.

U-Boot 1.1.3 (Apr 25 2019 - 14:47:34)
MT7621 #
MT7621 # ifconfig
Unknown command 'ifconfig' - try 'help'
MT7621 # help
?       - alias for 'help'
bootm   - boot application image from memory
go      - start application at address 'addr'
help    - print online help
loadb   - load binary file over serial line (kermit mode)
md      - memory display
mdio   - Ralink PHY register R/W command !!
mm      - memory modify (auto-incrementing)
nand    - nand command
nm      - memory modify (constant address)
printenv- print environment variables
reset   - Perform RESET of the CPU
saveenv - save environment variables to persistent storage
setenv  - set environment variables
tftpboot- boot image via network using TFTP protocol
version - print monitor version
MT7621 # printenv
bootcmd=tftp
bootdelay=1
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10"
ipaddr=192.168.0.1
serverip=192.168.0.101
stdin=serial
stdout=serial
stderr=serial
Image1Stable=1
BootType=3

from the stock FW GUI, one can save a log file which looks like a dmesg log without the initial lines, but with the results of -ps- appended. this is also posted below.

             total         used         free       shared      buffers
Mem:        250524       123884       126640            0            0
-/+ buffers:             123884       126640
Swap:            0            0            0
  PID USER       VSZ STAT COMMAND
    1 admin     1684 S    /sbin/procd
    2 admin        0 SW   [kthreadd]
    3 admin        0 SW   [ksoftirqd/0]
    4 admin        0 SW   [kworker/0:0]
    5 admin        0 SW<  [kworker/0:0H]
    6 admin        0 SW   [kworker/u8:0]
    7 admin        0 SW   [migration/0]
    8 admin        0 SW   [rcu_bh]
    9 admin        0 SW   [rcu_sched]
   10 admin        0 SW   [migration/1]
   11 admin        0 SW   [ksoftirqd/1]
   12 admin        0 SW   [kworker/1:0]
   13 admin        0 SW<  [kworker/1:0H]
   14 admin        0 SW   [migration/2]
   15 admin        0 SW   [ksoftirqd/2]
   16 admin        0 SW   [kworker/2:0]
   17 admin        0 SW<  [kworker/2:0H]
   18 admin        0 SW   [migration/3]
   19 admin        0 SW   [ksoftirqd/3]
   21 admin        0 SW<  [kworker/3:0H]
   22 admin        0 SW<  [khelper]
   23 admin        0 SW   [kdevtmpfs]
   24 admin        0 SW<  [netns]
   25 admin        0 SW<  [writeback]
   26 admin        0 SW<  [bioset]
   27 admin        0 SW<  [kblockd]
   28 admin        0 SW   [khubd]
   29 admin        0 SW   [kworker/3:1]
   30 admin        0 SW   [kworker/2:1]
   31 admin        0 SW   [kworker/1:1]
   32 admin        0 SW   [kworker/0:1]
   33 admin        0 SW   [kswapd0]
   34 admin        0 SWN  [ksmd]
   35 admin        0 SW   [fsnotify_mark]
   36 admin        0 SW<  [crypto]
   43 admin        0 SW<  [deferwq]
   44 admin        0 SW   [kworker/u8:1]
  138 admin      928 S    /sbin/askfirst ttyS1 /bin/login
  256 admin     1052 S    /sbin/ubusd
  280 admin     1296 S    /usr/bin/if_monitor
  291 admin     5156 S    /sbin/preinit
  304 admin        0 SWN  [jffs2_gcd_mtd6]
  320 admin     1236 S    /sbin/tw_hotplug
  336 admin     5692 S    /bin/nvram_daemon
  366 admin        0 SWN  [jffs2_gcd_mtd8]
  746 admin     4060 S    /sbin/stad 1
  747 admin     4060 S    /sbin/stad 2
  903 admin      940 S    nl_server -i br0 -s dlinkrouter -s dlinkrouter3301 -
  904 admin      940 S    nl_server -i br0 -s dlinkrouter -s dlinkrouter3301 -
  907 admin     1320 S    mDNSResponder -b -i br0 -f /tmp/mdns_resp.conf -e dl
  931 admin     1436 S    /bin/dnsmasq -C /tmp/dnsmasq.conf -6 /tmp/dnsmasq_dh
  933 admin     1424 S    /bin/dnsmasq -C /tmp/dnsmasq.conf -6 /tmp/dnsmasq_dh
  970 admin     4888 S    /bin/lighttpd -f /etc_ro/lighttpd/lighttpd.conf -m /
  981 admin     7932 S    /etc_ro/lighttpd/www/web/HNAP1/prog.fcgi
  986 admin     4236 R    /usr/sbin/timer
  991 admin     1960 S    syslogd -L
  998 admin      984 S    omcproxy -e1
 1000 admin     8048 S    /etc_ro/lighttpd/www/web/HNAP1/prog.fcgi
 1023 admin     4536 S    /sbin/myinfo.cgi
 1035 admin     1984 S    {mydlink_watchdo} /bin/sh /mydlink/mydlink_watchdog.
 1052 admin     1912 S    /usr/sbin/dhcp6s -c /tmp/dhcp6s.conf -k /tmp/dhcp6sc
 1070 admin     1040 S    /usr/sbin/radvd -m none -C /tmp/radvd.conf -d 5
 1091 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1097 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1098 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1253 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1254 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1255 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1264 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1265 admin     5724 S    /mydlink/da_adaptor -s LD_LIBRARY_PATH=/mydlink/lib 
 1323 admin        0 SW   [RtmpCmdQTask]
 1324 admin        0 SW   [RtmpWscTask]
 1325 admin        0 SW   [HwCtrlTask]
 1326 admin        0 SW   [ser_task]
 1333 admin        0 SW   [RtmpMlmeTask]
 1342 admin        0 SW   [RtmpCmdQTask]
 1343 admin        0 SW   [RtmpWscTask]
 1344 admin        0 SW   [HwCtrlTask]
 1345 admin        0 SW   [ser_task]
 1402 admin        0 SW   [RtmpMlmeTask]
 1473 admin     1472 S    bndstrg2 -i ra0 -i rai0 -i rax0
 1538 admin     4004 S    mosquitto -c /etc/mosquitto/mosquitto.conf -d
 1545 admin     5604 S    sbd
 1555 admin     7020 S    apsond
 1559 admin     7020 S    apsond
 1560 admin     7020 S    apsond
 1561 admin     7020 S    apsond
 1562 admin     7020 S    apsond
 1563 admin     7020 S    apsond
 1564 admin     7020 S    apsond
 1566 admin     4504 S    meshd
 1591 admin        0 SW   [kworker/3:2]
17148 admin     1956 S    sleep 5
17153 admin     1972 S    sh -c ps >> /etc_ro/lighttpd/www/web/messages
17154 admin     1964 R    ps
br0       Link encap:Ethernet  HWaddr 60:63:4C:7C:33:01  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::6263:4cff:fe7c:3301/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3625 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1995 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:746164 (728.6 KiB)  TX bytes:4583372 (4.3 MiB)

br1       Link encap:Ethernet  HWaddr 60:63:4C:7C:33:06  
          inet6 addr: fe80::a0b6:5dff:fe32:9f51/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:188 (188.0 B)

br2       Link encap:Ethernet  HWaddr 60:63:4C:7C:33:07  
          inet6 addr: fe80::eca8:81ff:fe6c:d539/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:188 (188.0 B)

br3       Link encap:Ethernet  HWaddr 60:63:4C:7C:33:08  
          inet6 addr: fe80::64c4:36ff:fe6e:b688/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:110 (110.0 B)

eth2      Link encap:Ethernet  HWaddr 60:63:4C:7C:33:01  
          inet6 addr: fe80::6263:4cff:fe7c:3301/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4301 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7291 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1111803 (1.0 MiB)  TX bytes:5431047 (5.1 MiB)
          Interrupt:3 

eth2.1    Link encap:Ethernet  HWaddr 60:63:4C:7C:33:01  
          inet6 addr: fe80::6263:4cff:fe7c:3301/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1761 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:272392 (266.0 KiB)

eth2.2    Link encap:Ethernet  HWaddr 60:63:4C:7C:33:01  
          inet6 addr: fe80::6263:4cff:fe7c:3301/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1760 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:272322 (265.9 KiB)

eth2.3    Link encap:Ethernet  HWaddr 60:63:4C:7C:33:01  
          inet6 addr: fe80::6263:4cff:fe7c:3301/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4301 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2002 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1034385 (1010.1 KiB)  TX bytes:4584071 (4.3 MiB)

eth2.4    Link encap:Ethernet  HWaddr 60:63:4C:7C:33:01  
          inet6 addr: fe80::6263:4cff:fe7c:3301/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1760 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:272322 (265.9 KiB)

eth3      Link encap:Ethernet  HWaddr 60:63:4C:7C:33:05  
          inet6 addr: fe80::6263:4cff:fe7c:3305/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:518 (518.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:17945 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17945 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1539950 (1.4 MiB)  TX bytes:1539950 (1.4 MiB)

ra0       Link encap:Ethernet  HWaddr 60:63:4C:7C:33:03  
          inet6 addr: fe80::6263:4cff:fe7c:3303/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4 

rai0      Link encap:Ethernet  HWaddr 60:63:4C:7C:33:04  
          inet6 addr: fe80::6263:4cff:fe7c:3304/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:24 

rax0      Link encap:Ethernet  HWaddr 60:63:4C:7C:33:02  
          inet6 addr: fe80::6263:4cff:fe7c:3302/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3000 
          RX bytes:519 (519.0 B)  TX bytes:537 (537.0 B)

looks like another version the the DIR-1760,1960,2640,2660
you should be able to load the initramfs image into RAM
for one of the others by using 1 in the menu
the memory map look's the same so you can backup the flash
a keeps it's setting & original firmware so save all it's MTD's
you can test the radio 1 of the the 5G it's looks the same
but the other radio is using DBDC not sure how much is working

https://fcc.report/FCC-ID/KA2IR3060A1

1 Like

they're different boards, @lucky1

my boys say this board has the "AP-MSMQ01-0010" as opposed to the canonical "AP-MTKH7-002 REV1.0"

further, i'm surprised the OP can do anything in stock firmware's serial. i just would be very, very, very careful with flashing a 2640/2660/1760/1960 build for this router. the PCB differences (memory and NAND being the same) seems to suggest there are other differences in the circuitry for one of the radios to accommodate the additional bandwidth.

yes it's all true
but I didn't say anything about flashing the board
I'm saying load the initramfs image into RAM (NOT FLASH)
if it crashes well that's it don't do it again
if it run's you can backup you untouched flash
& test out what works without having to risk anything
I'm sure this is from the same source code
as the memory map is the same

1 Like

yeah the memory map for sure looks the same (it is the same)

and chances are there is a lot of overlap.

he should try the initramfs but i don't doubt it will be successful.

i hate DBDC mode so much. i could do it for the existing routers but it is such a nuisance because you have to create additional input fields for new configuration files that are merged.

maybe with the mt76 driver it's easier. but the stock driver is so fast.

from what I understand
most of the radios configuration is inside the art partition
so if the driver is all working "don't think it is yet"
it get's all it's info form there about the radios setup
this board is just the same as the others having 2x 7615N's
but one is split into 2x 2x2 like the DIR-853 & DIR-1360 is with 1 radio

as the schematics are there in the FCC info this board should be easy :slight_smile:

i found the schematics for the 2660/3060 and they're definitely surprisingly different:L
https://fcc.io/KA2/IR3060A1 click Detail -> Internal Photos (3060)
https://fcc.io/KA2/IR2660A1 click Detail -> Internal Photos (2660)

i didn't know that 853/1360 are single radio but split into 2 2x2, are you sure they're not just 2 2x2 mt7615?

oh yeah you're right, the 853 is a single radio split into two streams. interesting.

definitions are a tricky thing is the mt7615 a radio or is it 4
but really I'm not 100% sure of anything in life
everything is always up for review
but this is what I think atm but no not 100%

2 Likes

all i know is the MT7615 definitely has a CPU of its own. maybe it has one for each stream. i really don't know. but the proprietary driver code suggests the whole driver is essentially a wrapper around an embedded (eCos?) operating system.

it is super cool if you ask me. very very cool. sometimes if you change the ram code or firmware, the radios need time to 'adjust'. it's almost like they're living and breathing haha.

1 Like

@Lucky1 -
i've tried adding bootdelay to the u-boot environment but the u-boot seems locked hard unless someone knows a secret key sequence.
the openwrt console also seems locked - at least root and admin don't work, and the password i set from the gui doesnt work.

so - i'm not sure how to save the mtd contents
which initramfs image do you suggest?

@broly -
yes, pcb is AP-MSM001-0010, rev 1.0

If you build the initramfs image with Luci included you can actually access the web interface and from luci there is an easy way (system - backup/flash firmware - save mtd content).

ok the others you can just send it a 1 and it will select 1 out of the menu
then you have to load the initramfs image into RAM
this should do
http://luckys.onmypc.net/openwrt/DIR-1960/2021.02.15/openwrt-snapshot-r15789-d79eeba688-ramips-mt7621-dlink_dir-1960-a1-initramfs-kernel.bin

https://downloads.openwrt.org/releases/21.02-SNAPSHOT/targets/ramips/mt7621/

sort of surprised they spun an entirely new PCB (i mean it has some similarities), but i guess the DBDC radio probably needed more circuitry or something

I just confirmed how my DIR-1960-A1 works
there is no delay for that menu you just send a few 1's to is before it gets to it
it will then prompt

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   6: System Enter UBoot to Update Img or Bin.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
default: 3

You choosed 1
                                                                              0


1: System Load Linux to SDRAM via TFTP.
 Please Input new ones /or Ctrl-C to discard
        Input device IP (192.168.0.1) ==:192.168.0.1

yea you just press one a few times before the prompt and it should enter automatically unless you hit an overriding key after

@broly, @lucky1 -
the tftp loader is a little differnt, seems to require a tftp server on my host, but tht's no biggy. by default, it looks for 'test.bin' and loads it.

i used the dir-1960-a1 and dir-2660 initramfs.bin files, renamed as test.bin, and - success getting wired interfaces up,launcing gui, and saving mtd partitions.

there are no radios active att his stage with either image.

what do you suggest for next steps?
thanks!

it's good news well you know where to start & you should have a backups
of the oem firmware and art partitions & all other if need be
you can start with the same dts files as others

things i think you will need are
WiFi interface difference with the others
switch input's
led outputs

capture a log of the oem firmware booting these come in handy
& after booting the oem firmware looking at the serial data try pressing it's buttons & see if it tells you there input numbers for wifi wps & reset you need to check these
and at some point test the led in openwrt

have you ever built an openwrt image ?

buttons & led from Schematic
wps button H5,CTS3_N, GPIO 6
reset button G18,JTMS, GPIO 15

power white F16,JTCLK, GPIO 16
power ogange H3,RXD3, GPIO 8
internet white P14,I2C_SD, GPIO 3
internet orange P13,I2C_SCLK, GPIO 4
wifi 2.4G H2,TXD2, GPIO 11
wifi 5G LB J3,RTS2_N, GPIO 9
wifi 5G HB J4,RTS3_N, GPIO 5
USB 3.0 G16,JTDI, GPIO 14
USB 2.0 G17,JTDO, GPIO 13

1 Like