My Ultimate LTE router using a Raspberry pi 4B

This a discussion place for anything.
Post Reply
poodad
Posts: 16
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 8 times

My Ultimate LTE router using a Raspberry pi 4B

Post by poodad » Thu Aug 06, 2020 9:57 am

I set out on an adventure to dump my 3Mb/768k DSL in favor of LTE data. Little did I know the depth and breadth of the rabbit hole I was about to plunge into.

My first big break was finding @swwifty's thread in this forum on building his router. Inspired by his RPi 3 build, I decided to replicate his setup, but use the newer Raspberry Pi 4B and a cat12 Sierra Wireless LTE modem in a USB enclosure. I intended on using GoldenOrb for the software (GoldenOrb only supports up to RPi 3, but the RPi 4 specs say "fully backwards software compatible", so it should work, right?).

I want to document my build story here in case anyone decides to do something similar.

First the TLDR version:
A RPi 4B with a PoE hat can just barely ensure enough power for itself and an LTE modem in a USB enclosure.
Said USB enclosure requires TWO USB connections to ensure enough power.
As of 08/06/2020 there is no GoldenOrb version for the RPi 4.
There is a community build of OpenWRT for the RPI 4.
Find some way of zeroing out your SDCARD before or when writing RPi images!!!

Ok, the details:

My first concern was how to adequately power everything. Since this rig is going to in an enclosure on the antenna mast, I wanted to use PoE to power it. After seeing the large current draw of Sierra Wireless cat12 modems, I immediately became concerned. The RPi PoE "hat" (that's what PRi daughter cards are called) can supply 5V at 2.5A. That's 12.5W.

Long story short, that's enough to power the RPi at max load, and supply the almost 5W max the LTE card can demand with a couple hundred milliamps to spare. I figure I'll have some additional power headroom by the fact that the RPi won't be doing much work as a firewall - just NAT and routing - no traffic inspection.

The big "a ha" here was that some of the Sierra Wireless modems can draw so much max current that a single USB 3 connection can't supply enough juice (USB3 is 900mA max). This is going to require a USB 3 enclosure with 2 USB connections - one for power and data, the other for additional power. Fortunately, the LTEFIX USB enclosures have exactly this capability.

First problem: LTEFIX and their associated facebook store are closed, so I can't get the modem and USB enclosure. But I order the the RPi and PoE hat from Amazon.

Once I get the RPi, I discover that GoldenOrb will not run on a RPi 4. It turns out that GoldenOrb is a specific release of the ROOTer project, which is itself a "community release" of OpenWRT. A bit of googling shows that while there is not a stable release of OpenWRT for the RPi4, there is a daily snapshot.

Further research turns up my next huge lucky break: Someone who has major OpenWRT skills is doing his own community build of OpenWRT for the RPi4. He's done a huge amount of work into building a Cadillac package. You can find it in this thread: https://forum.openwrt.org/t/rpi4-community-build/69998

I hit another snag. As I was experimenting with OpenWRt installs, it would start doing crazy things, including just not booting. I discover that the windows tools I'm using (Rufus and Win32DiskImager) to write the images to the sdcard apparently skip over "unused" areas. This leaves data hanging around on the sdcard that interferes with the system you just installed.

My solution is to use Windows Disk Manager to:
1. Create a partition in the tail end unused area of the sdcard.
2. Delete the first two partitions on the disk.
3. Create a partition in the empty space just created.
4. Format it as fat32 with the "quick format" option turned off. This causes every block to be written to.
5. Write the image to the sdcard.

NOTE: If you are using dd under linux to write your images, it does not skip areas and you don't have to worry about this.

Next problem: The fan on the PoE hat doesn't spin up and the RPi gets a bit warm. This is a real concern considering this is going to be in an outside enclosure in southern Indiana. Turns out, this is easy to fix. In the OpenWRT web interface (called luci, BTW) there's a place to install software packages. Just install kmod-hwmon-rpi-poe-fan.

As of now, I'm stuck until LTEFIX or their associated facebook shop opens back up and I can the modem and enclosure. Whenever I get these in, I'll continute the thread.

BTW, there also interesting developments on this OpenWRT thread https://forum.openwrt.org/t/raspberry-p ... /39444/258

poodad
Posts: 16
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 8 times

Re: My Ultimate LTE router using a Raspberry pi 4B

Post by poodad » Mon Aug 17, 2020 11:20 am

Thanks! I'll check it out!

poodad
Posts: 16
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 8 times

Re: My Ultimate LTE router using a Raspberry pi 4B

Post by poodad » Fri Aug 21, 2020 7:44 am

Some things to report:

Wifi is broken in the RPi4 builders of OpenWRT. There's some patches that fix this issue in the mainstream linux kernel needed to fix this, but they haven't made it over into the OpenWRT version yet. I'm not using wifi, so no worries for me, but I thought I'd pass it along.

poodad
Posts: 16
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 8 times

Re: My Ultimate LTE router using a Raspberry pi 4B

Post by poodad » Sun Aug 30, 2020 9:52 pm

Ok, time to update the build thread. I received my Sierra Wireless MC7565. I've been waiting for LTEFIX to open to buy their M2. USB3 enclosure, but I went ahead and bought a cheapo M.2 adapter off Amazon figuring I could at least get the modem software updated, which did indeed work from my Windows laptop. The firmware update utility did crash at the end of the process, but the modem reports the expected version.

Next step was to connect it to the RPi4. Success again. The build of OpenWRT I'm using had modemmanager installed, and modemmanager recognized the modem.

I wanted to poke around with AT commands, but there was no /dev/ttyUSBx device files. After a bit of digging and experimentation, I found that I needed to install kmod-usb-serial-qualcomm. Installed that package as well as minicom for a tty based terminal emulator and I'm now able to get information on the modem.

I connected up a single WIlson yagi and pointed it out the window in the direction of the tower. I got an IP address, but not a good enough signal for reliable connectivity.

Next step - get this stuff up on the roof and get both antennas connected.

I've been on a real Grafana binge lately. If you are interested in stats and dashboards, you should definitely check Grafana out (as well as InfluxDB and Telegraf), I've had some success in configuring OpenWRT's collectd to forward stats to Telegraf (which has a collectd listener plugin). Telegraf then writes the stats to InfluxDB where Grafana cann display them in a dashboard.

Next step is to write a small perl program to query the modem for connection stats and write them to InfluxDB.

User avatar
Didneywhorl
Posts: 1087
Joined: Fri Mar 23, 2018 5:37 pm
Location: USA
Has thanked: 292 times
Been thanked: 165 times
Contact:

Re: My Ultimate LTE router using a Raspberry pi 4B

Post by Didneywhorl » Thu Sep 10, 2020 9:47 pm

Great work, That's super cool.
The Solution for your Internet Connectivity and Speed.

Post Reply