How to flash LEDE onto Buffalo WHR-1166D?


I have downloaded the sysupgrade image for the Buffaldo WHR-1166D and tried to fasl through the manufacturers wen GUI. It fails with message "Invalid Firmware".

Could some kind person explain how I can flash LEDE onto this router ??

kind regards


Hi @facepoint Thanks for the note.

It seems that you tried to install the 'sysupgrade' image onto the vendor firmware. You need to use the factory image first.

For more details, please read the Standard Flashing Instructions that we have constructed to work on virtually every modern router.

You should also consider the steps in the Quick Start Guide for getting all the way up and running.


Thank you, but there is no factory image :frowning:

kind regards


I couldn't find much info on that model but a little bit of Google revealed a topic in the DD-Wrt forum topic which hints at the fact that you might need to do the initial flashing via the bootloader, using a serial console.

Check here:

Hi @jow

Yes I read similar posts through google . . . I dont want to go through the palava of using a serial cable etc.
Guess the unit will be a glorified access point. Thank you for your reply.

Seems there are few dual concurrent band routers with 128Mb RAM or larger that are current and NOT older models such as TP LINK that cannot be sourced new.

Look like my 1900ACS will still be the boss router for quite a while.

kind regards


I had a similar issue with a different Buffalo router (WLI-TX4-AG300N), a 'sysupgrade' file existed, but no 'factory'. I even compiled my own and didn't get the correct file. Not sure why not, I asked on the openwrt forums, but never got an answer.

I've been trying to find an answer to this for years. Having openwrt and ddwrt images but no way to get them on the thing is annoying so here...

Buffalo encrypts their firmware. Their old one had been cracked, but nothing within the last several years. That leaves two options (at least on 1.70): serial or tftp. Keep in mind that getting back to stock will be nearly impossible unless you backed it up.

For tftp, your server must be on and the file must be named firmware_WHR-1166DHP.ram (yes, I have the non-HP). It only loads the file into RAM, so the regular images can't find root and you'll have to flash a regular image later when you get past that. An image with an initramfs and the right command line worked for me for initial boot. I threw the one I made that finally worked for me up on google drive.

To put it in tftp boot mode you can hold down the aoss button while plugging it in and a bit after that (until you see it grab the image). Once it's up, you need a new IP. Backup the stock FW and sysupgrade (with a regular build) for a permanent install.

Hi there!

Just what I was looking for! Thank you very much for all the effort :slight_smile:
I was able to load your image to RAM, boot from it, back up the original firmware and flash LEDE 17.01.1.
Now - anybody knows how to use VLANs with the switch - is there any special configuration neccessary?


1 Like

Nothing special I could see, but I didn't try any more than trying to see if a bad switch configuration was causing

Does the GBE port work for you? For me it didn't on LEDE. It worked on CC, but the AC wifi didn't work then.

VLANs work well on tagged ports, if you need an untagged port you need to add switch_port block to /etc/config/network

config switch_port
option device 'switch0'
option port '4'
option pvid '9'

Without this block lede will set pvid to to vlan number (~ the order in which it was created) this is a problem for all the routers on mt7620 soc - both on lede and openwrt. On openwrt you don't need option device name, but on lede without this block pvid won't be set.

