# Building 4G/LTE Router



## balanga (Mar 23, 2020)

I would like to build my own FreeBSD based 4G/LTE Router and am looking at possible components....

I think I would like something like this, but am not sure if I could install FreeBSD on it...


----------



## SirDice (Mar 23, 2020)

balanga said:


> I think I would like something like this, but am not sure if I could install FreeBSD on it...


That looks like an all-in-one-device. Those things typically use a MIPS CPU.


----------



## balanga (Mar 23, 2020)

This looks like a reasonable candidate but it's no longer available....


----------



## Phishfry (Mar 23, 2020)

This board is console-only but is really the best deal going.





						PC Engines apu2 system boards
					

PC Engines apu2 network platform AMD crowned eagle SBC



					www.pcengines.ch
				



So what you want is the APU2 board, Case, mSATA module, Serial to USB cable and power supply.
They will assemble it too for a small build fee.
So the cheapest is the 2 ethernet model APU2e2 with 2GB RAM. Also the APU2d2 is fine.
These are very low power as well...
Lots of expansion with one slot for mSATA, one slot for Wifi and one slot for cellular modem.
The APU3 changes the config to one slot for mSATA and two slots for cellular modem.
There are two sims on the APU3 so you can use two different carriers. Nice for redundancy.

These also have a FreeBSD driver for the GPIO pins like RPi uses.
The BIOS is an open source bios called Coreboot/SeaBIOS.

I have 3 of these boards and I really like them. They are fanless.
I use one for a Wifi router, one as my Security DVR and one is older APU1 and sits unused.


----------



## msplsh (Mar 23, 2020)

PC Engines APU






						PC Engines apu3c4 product file
					

PC Engines apu3c4 system board



					www.pcengines.ch
				




Have two of them I use as routers.  I swap between when updating the OS (not FreeBSD because of better pf features elsewhere).


----------



## balanga (Mar 24, 2020)

Phishfry said:


> This board is console-only but is really the best deal going.
> 
> 
> 
> ...



About how much would one of these cost?

Looks like I should get this one, as it says it optimized for 3G/LTE modems - does that include 4G (or even 5G...)

I'm interested in connecting an outdoor antenna to one of these because of poor reception. Not exactly sure how all this should be connected up.  What sort of cables would I need inside the box and what sort of connectors on the case?


----------



## Phishfry (Mar 24, 2020)

The problem with the APU3 is both expansion slots are for Cellular Modem. With APU2 You get Wifi and Cellular Slots.
Remember one slot is for mSATA.


----------



## rootbert (Mar 24, 2020)

I can highly recommend the APUs ... the term "rock solid" should be renamed to "APU solid" - we all know that rocks break before an APU does ;-)


----------



## msplsh (Mar 24, 2020)

The prices and resellers are right up there in the shop tab on their page.


----------



## msplsh (Mar 24, 2020)

Building a FreeBSD 4G router
					

I would like to build a FreeBSD based 4G/LTE router which has the features available in this commercial product:-...




					forums.freebsd.org


----------



## Phishfry (Mar 24, 2020)

For the Antenna I have a directional Yagi.








						700-2700MHz Wide Band Directional Outdoor Cellular Yagi Antenna SMA 3G 4G LTE  | eBay
					

Find many great new & used options and get the best deals for 700-2700MHz Wide Band Directional Outdoor Cellular Yagi Antenna SMA 3G 4G LTE at the best online prices at eBay! Free shipping for many products!



					www.ebay.com
				




This uses SMA connectors which works out good because the APU case comes with SMA holes for antenna.
Then you would need an internal modem cable like this:








						UFL U.FL Original to SMA female bulkhead waterproof jack RG178 Pigtail Cable IPX  | eBay
					

Find many great new & used options and get the best deals for UFL U.FL Original to SMA female bulkhead waterproof jack RG178 Pigtail Cable IPX at the best online prices at eBay! Free shipping for many products!



					www.ebay.com
				




Note that the center pin is completely opposite of WiFi connector.
Wifi uses RP-SMA and Cellular uses SMA.
On cellular antennas the center pin is on the antenna side.

A truly ideal setup is two yagis for each connector on your cellular modem.

Be advised that there also M.2 Cellular modems, compared to MiniPCIe modems.
These are newer and use a different connector on the modem for antennas.
MiniPCIe modems use U.fl and M.2 modems use MHF-4


----------



## balanga (Mar 24, 2020)

With 5G about to be dropped on us, is this likely to work with 5G. Sorry if that is a stupid question... Don't really know anything about it but don't want to buy something with built in obsolence when a new technology is on the doorstep.


----------



## Phishfry (Mar 24, 2020)

Well most newer modems use the newer M.2 format. It is slightly smaller form factor than MiniPCIe.
As such there is a piggyback adapter to use M.2 Modems in a MiniPCIe slot.








						M.2 Ngff Ssd To Mini Pci-E Msata Adapter Card Replacement Converter S6S7  | eBay
					

Find many great new & used options and get the best deals for M.2 Ngff Ssd To Mini Pci-E Msata Adapter Card Replacement Converter S6S7 at the best online prices at eBay! Free shipping for many products!



					www.ebay.com
				



So you should be fine there. 
(Except the modem to case pigtail. They only cost a few bucks though. Remember U.FL connectors versus MHF-4)

Regarding the antenna, here in the US, I know ATT is using 850mhz for 5G so that Yagi covers 700-2700mhz.
So that should be fine too.


----------



## msplsh (Mar 24, 2020)

You don't seem to be in a big hurry about it, so if you wait long enough, they'll update it.  

