Tuesday, October 7, 2014

Turn your old wireless router into an LTE router with OpenWRT

Today's article has nothing to do with the NUC. Instead, I'm going to show you how you can turn your old wireless router into an LTE router if you just have an QMI-compatible LTE dongle. I recently got an LTE 4G mobile broadband connection that came with a Huawei E392 USB dongle. I found that the dongle was quite tedious to use on a laptop as it did not allow me to use the connection with multiple devices easily. A proper LTE router would have cost around €200 where as this project turned my old wireless router and the dongle that came with my subscription into an LTE router for no additional cost!

So I had a Western Digital N750 router and a Huawei E392 dongle.

OpenWRT is an open operating system that is meant to replace the OS that is running on many off-the-shelf wireless routers. It provides additional features compared to the manufacturers original firmware.

Is my router supported?

To make this happen, you will need a router that has a USB 2.0 port and that is supported by OpenWRT. The guys over at OpenWRT maintain a list of devices that are supported. Western Digital has discontinued their line of routers, so they're being sold currently for a fraction of the money I paid for mine! There are many others as well and this article will pretty much apply for any supported router.

My 3G/LTE Dongle - is it supported?

This is a more tricky question. Basically if your dongle runs Qualcomm's QMI protocol and it is supported by the qmi_wwan Linux module it should be fine. Huawei E392, E398, Vodafone K5005 and many others belong to this category. Do note that there are other drivers for other types of dongles, but this article only covers QMI dongles!

Installing the OpenWRT on the Router

It's good idea to go to the OpenWRT website where they maintain a page for each supported device. For example for WD MyNet N750 the page is here and for N600 here.

