TL;DR: You can build your own firmware based on LibreRouterOS (a fork of OpenWrt), or use any current release of OpenWrt from 19.07 but without dual boot support – read the instructions carefully before using OpenWrt or other non-LibreRouterOs firmware! Otherwise you might brick your LibreRouter, or need a serial cable to fix it.
The LibreRouter is an open source hardware device that runs open source software. You can use it for whatever use you imagine, and as such, you can install your own firmware on it.
LibreRouter comes from the factory with LibreRouterOs firmware, a packaged version of LibreMesh with up-to-date support for the hardware features of the LibreRouter.
LibreRouter hardware support has already been merged with upstream OpenWrt (see the merge commit or the tech data) so you can use any current release of OpenWrt from 19.07.0 or later, but at the moment there is no dual-boot support in OpenWrt so read the instructions below before you install OpenWrt or other non-LibreRouterOs firmware, as partitions may get corrupted and a serial cable will be needed to recover.
You will still find the recommended implementation of its support in LibreRouterOs, that will be kept updated as best as we can.
How to change from LibreRouterOs to OpenWrt
IMPORTANT: LimeApp offers a way to upload firmware files to the LibreRouter. This only works for LibreRouterOs firmware files. The upgrade will fail if you use an OpenWrt firmware file.
Assumptions: the LibreRouter is connected to the internet, and your computer is connected via cable to the LibreRouter LAN port (the one closer to the USB ports). These instructions use the default OpenWrt image, which has WiFi and ssh
disabled by default, so after installing OpenWrt you must connect via cable and go to http://192.168.1.1 to configure the router using the LuCI graphical interface.
Note about partitions and firmware size: The LibreRouter uses two partitions, alternating between them with each upgrade in order to maintain always a known-working firmware in one of the partitions. OpenWrt does not work this way, and must be installed to partition 1. Therefore, the upgrade process depends on which partition LibreRouterOs is currently running on: partition 1 or partition 2. The LibreRouter’s total storage space is 16 MB, therefore the dual-partition method means that the firmware image must be smaller than 8 MB.
Part 1
- From your computer (assuming you are using a Linux shell):
ssh root@thisnode.info
Part 2
The rest of the instructions are run in the LibreRouter shell.
DOWNLOAD_LINK="http://downloads.openwrt.org/releases/19.07.3/targets/ath79/generic/openwrt-19.07.3-ath79-generic-librerouter_librerouter-v1-squashfs-sysupgrade.bin"; SHA256SUMS="https://downloads.openwrt.org/releases/19.07.3/targets/ath79/generic/sha256sums"
-
cd /tmp;wget $DOWNLOAD_LINK;wget $SHA256SUMS;sha256sum -c sha256sums 2>/dev/null|grep OK
2.1. In the screen output, look for the correct checksum verification:FILE_NAME: OK
2.2. If that message does not appear, it means the firmware file did not download correctly, do not continue! Otherwise, continue. - To know what partition is currently in use, run
safe-upgrade show
and check thecurrent partition
value.
3.1. If thecurrent partition
is 1, use:sysupgrade -n /tmp/*.bin
. It may give an “invalid image” error. If you are very sure that you have a LibreRouter image, then you can add--force
to thesysupgrade
command. Wait until the router comes back online, at least 5 minutes. WARNING: do not turn off the router until the upgrade finishes!
3.2. If thecurrent partition
is 2, use:safe-upgrade upgrade -n /tmp/*.bin
. Thenreboot
. After the reboot, if the system is working fine, you have to confirm that the upgrade worked in order to keep it. To do this, runfw_setenv stable_part 1
.
[to do: expand this section with other options for: get/build the firmware, put the firmware in /tmp [wget, scp (useful when we download the firmware and then take it to a LibreRouter that is not connected to the internet), failsafe mode, UART], install the firmware [sysupgrade, failsafe]. Include information about wifi-unstuck-wa.]
How to change from OpenWrt to LibreRouterOs
Assumptions: We have a LibreRouter with OpenWrt installed on partition 1, with the LAN IP address 192.168.1.1, and we are using a GNU/Linux computer connected to the LibreRouter via cable to the LAN port (the port closer to the USB ports).
Method 1 - via the LuCI graphical web interface
(based on [OpenWrt Wiki] Upgrading OpenWrt firmware using LuCI and CLI)
- Download this file to your computer: http://repo.libremesh.org/librerouteros/v1.2/targets/ar71xx/generic/openwrt-ar71xx-generic-librerouter-v1-squashfs-sysupgrade.bin.
- Go to the LibreRouter’s web interface at http://192.168.1.1 and login.
- Navigate to LuCI → System → Backup / Flash Firmware → Actions: Flash new firmware image .
- Click Choose File button to select firmware image.
- Click Flash image… to upload firmware image.
- Verify firmware image checksum and proceed. The correct checksums are at http://repo.libremesh.org/librerouteros/v1.2/targets/ar71xx/generic/sha256sums.
- Wait until the router comes back online. The address for the local router in LibreRouterOs is http://thisnode.info or you can use
ssh root@thisnode.info
.
Method 2 - via SSH command line
Note: this will only work if you have enabled SSH access in OpenWrt.
- Open a terminal / shell / console on your computer and run
ssh root@192.168.1.1
and respond to any prompts regarding fingerprints or passwords. - Run the rest of these instructions in the shell you have just logged into on the LibreRouter.
DOWNLOAD_LINK="http://repo.libremesh.org/librerouteros/v1.2/targets/ar71xx/generic/openwrt-ar71xx-generic-librerouter-v1-squashfs-sysupgrade.bin"; SHA256SUMS="http://repo.libremesh.org/librerouteros/v1.2/targets/ar71xx/generic/sha256sums"
-
cd /tmp;wget $DOWNLOAD_LINK;wget $SHA256SUMS;sha256sum -c sha256sums 2>/dev/null|grep OK
4.1. In the screen output, look for the correct checksum verification:FILE_NAME: OK
4.2. If that message does not appear, it means the firmware file did not download correctly, do not continue! Otherwise, continue. sysupgrade -n /tmp/*.bin
- Wait until the router comes back online, at least 5 minutes. WARNING: do not turn off the router until the upgrade finishes! The address for the local router in LibreRouterOs is http://thisnode.info or you can use
ssh root@thisnode.info
.
Related OpenWrt documentation
- Sysupgrade (links to all other docs listed below).
- Upgrading OpenWrt firmware via LuCI and CLI
- Upgrading OpenWrt firmware via CLI
- Sysupgrade – Technical Reference
- Upgrading OpenWrt via web interface
Projects using custom firmware on the LibreRouter
- NuestraRed - a community network organization in Colombia, with documentation in Spanish. Their firmware is based on LibreRouterOS. See also the comment below.