D-Link DIR-3040 very bricked. Still any chance?

Hi I got a DIR-3040 2nd hand. Arrived in firmware 1.20, seemed working no problem. Tried recovery mode but firmware won't upload (timeout after clicking upload) in any OS/browser/cURL.

Randomly tried D-Link's "DIR-3040_REVA_FIRMWARE_v1.20B03_HOTFIX" but this firmware is apparently flawed. Now the router can't even function with factory firmware. After reset, set WIFI SSID, password and admin password, the SSID won't update. Still connectable through default SSID and password. Admin login gets kicked out immediately after entering the correct admin password. WAN drops immediately after clicking agree on EULA.

So this unit is like dead-dead: no way to upload through recovery mode, no way to login as admin. Any chance to rescue? For example serial connection? As long as I can get OpenWRT onto it I'm fully satisfied.

serial is usually something to try, yes ....

Any tutorial on how to do serial recovery on these routers? Thanks!

doesn't seem documented here, you're on your own, unfortunately, but we'll hold your hand.

start by opening it up, take a photo of the PCB, and post it.

You have to use real windows in recovery mode to upload the firmware
with only the LAN cable to the pc plugged in
I recommend Firefox

you can tftp via serial if it comes to it

Reading here: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=cab2e1de0d94ab35b5d032194fc5b4ab2e0d609a

It mentions recovery gui (like a lot of D-Link devices have) if you hold down the reset button on boot, so you'd figure it would be almost impossible to brick and super easy to recover since all you have to do is hold down the reset button then browse to a web page and upload the firmware file.

I'm not sure for this device, but usually you'd build your firmware, and there would be one with "factory" in the name and these are the ones you can upload straight into the emergency gui but I notice in this case the firmware selector has no "factory" option.

From V24
the firmware used for the recovery interface is called recover
the firmware used for the factory OEM interface is called factory
we don't have the RSA Keys to make the factory image for this model

Ok cool. I know with a 645 that I have that the recovery gui can be a little tricky with uploads. Sometimes it might take a few tries. There's also different browsers to try in linux like falkon

Linux won't work, something to do with the TCPIP stack
that's why Windows VMs on linux don't work either

Thank you all for the info. The situation for this router might be a bit unique: I even tried Windows 7 + Firefox 10 comb. I can always access the recovery web GUI but it hangs as soon as I hit upload file. Both v1.2 firmware equipped routers cannot go through this. Some people reported v1.13 worked. So maybe the factory firmware somehow destroyed the recovery mode.

Good news is the serial efforts paid:case opening is quite standard, rubber pads off, screws out, just a metal ply bar from the WPS button side will open it up.

Then the UART pins are very obvious, right next to the reset button. I connected (soldered) GND, TX and RX to a CP2102, set "57600 8N1" then no problem accessing the serial outputs and interrupting the boot.



1 Like

What tripped me over was setting up a working TFTP server. IDKY but everything I tried failed. Eventually I abusively repurposed another working server which I shouldn't. People may need to try different ways depending on their OS. For example, the tftp-hda in standard Debian repo just failed me.

After making sure the TFTP works and placing the firmware file, just interrupt boot with option 2 "Load system code then write to Flash via TFTP". Just wire the router and PC with ethernet cable and set IPs under subnet 192.168.0.*.

I also tried option 1 and booted into OpenWRT successfully. However the upgrade through web UI failed me:

verifying sysupgrade tar file integrity
cannot find ubi mtd partition rootfs
sysupgrade failed

I noticed around 80% chance of booting failures with 24.10 RC6, stuck at the wireless initialization. I have boot logs if anyone interested.

Reverted back to RC5 and it seems flawless by far.

You need unencrypted firmware for the recover interface
all the dlink ones are encrypted
here is an unencrypted one you should get and store
http://luckys.onmypc.net/openwrt/DIR-3040-A1/DIR3040_A1_FW120B03_unencrypted.bin
from this you can flash another real dlink firmware

You need to flash a factory image "recover in this case"
we may need to make this an option though sysupgrade
so if we change UBI format, we don't need to use the recovery interface

If the recovery GUI hangs with OpenWRT recovery bins, I believe it will also hang with the unencrepted D-Link fiemwares. Am I right?

Maybe just easier to go with serial.

if you want to go back to dlink firmware even via serial you need the unencrypted file

i have not tested the rc6 in any form yet & there is talk of RC7 so maybe it's buggy
but rc4 upload's fine

For all other D-Link models I always made recovery GUI work, just not this DIR-3040 so I guess it's just this model.

Most of the Dlink MT7621 AC models are made by ' Shanghai Gongjin Telecom Technology Co., Ltd. ([T&W]'
they are all the same
DIR-853-867-878-882-1360-1935-1960-2055-2150-2640-2660-3040-3060
are all the same recover
only the R1 versions that have Russian Failsafe interface
don't have this problem as then have a different bootloader

it's all simple the factory has a Windows computer to update the firmware
some programmer got it to work for the factory
they don't expect user to use it or care that it won't work with the linux stack

it's only linux user that have the problems over and over and over

Just a note, I have a USB Ethernet with static IP of 192.168.0.2 in LAN port 1
and pc Ethernet as DHCP in 2nd LAN port



router rebooted at 45%
in another window I login to 192.168.1.1

recover screen still going up %