OpenWRT on Librem 5

Hi!

It would be an interesting Project to run OpenWrt on Librem 5 instead of Pure OS.
Why? Because Librem 5 has an LTE modem, a capable WiFi card, battery, 3 GB RAM, and kill switches.
This means that Librem 5 could be used as a wonderful LTE travel router. With so much RAM one could maybe even run something like Suricata on it. Obviously Wireguard would be piece of cake.
But why not just use Pure OS?
OpenWrt is extremely light weight. And currently a lot of people report that the modem dies spontanuously from time to time. Maybe with OpenWrt it could run more stable.
Why not using something like GLiNet Mudi?

Because the GLiNet Mudi has just 128 MB RAM so you can forget about stuff like Suricata. Also the GLiNet has no HW kill switches and you have to trust that the LTE and WiFi are really off, while on Libre 5 you can be sure that they are off.
Why not use something like the Raspberry Pi 4?
Because the RPi has no integrated battery and is very power hungry. And the WiFi adapter on the RPi 4 is much worse in my view than the WiFi of Librem 5. For example RPi can’t do WPA3, while Librem 5 can. Oh, and RPi can’t do LTE without extension hat.

So it definitely sounds like a reasonable project.
I would not trust myself to do it myself. But if somebody tries, please tell about it.

5 Likes

Interesting idea. I don’t think I’d personally want or need t but I am a huge fan of OpenWRT so I would be interested to see if anyone ever does this.

1 Like

But then why not just fix that?

If it turns out that it is difficult to fix because too much of the problem is in the modem itself then

it will probably be the same under OpenWRT.

Undoubtedly PureOS is overkill if the sole purpose is to be a travel router.

I wonder though what your expectation is for how voice calls are handled while the Librem 5 is set up as a travel router.

Another option might be some kind of boot-time choice between normal mode and travel router mode, while still running PureOS. When you choose travel router mode, unnecessary components would be suppressed from starting i.e. make it a bit more lightweight.

A related issue is then what use, if any, you would like to make of the Librem 5 screen when in travel router mode.

Or USB dongle? (I know my USB 3G dongle works on a Pi. I haven’t tested 4G but don’t have any particular reason to think it wouldn’t work.)

Internet says it can “but”. Requires lots of messing around and then “maybe”.

For me personally, I need to run multiple SSIDs with at least one that is set up as “lowest common denominator” so that some older hardware can connect to the WiFi.

Well um I think you would need a second Librem 5 because I expect in the early phases of the porting process you would spend a lot of time with a non-working Librem 5. :rofl:

I have doubts that this is the case.
Why?
Because PinePhone uses an LTE modem that is used by many routers and runs very stable on them with OpenWrt while it does not run stable on the PinePhone.

PinePhone uses Quectel EC25.
And here we have a top notch industrial grade router that is known to run stable (using an OpenWrt fork) and at a tear down it also reveals a Quectel EC25 modem:

Actually I am even pretty sure that GLiNet Mudi also uses the same Quectec EC25 but I have no proof as the specs are behind password.

At the same time people report similar modem stability issues on the PinePhone as on Librem 5:
PinePhone modem keeps “disappearing” (pine64.org)

Maybe the problem lies in the software stack that is used by Linux distros that are used by Librem 5 and PinePhone and that is not present under OpenWrt. Maybe stuff like ModemManager causes the problems.
And I agree with you that if the root is in stuff like ModemManager, than it would be great if this gets fixed. And maybe all Linux phones are going to benefit from such fix even if they use different modems.

I don’t expect this to work. In the set-up Librem 5 will not be a phone. It will be just a router.

Dual boot would be the perfect scenario. Yes, one would not use them at the same time. But one would have the choice.

I have done it myself with an USB WiFi dongle.
But afaik the integrated WiFi of RPi is not capable to do WPA3 at all as it does not support the required cyphers while the Librem 5 wifi does support everything needed. You can compare by running the command
iw phy phy0 info | more
and look at the list of supported cyphers. And compare the lists that you get on Librem 5 and on RPi 4. The Librem 5 WiFi is much more capable.
Honestly the RPI WiFi is such a garbage, that I would have preferred if RPi 4 had no WiFi at all and the users would use WiFi dongles instead. This also eliminates the trust issues if the WiFi is really off. This is btw. an option with the RPi compute module 4 which is available also as a version without WiFi.

I like the lowest common denominator that has not been cracked. :smiley: And this is strictly WPA3 (no transitional mode). Many legacy devices could be upgraded with an USB WiFi dongle to handle it.
At some point it makes sense to retire some old devices for the sake to not let other people to enter your network without authorization. :wink:

Similar? Only roughly — in my experience, the Pinephone modem stability was way worse… at least until the modem died. I know it’s dead because neither Mobian nor PMOS sees it.

Still, you may be on to something. I would be very interested to see how OpenWRT ran on the L5.

On a Pi 4 here: WEP40, WEP104, TKIP, CCMP-128, CMAC.