I don't know of any 5G Mini PCI-E modems, so that's going to be your limiting factor.  They may never exist.


----------



## Phishfry (Mar 24, 2020)

Telit has a 5G MiniPCIe modem. LM960





						Cellular 5G
					

Future-proof IoT solutions and improve connectivity speeds with our reliable and secure cellular 5G-ready adapter modules and data cards.




					www.telit.com


----------



## msplsh (Mar 25, 2020)

$400 compared to a $200 LTE one that would work now.  I'd say just build a 4G one and wait for the 5G to come down in price (and get rolled out to your area).

Of course, this all assumes the modems work in FreeBSD.


----------



## Phishfry (Mar 25, 2020)

I agree and 5G seems like hype when you look at coverage maps.


----------



## balanga (Mar 25, 2020)

Phishfry said:


> I agree and 5G seems like hype when you look at coverage maps.


It may seem like hype now, but it's inevitable that it will be with us within a year or two. And if I want to install an antenna, which is relatively inexpensive, it might as well be future proof.


----------



## balanga (Mar 26, 2020)

Looking again at the pcengines boards, they really do look to be beyond my budget. I will only have a small network. Is there anything similar but less expensive?


----------



## msplsh (Mar 26, 2020)

Not that I know of and I shopped around for these.  I am surprised that you could consider affording a $400 5G modem but not $160 for a CPU, RAM and motherboard.


----------



## balanga (Mar 26, 2020)

msplsh said:


> Not that I know of and I shopped around for these.  I am surprised that you could consider affording a $400 5G modem but not $160 for a CPU, RAM and motherboard.


 My initial enquiry regarding 5G was about the antenna... I'd be looking at a 4G modem initially, but having an antenna capable of 5G reception means I wouldn't need to concern myself with that in the future.


----------



## JohnnySorocil (Mar 26, 2020)

I am using low budget version of LTE router:
Orange Pi Zero (ARM Cortex A7, 512 MB RAM, microSD, opensource "BIOS") - around $30
Dell DW550 miniPCIe LTE card - around $10
USB miniPCIe adapter - $8
USB WLAN card which can be used in AP mode - around $10
microSD, antennas, misc - $10-$15

It works fine in my home network - 2 to 6 devices, ppp, WLAN AP, DHCP + DNS.
Only problems which I had was with weak USB power supplies for it.

Not sure if that setup is good enough for you (it is console/ssh only and definetly noticably slower than my old laptop).


```
root@naranca:~ # dmesg | grep umodem
umodem0 on uhub6
umodem0: <Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card Modem> on usbus6
umodem0: data interface 2, has CM over data, has break
umodem1 on uhub6
umodem1: <Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card Data Modem> on usbus6
umodem1: data interface 4, has CM over data, has break
umodem2 on uhub6
umodem2: <Dell Wireless 5550 HSPA+ Mobile Broadband Mini-Card GPS Port> on usbus6
umodem2: data interface 10, has CM over data, has break
```


----------



## balanga (Mar 26, 2020)

Thanks for the suggestion. I have an old RPi 3 hanging around somewhere... maybe I can put a prototype together.

Just wondering what sort of antenna you use... I'm specifically wanting an external antenna because of bad reception. I'm hoping an external antenna will greatly improve reception.

As far as your FreeBSD setup goes did you need add anything specific to /etc/rc.conf?


----------



## JohnnySorocil (Mar 26, 2020)

Nothing special in my rc.conf (nor ppp.conf, not dhcpd.conf. nor...) - it was basically copy-paste from my laptop which had role of router before.
Only special for this thing was to select WLAN card which will work reliably in AP mode and then to speed it up with adding this to rc.conf:

```
# enable more than 1M for hostapd
kld_list="${kld_list} wlan_amrr"
```

There was issue (on my SBC) with non recognized thermal sensor, USB hub, analog audio and so on, but that was fixed with device tree overlays. You probably won't have that issues with your Raspberry 

For antennas I am using 2.4 GHz WLAN antennas for $1 
I have ordered better 4G antennas and IPX -> SMA adapter but they are not arrived.


----------



## balanga (Mar 27, 2020)

Looking at USB miniPCIe adapters, there seem to be many available... Is there anything specific to look for? Should I expect them all to work with any 4G WWAN card?


----------



## msplsh (Mar 27, 2020)

IDK how you're going to get a PCIe LTE modem on USB to work without a SIM slot.


----------



## balanga (Mar 27, 2020)

https://www.ebay.co.uk/itm/Mini-Wireless-PCI-E-to-USB-Adapter-with-SIM-8Pin-Card-Slot-for-WWAN-LTE-Module/142650904466?hash=item2136a80f92:g:WuIAAOSw3q5aVIQo


----------



## JohnnySorocil (Mar 27, 2020)

That is the exact model I have (well, two, one was donated to a friend who is using it) and works for something like 4 years now. Only annoyance is flimsy USB connector.
LTE modem is basically a USB UART device (I got 3 of them, one is modem, 2nd one is ???, 3rd should be GPS).
mPCIe slot (in older laptops) can have various pinouts (for use with mSATA, LTE, WLAN cards...) but one configured for WWAN modem is almost a breakout board for USB and SIM pins: https://hackaday.com/2017/03/29/use-a-mini-pci-e-3g-card-with-usb-instead/

I have ordered M.2 adapters (newer  layout for addon cards for laptops) and LTE modems but didn't try that but it should be the same (only different physical connector).

Edit: I cannot guarantee that every mPCIe LTE modem out there is USB -> 3x UART device, but I can guarantee that the one I got is (Dell DW5550 by Ericsson)


----------

