Ubiquiti NanoStation 2

This device is NOT RECOMMENDED for future use with OpenWrt due to low flash/ram.
DO NOT BUY DEVICES WITH 4MB FLASH / 32MB RAM if you intend to flash an up-to-date and secure OpenWrt version onto it! See 4/32 warning for details.

1) This device does not have sufficient resources (flash and/or RAM) to provide secure and reliable operation.
This means that even setting a password or changing simple network settings might not be possible any more, rendering the device effectively useless. See OpenWrt on 4/32 devices what you can do now.

2) OpenWrt support for this device has ended in 2022.
19.07.10 was the last official build for 4/32 devices.

NanoStation2, NanoStation Loco2, LiteStation 2 and PicoStation 2

The following devices are not NanoStations but these devices use the same image as well. They most probably require snapshot builds.

  • LiteStation 2 uses openwrt-atheros-ubnt2-squashfs.bin. Steps for flashing are the same as for NanoStation2.

Models of the Ubiquiti NanoStation family are quite similar to each other so the same images and instructions can be used for the listed devices.

Datasheets for all models are available from Ubiquiti.

Both NanoStation 2 and NanoStation 5 are supported by the OpenWrt AtherosPort. It is available as a pre-built image and can be built through buildroot.

The OpenWrt buildroot generates images that can be directly flashed to the NanoStation, usually with a name like openwrt-atheros-ubnt2-squashfs.bin (for the NS2 and Loco2).

When flashing those images, the Ubiquiti web interface will show a warning about unsupported third-party firmware. This warning can be ignored.

In order to upgrade from OpenWrt to a newer version, both the kernel mtd and filesystem mtd must be reflashed. The kernel is likely lzma compressed. If either mtd block isn't big enough, reflashing can not be completed through OpenWrt, but must be done through the RedBoot bootloader.

Recent versions of OpenWrt (8.09.2 and newer) support sysupgrade on this platform. To upgrade, put a combined firmware image into /tmp on the device and flash it using the sysupgrade command as outlined below.

cd /tmp
wget http://example.org/openwrt-atheros-combined.img
sysupgrade openwrt-atheros-combined.img

This can also be used to upgrade a device if you don't mind loosing your old config.


  • Ethernet cable connection between PC and NanoStation. A switched connection or a bridged connection seems to work fine.
  • Network settings of PC:
  • TFTP client on PC
  • NanoStation firmware file from Ubiquiti (not an OpenWrt image)


  1. Turn off the device
  2. Press the reset button
  3. Turn on the device
  4. Release the reset button ~10 seconds (but not longer) after turning the device on. You will know it's ready when the LEDs change.
  5. Ping If it works, you're ready to upload an image, if not, go back to step 1.
  6. tftp the image in binary mode to as 'flash_update'.
tftp> bin
tftp> put openwrt-atheros-ubnt5-squashfs.bin flash_update
Sent 1965199 bytes in 28.8 seconds
tftp> quit

or in Windows Dos prompt

tftp -i put openwrt-atheros-ubnt5-squashfs.bin flash_update

