15 minute read

DIY 4G/LTE Router with Rooter

Let’s build a 4G/LTE hotspot. For this we will use the Mikrotik RBM33G Routerboard, a miniPcie LTE/4G modem and - Rooter. Yes, this is no typo. Rooter is a fork of OpenWrt and specializes on LTE/4G Hardware.

Watch the video on YouTube

Click to view the entire transcript Let‘s build a mobile hot spot or – technically speaking - an LTE router all by ourselves. For this, I will use the Mikrotik Router board RB M33G and a Quectel EC25 mini PCIe modem card. But you may use a great variety of different hardware to do this. As a software we will use the Rooter software which in fact is a Fork of the OpenWrt project. But let‘s go step by step. Use the chapters if you want to skip forward. First let me answer some questions that you may have. Why would you want to use an LTE router – or rather who would want to use that ? I can think of two or three use cases here. Either you live off grid or in a rural region and your DSL or cable connection sucks or it is ridiculously expensive. LTE or 4G might be an alternative for you then. But even if you live in the city it might occur that your internet connection goes down. The second use case would therefore be to use the LTE connection as a fail over or fall back solution. If the DSL or fiber goes down, your router would then switch to LTE automatically and fail back if the DSL is back online. Third use case – you want more bandwidth and potentially you want to bond, aggregate or bundle various connections. Second question - Why would you want to build your own LTE router and not use a ready made one? Well, first of course – because you can. It‘s more fun building stuff than it is just buying stuff – but more importantly, a custom made solution like we do here gives you way more possibilities of tweaking and adapting stuff than a commercial solution could ever do. Unless of course you want to spend 4 figures for a professional solution, but the implementation that I show here costs around 100$ and can do much much more than the average consumer grade LTE router. It will become clear once we install Rooter. That leads me to the third question - Why would we want to use Rooter as a software and not Mikrotik RouterOs or OpenWrt ? The answer to this can be found if we browse to the Rooter homepage and check not only on the supported routers page where we can find a large variety of routers that are supported out of the box so to speak – Various vendors and models which we couldn’t use for example with RouterOS. But also – if we browse to the supported modems page, then we will quickly see that Rooter supports a lot of LTE modems out of the box – we would have to adapt OpenWrt for example with a lot of scripts and custom stuff to get to the functionality that Rooter has built in already. But that will become clear when we look at the configuration. Rooter is just much easier to use and will get you to usable results much quicker. Last question before we start and build the stuff – Why did I chose the Mikrotik Routerboard? A year ago I thought I’d make some videos about LTE or 4G usage in the light of the use cases that I have just mentioned. But when I started to look for hardware, it became quickly apparent that there are basically four ways to add LTE connection to a router. Either you connect a smartphone to it and tether the LTE connection over the USB bus. Or – that’s the second possibility – you use an existing Wi-fi LTE hotspot and connect to it as a Wi-fi client. Or – third possibility – you use a USB dongle such as these Huawei dongles here that are popular in Germany for example. Or – that’s the fourth possibility – you use an mpcie LTE modem card like we do here in this video. Each of these solutions has their own advantages and disadvantages. Using your phone for tethering implies that your phone is positioned next to the router and wired to it. Using a USB dongle actually very often requires using a powered USB hub because those dongles are quite hungry for electricity. Both solutions would give us a rather bad form factor – Using a Wi-fi hotspot also has a couple of challenges – bridging into a Wi-fi network as a client in STA mode is actually not that easy and not very reliable. And all these options have one big challenge – the antennas. If we want to optimize LTE connection then we need external antennas. That leaves us with the fourth possibility – the mPCIe solution. For this we need of course a board that actually has mpcie slots. Last year, when hardware was still affordable, I bought three of those – The Mikrotik Routerboard RBM33g, the SinoVoip Banana Pi R64 and the PCEngines APU4D4 board which is actually a fully blown PC with a 64 bit AMD processor and 4 Gigabytes of RAM. The decision for the Routerboard was made because unlike the Banana Pi, it is supported by Rooter and I have other plans for the PcEngines board. But enough talk – let’s go and configure things. A quick reminder at this point though – if you handle circuit boards and devices and you need to touch components on those boards then please use an antistatic mat and wrist strap so that you don’t fry your stuff with static discharges. Seriously, guys – you need that. Everything else is just gambling really. First let’s have a look at the Rooter page – if you google for Goldenorb Rooter – that’s Rooter with a double “O” - then you should be directed to the page ofmodemsandmen.com. Let’s go directly to the Firmware Downloads page here and grab the right firmware. I am ready for a mini-adventure here and select the prerelease. If you want to be safe, then you would rather scroll down here and use the “official” download link down here. Scroll down to the desired hardware – in my case that’s of course the Mikrotik RBM33G and download the ZIP file. I use the newest file but again – you may use the stable or official version. If we look at the content of this zip file then we will see that it contains two flavors of the firmware – one has the word “full” in it- That one has just more software packages installed, so I’ll use that one. For the initial install we will need to use the factory image. For subsequent updates we will then use the sysupgrade images in the future. What’s nice here is that there is a PDF file that actually outlines all the required steps for flashing. Plus – the needed tools such as the tftp server are already packed and pre-configured in the zip file. That comes in very handy. Just before we flash I advise you to actually save your RouterOs license. The Mikrotik boards come with an operating system called RouterOS. That software is not free, you need a license. If you purchase a device from them, then the license is already stored on the device. In order to save it please follow the steps as outlined on these OpenWrt pages. Either use Winbox and export the license or connect to the router using ssh or a serial cable and then type the outlined commands such as /system license output and /file print like it is described on these pages. Good – the flashing procedure on these Routerboards is actually similar to many other devices. Basically we interrupt the bootloader and then we download the image from an attached PC via TFTP. Where the routerboards are different is that they do not use “Das U-Boot” or short “uboot” as a bootloader, but they have their own bootloader called RouterBOOT. And if you want to instruct the bootloader to load an image over TFTP then all you have to do is to press and hold the reset button here while you switch it on. RouterBOOT will then try to find a DHCP Server on the network and then load and boot an image from a tftp server as instructed by DHCP. The tftpd32 software that comes with the Rooter zip package is already preconfigured for that. All we have to do is to change the IP address of our PC to 192.168.1.2, don’t forget to set the Netmask and also set the gateway to 192.168.1.1 otherwise it won’t work. Now – unzip all the files in the ZIP file. Next, change the tftpd32.ini file and adjust that BootFile entry here. In my case I let it point to the full factory image. Perfect, now connect the POE port of the Routerboard with the LAN cable of your PC and start tftpd32.exe – then press and hold the reset button on the router and switch it on. I have a serial cable connected as well here – you don’t need it but it shows you what’s going on at boot time on the router. So it’s connecting to the network, then gets the information it needs from the DHCP Server that is built into tftpd32 and then downloads the image via tftp and boots into it. Very easy and convenient. So now we can already browse to the 192.168.1.1 address and open the Rooter main page. You might get a certificate warning because of course we don’t have proper TLS certificates on that device. I just say that’s OK so connect. I can log in without a password. The Rooter software is currently running in the RAM of the board and has not yet been installed. In order to install it permanently on the router I then go to System – Backup and Flash Firmware – and from here upload the sysupgrade image to the router. Once I reboot then I should get Rooter by default. Before we can enjoy internet connection over LTE 4G we have to install the LTE modem into the device. That is done quite easily by just clicking the modem into the right mPCIe slot here. Tighten it with the screws and that’s it. Just a quick remark with regards to mPCIe. Even though those slots here look the same, actually they are not. Depending on the board that you are using, not all connectors are necessarily wired on these slots. In fact, an mPCIe LTE modem will not be recognized by the operating system as a PCI device, but rather as a USB device. Yes - you have heard well – USB device. The Mini PCI Express bus has pins for PCI connection and for USB connection. And on some boards it is therefore crucial to select the right slot. So double check the hardware notice of your board. On the RBM33G routerboard we may use both slots but we can change the behavior of the second slot with one of the jumpers on the board and redirect USB2 to the second slot. If you only have one modem then use the J8 slot, which is the one close to the edge here. If you want to add a Wifi card to the device then use the middle slot for Wi-fi. If you are using a hardware without mPCIe slot then you may for example use a USB adapter like this one or even a shield for the Raspberry Pi which requires an external USB cable to be connected. These adapters come with SIM card slots. The Routerboard already has SIM card slots so we don’t need that. Next, we need to connect the antennas. I have 3D printed that case which I have found on Thingiverse. Unfortunately the antenna connectors are very close to the slots and actually cover the cards in a way that you can’t take it out any more. Also, the antenna connectors are quite close to each other which will require additional measures in order to avoid antenna interference. But I’ll come to that. First let’s use those pigtail connectors as they are called and connect two RP SMA connectors to the IPEX connectors on the LTE modem. The outputs that you need to connect are the outer two ones – main and div (div stands for diversity antenna). You do not need to connect GNSS – that’s actually a GPS antenna connector. The Quectel card has a built-in GPS. But usually I know where my router is, so I do not need GPS here. Awesome – I have just said that there are caveats with regards to the antennas. Let me explain. Let’s look at this short animation here. I have an LTE tower and my LTE device also has an antenna and sends and receives data from and to the tower. Now – LTE supports MIMO – that’s short for Multiple Input, Multiple Output. That means that we can use multiple antennas in order to send and receive at the same time. Unfortunately, those antennas are also influencing each other. The sending antenna would influence the receiving antenna, especially as they would be very close to each other in this setup. In order to avoid this we could use a trick. We could set one antenna to actually send or receive vertically and the other one horizontally. That’s called polarization. But – we can’t tell the tower to change its polarization. Therefore, we just bend both antennas in a 45 degrees angle so that they form a 90 degrees angle between them. This way we would just be 45 degrees off to the tower, but our two antennas would just not notice each other. In my setup with those paddle antennas that I am using here this would look like this. Cool – enough Antenna talk. Let’s insert a SIM card into the router and switch it on. I log into the Rooter page and here we can instantly see the difference towards standard OpenWrt. There is an additional modem menu here that helps us set up different LTE hardware. Also – if we check on the System – then Software menu – we can see that there are a lot of software packages preinstalled here. Especially the wwan drivers and utilities for the various modems using the various protocols such as QMI. Rooter also comes with MWAN3 preinstalled so you could do stuff like policy based routing for higher availability and bandwidth. But let’s cover that in a different episode. There’s a lot of tools in this software. The only thing that I really had to do in order to get a connection was that I created a profile here under connection profile. I attached that profile to the SIM card – that means that this profile will be loaded whenever I insert that specific SIM card. The only parameter which I changed really here is the APN – that’s short for Access Point Name and is in fact the gateway between the 4G network and the internet. Those settings depend on your provider and can easily be googled for. In my case it’s web.vodafone.de as I have a Vodafone SIM card here. Just a quick tip – if you change these values then it might be safe to reboot the router in order to make sure that they are taken into account. I had changed them on the fly but when I checked on this “Debug Information” page here, then I could see that the changes had not been taken into consideration. I could not use the Disconnect Modem function here in order to reload as the modem was not yet connected. Kind of a catch 22 really. Safest bet – reboot after changes. Great, once I had put that in then I actually got connected and could enjoy LTE internet connection. Just another quick tip with regards to the Rooter software as opposed to standard OpenWrt. Do not change, add or remove the WAN interfaces here manually. The modem profiles are attached to the WAN1 and WAN2 interfaces. If you keep the defaults, then you should be up and running quite quickly. Just before we close, let me do a quick speed test with my router. Rooter has built in speed tests. Let’s do that. I switch off the WAN connection in order to make sure that we measure the LTE and let’s go. 70 Mbits down. And 40 Mbits up. that’s great. I am happy. Maybe a couple of last words with regards to using Rooter as opposed to standard OpenWrt. Rooter is really a separate build. That means that it is based on OpenWrt and also it comes with the list of sources for packages from OpenWrt but you can not necessarily install everything on it. Especially Kernel modules, so everything that has kmod in its name. That’s because Rooter does not have their own software package distribution system. So if you are planning on having additional hardware in the router such as bleeding edge Wifi 6 hardware etc, then you might run into issues there. A better solution in this case would be to use plain OpenWrt and add the bits and pieces of Rooter to your installation. We’ll see how to do that in one of the next episodes when I will use that PCEngines APU board. Guys, that’s it for today – but please let me know if you want to see more content on LTE 4G please. I could think of doing this installation with plain OpenWrt on my Banana Pi R64 or – we could talk about Internet availability using MWAN3 and policy based routing – basically use the LTE as a backup for a wired connection. Or – we could build this with a Raspberry Pi using either the USB adapter or the mPCIe shield. Please do leave me a comment. Anyhow – many thanks for watching, liking, commenting, subscribing and sharing the video on social media such as reddit, Facebook, Twitter and what else. Again – many thanks for watching. Stay safe, stay healthy, bye for now.