Monday, 8 February 2016

Ubiquiti UniFi AP - Restoring to Original Firmware

The process of resetting the UAP is as follows

Please download the following software before you start this guide - http://kin.klever.net/dist/pumpkin-2.7.3.exe

  1. Unplug the ethernet from the Unifi AP
  2. Press and hold in a paper-clip or other object in to the Reset hole (next to the Ethernet plug) on the AP. Make sure you can feel it pushed in.
  3. Plug the Ethernet cable back in whilst still keeping the reset button held in.
  4. After around 25 seconds the light on the Unifi will go between flashing orange then green, orange then green etc. This means the AP is in upgrade mode.
  5. Set your PC's network IP address to 192.168.1.25, subnet is 255.255.255.0 and gateway is 192.168.1.20 (you might wish to do this in preparation)
  6. Plug the LAN cable from the Unifi POE adapter in to your PC.
  7. Open the TFTP application (in this instance we're using the Pumpkin software as an example) and click on "Put File". In "Local file" choose your original firmware file. In the "Remote host" field enter 192.168.1.20 - then click OK. 
  8. You should now have some indication of the file being transferred )in Pumpkin you'd see the numbers going up as the file is transferred).
  9. The firmware on your AP will be upgraded and the device will automatically reboot back to original settings.
  10. Re-connect the LAN cable from the Unifi POE adapter in to your broadband router.
  11. Remember to set your PC's network IP back to what it was before (DHCP etc).


OSX should have a built in command line version of TFTP that you might use from terminal, the process of the last instructions are essentially the same in terms of getting the UAP into 'upgrade mode' to enable you to TFTP back in the Ubiquiti firmware - rather than using Pumkin to initiate TFTP you'll want to get yourself to a point where you can execute a few lines in the MAC Terminal window, to provide the 

  • First, put the original UAP firmware in your user folder (/Users/yourusername/).
  • In System Preferences and Network, set your Apple PC's network IP address to 192.168.1.25, subnet is 255.255.255.0 and gateway is 192.168.1.20 (which you might wish to do this in preparation)
  • Copy & paste the following text into a text editor:

    connect 192.168.1.20
    binary
    rexmt 1
    timeout 60
    put firmware.bin

  • In that last line change firmware.bin to the name of the firmware file, which you just moved to your user folder. Copy (Cmd+c) this text to your clipboard - be sure to include a line break after the last line.
  • Now open Applications > Utilities > Terminal. and type:
    tftp
  • A "tftp>" command prompt will appear. 
  • At this point you're ready to reset the UAP and connect it to your Apple PC, while it's in 'upgrade mode', so to initiate the tftp transfer...
  • On the tftp command line in Terminal, paste (Cmd+v) the text you copied. Since you copied the line break at the end, tftp will execute the command at the moment you paste it. Depending on your router, you may have to paste it multiple times to get the timing right. If all is well, you'll see something like this:

    tftp> connect 192.168.1.20 
    tftp> binary 
    tftp> rexmt 1 
    tftp> timeout 60 
    tftp> put firmware.bin
    Sent x bytes in x seconds

Alternatively you might try another third party software