Can I put my own firmware on it?

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

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.

  1. 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"
  2. 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.
  3. To know what partition is currently in use, run safe-upgrade show and check the current partition value.
    3.1. If the current 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 the sysupgrade 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 the current partition is 2, use: safe-upgrade upgrade -n /tmp/*.bin . Then reboot. 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, run fw_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 https://openwrt.org/docs/guide-user/installation/generic.sysupgrade#web_interface)

  1. Download this file to your computer: http://repo.libremesh.org/librerouteros/v1.2/targets/ar71xx/generic/openwrt-ar71xx-generic-librerouter-v1-squashfs-sysupgrade.bin.
  2. Go to the LibreRouter’s web interface at http://192.168.1.1 and login.
  3. Navigate to LuCI → System → Backup / Flash Firmware → Actions: Flash new firmware image .
  4. Click Choose File button to select firmware image.
  5. Click Flash image… to upload firmware image.
  6. Verify firmware image checksum and proceed. The correct checksums are at http://repo.libremesh.org/librerouteros/v1.2/targets/ar71xx/generic/sha256sums.
  7. 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.

  1. 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.
  2. Run the rest of these instructions in the shell you have just logged into on the LibreRouter.
  3. 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"
  4. 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.
  5. sysupgrade -n /tmp/*.bin
  6. 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

  1. Sysupgrade (links to all other docs listed below).
  2. Upgrading OpenWrt firmware via LuCI and CLI
  3. Upgrading OpenWrt firmware via CLI
  4. Sysupgrade – Technical Reference
  5. 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.
1 Like

Gitlab says:

Project ‘librerouter/openwrt’ was moved to ‘librerouter/librerouteros’. Please update any links and bookmarks that may still have the old path.
I could edit the post to update the links, but it now seems incorrect to say that LibreRouterOS is a fork of OpenWrt – maybe I’m wrong.

librerouter/librerouteros is at version 18.06.8, and openwrt/openwrt is at 19.07.3. Which one will work better on the LibreRouter?

yes

It is a way to workaround potential unknown issues that might arise, at least for now while we fix some issues with the radios.

Will leave this one to @SAn

you can follow either way.

I have updated a bit the information and added a warning about using safe-upgrade to install firmwares that don’t have dual boot support (any that is not LibreRouterOs). I would always recommend using LibreRouterOs for mesh use.
For other uses I would say that may be better to use OpenWrt directly.

I have added a section to the wiki post: “How to Change from LibreRouterOS to OpenWrt”. It is based on OpenWrt documentation. Maybe you can check if it looks correct.

How important is wifi-unstuck-wa? In other words, is it dangerous to install the firmware from the OpenWrt website because it does not have the wifi-unstuck-wa package?

Are there dangers of the partition table getting corrupted by switching to OpenWrt? Or by switching from OpenWrt back to LibreRouterOS? I don’t know much about the partitions… will OpenWrt only use half of the available storage space, because the other half is saved for a safe-boot system?

It is not dangerous. The radios will work good enough for multiple purposes, and like the other routers that use ath9k (multiple tp-link devices, etc). This is a workarround with the objetive of providing 24x7 stability. In a mesh network it is recommended to use it (or some cronjob that does the same). For other use cases it may be not very important. The router will run fine most of the time and scenarios. It prevents some edge cases (not identified and not able to reproduce) the arise in the wild from time to time. The router will only need a reboot (or a manual wifi scan) if this happens.

The upgrade instructions depend on which partition you are (1 or 2). To know it you must run safe-upgrade show and check the current partition value.
If current partition is :

From partition 1

This will install OpenWrt to partition 1 from partiton 1.
Use sysupgrade: sysupgrade -n /tmp/xxxx-librerouter-v1-squashfs-sysupgrade.bin. It may be posible that an error of invalid image is displayed. If you are very sure that you have a liberouter imagen then you can add --force to the sysupgrade command.

From partition 2

This will install OpenWrt to partition 1 from partiton 2.

Use safe-upgrade: safe-upgrade upgrade -n /tmp/openwrt-xxxx-librerouter-v1-squashfs-sysupgrade.bin. Then reboot. After the reboot if the image is working fine you have to confirm it. As safe-upgrade may not be available in this image you can confirm it using fw_setenv stable_part 1

@patogit can you update the instructions please?

The OpenWrt images only use half the space (like LibreRouterOs), so partition 2 won’t be overwritten if you use the guide above.

I’ve also tested that 19.07.3 image works good:


Thank you for the details, @SAn :slight_smile:

How do we do this?

yes
EDIT: I have updated the instructions. Please read them to check for errors.

1 Like

In NuestraRed for some equipments we are using OpenWRT version 19 with the LibreMESH packages, normally what we do for the Firmware is compile it based on the official OpenWRT branch and add the packages we need from LibreMESH and custom configurations for the network, in the documentation.

Soon I will publish in this link the things that must be taken into account to have the LibreMESH packages working in OpenWRT version 19 to create a mesh network. https://docutopia.tupale.co/Compilando-LibreMESH

1 Like

Ah sorry, the words that I used are not the best! I will update directly the instructions (the confirm I am referring is to “confirm the image” not to “confirm that the safe-upgrade is not avaialable in this image” :stuck_out_tongue:

I have just added this ^ section, but I do not have an easy way to test the instructions right now.
@SAn, can you review it?

Thanks! Reviewed and added minor improvements and some warnings.

1 Like