What do you get with that command on your Librem 5?

I think WPA2-Personal and WPA3-Personal actually use the same encryption cypher (AES, 128 bit, in CCM mode i.e. CCMP-128). The difference is in the initial handshake.

Likewise on the Pi 0.

Maybe.

I have a wireless printer that doesn’t support PMF. I don’t really want to throw it out. I have at least one other similarly limited wireless client that does not support WPA3 and which I don’t want to throw out.

Neither of them I think could be fixed with a USB WiFi dongle. The printer maybe could be fixed by putting in a print server and using the printers’s USB interface or similarly front-ending it.

Another approach is to partition the network - so, yes, if someone were to approach my property and do what is necessary to break WPA2-Personal, they could mess with traffic to my printer but at least they would not have access to the wider network.

This strengthens the argument that the problems are not in the hardware and that something that works stable under OpenWrt for some reason does not work stable with the distro that Pinephone uses.

Not exactly.
Check this video:
Raspberry Pi running on WPA3 network - YouTube

Seeing the problems with hardware being complicated and/or not matching documentation that I’ve seen while working for Purism, and the struggles that this caused, my bet here is that both sets of hardware have issues.

1 Like

I want to set up docker on my Librem…is there a docker image of OpenWRT?

How does this fit with the observation that Quectel EC25 works stable in routers but works unstable in the PinePhone?

I don’t have any definite proof that it does :slight_smile:

Even then, half the trouble with stability is how things are connected to each other. I doubt that they have the same configuration between the devices.

2 Likes

In other words, enabling the voice part may be tripping it up. Hopefully it is that and not voltage regulation.

One way to see if the modem can be stable without voice while still providing voice features is to use VoIP for calls. It would be nice if it were possible to decode VoLTE and VoWiFi on the iMX 8 with the modem just passing data, but I guess that would run into authentication problems. https://jmp.chat/ seems to be on its way to providing all of the cell phone experience, without the use of voice on the modem. There are other more professional providers who provide more (Telnyx, Cloudli, Flowroute, etc.), such as 911, but it would require more work to integrate their services (like messaging) into the native PureOS apps.

These issues are unrelated to what we’re seeing on L5, and so is ModemManager. Switching to, let’s say, OpenBSD and seeing how it behaves there could indeed be a very interesting exercise, but OpenWrt won’t help you there.

Do these routers run out of a battery and have to use various power saving modes?

Just do that then. With up-to-date u-boot, all you have to do to boot from an SD card is to hold Vol- at power on.

Take a kernel from PureOS and boot into OpenWrt rootfs. Getting it to boot will be an easy one weekend project (making it usable for various use-cases on the other hand…)

2 Likes

Does anyone remember where are the instructions for dualboot/multiboot? And could those be added to the wiki too.

Interesting idea. I suppose OpenWrt will not enable any of the power savings stuff, and the battery charge time will be less phone like and more UPS like. In other words, it will have to stay on a power source, but if that power is lost, it will have a decent amount of time before the battery dies. I expect that it will be better than most UPS solutions.

I wonder if it is possible to selectively turn off power savings to the cell modem for diagnostic purposes in PureOS, or if someone wants to operate a wall powered hotspot. I am guessing that power savings on the other components will still be necessary to avoid overheating.

2 Likes

This would be indeed interesting.
I would definitely prefer shorter runtime on battery and being as often as possible connected to the electricity grid than having an unstable L5 modem and L5 WiFi Hotspot.

Today I wanted to use the L5 as a hotspot. This usually works, but today it was particularly unstable and after the WiFi dropping 3 times within 30 minutes (2 of which with an error “WiFi adapter not found”), I switched to hosting the hotspot from an Android cell phone. The L5 modem stayed stable today.

2 of the GLiNet routers do indeed have built in batteries so obviously they could run out of battery. GLiNet Puli does have as an option the same modem as PinePhone (5 different modems to choose from):
Puli (GL-XE300) Portable IoT Gateway | 4G LTE | OpenWrt | 5000mAh Battery — GL.iNet (gl-inet.com)

They still might not put the various chips in various power savings modes. The big difference between a battery powered hotspot and a phone is that the hotspot is expected to be turned off when not in use, and a phone is expected to stay on all day on a single charge.

I need to write a dedicated post about this, but I put a WiFi 6 card (AX210NGW) in my Librem 5 and after 223 days now (and counting), the WiFi still works. This is reported from the uptime command. I have not rebooted it, so software updates have not been applied for a while. I have it on a USB charger for (almost) the entire time, so I cannot comment on power consumption, but it did survive being without power for a while. Bluetooth does not work, but that is probably because I do not have the right firmware for it. The hotspot feature creates a WiFi network that other devices can see, but I cannot test connecting to it because I do not have a SIM in the phone. This solution would probably work just fine for a OpenWRT hotspot, assuming that this card’s firmware works with the hotspot mode (I am not sure to what degree the host CPU vs the WiFi firmware deals with hotspot functionality).

3 Likes