Installing OpenWrt on UniFi nanoHD

Hi,

sorry to resurrect, but need advice on flashing nanohd with openwrt

managed to tftp to 3.9.27, can ssh with ubnt default account

openwrt-22.03.0-rc6-ramips-mt7621-ubnt_unifi-nanohd-squashfs-sysupgrade.bin: No such file or directory
UBNT-BZ.v3.9.27#

what could i be doing wrong?

Thankyou

update: managed to work it out, using first post from david, used winscp to copy openwrt sysupgrade to tmp, then ssh'd in ran commands in the post and then rebooted, worked!

1 Like

Could be one or more of these:

  • Using the wrong file. The factory file is used for initial install, not sysupgrade.
  • Didn't push the file to the router using scp first.
  • Didn't cd to /tmp, where the file should have been placed.

so whats the best way to revert back to original unifi firmware?

any hints available, tftp? or via sysupgrade from openwrt web interface?

TFTP should work just fine.

TFTP method does not work. I flashed Openwrt 22.03.3 today and tried the tftp method. ARP shows that 192.168.1.20 is there, but does not accept data. I still can boot into openwrt - any possibility to revert to stock via commandline?

TFTP is the preferred method to return to stock. After activating TFTP recovery by holding down the reset button while turning the power on until the LED flashes blue and white, there is only a short time of about 20 seconds to transfer the file. The lights will continue to flash indefinitely but the TFTP server stops.

1 Like

I'm running in a problem like this user:

https://community.ui.com/questions/Back-to-original-firmware-from-Openwrt/6a0ea273-59fc-40e2-9e38-f728f5745067

I can properly enter TFTP mode, arp shows theres is 192.168.1.20 but i cannot put any file to him. Probably Openwrt corrupted the filesystem.

Is there any other possibility to revert to stock?

If it does not work, probably your only option is JTAG.

Installing OpenWrt does not alter the bootloader, so TFTP really should still work.

1 Like

Hi everyone, i've been trying to install OpenWrt for a week on and off, learning how to use jtag and tftp and all that jazz (my nanoHD came with a firmware version after v3.9.27) . I've actually gotten to the point where i can transfer the v3.9.27.bin file with tftpboot and tftpsrv commands in Uboot, but they just download the file to the 0x86000000 address and stop there. What do i have to do after that to actually install the firmware?

Ok, i tried again and it doesn't reboot after transfering the file, and i can't get it to boot or flash 3.9.27 with other commands, so i think i'm either doing something wrong or something is wrong with this AP

Nothing is wrong with the AP, it will reboot, but due to UBoot being locked it's tricky. You require a terminal access using serial/JTAG connection as I did.

Downgrading may not be allowed. If the firmware that is installed still has the dd command you could try the install process as it is. There is not a huge risk to that, but confirm that the partitioning has not changed, or you could clobber something that is not fixable with a TFTP flash back to stock.

I'm already using jtag/serial with the device opened and pins connected to the board, using 'tftpboot' or 'tftpserv' commands just load the file but don't make the device reboot. I downgraded to 4.3.21 just in case. I could post the entire log from boot to transfered file later if it helps.

Despite the name, tftpboot only downloads a file into RAM and then stops. It must be followed with bootm to execute the boot.

Stock firmware files can't be booted directly with bootm. Use the OpenWrt initramfs image. That should start OpenWrt running from RAM. Nothing has been changed in the flash yet so it will go back to whatever is in flash on a reboot. Use sysupgrade from within the RAM OpenWrt to install the sysupgrade image into flash. It is a good idea to first back up all the mtd partitions and scp them to your PC in case something goes wrong with the install.

3.9.27 is the one you need. And then once it boots just follow the steps I posted. There were no complications of any type, honestly. I'm not following the issue.

Installation
------------

These instructions were written for firmware version v3.9.27.
Downgrade if necessary.

1. Copy the OpenWrt sysupgrade image to the devices /tmp folder
   via scp. On factory defaults, user and password is "ubnt" at
   192.168.1.20/24.

2. Write the bootselect flag. Otherwise, the device might boot from the
   wrong partition. Verify the mtd partition used in the command below
   is the one labled "bs" in /proc/mtd (as this might change in the
   future).

   > dd if=/dev/zero bs=1 count=1 of=/dev/mtd4

3. Write the OpenWrt sysupgrade to the mtd partitions labled
   "kernel0" and "kernel1".

   > dd if=/tmp/openwrt-sysupgrade.bin of=/dev/mtdblock6
   > dd if=/tmp/openwrt-sysupgrade.bin of=/dev/mtdblock7

4. Reboot or powercycle the device.

It will reboot but won't give you proper access to the network, this is why you need the serial connected. From here I just follow the 7 steps I provided, using above instructions to flash the OpenWrt sysupgrade version I wanted.

Not sure if downgrading bootloader to 3.9.27 makes sense anymore, by the way.

Tried booting latest initramfs image "bootm 0x83000000 (default tftp download address)" results in "Wrong image format for bootm command
ERROR: can't get kernel image!"

hello I am new to OpenWrt but started to love it! I have downgrade my NanoHD to v 3.9.27 (BZ.mt7621.v3.9.27.8537.180317.1220) as advertised here but when I am trying to flash it with OpenWrt via mtd write command - it's says mtd not found - Am I doing something wrong or mtd has been removed from that version already?
If so is there a way to manually add mtd-tools to that version? or some alternative way?

btw:

I have successfully flashed the AC lite with BZ.qca956x.v3.7.58.6385.170508.0957 and that worked fine!

Thank you in advance for any help!

If you check the instruction just 2 post above yours you'll see OpenWrt is flashed using dd not mtd. You can see that in the OP link to the initial support patch.

1 Like