Connecting 4G usb stick to internet in Linux using command line wvdial or qmicli ( examle Telewell LTE usb )

Traditional wvdial way (non qmi)

I go this trought shortly and expect that you know normal hasle needed for usb modems... You will need support for /dev/ttyUSBx devices in your kernel (might have been usb to serial drivers) and usb_modeswitch to get stick to state that you get /dev/ttyUSBx devices.

Once you have /dev/ttyUSBx devices, check which of 3 devices is for at commands. There was some tool to do that, but trial and error is the method I do recall now ;) . AT device has newer been the first device for me thus if you have only 3 ttyUSBx devices good quess is that /dev/ttyUSB2 is the one you need.

So my only real wvdial tip is that do not keep trying that /dev/ttyUSB0 endlesly if it dosen't work ( these modems can create 3 or more tty devices ).

My wvdial.conf file has all I am using to get connected with wvdial

qmi networking way with qmicli (commandline qmi tool)

You need kernel module qmi_wwan ( drivers - network - usb net ). You might need some udev magic to get your wwan0 device name, but you could also replece wwan0 in commands with what ever device name you happen to get.

sudo ifconfig wwan0 up

Then we need qmicli application to make the connection. qmicli can be used for signal strenght, location info etc, but it was not straight ovious for me that it can be used to create connection.

sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode=online

This can fail time to time ( I remove and insert the stick which normally helps ).

sudo qmicli -d /dev/cdc-wdm0 --wds-start-network=internet --client-no-release-cid

Now if in luck you are connected. You could fetch ip with sudo dhcpcd wwan0 and do other network magic you need...

My motive to write this

It was pain to find out how to get 4G connected and use networkmanager comments did not help that much ( I use terminal driven non automagical X env for my limited GUI needs ). I managed to get connected with wvdial once noticed that one created devices was AT command cabable modem. I did try early on to use wrong device with wvdial and thought stick works only with qmi driver. It would be nice to Telewell point out that there is traditional AT interface available. Telewell comments that I must have Ubuntu and install "telewell qmi drivers" was not helping. Telewell qmi drivers are just the general ones from Linux kernel tree and those are working outside ubuntu just fine.

It would have been nice to know ealyer about qmicli and that one can get connected with it.

Sorry for not writeing complete guide just some pointers that might help if you mosly know what you are doing. If you are using Ubuntuish system it might be good idea to use automagic network manager included...

Last edited 12/2015