Know that the controller and the UAP's should have had first contact into the same network!
It is here that you config the network settings into your UAP's.
After adoptation the controller uploads these network settings back into the UAP's.
$ syswrapper.sh restore-default
The Unifi Access point will reset and reboot. It might get another IP address, so if you cannot connect to it again, check the DHCP server status info. Or connect the network cable of the AP into the same subnet as the controller.
Login into the AP on the new IP address with SSH.
This time you should use the factory default username and password:
ubnt:ubnt
Once in the AP give the Inform command, so the Controller knows where the AP is and can push the settings to the AP:
$ set-inform http://controller_ip:8080/inform
You should now see the Unifi Access Point in the controller ready to be adopted.
I call this the last resort, because you need to remove the access point from the wall or ceiling. But the network cable must stay connected, due to the power-over-ethernet.
On the back of the UAP there is a small hole whereby a user can use a paperclip to depress a button and reset the UAP back to its factory default settings. (The location of the reset button might vary on different UAP models)