[DIR-1960] Install fails

Hi,

Seeing that it is listed as a supported device, I just bought a D-Link DIR-1960.

However, I haven't had much luck in getting the OpenWRT firmware to flash.

I tried uploading the factory image using all browsers I could get hold of. Even FF (also in private mode), Chromium and Edge on Windows 10. No success in even getting the upload to start.

Using the trick of loading the page, selecting the firmware, then going into factory reset again and then pressing the upload button yields nothing more than "Upgrade Failed!".

The curl upload of the firmware, which should negate the browser issues, seems to succeed at first, but a reboot never happens and after manual reboot the dlink software is still present.

I also tried the telnet exploit, but although the python script contained in D-LINK recovery mode (DIR-882 DIR-878 DIR-867) claims success, no telnet access was possible.

I tried all of this with the original FW 1.01 and also with the latest 1.11.

I used factory images openwrt 21.02.0, 22.03.5 and 23.05.0-rc2.

Does anyone have any further ideas short of opening the case and soldering?

Win on physical machine or
Win in VM on Linux?

Good question. I don't own a windows laptop, but I could use my brother's. So, a physical Windows machine.

Perhaps some sort of security protection is kicking in when doing web upload.

We're talking about 128 mb flash here, writing to it would certainly take more time than usual. After the image is transferred to the router, it goes into router's RAM memory, then it starts writing to the flash, which takes time to finish.

I really hope that you've waited long enough for the writing operation to complete before doing manual reboot.

1 Like

Have you tried it like it's described in the commit?

Installation:

  • D-Link Recovery GUI: power down the router, press and hold the reset
    button, then re-plug it. Keep the reset button pressed until the power
    LED starts flashing orange, manually assign a static IP address under
    the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1

  • Some modern browsers may have problems flashing via the Recovery GUI,
    if that occurs consider uploading the firmware through cURL:

    curl -v -i -F "firmware=@file.bin" 192.168.0.1

Since OP says he even tried curl, one would assume he's already been there...

I might misinterpret tough.

Yeah, if none of the other workarounds had helped. The mini http server implementation of the recovery boot option is somewhat broken, and regular Linux client network stack and/or curl/http libs though are serious gourmet shit, but unfortunately seems too strict/not forgiving, to compensate the broken DLink recovery network stack of lots of devices.

At least people keep reporting problems, when trying to use the recovery option of DLink routers via native installed Linux clients, while Windows clients seem to work for some reason.

I believe I have waited long enough. The countdown in the JavaScript on the response page waits 100 times 2.2s. I always put a sleep of 220s, then I waited for at least 5 minutes more. On one occasion even more than half an hour.

There is a report of someone having the same problem but in his case switching to Windows helped. We're now 3 years further and the browsers on Windows have changed too much it would appear.

Indeed. I read the commit instructions (and every other document I could find, even from DD-WRT to get some inspiration). I did try the curl command line. This got me the furthest, but alas not far enough.

just use a real window install Not a VM
I have some old DIR-825-B1's
and to use it's recovery interface the only way I have found
other then to install windows 9x or XP "current pc has to much ram"
was to download the last version of Netscape Navigator "not usable as a browser any more tho"

I'm am trying to install OpenWRT on a D-link DIR-1960 via the "D-Link Recovery GUI" and am having no success. All I get is "Firmware Upgrade failed!". I've tried using curl with no result. I've tried Windoze and Netscape etc. and 5 or 6 browsers under Linux, no luck.

I'm beginning to have doubts re the faulty D-link network stack theory for the following reasons :

  1. I can install all the OEM firmware no worries ie. v1.02, v1.03 and v1.11. If the network stack is the problem would the OEM firmware fail too?
  2. If I run the Linux file utility on the OEM and OpenWRT bin files it shows that the files differ. The OEM firmware has no debug info. whereas the OpenWRT bin files do. The two set of files (OEM and OpenWRT) differ. Perhaps this is the problem.

I think using the strip utility would remove the debug info. from the OpenWRT files but I don't have MIPS support on my machine so haven't tried this.

Any thoughts?

