daileon
September 15, 2023, 3:01pm
1
Hi all. I see that there is a topic about this model Dir 853 a2 - For Developers - OpenWrt Forum , but it is closed for new replies and the downloads are expired, and it still doesn't seem to be supported, so I would like to ask if this could be worked on and added to official supported devices. I'm a programmer without much experience in soldering or whatever (neither what is required to make OpenWRT work), but I'm very curious and interested in making this a possible improvement for the project, just let me know how can I help.
@kar200 as you were the one the were able to help op there, can you please share the file or code you had there?
Thanks!
Lucky1
September 15, 2023, 4:47pm
2
Hi daileon
cant you go into the web interface of the router
and tell me what the model number is shown in there ?
kar200
September 16, 2023, 5:43pm
3
Hi @daileon ,
AFAIK The DIR-853 A1 and A2 are identical (@Lucky1 can confirm maybe?). On the Dlink download page they actually have a single firmware file for both.
If you have the A2 model you should be able to flash the A1 version (maybe not from the web interface) but at least from the recovery mode.
It should be availble on the download for openwrt.
As for adding support have a look at this pull request. It shouldn't be hard to add the A2.
openwrt:master
← rikka0w0:master-dir-853-a1
opened 10:16AM - 26 Feb 23 UTC
Specifications:
* SoC: MT7621AT
* RAM: 256MB (NT5CC64M16GP-DI)
* Flash: 16MB … NOR SPI flash (GD25Q127CSIG, using GD25Q128C driver)
* WiFi: MT7615DN (2.4GHz+5Ghz) with DBDC
* Ethernet: 4x1000M LAN, 1x 1000M WAN
* LEDs: Power Blue+Orange,Wan Blue+Orange,WPS Blue,"2.4G"Blue, "5G" Blue, USB Blue
* Buttons: Reset,WPS, Wifi
* Serial interface: on board but not populated, pinout (from the DC jack side to the WAN port side) is "3.3V Input Output Gnd". Baud rate is 57600, settings are 8 data bits, no parity bit, one stop bit, and no flow control.
Stock flash layout:
```
GD25Q128C(c8 40180000) (16384 Kbytes)
mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K)
.numeraseregions = 0
Creating 7 MTD partitions on "raspi":
0x000000000000-0x000001000000 : "ALL"
0x000000000000-0x000000030000 : "Bootloader"
0x000000030000-0x000000040000 : "Config"
0x000000040000-0x000000050000 : "Factory"
0x000000050000-0x000000060000 : "Config2"
0x000000060000-0x000000fb0000 : "Kernel"
0x000000fb0000-0x000001000000 : "Private"
```
The kernel partition will be replaced with the OpenWrt image, the other partitions are left untouched.
"Config2" seems to be the config storage used by the stock firmware.
"Private" is a 320kB empty JFFS2 partition that comes with the stock firmware. One can get a larger space for OpenWrt by merging it with "Kernel".
OpenWrt flash layout:
```
0x000000000000-0x000000030000 : "u-boot"
0x000000030000-0x000000040000 : "u-boot-env"
0x000000040000-0x000000050000 : "factory"
0x000000050000-0x000000060000 : "config2_stock"
0x000000060000-0x000000fb0000 : "firmware"
0x000000fb0000-0x000001000000 : "private_stock"
```
The OpenWrt image must have 96 bytes of padding in the header.
MAC addresses on OEM firmware:
| | location on the flash | notes |
|------ |----------------------- |---------- |
| lan (eth2) | factory + 0xe000 | on label |
| wan (eth3) | factory + 0xe006 | |
| 2.4g (rax0) | not on flash | lan + 1 |
| 5g (ra0) | not on flash | lan + 2 |
Mac addresses of the 2.4g and 5g interface are stored as ASCII strings in the u-boot-env partition, but they are not used. OpenWrt calculates Wifi Mac addresses based on the LAN Mac.
Flash and test instructions:
Flash the encrypted image (available in the OpenWrt forum) through the stock D-Dink web interface.
1. Open the case, and solder the 4-pin header near the WAN port.
2. Connect it to a USB-UART TTL (3.3V) adapter, no need to connect VCC.
3. Open a terminal emulator (e.g. `screen /dev/ttyUSB0` on linux) with the settings mentioned above.
4. Setup a TFTP server on your PC that can serve `xxx-ramips-mt7621-dlink_dir-853-a1-initramfs-kernel.bin`.
5. Connect any LAN port to your PC and set a static IPv4 address to 192.168.0.101 (netmask 255.255.255.0).
6. Power on the device and keeps pressing 1 until you see the prompt.
7. Use default IP addresses and enter the file name accordingly, then hit enter.
8. Wait until it boots to OpenWrt, the default IP address is 192.168.1.1, you need to change your PC network adapter to use DHCP in order to access LUCI.
9. So far, the OpenWrt runs in RAM and the flash contents are not touched. You can try OpenWrt without having to overwrite the stock firmware, a reboot clears all changes.
10. Optionally, backup the stock firmware (the "firmware" partition) in Luci.
11. To permantly install OpenWrt to the device , click on "System -> Backup/Flash Firmware" in Luci and flash `xxx-ramips-mt7621-dlink_dir-853-a1-squashfs-sysupgrade.bin`
Known problems:
* WLAN0 defaults to 5G after a fresh installation, to enable 2.4G network, you need to config it manually in LUCI.
* If you see jffs2 related warnings/errors after updating from the stock web interface, you need to do a reset in LUCI. The error will be gone after a cold reboot.
____
Credits to Kar200 and Lucky1 who gave me plenty of help.
Prebuild OpenWrt (initramfs, binary, sysupgrade):
[dir-853-a1.zip](https://github.com/openwrt/openwrt/files/10805078/dir-853-a1.zip)
Use this for updating from stock (Tested on Ver 1.2):
[dir-853-a1-fac-enc.bin.zip](https://github.com/openwrt/openwrt/files/10833430/dir-853-a1-fac-enc.bin.zip)
K.
1 Like
Lucky1
September 16, 2023, 9:18pm
4
this is what I'm thinking "same as the DIR-2060-A1/A2"
but no one has been able to tell me what the firmware thinks it is yet ?
the last person just replied with the external sticker
I would test this via upload the DIR-853-A1 firmware via the normal
update web interface "most protection against invalid firmware"
if that's is successful it's expecting the DIR-853-A1 header
and to use the A1 openwrt files
kar200
September 17, 2023, 6:10pm
5
Good point. I would say maybe A1? Looking at the download page from Dlink the firmware the file name is A1
Also after decrypting the firmware file and looking at the header it shows A1 only
00000000 27 05 19 56 b5 f8 9f 50 5c dd 2f bb 00 d2 5b c6 |'..V...P\./...[.|
00000010 81 00 10 00 81 60 d7 80 57 56 1b 4a 05 05 02 03 |.....`..WV.J....|
00000020 4c 69 6e 75 78 20 4b 65 72 6e 65 6c 20 49 6d 61 |Linux Kernel Ima|
00000030 67 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |ge..............|
00000040 44 49 52 2d 38 35 33 00 00 00 00 00 00 00 00 00 |DIR-853.........|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000080 56 31 2e 31 30 42 30 34 00 00 00 00 00 00 00 00 |V1.10B04........|
00000090 41 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |A1..............|
000000a0 5d 00 00 00 02 c0 99 24 01 00 00 00 00 00 00 6f |]......$.......o|
I would assume this would make the A1 works on both devices wouldn't?
EDIT: I just realised that the commit contains an encrypted factory for the V1 with a downalod link. Maybe this can be used to upgrade from the web interface
https://github.com/openwrt/openwrt/files/10833430/dir-853-a1-fac-enc.bin.zip
Lucky1
September 18, 2023, 1:33am
6
my local dlink has no mentions of a2 or a3 for that matter
but looks like you found what I was expecting
1 Like
daileon
September 19, 2023, 11:03pm
7
Hi guys! Sorry the delay, it was not intentional. I was just able to check your suggestions and I got a crazy thing here. If I went to my local (Brazil) D-Link site, I would only see FW v1.1 and that matches current installed version on the router.
Checking web UI it displays "DIR-853 HW: A2, FW 1.10"
However, the firmware file says A1, so I took a shot and downloaded A1 FW 1.2 and tried to update via web UI and...
Well, now I can try OpenWRT for A1 and hopefully it will work.
2 Likes
kar200
September 20, 2023, 5:22am
8
I am assuming it will work. I am assuming the A2 reference on the web interface is read from one of the partitions (cannot recall which one) which holds the device info (Like serial number ...etc).