Monthly Archives: June 2017

  • 0

Add mobile broadband connectivity to Embedded Linux

In this article we will show how to extend an IoT Embedded Linux System with a broadband connection using 3G/4G networks.

Poky/Yocto is used as Linux distribution in combination with the mobile telephony application oFono.

As hardware example we have a raspberrypi, nevertheless the same setup was applied and verified on other standard development kits and custom boards.

For the broadband connectivity Huawei E173  3G USB stick is used:

If using a different modem, check first if it’s supported with oFono. Here is a list of supported hardware.

Kernel configuration

In order to support 3G USB modems, the following kernel configuration options
need to be enabled :

If those options are used, you should see the following in dmesg:

 

Yocto recipes

To support oFono, the image recipe should include the following packages:

To allow ofono integration with network manager connman, the following packages can be added:

Connman shall be then enabled with 3g support:

 

Ofono setup

oFono provides a mobile telephony (GSM/UMTS) application framework that includes consistent, minimal, and easy to use complete APIs. It offers a high-level D-Bus API for use and integrate with other applications.

The advantage of using oFono is that very simple to configure and you will not have to deal with any kind of AT commands.

Plug in your 3G modem and check if recognized by oFono:

Enable modem:

If SIM card is protected with pin, enter the code:

Depending on the country and Network provider, APN setting is to be configured:

Now the modem can be set online and activated:

That’s it! the modem is up and the broadband connection is enabled:

The cellular connection is also available in connman:

we can for example enable cellular connection tethering over wifi:

If having problem to connect with cellular network, you can use list-modem to check the connection status:

Those configuration steps above are persisted to /var/lib/ofono, so on the next reboot, it’s only required to enter the Pin code and activate the modem using online-modem.