- As refered, it could be impossible to install OpenWrt/LEDE on UAP-v2 devices.

Upgrading OpenWrt

If you have already installed OpenWrt and like to reflash for e.g. upgrading to a new OpenWrt version you can upgrade using the sysupgrade command line tool. It is important that you put the firmware image into the ramdisk (/tmp) before you start flashing.

Serial

JTAG

How to connect to JTAG interface, and how to reflash the device with JTAG tools
See port.jtag for more JTAG details.
The USBJTAG NT also supports read, write, erase, debrick, etc. You can use the WRT160NL config, or download the specific device config from this forum post.

Photos

Specific Configuration

The UniFi ap has 2 leds, the orange one can be configured adding something like:

Network configuration (Unifi as standalone wireless Router)

This is a working standalone router setup, working as of 17.01.4.
The old version used a trick with bridging a nonexistent interface (eth1) for no real reason, and it didn't work for me. Instead, I just set the wlan0 interface to be the lan network and everything worked perfectly. This is a working configuration that should be default, in easily pasteable form:

uci set network.loopback=interface
uci set network.loopback.ifname='lo'
uci set network.loopback.proto='static'
uci set network.loopback.ipaddr='127.0.0.1'
uci set network.loopback.netmask='255.0.0.0'
uci set network.lan=interface
uci set network.lan.proto='static'
uci set network.lan.ipaddr='192.168.1.1'
uci set network.lan.netmask='255.255.255.0'
uci set network.lan.ip6assign='60'
uci set network.wan=interface
uci set network.wan.proto='dhcp'
uci set network.wan.ifname='eth0'
uci set network.wan6=interface
uci set network.wan6.proto='dhcpv6'
uci set network.wan6.ifname='eth0'
uci set network.wan6.reqaddress='try'
uci set network.wan6.reqprefix='auto'
uci set wireless.radio0=wifi-device
uci set wireless.radio0.type='mac80211'
uci set wireless.radio0.channel='11'
uci set wireless.radio0.hwmode='11g'
uci set wireless.radio0.path='pci0000:00/0000:00:00.0'
uci set wireless.radio0.htmode='HT20'
uci set wireless.radio0.distance='20'
uci set wireless.default_radio0=wifi-iface
uci set wireless.default_radio0.device='radio0'
uci set wireless.default_radio0.network='lan'
uci set wireless.default_radio0.mode='ap'
uci set wireless.default_radio0.ssid='OpenWRT'
uci set wireless.default_radio0.encryption='open'
uci commit
/etc/init.d/network reload

OLD: Network configuration (Unifi as standalone wireless Router)

The UniFi has only the single ethernet port, so much of the OpenWrt documentation is a little confusing. Most of the documentation is written with the idea of routers which have a WAN port, a LAN wired switch and the WLAN wireless. Clearly the Unifi doesn't have the wired LAN switch.

After flashing (I found r41163 worked while the 12.09 version had the XM problem discussed above and editing the characters 4-6 didn't fix it) I was able to connect via wired ethernet as described in FirstLogin (i.e. there is a DHCP server handing out IPs in the 192.168.1.X subnet, running on the ethernet port).

After changing the password and exiting, I had to wait a while (60 secs?) until I could ssh back into the box. That was strange because I thought I'd lost networking … I think that is due to a long-running first time ssh key generation. Even so, each ssh in takes a long time to respond (something about recent versions of dropbear taking a long time to setup a session key). I found LUCI not installed, so I had to work to get internet access on the box before I could use that.

Once ssh'd into the box I followed these steps:
1. Enable wireless, using commands at top of the UCI wireless config page. This enables the radio. The radio is bridged to the lan network.
2. Connect to the wireless network, disconnect the wired from your computer, and ensure that you can ssh in via the wifi.
3. Swap eth0 and eth1 between lan and wan. The default configuration has the ethernet port on the lan network. But if you are going to plug the Unifi into a cable modem (for example) to use it as a router, then you want the ethernet port to be the wan network (and to seek a dhcp assigned address). I edited the /etc/config/wireless file changing etho in the lan section to eth1, and eth0 in the wan section to eth1. Quite honestly I'm not sure that this is perfect (since there isn't an eth1 on the Unifi, but it worked for me).
4. Restart networking (/etc/inid.d/networking restart)
5. Connect the ethernet lan on the PoE injector to the cable modem. Remember nonsense about having cable modem off for 20 seconds or so to give out an IP to a new MAC address.
6. Connect back to the OpenWrt Wifi.
7. ping google.com. yay.

At this point things are working with NAT routing between the lan and the wan.

Network configuration (DHCP Client and static IP)

In a situation where you'd just like to drop the AP in an existing network, it might be handy to use DHCP. However, how do you figure which IP the AP is using… Below config allows you to use a DHCP assigned IP and still keep an extra IP address (192.168.254.1) you can use to directly connect over the ethernet port.

Your usual 'ifconfig -a' will not show this 2nd IP. Yes, this very confusing and is caused due to a limitation of Busybox. You'll have to use the 'ip' command which you can install using 'opkg install ip'.

Putting Unifi into failsafe mode & TFTP Recovery/Upgrade

Before starting, set a static IP on your PC's NIC from 192.168.1.0/24 range, but not 192.168.1.20 (this is the Unifi AP default TFTPIP).

Follow the steps to unbrick your UAP:

Set the IP on your PC to be able to access the bricked unit and prepare the firmware file.

On your PC, open your TFTP client and locate the firmware.bin file so you can start it later. Do not initiate the transfer. (You may use a stock Ubiquiti firmware or applicable OpenWrt firmware as mentioned above)

Using the Windows integrated TFTP client (or the client of your choice) the command to prepare is: “tftp -i 192.168.1.20 PUT [path to file]\firmware.bin” for stock or “tftp -i 192.168.1.20 PUT [path to file]\openwrt-ar71xx-generic-ubnt-unifi-squashfs-factory.bin” for OpenWrt. Do not start the transfer until following steps below.

Unplug the bricked unit.

Plug the LAN connection of the PoE injector directly to your PC's NIC.

Keep the UniFi AP's reset button depressed and plug in network/PoE in the unit.

Keep the reset button depressed until you see the light cycling relatively fast through amber/green/off colors (~14 seconds from power on) → Release it. Now the device is in TFTP transfer mode. The AP will not respond to pings in this mode but will accept a TFTP file transfer

Engage the TFTP push command and wait. The device will write the firmware and it will reboot.

If you wait too long to start the TFTP transfer, the push will not work as the device will stall. Please redo from step 3.

At this point your device should be recovered and ready to go. If it is still not functioning as expected then you will need to send for RMA (if under warranty).