Blog Archives

Talking at FOSDEM 2014


Third time in a row, I’ll also be giving a talk at FOSDEM this year:
LTE in your Linux based system

The talk is an introduction to QMI and MBIM devices, how they are exposed by the Linux kernel, and how you can use them from the command line through libqmi, libmbim and ModemManager.

See you there!

QMI-powered broadband connections in OpenWRT

Linux 3.2 kernel with QMI support

When I started to develop the QMI support in OpenWRT, latest trunk was based on the 3.2 kernel series. By the time you read this, OpenWRT may already have a recent enough kernel (>= 3.4), so this custom setup may not be needed any more, so keep it just for reference.

The ‘v3.2.5-qmi’ branch in the Lanedo stable kernel tree contains a set of patches on top of the 3.2.5. Linux kernel release. These patches add support for QMI ports (updated ‘cdc-wdm’ and new ‘qmi_wwan’ driver) in the 3.2 stable series:


OpenWRT with QMI support

The same set of patches was then added to the ‘qmi-support’ branch of the Lanedo openwrt tree, enabling OpenWRT builds with QMI support:

When you compile this OpenWRT build, make sure you configure the kernel with the QMI-specific requirements enabled:


For reference, you can find here the .config I used for the ar71xx-nand builds (installable in a RouterBoard 433UAH).


libqmi-glib and qmi4g

‘libqmi-glib’ and ‘qmi4g’ are two new packages added to the ‘qmi-support’ branch of the Lanedo openwrt-packages tree:

This repository can be added to your OpenWRT build by creating a new ‘feeds.conf‘ with the following contents:
src-git packages git://;qmi-support

The new packages, in detail:

  • libqmi-glib: This package provides a preliminary version of libqmi-glib, as released unofficially by me. This package will provide the libqmi-glib library, the qmicli command line utility and the qmi-network script.
  • qmi4g: This package registers a new ‘qmi4g‘ network protocol, which takes care of launching the network start/stop requests through QMI.

If you’re using the precompiled OpenWRT images I gave above, you can just install these packages using ‘opkg’ once you’ve added the ‘latest’ Lanedo repository.


Configuring qmi4g

Once the qmi4g package is installed, you are then allowed to include the
following configuration under /etc/config/network:

config 'interface' 'broadband'
option 'ifname' 'wwan0'
option 'proto' 'dhcp'
option 'auto' '0'

config 'interface' 'wdm0'
option 'proto' 'qmi4g'
option 'wdmif' '/dev/cdc-wdm0'
option 'wwanif' 'broadband'

The configuration is split into 2 interfaces:

  1. First, the configuration for the ‘wwan0‘ interface. This interface needs to be set with ‘auto‘ equal to ‘0‘, so that it is never brought up automatically; and with ‘dhcp‘ as the protocol to be used. You should never ifup/ifdown this interface manually.
  2. Second, a virtual interface using the new ‘qmi4g‘ protocol, which needs 2 options set: ‘wdmif‘ with the cdc-wdm port to use for the QMI protocol, and ‘wwanif‘ with the uci-interface-name of the wwan iface to use.


Start/Stop the network

Once the qmi4g setup is added in /etc/config/network, you can now then just:
$> ifup wdm0

That command will internally first launch the network start QMI command, and if succeeds it will itself ifup wwan0. The wwan interface can be used as any other eth-based interface now, it can be added as part of multiwan or in a vlan or in a bonding, or anything.

Once the connection is no longer wanted, you can just:
$> ifdown wdm0

That command will stop the network with QMI and also ifdown wwan0.



Once the network configuration is in place, the connection can also be started via web. Just log in to LUCI, go to Network interfaces and you’ll see both the wwan interface (“broadband“) and the virtual “wdm0“. Starting/Stopping the “wdm0” interface via LUCI should work. As said before, you shouldn’t touch the wwan interface directly.


Fools rush in where angels fear to tread

I really had to write an email (quoted below) to the author of this blog post regarding the old GNU/Linux vs Linux battle

Just wanted to tell you that you are sooooo wrong in most of the things
you say… and that it is very very funny how you say you can remove all
GNU apps from several distros.

Did you remove GNU coreutils? Then how can you for example do a simple
“ls” in the command line?

Oh, and do you know what the “G” means in GNOME?

Glib? GTK+? All GNU packages.

And you’re part of an Ubuntu LoCo team —> What about Bazaar, widely
used in Ubuntu, as it is written by Canonical people… Also a GNU

Tell me now what you get if you remove all GNU packages from Ubuntu (if
theoretically possible). Including GLib, GTK+ (and of course all their
dependencies); including coreutils, bash, gdb, gcc… including the
glibc (GNU C library)!

Now what you will probably get?

Probably *nothing*. Even the Linux kernel depends on the glibc.

Now, next time, I would suggest you just read a little bit more and
understand what GNU means, before writing such wrong post.

Check which is the whole list of GNU packages here:


Get every new post delivered to your Inbox.

Join 36 other followers