Installing OpenWRT on a Ubiquiti UniFi 6 Lite

Hi,

I'm trying to install OpenWRT on a Ubiquiti UniFi 6 Lite.

Before starting the AP was on BZ.6.2.49, and after rebooting, it has fallen back to BZ.5.60.13.

The steps I performed are below:

U6-Lite-BZ.6.2.49# fw_setenv devmode TRUE
U6-Lite-BZ.6.2.49# fw_setenv boot_openwrt "fdt addr \$(fdtcontroladdr); fdt rm /signature; bootubnt"
U6-Lite-BZ.6.2.49# fw_setenv bootcmd "run boot_openwrt"
U6-Lite-BZ.6.2.49# fw_printenv
appinitdone=true
baudrate=115200
ble_mode=serial
bootdelay=2
device_model=U6-LITE
ethact=eth@1e100000
ethaddr=60:22:32:45:98:f8
fdtcontroladdr=8ffecf90
fw_version=9.9.9
macaddr=60:22:32:45:98:f8
netmask=255.255.255.0
serverip=192.168.1.19
stderr=uartlite0@1e000c00
stdin=uartlite0@1e000c00
stdout=uartlite0@1e000c00
ubntaddr=850000a0
is_ble_stp=true
ipaddr=192.168.1.20
is_default=true
devmode=TRUE
boot_openwrt=fdt addr $(fdtcontroladdr); fdt rm /signature; bootubnt
bootcmd=run boot_openwrt
U6-Lite-BZ.6.2.49#

U6-Lite-BZ.6.2.49# sha256sum openwrt-23.05.4-ramips-mt7621-ubnt_unifi-6-lite-squashfs-sysupgrade.bin 
4dd51d321df3dcb425e4ec78b062361d00bd65e32e8fdc586d32b12ec015a639  openwrt-23.05.4-ramips-mt7621-ubnt_unifi-6-lite-squashfs-sysupgrade.bin
U6-Lite-BZ.6.2.49#

U6-Lite-BZ.6.2.49# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00060000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00040000 00010000 "Factory"
mtd3: 00010000 00010000 "EEPROM"
mtd4: 00010000 00010000 "bs"
mtd5: 00100000 00010000 "cfg"
mtd6: 00f10000 00010000 "kernel0"
mtd7: 00f10000 00010000 "kernel1"
U6-Lite-BZ.6.2.49#

U6-Lite-BZ.6.2.49# dd if=/dev/zero bs=1 count=1 of=/dev/mtdblock4
1+0 records in
1+0 records out
U6-Lite-BZ.6.2.49#

U6-Lite-BZ.6.2.49# dd if=openwrt-23.05.4-ramips-mt7621-ubnt_unifi-6-lite-squashfs-sysupgrade.bin of=/dev/mtdblock6
13697+1 records in
13697+1 records out
U6-Lite-BZ.6.2.49# dd if=openwrt-23.05.4-ramips-mt7621-ubnt_unifi-6-lite-squashfs-sysupgrade.bin of=/dev/mtdblock7
13697+1 records in
13697+1 records out
U6-Lite-BZ.6.2.49#

The steps I followed are here.

Am I missing something?

Thanks.

I know you said 6.2, but

Attention! If your device has too recent official firmware (6.5 or newer), you need to downgrade the official firmware first, see below. You can tell it is not working if the last dd commands are completed under 10 seconds (30s+ are expected).

how long did it take ?

There shouldn't be a problem if it's using BZ.6.2.49, right?

If step 6 in the instructions was successful, then the AP should've booted from kernel0. If step 7 in the instructions was successful, then both kernel0 and kernel1 should've been overwritten with OpenWRT.

I can't see anything in the logs about what software version it's loading.

It's possible it took around 15 seconds.

Full commit is here:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=fb4d7a9680117a00721936c98ce41eeb2dea95c9

It does not seem to match the wiki instructions as there's a initramfs image to boot first.

1 Like

The only reason I can see is that the instructions tell you to write the openwrt image to both kernel partitions. A sysupgrade image cannot be booted from "kernel1", I believe. But since they also tell you to clear "bs", then there should be no need to write anything to "kernel1".