you need a windows pc to upload the unencrypted firmware files in the recovery interface
linux won't work
yes the encrypted OEM firmware files do work via the normal web interface but openwrt won't
as we don't have the private encryption key to make this pass the validation
here is an unencrypted OEM firmware file for you to play with and or compare
http://luckys.onmypc.net/openwrt/DIR-1960/DIR1960A1_FW101B04.bin

So the problem is that the OpenWRT firmware file needs to be encrypted using a key that is unknown.

Is the above statement correct?

to make the regular web install yes
that's why we have to use the recovery interface with an unencrypted file

due to the fact that it's the only way to go back to the OEM firmware
it's a good thing for people to know anyway

if the upload/flash process GUI via D-Link recovery hangs unexpectedly/gets stuck (without reasonable error message) before it has even started flashing, another attempt using Windows and/or curl or a different browser might remedy the situation.

If it starts flashing, but you get failed-errors, likely something else might be the cause.
Could you post a link of the firmware file that you tried to flash?

I have tried to flash the following file :
https://downloads.openwrt.org/releases/23.05.0/targets/ramips/mt7621/openwrt-23.05.0-ramips-mt7621-dlink_dir-1960-a1-squashfs-factory.bin

I'm doing some R&D on this router with OpenWRT and will report my observations as
I collect them.

I've run the Linux file utility on the OpenWRT firmware files eg. for openwrt-ramips-mt7621-dlink_dir-1960-a1-squashfs-factory.bin, file generates the following output :

openwrt-ramips-mt7621-dlink_dir-1960-a1-squashfs-factory.bin: u-boot legacy uImage, MIPS OpenWrt Linux-5.15.137, Linux/MIPS, OS Kernel Image (lzma), 2968388 bytes, Mon Oct 30 08:08:39 2023, Load Address: 0X80001000, Entry Point: 0X80001000, Header CRC: 0X37810931, Data CRC: 0X375D415C

For the unencryted OEM firmware file DIR1960A1_FW101B04.bin :

DIR1960A1_FW101B04.bin: u-boot legacy uImage, Linux Kernel Image, Linux/MIPS, OS Kernel Image (lzma), 17702084 bytes, Sun Apr 14 18:33:47 2019, Load Address: 0X81001000, Entry Point: 0X8161CCD0, Header CRC: 0X68CDA23B, Data CRC: 0XB5CC9B7A

For the encryted OEM firmware files DIR1960A1_FW102B01.bin, DIR1960A1_FW103B03.bin & DIR1960A1_FW111B03.bin :

DIR1960A1_FW102B01.bin: data
DIR1960A1_FW103B03.bin: data
DIR1960A1_FW111B03.bin: data

Viewing unencrypted files with hexedit each contain human readable strings at the head of the file but the encrypted files don't. The first 6 bytes of all three encrypted file are identical.

Don't know if the preceding is of any use but there it is.

I've tried to access the DIR-1960 router web interface under Windoze 10 and Netscape Navigator v9.0.0.6. Navigator displays a blank page and reports about 90 unknown CSS property warnings and 8 errors including jQuery is not defined and JSON is not defined.

Can access the router web interface with M$ Edge and Firefox fine but can't program the firmware.

Have tried the curl command (ie. curl -v -i -F "firmware=@file.bin" 192.168.0.1) under Linux and Windoze 10, both just barf immediately.

Think I'm going to send this router to e-waste. Got it cheap and I'm doubtful that the WAN port is working anyway.

I'll go over the basics
make sure you have A DIR-1960-A1 model
use real windows I use firefox in incognito mode "stops cache"
set you local lan interface to 192.168.0.10 255.255.255.0
turn off your firewall "just to make sure"
remove all other cables except the one form you network card to one of the lan ports
power on with the reset button held until the orange led flashes
in you browser go to 192.168.0.1 the recover page comes up
upload openwrt V23.05.0 factory file
this should work & say flashing & then complete
turn back on firewall
reset local lan interface back to dhcp
now try to login to 192.168.1.1

also don't discount a faulty lan cable

Thanks for the to do list Lucky1. I'll give it a go and report back.