On my device (using lede 17.01.2) the gigabit port works when connected to fast ethernet, but when connected to gigabit switch the speed is negotiated as GBit, the switch sees the mac of 1166, but no correct packages packets are sent (at least I can't see any with tcpdump on the other end), but something is being sent, as counters both on the switch and 1166 go up.

Do you mean packets instead of packages?

Tcpdump probably didn't show anything because the problem is at the ethernet or physical layers. Ifconfig didn't even see any packets recieved, but I didn't try connecting that port to a computer.

I have a hypothesis. I'm waiting on a build to find out if it worked.

My workaround worked, but I don't think it's the right longterm fix. I updated the bug so someone more closely related to the project can decide.

Here's my build. If that helps someone, go vote for the bug. I doubt I will keep the image updated. I did add some goodies like adblock and SQM and there's still 11MB free. I tried to match 17.01.2 as well as I could figure out how, so the regular package feeds should work, just not anything requiring a kmod.

I was able to swap the WAN port from the gigE to another through the switch settings on LuCI. Required a reboot though.

Thanks everyone who contributed here to this. I guess this router is pretty rare, so not much to find on the Internet about the WHR-1166D.

I just wanted to confirm that what is discussed here works flawless - I just did this to my WHR-1166D (EU Version).

For any fellow noobs, here is a summary of what you need to do in order to flash OpenWRT on your WHR-1166D:

  • Set your PC IP to
  • Start a tftp server (I used pumpkin tftp, tftp32 is another popular one for windows), provide it with the firmware_WHR-1166DHP.ram from andapanda's google drive linked above
  • Keep AOSS button pressed while plugging the power cable into the device, it will now within a few seconds start to fetch the firmware file from your tftp server- watch the logs. Once it does that, release the AOSS button.
  • Wait a little until it has finished, now login using your web browser on You will have to change the settings on your network interface to DHCP or change or add an IP in the 192.168.1.X range to your network card before you can do this!
  • After logging in, go to System => Backup/Flash Firmware => Disable the keep settings checkbox => flash openwrt-.......VERSION_NUMBER........-ramips-mt7620-whr-1166d-squashfs-sysupgrade.bin
  • (which I got from the line "Firmware OpenWrt Upgrade URL" on this page:
  • wait for some time for it to finish flashing, then relogin into the web interface and verify you are using the version (Status => Overview => Firmware Version) you downloaded from the openwrt download servers.
  • Your device should now be ready and the OpenWRT firmware will still be there after turning it off and on again.

I have yet to try if how well the new firmware actually works compared to stock, but flashing it worked really really well.

Here's an update regarding my experiences how well OpenWRT 18.06.1 on the WHR-1166D actually works:

First things, first. If you want to use it as Access Point instead of as a router, you need to do the following:

  • Network ⇒ Switch ⇒ Delete VLAN2, Set WAN Port to untagged ⇒ Save&Apply
  • Network ⇒ Interfaces ⇒ Delete Interface WAN ⇒ delete Interface WAN6 ⇒ Save & Apply
  • Network ⇒ Interfaces ⇒ Edit Interface LAN ⇒ at the bottom in the area "DHCP Server" ⇒ check [X] Ignore Interface and set the three IPv6 Settings to disabled ⇒ Save&Apply
  • Network ⇒ Interfaces ⇒ Edit Interface LAN ⇒ set static IPv4 address, static gateway, static dns
    => This bridges the single GBit Port (named WAN) to the LAN and allows usage as an 11ac access point connected by gigabit. Otherwise the 100MBit Ports would be the bottleneck for 11ac clients!

Power Draw & Performance:

  • Power Draw: ~3W idle with two 11ac Clients and 1x 100MBit connected
  • Power Draw: ~5W idle with two 11ac Clients and 1x 1 Gbit connected - wow does usage of the WAN port increase power draw!
  • Performance: A HP ProBook 440 G5 (Intel WiFi 7265 Chipset) connected to the AP was able to download at about 30MB/s from a SMB share and upload at about 20MB/s to the smb share.

In general I have to say everything worked perfectly fine. In fact, the WiFi compatibility using OpenWRT is significantly better than with all the stock firmware versions (2.91 is the latest as of 10/2018). With my iPad Pro 9.7" (an early 2016 device), the Buffalo WHR-1166D was behaving weirdly at best: when in the Settings => WiFi menu of the iPad the iPad would reproducibly lose connection to the buffalo, reestablish it and lose connection again. It seems that something about scanning for other WiFi networks made the buffalo drop the connection. This is something the iPad does with no other access point and which also does not happen between the iPhone X and the Buffalo. This weird incompatibility with the iPad 9.7" was present in all Buffalo firmware versions I've tried (and I tried a lot) and could not be solved with any setting in the buffalo stock firmware (and I tried a lot of settings). Now with OpenWRT 18.06.1 both the iPad and the iPhone work perfectly fine with this access point. Great success :slight_smile:

Hi andapanda,

Could you create one for the WHR-600D?
The firmware_WHR-1166DHP.ram works on the 600D but only partly and i can't flash a regular 600D.

how does one backup the original firmware?

Interesting results. I think I still have been having trouble where using the gigabit port actually causes less throughput compared to 100tx sometimes. I don't use the router much anymore so I don't know if that got fixed later. Maybe I'll try 18.06.

Not easily since I deleted my build directory. There might be an image floating around somewhere else for that one though (possibly ddwrt that you might be able to then cross flash). I think that was the router that told me how to get at TFTP and suggested the ramdisk build.

What about the image isn't working? I needed serial access to figure out what to name the file, that I needed the ramdisk, and getting the command line right. So even if I figure out mine again, it might not help you.

I use dd to copy the contents of /dev/mtd* to files and then use scp to get them off of there.