Basically the process is following:

  • Locate the OpenWRT image for your router (there's one you need for flashing over a factory image and another one you use for upgrades - choose the factory image if your flashing OpenWRT for the first time)
  • Download the image
  • Load the image into your router via the management web interface that your router has. Typically available at http://192.168.0.1 or http://192.168.1.1 Check the manual of your router or the OpenWRT installation page. If you've changed the settings on your router, there's usually a reset button to clear the settings, but if you can access the web interface it's not typically necessary to clear them.
  • Configure your router

These steps depend on the model of the router and are typically well-described on the OpenWRT page. After the software is flashed, the router will reboot and it will be running OpenWRT. Time to start the actual configuration!

Change the root password

Now that you have your router up, connect your computer to it with a cable and let it retrieve the IP address automatically using DHCP (this is usually what you do if you don't have a static IP address configured for the computer). Then open a browser and point it to http://192.168.1.1 address. You will see page saying that there is no root password configured and that you should change it. Do that.

When you've changed the root password you should be able to see the status of the router in the web interface.

Installing QMI Drivers

The QMI drivers are not installed in OpenWRT by default. So you will need to install them manually. There are 2 ways to handle this installation. Either you have wired Internet connectivity to your router, which makes things very easy for you. However, I did not have, so I had to download the packages beforehand and then transfer them to my router and install them. This article describes what I had to do. If you have connectivity to your router, skip here.

Prerequisite Software

Download and install the following software on your laptop. If you use other OS than Windows, you can use other similar software.

OpenWRT Packages

Download the following packages. You can find all the packages here: downloads.openwrt.org/barrier_breaker/14.07/. At the time of writing 14.07 is the latest stable release. In case you're installing a later release, download the packages for the corresponding release. Under that link you will find a folders for each type of architecture. You will need to determine the type of architecture that applies to your router (the factory image download link contains the architecture, so if unsure look at that link). For WD N600 and N750 it's ar71xx. Under the architecture folder you will need to go into generic/packages/base folder and download the following packages:

  • libpthread
  • kmod-mii
  • kmod-usb-net
  • kmod-usb-wdm
  • kmod-usb-net-qmi-wwan
  • librt
  • libusb-1.0
  • usb-modeswitch
  • uqmi

Installing the Packages

Now open up WinSCP and create a new connection to your router. Select SCP as the protocol, enter 192.168.1.1 as the IP, root as the username and the password you set earlier.

Drag and drop the download packages to the right side which represent the files in your router.

Good, now you can close WinSCP and open the other software you downloaded, PuTTY. Define 192.168.1.1 as the IP address and hit connect.

After a confirmation you will see a terminal screen and a command line prompt.

Now enter the command to install all the packages that you had downloaded.

opkg install *.ipk

If you are missing some package, it will complain about missing dependencies. If that happens, go back, download the missing packages, transfer them to your router and try again. Successful output should look like this:

root@OpenWrt:~# opkg install *.ipk
Installing kmod-mii (3.10.49-1) to root...
Installing kmod-usb-net-qmi-wwan (3.10.49-1) to root...
Installing kmod-usb-net (3.10.49-1) to root...
Installing kmod-usb-wdm (3.10.49-1) to root...
Package kmod-usb-net (3.10.49-1) installed in root is up to date.
Package kmod-usb-wdm (3.10.49-1) installed in root is up to date.
Installing libpthread (0.9.33.2-1) to root...
Installing librt (0.9.33.2-1) to root...
Installing libusb-1.0 (1.0.9-1) to root...
Installing uqmi (2014-05-27-d7a56cad6d6ef3c2a5602fc604ee78fa) to root...
Installing usb-modeswitch (2014-07-18-01ecc3b97648f9adb0cd33) to root...
Configuring libpthread.
Configuring kmod-mii.
Configuring kmod-usb-net.
Configuring kmod-usb-wdm.
Configuring kmod-usb-net-qmi-wwan.
Configuring librt.
Configuring libusb-1.0.
Configuring usb-modeswitch.
Configuring uqmi.

That's it, the packages are there. Now reboot the system by issuing a command reboot and proceed from chapter Configuring QMI just a little bit below. Note that you will lose connectivity when the system is rebooted.

reboot

Installing the Packages with Internet Connectivity

If you had wired connectivity on your routers WAN port, there would be no need to transfer the files with WinSCP or PuTTY. Instead you could go to web interface with your browser and open System -> Software. Click Update lists then type uqmi in the box that says Download and install package and click OK. Repeat for packages usb-modeswitch and kmod-usb-net-qmi-wwan. Then reboot the system via System -> Reboot.

Configuring QMI

At this point, you may want to log in to the router and confirm that you have a /dev/cdc-wdm0 device present. This represents your USB dongle.

root@OpenWrt:~# ls -l /dev/cdc-wdm0
crw-r--r--    1 root     root      180, 176 Oct  1 12:03 /dev/cdc-wdm0

If you do not have it, try to run the following, wait a short while and check again:

usbmode -l
usbmode -s

If you still don't have /dev/cdc-wdm0 present, run logread and try to see if you can find any clues in the logs.

Now that you have your /dev/cdc-wdm0 device present, you can check that device is responding correctly.
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status
"disconnected"
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
{
        "type": "lte",
        "rssi": -61,
        "rsrq": -6,
        "rsrp": -88,
        "snr": 290
}

The commands show that mine is disconnected currently and has LTE coverage at the moment. Now I need to issue a start-network command. For that I need to know which APN my dongle needs to use (typically internet, but check from your operator) and if authentication is used. In my case there's no authentication.

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect
38750672
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status
"connected"

The autoconnect parameter is important. It makes sure that device automatically reconnects when you restart your router or if you lose the connection for a while. In case you need to define authentication, add the parameters username and password plus possibly the auth-type to the start-network command line:

  --start-network :            Start network connection (use with options below)
    --auth-type pap|chap|both|none: Use network authentication type
    --username :              Use network username
    --password :          Use network password
    --autoconnect:                  Enable automatic connect/reconnect

Now the last thing to do is to add the following lines into /etc/config/network file:

config interface 'wwan'
        option ifname 'wwan0'
        option proto 'dhcp'

You can do this using the vi text editor, but if you're not comfortable with that, point your browser to 192.168.1.1 again, choose Network -> Interfaces and click Add new interface.

Write wwan as the name of the interface and make it cover the wwan0 interface. Choose DHCP client as the protocol.

If you go back to the list of network interfaces, you should soon see the IP address that your dongle has received from your operator.

We're almost there! Now you need to make sure that wwan interface belongs to your firewall's WAN zone. To do that, go to Network -> Firewall, scroll down to wan and click the Edit button.

Now add a checkmark to the wwan box under Covered networks heading, click Save & Apply and you're done.

That's it! You've configured OpenWRT to be your LTE router. Now you can add other kind of functionality like wireless networks, tweak the firewall rules, install further software into the box - possibilities are almost endless. Or then you can just use it to share your USB dongle to your network. Finally, a speedtest.net result of 70+ Mbps downlink and 35+ Mbps uplink - not too bad.

44 comments:

  1. Hello! This is my first comment here so I just wanted to give a quick shout out and say I really enjoy reading through your blog posts. Can you suggest any other blogs/websites/forums that deal with the same topics? Thanks a lot!

    ReplyDelete
  2. Why not install via opkg?
    opkg update
    opkg install package name

    ReplyDelete
    Replies
    1. That definitely is a possibility if you can provide wan connectivity for your OpenWRT box. I only had a laptop, router and the USB LTE dongle so I had to download the stuff on the laptop using the dongle, move them to the router and install. Only then the dongle became usable in OpenWRT and I could do an opkg update. :)

      Delete
  3. what type of stick would a Bell Turbo Stick be? it's a lte/4g usb dongle
    thanks

    ReplyDelete
  4. nice post… simple and useful :).... Plz visit my site...! Thanks
    Technical Support Engineering Services in Delhi,

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. BUY NOW The Intercel UltraSAM 4G/LTE router An industrial-grade cellular modem router
    supporting various networks and service types including UMTS/HSDPA/HSUPA/LTE and
    delivering high download speeds of up to 100 Mbps.

    https://www.intercel.com.au/product/ultrasam4w/

    ReplyDelete
  7. In this article understand the most important thing, the item will give you a keyword rich link a great useful website page:
    top-5-best-wireless-routers

    ReplyDelete
  8. Mrhomereview is a high quality and trustworthy website that offers the most popular items in "Home and Kitchen" such as wireless router, coffee maker, oven, treadmill, vacuum clean and so on. For more details, please click here: mrhomereview.com

    ReplyDelete
  9. As you are facing the Router Error Code 448 this article will guide you on how to fix Router error code 448. The steps are also quite easy and smart. For more information, just dial Router Error Code toll-free helpline numbers USA/CA: +1-888-480-0288 and UK/London: +44-800-041-8324.

    ReplyDelete
  10. When you get a Roku error code 003, it simply means that your Roku player is unable to update the software. At the time of setup, you may have completed all the process and an IP address is also allocated. For more information to find the best solution. Just dial our toll-free helpline numbers at USA/CA: +1-888-271-7267 and for: UK/London: +44-800-041-8324.

    ReplyDelete
  11. This might help you resolve the issue of Echo Not Working. There can be a possibility where you are facing this issue and are not able to resolve it. For more information, visit our website echohelpline.com

    ReplyDelete
  12. If you are not able to follow the process of canon printer error 5100 and looking for help. Then you can get in touch with our experts.

    ReplyDelete
  13. Do you want to know how to fix Netgear Router Error 403 Forbidden? Visit our website Router Error Code. You can also discuss our experienced experts about your issues. We are always 24*7 ready to help you.

    ReplyDelete
  14. Are you finding the best solution on how to fix Roku Error Code 005? Well, don’t you worry get in touch with our experienced experts to help you find the best solution? Our experienced experts are available 24*7 hour. Just dial Smart TV Error toll-free helpline numbers at USA/CA: +1-888-271-7267 and UK/London: +44-800-041-8324.

    ReplyDelete
  15. If your router shows an Error like Linksys Router Error 2197, here we are explaining the errors as if you are taking it up for the first time. You can skip the steps which you are already done with. You can also get in touch with our experts for more information.

    ReplyDelete
  16. Are you looking for a solution on how to resolve D-Link Wi-fi Extender Setup? Don’t worry visit our website or get in touch with our experienced experts. Our experts are available 24*7 hours for you. For more information, call our toll-free helpline numbers at USA/CA: +1-888-480-0288 and UK/London: +44-800-041-8324.

    ReplyDelete
  17. Thanks for sharing !!! for more information on arris firmware updateyou can visit here !

    ReplyDelete
  18. The arris router setup process begins with accessing the arris router setup wizard on your
    web browser. On more information arris setupplease visit!!

    ReplyDelete
  19. If you are facing Problem Roku stick not working and want to solve the problem, you can dial our experts number +1-844-521-9090 or visit our website Smart-Tv-Error.com .Our team is 24/7 available for users to provide the best solution.

    ReplyDelete
  20. If you are facing Garmin Nuvi 1300 Update related issue and want to solve the problem, you can dial our toll-free number +1-888-480-0288 or visit our website Our team is 24/7 available for users to provide the best solution.

    ReplyDelete
  21. Are you searching for an easy method to solve the problem of the canon printer won't connect to wifi Then you are at the right place. We are a team of skilled technicians, who are known for their best printer services. Visit Printer Offline Error to know more.

    ReplyDelete
  22. Facing difficulty in fixing kindle won’t connect to wifi issue? Don’t worry, get a detailed guide on how to solve kindle won’t connect to wifi error from our highly experienced technicians. To know more visit the website Ebook Helpline.

    ReplyDelete
  23. What are the reasons for Roku Won’t Connect to Wifi? Get connected with the highly skilled experts of Smart TV Activation and get the solution within minimum time. Our team is available round the clock to help you. Feel free to call us at toll-free helpline number USA/Canada: +1-888-270-6412 and check out the website to know more.

    ReplyDelete
  24. Are you looking for a solution why d-link router not working? Don’t worry, visit our website or get in touch with our experienced experts. Our experts are available 24*7 hours for you. For more information, call our toll-free helpline numbers at USA/CA: +1-888-480-0288.

    ReplyDelete
  25. Keep the Rockspace wireless extender in the most centralized location of your home. Wi-Fi extenders come in a default login credential, which is Re.rockspace.local login. You just need to plug-in the range extenders near the power outlet of the extender. Desktop version of the latest Rockspace extenders has several Ethernet ports so that you can maximize the internet speed according to you, by connecting the device directly. The digits like 192.168.1.1 is the default Rockspace WIFI extender IP address used by Rockspace broadband extenders, and other network extenders. Whereas the Rockspace Extender setup is a networking gateway equipment.

    ReplyDelete
  26. Limiting the WIFI signal strength of your http://Re.rockspace.local, along with the coverage area, resolves a lot of Logging issues. Here is the article that goes through your Rockspace WIFI Extender setup. The "Rockspace 750 Mbps" which is a basic home WIFI extender. The configurations will be the same to other Rockspace WIFI extenders if you went through the account setup, then configuration. Open the access point/extender configuration page. If you have not changed the default IP address of your Rockspace extender, then you can easily access the ap.setup page.

    ReplyDelete
  27. If you are facing Problem Roku error code 018 and want to solve the problem, you can dial our experts number +1-844-521-9090 or visit our website Smart-Tv-Error.com .Our team is 24/7 available for users to provide the best solution.

    ReplyDelete
  28. Dial our toll-free numbers at USA/Canada: +1-855-869-7373 and UK/London: +44-800-041-8324, if you are unable to fix Orbi Satellite Not Syncing. Our experts are available 24*7 hours and ready to help you. To get 24*7 instant help, visit the website Orbi Helpline or get in touch with us.

    ReplyDelete
  29. Are you going to face issues with Brother Printer Error 04? If yes, don't worry; we are always 24*7 ready to help you. You can consult with our experienced experts. Need any instant help? Contact our experts on toll-free numbers at USA/CA: +1-888-966-6097 and UK/London: +44-808-169-7737.

    ReplyDelete
  30. Why do I not see my repeater network after configuration settings? Your Rockspace Extender might have a name like "Rockspace Extender_YYYY" for the configuration. When you do the Re.rockspace.local setup, it gets a new wifi name. In some Rockspace Extender models, they have the same wifi name as in your existing wifi name. But in some other Rockspace Extender models, you see "_EXT" is added at the end of your wifi name. It is always advisable to create a new and unique wifi name. As an example, if the actual wifi name is "WXYZ" after configuration.

    ReplyDelete
  31. Are you looking for a solution on how to reset d-link router password? Don’t worry, visit our website or get in touch with our experienced experts. Our experts are available 24*7 hours for you.

    ReplyDelete
  32. Thank you for sharing the post. Very helpful for me
    Learn how to Setup D-Link Router on our website? If you need any help regarding setup to router don’t worry, we are here for you to resolve the queries instantly. Just dial toll-free helpline number at USA/Canada: +1-888-480-0288. We are 24*7 hours available.

    ReplyDelete
  33. Checkout the latest blog to why Roku Error Code 014.40 on our website. If you are confused about how to fix yourself. Don’t worry, get in touch with us. We are here for you to fix the errors easily and instantly. Just dial toll-free helpline number at USA/Canada: +1-888-270-6412. We are 24*7 hours available.

    ReplyDelete
  34. The TP-Link TL WA855RE Setup process deals with configuring your TP-Link router device for uninterrupted internet access and more. You can set parental controls, configure the network settings like the username and the password, and change the details and more. Visit the TP-Link setup guide on our website for more info.

    ReplyDelete
  35. The Linksys WRT32x Router Setup wizard gives you access to the Linksys router device and allows you to set up a working internet connection. You can navigate through different pages and follow the steps mentioned on our website to access the Linksys router setup wizard and get done with the network configuration.

    ReplyDelete
  36. The Linksys RE6700 AC1200 Extender Setup page can help you gain access to the settings of your extender device. For help with the setup process and login page, you can always refer to the blogs section of our website. For further help, you can log in to the setup wizard and then proceed with the steps as mentioned.

    ReplyDelete
  37. Your Epson printer can stop printing black and white prints if the printer detects the color ink cartridges to be empty. To resolve Epson printer won't print black and white without color ink first, cancel the print job, and when the Epson Status Monitor status appears, click 'Stop.' Now, load plain paper in the tray. Click 'File' and select 'Print Setup.' Now, click on 'Properties' and open the 'Main.' Select 'Plain' or 'Envelope' as the typesetting. Then, select the 'Grayscale' checkbox in the 'Print' options and click 'OK.' Now, try to print your file to check if the Epson printer can only print black and white.

    ReplyDelete
  38. If you are Looking for how to Roku buffering problems , you can visit our website or call our experts at +1-844-521-9090 . Our team is 24/7 available for users to provide the best solution.

    ReplyDelete
  39. Checkout the latest blog on this website to Reset Linksys Router Password. In this article describe the causes of Linksys Router. Hope that you can resolve the issue yourself. Read more:- https://bit.ly/3GtOzu4

    ReplyDelete
  40. If you are not able to solve Roku Error code 0033 , then you can visit our website or call our experts at +1-844-521-9090 . Our team is 24/7 available for users to provide the best solution.

    ReplyDelete
  41. In larger areas wireless transmission is required, re.rockspace.local wifi extender function as a repeater to boost the signal. You can Setup Rockspace Extender using the , Rockspace website . To setup the rockspace Account or to login Rockspace Setup simply open the turn on your rockspace extender.

    ReplyDelete