7. Signal LEDs might be blinking during the upgrade. On a Nano5L, the power lights go back and forth. 7. Wait ~7 minutes before restarting or until the power lights stop their back and forth blinking. 7. Restart. The device should be back to its old configuration (OpenWrt doesn't overwrite or modify the NVRAM settings).

8. telnet to and set a password with


To restore original firmware back you can't use mtd or sysupgrade but you have to use tftp method described above. (Note that the Nanostation will show up under if everything is done correctly)

First put Nanostation in recovery mode via reset button on power on, and then flash original flash image via tftp.

If wireless does not work with eg. backfire 10.03.1 prebuilt firmware, and you get (in dmesg) “wifi%d: ath_attach failed: -22”, then you may need to run the following script by Bill Moffitt. WARNING: This script might brick your router (but it worked for me, User:green, on a NanoStation Loco2).

# By Bill Moffitt - this script puts a zero in the 632nd byte of the appropriate device
date >>/etc/firstbootlog
echo "Starting regdomain-script.sh" >>/etc/firstbootlog
partn=`grep boardconfig /proc/mtd |awk '{print $1}' |cut -d: -f1`
byte=$(hexdump -b /dev/$partn |grep 0000270 |awk '{print $9}')
echo "Going to work on partition $partn where regdomain is $byte"
if [ $byte == "000" ]; then
   echo "success" >/tmp/regdomain_success
if [ $partn -a ! $byte == "000" ]; then
   echo "Setting up regdomain on partition /dev/$partn" >>/etc/firstbootlog
   dd if=/dev/$partn of=/tmp/mtdfile bs=1 count=631 && echo "got the first 631 bytes" >>/etc/firstbootlog
   dd if=/dev/zero bs=1 count=1 >>/tmp/mtdfile && echo "put in the zero" >>/etc/firstbootlog
   dd if=/dev/$partn bs=1 skip=632 >>/tmp/mtdfile && echo "got the rest of the file" >>/etc/firstbootlog
   mtd erase $partn && echo "erased the partition" >>/etc/firstbootlog
   dd if=/tmp/mtdfile of=/dev/$partn 2>>/etc/firstbootlog && echo "Finished flashing partition $partn" >>/etc/firstbootlog
   sync && echo "Sync succeeded" >>/etc/firstbootlog
   byte=$(hexdump -b /dev/$partn |grep 0000270 |awk '{print $9}')
   if [ $byte -eq "000" ]; then
      echo "regdomain is zero" >>/etc/firstbootlog
      sync &&
      rm /tmp/mtdfile
      date >>/etc/firstbootlog
      echo "done with regdomain" >>/etc/firstbootlog
      echo "success" >/tmp/regdomain_success
      echo "FAIL writing the file back to /dev/$partn - regdomain remains $byte"
   echo "Could not find partition" >>/etc/firstbootlog

The two internal antennas work more or less automatically, using the driver's “diversity” setting to choose the correct one. Using an external antenna requires manually setting a few things:

sysctl set dev.wifi0.softled 0
gpioctl 7 0

These can be added to an init file in /etc/rc.d and /etc/init.d

In recent OpenWrt versions (8.09.1+) the antenna setting is covered by the wireless configuration. The corresponding option is called antenna and should be set within the wifi-iface section.

uci set wireless.@wifi-iface[0].antenna=mode
uci commit wireless
Value (mode) Description
vertical Use internal antenna with vertical polarization
horizontal Use internal antenna with horizontal polarization
external Use external antenna port

Some photos on this page © Matt Westervelt and available for use under a Creative Commons license for non-commercial works.

Instruction set MIPS
Vendor Qualcomm Atheros
bootloader redboot
System-On-Chip Atheros AR2315
CPU @Frq MIPS 4Kc @180MHz
Flash size 4 MiB
Flash Chip ST 25P32V6P
RAM size 16 MiB
RAM Chip ISSI IS42S1680A-7TL / SDR-100
Wireless SoC-integrated: Atheros 802.11b/g (400mW)
Ethernet 1 port connected to the CPU
Power passive POE (pairs 4,5+; 7,8 return) 12 to 24 VDC (POE injector included in the package)
Serial Yes

This device is an integrated wifi spot designed to be used outdoor. With Ubiquiti Firmware, AirOS 3 actually, it can act as station, station WDS, client, client wds... There is a dual patch antenna system able to work in vertical or horizontal polarity, or to send RF to an external RP-SMA female or SMA female connector (depending of date of manufacturing) - This feature is software selectable with AirOS.


  • The Nanostation comes with a 12V power supply, the internal DC-Converter seems to be realized with a AP1510 PWM Control 3A Step-Down Converter. This can handle up to 23V. (untested)

also, hardware partically compatibility with TP-Link TL-WA5210G

There are two screws under the label on the back. The newer M2 and M5 versions have just one screw under the label and two plastic pins that can be lifted out of their holes by pushing a plastic cable tie end next to them. After removing these, the board can be removed.


NanoStation Loco 2:
Nanostation Loco 2 serial

LiteStation 2:
Litestation 2 serial

pin 1 - vcc
pin 3 - RX
pin 7 - TX
pin 9 - gnd

(9600 8n1)
RedBoot> fconfig
Local IP address:
Local IP address mask:
$ echo -e "\0377\0364\0377\0375\0006" > break
$ nc -vvv 9000 < break ; telnet 9000
pin 1 - TRST  pin 2 - GND
pin 3 - TDI   pin 4 - GND 
pin 5 - TDO   pin 6 - GND
pin 7 - TMS   pin 8 - 3V3
pin 9 - TCK   pin 10 - COLD_RST
Do note that the 10 pin headers used for both JTAG and Serial have a hart-to-hart pin distance, 'pitch', of 2 mm.
Not the common 1/10" / 2.54 mm.


+Ethernet eth0: MAC address 00:15:6d:a8:b9:c2 IP:, Gateway: Default server: RedBoot(tm) bootstrap and debug environment [ROMRAM] Ubiquiti Networks certified release, version 0.9.00483.1103151313 - built 13:14:44, Mar 15 2011 Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc. Board: Ubiquiti Ubiquiti AR2315/6/7/8 based board (Ubiquiti NanoStation2 detected) Arch: ar2316 RAM: 0x80000000-0x81000000, [0x80040b80-0x80fe1000] available Flash: 0xbfc00000-0xbfff0000, in 64 blocks of 0x00010000 bytes each == Executing boot script in 1.000 seconds - enter ^C to abort RedBoot> cache off RedBoot> fis load -d -e kernel Trying LZMA decompression... Image loaded from 0x80041000-0x801df25c Entry point: 0x80196040, address range: 0x80042000-0x801bf000 RedBoot> go [ 0.000000] CPU revision is: 00019064 [ 0.000000] Primary instruction cache 16kB, physically tagged, 4-way, linesize 16 bytes. [ 0.000000] Primary data cache 16kB 4-way, linesize 16 bytes. [ 0.000000] Linux version 2.4.27-ubnt0 (buildd@builder) (gcc version 3.3.3) #2 Thu Mar 28 10:55:48 EET 2013 [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 01000000 @ 00000000 (usable) [ 0.000000] On node 0 totalpages: 4096 [ 0.000000] zone(0): 4096 pages. [ 0.000000] zone(1): 0 pages. [ 0.000000] zone(2): 0 pages. [ 0.000000] Kernel command line: console=ttyS0,9600 console=ttyS0,9600 root=/dev/mtdblock2 rootfstype=squashfs init=/linuxrc ro [ 0.000000] Using 92.000 MHz high precision timer. [ 0.010000] Calibrating delay loop... 181.45 BogoMIPS [ 0.290000] Memory: 14228k/16384k available (1351k kernel code, 2156k reserved, 88k data, 68k init, 0k highmem) [ 0.410000] Dentry cache hash table entries: 2048 (order: 2, 16384 bytes) [ 0.490000] Inode cache hash table entries: 1024 (order: 1, 8192 bytes) [ 0.570000] Mount cache hash table entries: 512 (order: 0, 4096 bytes) [ 0.650000] Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.730000] Page-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.810000] Checking for 'wait' instruction... unavailable. [ 0.870000] POSIX conformance testing by UNIFIX [ 0.930000] Linux NET4.0 for Linux 2.4 [ 0.970000] Based upon Swansea University Computer Society NET3.039 [ 1.050000] Initializing RT netlink socket [ 1.100000] Starting kswapd [ 1.130000] Squashfs 2.2-r2 (released 2005/09/08) (C) 2002-2005 Phillip Lougher [ 1.220000] pty: 256 Unix98 ptys configured [ 1.270000] Serial driver version 5.05c (2001-07-08) with no serial options enabled [ 1.360000] ttyS00 at 0xb1100003 (irq = 37) is a 16550A [ 1.430000] PPP generic driver version 2.4.2 [ 1.480000] PPP Deflate Compression module registered [ 1.540000] MPPE/MPPC encryption/compression module registered [ 1.610000] spiflash: JEDEC compatible device detected (Manufacturer: 0x20; device: 0x2016) [ 1.710000] mtd: adjusted dev mtd2 size from 61440 to 65536 bytes [ 1.790000] Creating 8 MTD partitions on "spiflash": [ 1.850000] 0x00000000-0x00030000 : "RedBoot" [ 1.900000] 0x00030000-0x00100000 : "kernel" [ 1.950000] 0x00100000-0x003c0000 : "cramfs" [ 2.000000] 0x003c0000-0x003e0000 : "cfg" [ 2.050000] 0x003e0000-0x003f0000 : "FIS directory" [ 2.110000] 0x003ef000-0x003f0000 : "RedBoot config" [ 2.170000] mtd: partition "RedBoot config" doesn't start on an erase block boundary -- force read-only [ 2.280000] 0x003f0000-0x00400000 : "EEPROM" [ 2.330000] 0x00030000-0x003e0000 : "Working flash" [ 2.390000] Initializing Cryptographic API [ 2.440000] NET4: Linux TCP/IP 1.0 for NET4.0 [ 2.490000] IP: routing cache hash table of 512 buckets, 4Kbytes [ 2.560000] TCP: Hash tables configured (established 1024 bind 2048) [ 2.640000] IPv4 over IPv4 tunneling driver [ 2.690000] GRE over IPv4 tunneling driver [ 2.740000] Linux IP multicast router 0.06 plus PIM-SM [ 2.800000] NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. [ 2.870000] Ebtables v2.0 registered [ 2.910000] NET4: Ethernet Bridge 008 for NET4.0 [ 2.970000] Bridge firewalling registered [ 3.020000] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com> [ 3.100000] All bugs added by David S. Miller <davem@redhat.com> [ 3.180000] VFS: Mounted root (squashfs filesystem) readonly. [ 3.250000] Freeing unused kernel memory: 68k freed [ 3.310000] Warning: unable to open an initial console. [ 3.760000] Algorithmics/MIPS FPU Emulator v1.5 UBNT login: ubnt Password: Mar 28 10:58:13 login[297]: root login on `ttyS0' BusyBox v1.01 (2013.03.28-08:56+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. XS2.ar2316.v4.0.3.5058.130328.1054# cat /proc/cpuinfo system type : Atheros AR5315 processor : 0 cpu model : unknown V6.4 BogoMIPS : 181.45 wait instruction : no microsecond timers : yes tlb_entries : 16 extra interrupt vector : yes hardware watchpoint : no VCED exceptions : not available VCEI exceptions : not available XS2.ar2316.v4.0.3.5058.130328.1054#

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2024/02/12 08:58
  • by