LEDE firmware for Sitecom Wireless Router N300 X2 (WLR-2100 v2)
Proceed with caution
Using and flashing a custom firmware is a very delicate process. You might damage your device, so proceed with care! Use this guide and firmware at your own risk. Neither LEDE nor I can be held responsible for causing damage to your router.
Software and hardware prerequisites
Listed are the required software and hardware with examples.
-
Serial terminal. Use
minicom
(Linux), PuTTY (Windows), or other preferred software. -
SSH client. Use
ssh
(Linux), PuTTY (Windows), or other preferred software. -
SCP client. Use
scp
(Linux), WinSCP (Windows), or other preferred software. -
TFTP server. Use
tftpd
(Linux), Tftpd32 (Windows), or other preferred software. -
Hex editor. Use
dhex
(Linux), or HxD (Windows), or other preferred software. - USB TTL converter. FTDI FT232RL based boards are good and cheap USB TTL converters (€1.50 on your favorite China webshop).
- Soldering iron and supplies. Basic set of supplies such as soldering wire, jumper wires, flux, litze and pin headers.
Flashing instructions
This manual assumes you have basic knowledge on how to use the basic software and hardware prerequisites. It is written using the listed Linux software on a Ubuntu desktop. Windows users are able to do the same, albeit using another procedure.
Serial communication with the router is required in order to flash the firmware. You will need some soldering skills in order to access the serial interface. With the serial interface available, we can start modifying the routers software.
If you're running this firmware for the first time, you'll need to create a back up of the routers flash memory. Subsequently, a copy of the back up will be used to modify the ART partition to store the routers WAN MAC address. The ART partition is then flashed back to the router.
When the back ups are created and the MAC address set, download the firmware of your choice and we can start flashing the firmware.
Serial interface
Open the case by removing the five screws. There are four screws located in each corner at the bottom of the device. A fifth screw is located under the sticker.
A serial interface is available at the J4 mark on the PCB. No pin header is available, so you might want to solder pin headers on the PCB. Remove the solder from the holes using litze wire or other desoldering techniques. If not possible, use a 0.8 mm drill.
- Pin 1: Vcc (NC, marked with arrow)
- Pin 2: GND
- Pin 3: TxD
- Pin 4: RxD
Connect the pins to your USB TTL converter. Do not connect Vcc. Only connect GND, TxD and TxR.
Note that the router's TxD and TxR are connected to TxR and TxD of your USB TTL converter respectively.
Now connect the USB TTL to your computer and find out on which COM port the USB TTL converter is available. Use your serial terminal software to connect to this COM port using following settings for serial communication with the router:
- Baud Rate: 115200
- Data Bits: 8
- Stop Bits: 1
- Parity: None
- Handshake: None
Download the firmware
Visit my OneDrive to download precompiled binaries (tip: use listview to navigate). Use initramfs binaries to run LEDE from the RAM. This comes in handy for making a backup when the router is running stock firmware. Use sysupgrade binaries to flash LEDE.
Additional builds are also available:
- sysupgrade-luci: Default LEDE build for the WLR-2100 v2 with LuCI (web GUI) precompiled.
- sysupgrade-strongswan: Custom LEDE build for the WLR-2100 v2 with StrongSwan (IPsec VPN server) precompiled.
Back up flash memory
This manual is written using the listed Linux software on a Ubuntu desktop. Windows users are able to do the same, albeit using another procedure.
The flash memory contains essential data necessary for the router to work. This includes the firmware, but also the bootloader, the bootloader settings, and the router's calibration data (ART). These are not included in the (OEM) firmware images. You should back up this data in case you want to restore the original firmware, or when flashing went wrong.
- Set up a TFTP server with static IP address
192.168.1.101
. Make sure the router can communicate with the TFTP server. - Download a initramfs firmware, rename the firmware to
ap.bin
and make sure the TFTP server can serveap.bin
to your router. - Set up a serial connection with the router, ready to send and receive serial data.
- Power on your router, and load system code to the SDRAM via TFTP by tapping
1
while booting.
Please choose the operation:
1: Load system code to SDRAM via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
You choosed 1
- The router should automatically trying to download
ap.bin
from the TFTP server. If everything is set up correctly, LEDE should now boot. - Use SSH to access the router's console. Use username
root
and IP address192.168.1.1
.
foo@bar:~$ ssh root@192.168.1.1
- List all partitions with
cat
.
root@lede:~# cat /proc/partitions
major minor #blocks name
31 0 192 mtdblock0
31 1 64 mtdblock1
31 2 3776 mtdblock2
31 3 1344 mtdblock3
31 4 2432 mtdblock4
31 5 576 mtdblock5
31 6 64 mtdblock6
- Create a backup of
mtdblock0
(bootloader),mtdblock1
(bootloader configuration),mtdblock2
(firmware), andmtdblock6
(ART) by redirecting the output ofcat
. Transfer them to your computer withscp
. Replace<n>
with the block number, and replace<local path>
with a writable local directory of your choosing (e.g.~/Desktop
for your desktop on Ubuntu). Note that thescp
command is executed within a desktop terminal, and not in the router's console.
root@lede:~# cat /dev/mtdblock<n> > /tmp/mtdblock<n>_backup
foo@bar:~$ scp root@192.168.1.1:/tmp/mtdblock<n>_backup <local path>
root@lede:~# rm /tmp/mtdblock<n>_backup
- When done correctly, you now have a copy of
mtdblock0
,mtdblock1
,mtdblock2
, andmtdblock6
on your computer. Save these files to restore your router when needed.
Set MAC address in flash memory
Before we can use LEDE, we need to write some MAC addresses to the flash memory. Many Atheros based routers store their MAC address on the ART partition. However, the WLR-2100 v2 stores its MAC addresses in the bootloader configuration and passes the MAC addresses as kernel boot argument. This section describes modifying the ART partition to store the MAC addresses.
- Set up a TFTP server with static IP address
192.168.1.101
. Make sure the router can communicate with the TFTP server. - Power on your router, and enter the boot command line interface by tapping
4
while booting.
Please choose the operation:
1: Load system code to SDRAM via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
You choosed 4
- Press any key to prevent auto booting the currently flashed firmware.
4: System Enter Boot Command Line Interface.
U-Boot 1.0.1 (Mar 14 2012 - 16:09:18)
Hit any key to stop autoboot: 0
ar7240>
- Skip to step 6 if you already have a MAC address. Use
md
to read a piece of bootloader configuration stored in the flash memory.
ar7240> md.b 0x9f030000 0x400
- Write down your MAC address. It is defined by
ethaddr
in the output of themd
command. The MAC address isA0:12:34:56:78:9B
in the following example:
9f0300d0: 32 30 30 00 65 74 68 61 64 64 72 3d 22 41 30 3a 200.ethaddr="A0:
9f0300e0: 31 32 3a 33 34 3a 35 36 3a 37 38 3a 39 42 22 00 12:34:56:78:9B".
- Now switch over to your desktop computer. Use a hex editor to modify a copy of your ART backup (
mtdblock6
). Offset0x0
to0xFFF
should be padded withff
(empty) when doing this for the first time. Add your MAC address twice written in hex at the beginning (at offset0x0
). Add or subtract0x1
for the second MAC address, whatever is appropriate. Do not use the colon character. In our example withA0:12:34:56:78:9B
you should write downa0 12 34 56 78 9b
anda0 12 34 56 78 9c
(9b
becomes9c
when by adding0x1
) as hex:
0: a0 12 34 56 78 9b a0 12 34 56 78 9c ff ff ff ff ..4Vx...4Vx.....
10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
- Save your modified ART image, and make sure the TFTP server can serve this modified ART image to your router. Now switch back to your router.
-
Verify the flash memory sector addresses with
flinfo
. The first sector should have address9F000000
and the last sector should have address9F3F0000
. Sectors9F000000
,9F010000
,9F020000
and9F030000
contains the bootloader and bootloader configuration. Sectors from9F040000
to9F3E0000
can be used to store the firmware. Sector9F3F0000
contains the router's calibration data (ART). Do not proceed when your addresses differ!
ar7240> flinfo
Bank # 1: Size: 4 MB in 64 Sectors
Sector Start Addresses:
9F000000 9F010000 9F020000 9F030000 9F040000
9F050000 9F060000 9F070000 9F080000 9F090000
9F0A0000 9F0B0000 9F0C0000 9F0D0000 9F0E0000
9F0F0000 9F100000 9F110000 9F120000 9F130000
9F140000 9F150000 9F160000 9F170000 9F180000
9F190000 9F1A0000 9F1B0000 9F1C0000 9F1D0000
9F1E0000 9F1F0000 9F200000 9F210000 9F220000
9F230000 9F240000 9F250000 9F260000 9F270000
9F280000 9F290000 9F2A0000 9F2B0000 9F2C0000
9F2D0000 9F2E0000 9F2F0000 9F300000 9F310000
9F320000 9F330000 9F340000 9F350000 9F360000
9F370000 9F380000 9F390000 9F3A0000 9F3B0000
9F3C0000 9F3D0000 9F3E0000 9F3F0000
- Load the ART image into the RAM of the router with
tftpboot
. Replace<filename>
with the filename of the ART image.
ar7240> tftpboot 0x80800000 <filename>
- Erase all data in sector
9F3F0000
witherase
.
ar7240> erase 0x9f3f0000 +0x10000
- Write the loaded ART image to the flash memory with
cp
.
ar7240> cp.b 0x80800000 0x9f3f0000 0x10000
- Your ART partition is now set up. Reboot your device now.
Flashing the LEDE firmware
Proceed with caution. This section describes actions that might damage your device or firmware!
- Set up a TFTP server with static IP address
192.168.1.101
. Make sure the router can communicate with the TFTP server. - Download a sysupgrade firmware, and make sure the TFTP server can serve firmware to your router.
- Set up a serial connection with the router, ready to send and receive serial data.
- Power on your router, and enter the boot command line interface by tapping
4
while booting.
Please choose the operation:
1: Load system code to SDRAM via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
You choosed 4
- Press any key to prevent auto booting the currently flashed firmware.
4: System Enter Boot Command Line Interface.
U-Boot 1.0.1 (Mar 14 2012 - 16:09:18)
Hit any key to stop autoboot: 0
ar7240>
-
Verify the flash memory sector addresses with
flinfo
. Do not proceed when your addresses differ! - Load the firmware into the RAM of the router with
tftpboot
. Replace<filename>
with the filename of the firmware (e.g.lede-ar71xx-generic-wlr2100v2-squashfs-<version>.bin
).
ar7240> tftpboot 0x80800000 <filename>
- Write down the hex value of the number of bytes transferred. This number might differ, depending on the firmware version. It may never exceed 0x3B0000 (3866624). The hex value is equal to
0x360004
in the following example:
Bytes transferred = 3538948 (360004 hex)
- Erase all data in sectors
9F040000
to9F3E0000
witherase
.
ar7240> erase 0x9f040000 +0x3b0000
- Write the loaded firmware to the flash memory with
cp
. Replace<bytes transferred>
with the hex value that you have written down. Do not forget hex strings always starts with0x
.
ar7240> cp.b 0x80800000 0x9f040000 0x<bytes transferred>
- Flashing is now complete. Reboot your device now.
Personal experience with the LEDE firmware
I acquired this router when replacing some network components with some fine Ubiquiti hardware. In terms of stability, the WLR-2100 v2 was utterly shit running on stock firmware. The router needed multiple reboots per month (WiFi issues and stability problems at high load). Using the LEDE firmware gave this router a second life, getting the maximum performance with good reliability. I had no stability or WiFI issues, or the need to reboot the router the past 6 months using my 0.4 build of the LEDE firmware.