close
close

Portable Router Build: Choose Your CPU

Portable Router Build: Choose Your CPU

I’d like to introduce you to a project of mine – building a portable router – and show you how to use it to build a special device. You may have seen portable routers for sale before, but if you’ve been around the hacker scene long enough, you may notice that there are “coverage gaps,” so to speak. The Pi-hole project is a household item that keeps getting turned into products through shady Kickstarter campaigns, a “mobile hotspot” button is a staple of every decent mobile and desktop operating system, and “a reset device for the ISP router” is an entire genre of hacker projects. Sort the projects on Hackaday.io by “All Time” popularity, and right at the top you’ll see an OpenVPN and Tor router project – it’s there for a reason, and it made it to the semifinals of the 2014 Hackaday Prize for a reason, too.

I own a number of devices that benefit from both an internet connection and point-to-point connections between them. My internet connection sometimes comes from an LTE uplink, sometimes from an Ethernet cable, and sometimes from an open WiFi network with a portal you have to click through before you can even ping anything. If I want to connect my pocket devices to my home network for backups and home automation, I can install a VPN client on my laptop, but a VPN client on my phone will drain its battery, and the most sensible option would be to use the internet uplink via VPN – somehow that’s a feature I shouldn’t have, and let’s not even talk about DNSSEC! Whenever I tried to use one of these portable LTE+WiFi(+Ethernet) routers and actively use it for a month or two, I encountered serious hardware or firmware bugs – which is understandable, since it’s a niche product that doesn’t get tested as often as phones.

I now hate these little boxes with all my heart. By (www.digitalpush.net), CC BY 4.0

Solving these problems and implementing the features I want is very motivating for me – not only because I need my devices to work for me, but also because every time I tackle a project like this, I push cool engineering boundaries, find out a bunch of fun things to share with you all, and end up creating another device that makes my life significantly better. On top of that, routers are a sea of ​​proprietary hardware coupled with proprietary software, and it shows. The Pi-hole project is all about cutting profit margins, and with the Tor network, you won’t find them on any commercial device. Battery on your Huawei portable router died? Good luck finding a replacement. Router randomly shutting down due to overheating? Either you do something and lose your warranty, or you send it in for repairs for weeks with no guarantee it will be fixed, and stars help you if it’s from Asus.

Functional plan

I need a router with an always-on WiFi AP, LTE, Ethernet, and an optional WiFi station interface. As for software, it needs to run a lightweight VPN client like Wireguard and route my traffic through it. It also needs to offer a number of quality of life features – from reasonable static IP assignment and DNS configurability to captive portal auto-clicking and DNSSEC. The best part about building your own hardware is that you can choose your batteries and choose any size cell, so it shouldn’t be hard to keep it going for a day either.

You can also choose your own CPU, LTE modem, and power management circuits. Luckily, I have building blocks for most of these, and I’ve discussed them before – let’s talk about CPUs first, and we’ll cover LTE modem selection next time.

You may have seen funny boards over the last decade – a half-GHz CPU, 64 to 512MB of external RAM, WiFi and Ethernet interfaces in hardware, an SPI flash for firmware, a bunch of GPIOs, OpenWRT included as standard, and no video output interface in sight. You may have bought one for a generic Raspberry Pi project and misunderstood its purpose. It’s a router CPU board in a manufacturer-friendly form factor – it’ll do wonders for routing packets, but it won’t work well for video streaming. I know this because I bought my first board ever with the intention of running mjpg-streamer on it, and as soon as I set it to a reasonable resolution, the CPU went to 100% usage in no time.

Perhaps one of the most promising “router CPU” modules to date. By (Pinguinguy), CC0 1.0

There are many boards like this – the VoCore, the Carambola boards, the BlackSwift boards that I still remember nostalgically, LinkIt boards, and the Onion Omega modules. Of these, the Onion Omega 2 is the most up to date of all as far as I know, so I picked up one cheaply with a breakout here – despite their name, they have nothing to do with Tor routing, although I want to change that. The breakout designed by Omega is underwhelming in my eyes – they used a power bank IC to add battery backup functionality, with all the inefficiency and bugs that brings. As you may already know, you literally don’t have to do that.

Still, it ships with OpenWRT, is reasonably open, and has everything I need. I started this project in 2018, but luckily I made a good choice – the Onion Omega repositories are still active to this day, meaning I can continue my project to this day by simply reflashing OpenWRT to a newer version; if you don’t do that, you won’t be able to make any meaningful use of the repositories, which is a big part of the fun!

Want to prototype a project that includes multiple components? Just glue them to a piece of board while you plan and test it together!

Could you choose something more powerful? Yes, absolutely – a Raspberry Pi would have a more powerful CPU for anything I want to hack – in fact, many boards today can boast a faster CPU and better peripherals. I suspect native WiFi and Ethernet are important though – I don’t want to switch everything I need to USB completely lest I get throttled by the 480Mbps limitation. I also want to make sure that the module I choose is well suited to the task in aspects I may not even be able to anticipate yet, and it just feels right to use a router CPU.

In short, I have no problem throttling my internet uplink to some extent as long as I get a bunch of cool features in return. Later I can do some market analysis and see if there is a more suitable card I could integrate, but until then I don’t see any cards like this one. Do you have any better suggestions for CPU cards for a portable router? Post them in the comments below.

Selection results

So, that’s my goal: I want to use an Onion Omega as my personal WiFi repeater, without an integrated LTE uplink for now. I used it as my portable router, in a half-finished configuration, and this is what I came up with. First of all, the WiFi adapter enables combined STA (station = client) and AP (access point = hotspot) mode – something that might seem like a pretty nifty feature to you, and it was to me. At first I thought I could easily set up WiFi forwarding with it – and it did, but as soon as I leave the house with the router in my backpack and STA mode becomes inactive, everything breaks.

Test setup, creating an access point with Ethernet uplink. With two 18650 cells, no LTE enabled, it works for about 20 hours.

Here’s a bug – if you expect an always-on AP and an occasionally active STA, your AP will periodically experience glitches, at least on the Onion Omega, and this is a fundamental problem that could carry over to other hardware as well. This is because when the STA interface is disconnected, it has to periodically rescan the network to see if it needs to reconnect to an AP. Your WiFi radio has to stop and pause its activities, including any ongoing transmissions, and listen to the airwaves for a while – switching between different channels as it goes. This is very noticeable during live audio or video streaming; if you do a local file transfer over the AP’s network and the transfer speed is recorded, there will be visible gaps in the transfer speed.

First lesson: Examine cool features like combined STA+AP modes closely if you’re actually building a network you want to rely on. Especially if you don’t see them – you’ll find that many devices don’t come with support for simultaneous STA+AP connections out of the box. Sharing one antenna for two different purposes at once seems like a failure-prone situation, and if you’re having a connection problem, it’s worth looking into.

Is the hardware support optimal? No. Is it fun so far? Yes, absolutely, and there are some cool insights into features you might find worthwhile for your project. Does this router outperform a battery-powered Huawei router I used to carry in my pocket? Yes, it already has some key features I’ve always wanted, like static IP assignments and an Ethernet port I can use for an uplink. Well, it doesn’t have LTE yet – we’ll talk about that in the next article. We’ll show you how to choose an LTE modem and what you can do to make the process much easier for you.

Leave a Reply

Your email address will not be published. Required fields are marked *