The wiki instructions could use a clean-up. But there's no harm in following the current version.

1 Like

started wondering if the "bs" clearing instructions are correct. Are we sure the flag bit is in the first byte here?

(all my devices have always had "00 00 00 00" so it's a bit hard to guess)

Sadly I do not have one to hand, got a couple of ac lites, but as that's Qualcomm not Mediatek, it's probably not much help.

What information do you need?

Is it possible that the jump from UniFi firmware 6.2.49 to OpenWRT 23.05.4 is too great?

I just downgraded to UniFi firmware to 6.0.14, and then upgraded to OpenWRT 23.05.4, and now the AP is unresponsive.

I just tried the upgrade with the earliest version of the UniFi firmware available (5.43.19) and the earliest version of OpenWRT available (21.02.0) and I got the same result.

Is it possible that console access is required?

No, console is not required to install OpenWrt on a Unifi 6 Lite. Nor to recover from any failures

I looked through your messages and cannot find any description of what errors or problems you see. The steps you described in your first post should have resulted in a successful OpenWrt installation. But you stopped before the final reboot and said absolutely nothing about what happened after that. Yet, you somehow decided that it didn't work? How?

FWIW, I have installed OpenWrt on my two Unifi 6 Lites from stock a number of times, and it has been successful every single time. I dont think I've tried from v5.43.19 or v6.2.49. But I have done it from v5.43.14 and multiple times from v5.43.23.

1 Like

Hi hope you can help. I have tried to install OpenWRT on my U6lite, an older version which was recommended. All went well until it rebooted, and now there are no signs of life. :frowning:

Hi Tsmjay

How did you fix your unresponsive AP after downgrading firmware?

Thanks

Robin

First make sure that it really is dead. Do you have the correct address? Are there any LED indications showing failure/success? Is the ethernet link up?

If it really is dead, then the Unifi tftp recovery mode is a reliable restore method. See https://help.ui.com/hc/en-us/articles/360043360253-UniFi-Recovery-Mode for instructions. You may want to disregard the "most recent firmware" part. The procedure works with any supported firmware.

There is one minor problem affecting the U6 Lite wrt this procedure: The actual device address is not necessarily 192.168.1.20 as documented. The boot loader will use the address from the "ipaddr" U-Boot environment variable. Some(?) devices were manufactured with some other 192.168.1.xx address by default.

If you have an environment dump (e.g fw_printenv from the Unifi OS) from betore it failed, then you can look up the address there. You can also look it up if you have a backup of the mtd1 partitions. Just run "strings mtd1.backup" and look for "ipaddr=.192.168.1.xx".

Or you can just try different addresses until it succeeds. Start with xx=20 and increment until tftp works. Ping won't work. arp is the only reliable detection mechanism. But testing a tftp put is just as good.

My two U6 Lite's defaulted to

ipaddr=192.168.1.33
serverip=192.168.1.19

and

ipaddr=192.168.1.31
serverip=192.168.1.19

respectively.

Note that the tftp recovery will also reset the U-Boot environment, so these values will become

ipaddr=192.168.1.20
serverip=192.168.1.1

as documented after the first successful restore. Nice to know in case you need to do this more than once. Next time you can use 192.168.1.20 as documented.

Hi Bjorn

I followed these instructions, but forgot to downgrade the firmware beforehand. Once I'd realised my mistake I tried the factory downgrade instructions below and it went off for a reboot but has never come back. The PoE adapter has been checked as has the CAT5 - there are no LED lights either on the NIC or the actual ring on the AP never lights up.

I've tried pinging everything in that subnet and checked ARP too but nothing....

Is it just dead or could it still be alive but with no LEDs showing?

Thanks
Robin

...I've even tried Wireshark on the interface on my laptop and can't see any responses to my laptops ARPs or broadcasts.

Did you hold the reset button until the LED flashes white, blue, off?

Hi, yep had it pushed in for nearly a minute. No LEDs no matter what I do.