Thales IoT Developer Community
Make the ELS81-E/US MBIM Function Works with Ubuntu Linux 18.04
Tutorial, February 14, 2019 - 10:51am, 7397 views
Because Microsoft drawed up the Mobile Broadband Interface Model (MBIM) specification and pushed it as an open standard, MBIM interface works well with Windows 8, 8.1 and 10. The built-in Windows connection manager also relys on MBIM interface to control of the cellular modules.
ELS81 and some of newer Cinterion 4G/LTE cellular modules implements the USB MBIM interface.
Although MBIM is mostly a specification for Microsoft Windows, newer version of Linux distribution can support it. Any distribution contains Linux kernel v3.8 or newer version and libmbim userspace library/utility can support cellular MBIM devices.
In this article, we'll demostrate how to make the ELS81-E/US MBIM function works with Ubuntu Linux 18.04. There are Preparations and Configurations tasks to be done on ELS81 and Ubuntu Linux. Here we assume you all knows how to input AT command to a cellular module/modem, how to input command or apply change to a Linux system.
1. For ELS81, one has to enable MBIM function on via this AT command:
2. After applying it please remember to reboot/reset the ELS81 to allow the setting to take effect.
3. To verify if ELS81 has booted-up with MBIM function enabled, you can attached ELS81 via USB with a Linux PC and run:
If the output looks like this and including cdc_mbim, then ELS81 is good to go:
[ 125.072051] usb 2-1.2.4: new high-speed USB device number 14 using xhci_hcd [ 125.176781] usb 2-1.2.4: New USB device found, idVendor=1e2d, idProduct=005d, bcdDevice=17.29 [ 125.176783] usb 2-1.2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 125.176785] usb 2-1.2.4: Product: ELSx [ 125.176786] usb 2-1.2.4: Manufacturer: Cinterion Wireless Modules [ 125.882279] cdc_acm 2-1.2.4:1.0: ttyACM0: USB ACM device [ 125.883586] cdc_acm 2-1.2.4:1.2: ttyACM1: USB ACM device [ 125.884274] cdc_acm 2-1.2.4:1.4: ttyACM2: USB ACM device [ 125.884734] cdc_acm 2-1.2.4:1.6: ttyACM3: USB ACM device [ 125.885280] cdc_acm 2-1.2.4:1.8: ttyACM4: USB ACM device [ 125.886183] usbcore: registered new interface driver cdc_acm [ 125.886184] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters [ 125.915537] usbcore: registered new interface driver cdc_ncm [ 125.924838] usbcore: registered new interface driver cdc_wdm [ 125.969215] cdc_mbim 2-1.2.4:1.10: setting rx_*** = 16384 [ 125.969703] cdc_mbim 2-1.2.4:1.10: cdc-wdm1: USB WDM device [ 125.970365] cdc_mbim 2-1.2.4:1.10 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-1.2.4, CDC MBIM, fe:00:09:90:0e:42 [ 125.970558] usbcore: registered new interface driver cdc_mbim
4. On the PC to be used, install Ubuntu 18.04 or newer version.
5. Please disable Modem Manager before starting any following steps:
$ sudo systemctl stop ModemManager.service
6. Then please install the libmbim-utils package; this package provides the mbimcli and mbim-network utility
$ sudo apt-get install -y libmbim-utils
For curious people you can find more details about libmbim here: https://www.freedesktop.org/wiki/Software/libmbim/
After the package installed, the preparation has done. What to do next is Configuration.
1. The aforementioned dmesg output cdc_mbim 2-1.2.4:1.10: cdc-wdm1: USB WDM device shows a device node named as cdc-wdm1 was created during the initialization process. This device will be used everywhere for mbimcli via the parameter --device=/dev/cdc-wdm1 . The proxy function to enable parallel commands to module should also be used in most of cases. This is can be done by including --device-open-proxy or -p in every mbimcli requst to the cellular module.
Ex: Use mbimcli to query device capabilities and information (firmware & IMEI code etc.):
$ sudo mbimcli --device=/dev/cdc-wdm1 --device-open-proxy --query-device-caps
[/dev/cdc-wdm1] Device capabilities retrieved: Device type: 'embedded' Cellular class: 'gsm' Voice class: 'no-voice' SIM class: 'removable' Data class: 'gprs, edge, umts, hsdpa, hsupa, lte' SMS caps: 'pdu-receive, pdu-send' Ctrl caps: 'reg-manual' *** sessions: '8' Custom data class: 'unknown' Device ID: '004401082447729' Firmware info: 'M2M_7160_ATT_ELS61_V1.1_MBIM_N' Hardware info: 'XMM7160_V1.1_MBIM_NAND_ADAPT_R'
Ex: Enter SIM PIN if required, assuming the PIN code is "1234":
$ sudo mbimcli -d /dev/cdc-wdm1 -p --enter-pin=1234
2. mbim-network is a tool to simplify data connection setup process. To use it, one has to create a config file containing operator's APN details, the default path of the configuration file is: /etc/mbim-network.conf .
Assuming the APN to be used is "INTERNET", write below content to the configuration file /etc/mbim-network.conf:
APN=INTERNET APN_USER= APN_PASS= APN_AUTH= PROXY=yes
If the APN requires a username and password then it is also required to fill in the APN_AUTH protocol type with either PAP, CHAP or MSCHAPV2.
3. If the SIM PIN was not set or already entered via proper command, starting the mbim data connection with the command shown bellow, if successful it will print Network started successfully
$ sudo mbim-network /dev/cdc-wdm1 start
4. After the network started, one can query current IP configuration like this:
$ sudo mbimcli --device=/dev/cdc-wdm0 --device-open-proxy --query-ip-configuration
[/dev/cdc-wdm0] IPv4 configuration available: 'address, gateway, dns' IP : '10.191.22.129/24' Gateway: '10.191.22.1' DNS : '184.108.40.206' DNS : '220.127.116.11' [/dev/cdc-wdm0] IPv6 configuration available: 'none'
The data will be used to configure the wwan0 NIC as shown in the aforementioned dmesg output:
[ 125.970365] cdc_mbim 2-1.2.4:1.10 wwan0: register 'cdc_mbim' at usb-0000:00:14.0-1.2.4, CDC MBIM, fe:00:09:90:0e:42
5. Apply below command to setup the wwan0 network I/F
$ sudo ip addr add 10.191.22.129/24 dev wwan0
$ sudo ip link set wwan0 up
$ sudo ip rout add default dev wwan0
6. On Ubuntu 18.04 the DNS setting may have to update via edit /etc/systemd/resolved.conf like below:
$ sudo vi /etc/systemd/resolved.conf
[Resolve] #DNS= FallbackDNS=18.104.22.168 #Domains= #LLMNR=no #MulticastDNS=no #DNSSEC=no #Cache=yes #DNSStubListener=yes
After changing FallbackDNS to have a value 22.214.171.124, remember to restart systemd-resolved service:
$ sudo systemctl restart systemd-resolved.service
Now the MBIM network should be up and running, you can use a browser or some network utility to check and using the cellular Internet!
$ mtr 126.96.36.199
$ mtr www.google.com