My Ultimate LTE router using a Raspberry pi 4B

This a discussion place for anything.
poodad
Posts: 28
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 14 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: 28
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 14 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: 28
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 14 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: 28
Joined: Thu Jul 23, 2020 4:09 pm
Has thanked: 1 time
Been thanked: 14 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: 1172
Joined: Fri Mar 23, 2018 5:37 pm
Location: USA
Has thanked: 321 times
Been thanked: 192 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.

R1250GSA
Posts: 37
Joined: Fri Sep 25, 2020 10:45 am
Location: USA
Has thanked: 13 times
Been thanked: 4 times

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

Post by R1250GSA » Fri Sep 25, 2020 3:11 pm

P.D.,
How has your project been going?
It has been about a month since your last update.
I have an RPi4B that wants to go in my attic...
In search of the Wireless Unicorn...
Gigabit speed 4G LTE Advanced Pro
CAT-20, 4x4 MIMO, Ubuntu Open Source

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

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

Post by poodad » Wed Sep 30, 2020 10:20 am

That's weird - I updated the thread a while back, but the update is gone.

The project has felt like one step forward and two steps back.

Anyway, after the initial indoor testing, I tried taking the rig up on the roof but a slight mishap ripped both antenna wires out of the connectors. I decided no more risking my $200 modem until I received the real USB3 M.2 enclosure that I ordered from China (while LTEFIX was closed).

I eventually got the enclosure, but had a nasty bout of gout which prevented me from getting up on the roof.

After the gout subsided, I took the temp antenna rig with the bare RPi and USB modem enclosure up on the roof. Using a temporary SIM, I was getting mixed results. Anywhere from almost no bandwidth up to 10Mb down and 6Mb up.

Running minicom against /dev/ttyUSB2, I could do AT!GSTATUS? and see that occasionally the modem would get carrier aggregation, but mostly was sticking with one band.

About that time, my largish enclosure from Amazon (again, LTEFIX was closed) arrived that is going to be the mast mounted home for the RPi and the USB enclosure. I had assumed that the machine screws and standoff hardware the RPi uses was the standard M3 standoffs that PC motherboards use which I have a bunch of. I was wrong - RPi uses M2.5 which is fairly rare and not stocked anywhere locally. So, back to Amazon for M2.5 hardware.

I'm also now trying to find a provider. I had assumed this would be the easy part. Turns out, it appears to me that most, if not all of the rural/RV LTE plan providers are, um, a bit less than fully legit.

I will have more updates soon.

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

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

Post by poodad » Sun Oct 18, 2020 11:46 am

It's alive! Frankenrouter (as I've come to call it) is put together and installed.
IMG_5604.JPG
IMG_5604.JPG (239.74 KiB) Viewed 103 times
Inside is the Raspberry Pi 4B, the USB3 M.2 enclosure with a Sierra Wireless 7565. Also notice the heat management system. I drilled some tiny holes in the bottom of the case (you can see the inlet holes on the left), I took a 1 1/4" sink drain tailpiece, cut it to length, hot glued a small fan on top, then hot glued that over the holes on the bottom right. The fan pulls hot air from the top of the case and pushes down the tube and out the bottom. Not optimal, but it appears to work since the RPI4 temps are the same with the case open and closed. The fan is powered from the 5V GPIO pin on the RPI.
IMG_5605.JPG
IMG_5605.JPG (174.36 KiB) Viewed 103 times
Here's a shot of my Grafana dashboard. I've got perl scripts that queries the Raspberry Pi 4 temperature and fan speed and the modem stats and writes them to an InfluxDB database. You can see that the modem starts heating up pretty dramatically when it is under load.
grafana1.jpg
Next move is to remove the top of the USB enclosure case for improved airflow. I may add a heatsink to the modem.

BTW, if anyone wants the perl scripts, let me know.

R1250GSA
Posts: 37
Joined: Fri Sep 25, 2020 10:45 am
Location: USA
Has thanked: 13 times
Been thanked: 4 times

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

Post by R1250GSA » Sun Oct 18, 2020 3:59 pm

OUTSTANDING!
Well played Dr. Frankenstein.

What are the speeds now that the smoke has settled?
Which carrier?
Any lessons learned from your modem choice, the Sierra CAT-12?

Yes, I would like to see your Perl scripts.
In search of the Wireless Unicorn...
Gigabit speed 4G LTE Advanced Pro
CAT-20, 4x4 MIMO, Ubuntu Open Source

SliverGT
Posts: 48
Joined: Sun Dec 22, 2019 10:41 pm
Has thanked: 0
Been thanked: 6 times

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

Post by SliverGT » Sun Oct 18, 2020 8:27 pm

Nice work, do you have a better picture of how your mast is attached to the roof?

Post Reply