Why is IoT still so doggone difficult? I don’t get it… we know how to do it, right?
August 9, 2022Key things to consider when selecting an cellular IoT connectivity solution for your IoT Device
August 30, 2022Order your Simplex Test SIM card here!
Starting TELIT LE910-NA1 in Linux
The LE910-NA1 module is an older mini-PCIE cellular module, which is capable of LTE CAT-1 speeds. For an IoT project involving low data transmission rates, it’s a viable choice. The newer replacement for this module would be the LE910C1-NFD, for North American markets.
The module we’re testing was inserted in a USB to mini-PCMCIA enclosure. We were testing on Linux desktop to get the steps required to move to a smaller distribution (i.e. Raspberry PI).
The steps below have been tested on several variants of Linux (Mint 20 and Arch primarily).
Prerequisites
The Telit module uses the cdc_adm and cdc_ncm Linux drivers, and this appears to be installed on several of the Linux distributions that we tested.
The steps below require
- modemmanager be enabled and running
# systemctl enable ModemManager # systemctl start ModemManager
- networkmanager be enabled and running
# systemctl enable NetworkManager # systemctl start NetworkManager
Plugging in the modem
The first step is to make sure that the modem is visible. From the command line, do:
$ lsusb ... Bus 001 Device 022: ID 1bc7:0036 Telit Wireless Solutions FIH7160 ...
And identify the modem using the modem manager:
$ mmcli -L /org/freedesktop/ModemManager1/Modem/6 [Telit] LE910-NA1
This means the modem index is 6
$ mmcli -m 6 -------------------------------- General | path: /org/freedesktop/ModemManager1/Modem/6 | device id: 27afe8013447674bbe67aec2dac663322e60a9d3 -------------------------------- Hardware | manufacturer: Telit | model: LE910-NA1 | firmware revision: 20.00.522 | supported: gsm-umts, lte | current: gsm-umts, lte | equipment id: 357766097873223 -------------------------------- System | device: /sys/devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:05:00.1/usb1/1-4 | drivers: cdc_acm, cdc_ncm | plugin: telit | primary port: ttyACM0 | ports: ttyACM0 (at), ttyACM1 (ignored), ttyACM2 (ignored), | ttyACM3 (at), ttyACM4 (ignored), ttyACM5 (ignored), wwx000011121314 (net) -------------------------------- Status | unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10) | state: registered | power state: on | access tech: lte | signal quality: 100% (recent) -------------------------------- Modes | supported: allowed: 3g; preferred: none | allowed: 4g; preferred: none | allowed: 3g, 4g; preferred: none | current: allowed: 3g, 4g; preferred: none -------------------------------- Bands | supported: utran-5, utran-2, eutran-2, eutran-4, eutran-5, eutran-12, | eutran-13, eutran-17 | current: utran-2, eutran-2 -------------------------------- IP | supported: ipv4, ipv6, ipv4v6 -------------------------------- 3GPP | imei: 357766097873223 | registration: roaming -------------------------------- 3GPP EPS | ue mode of operation: csps-1 -------------------------------- SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/0
The first thing to do is to bring the modem into a connected state. The simplest way to do this is to do the “simple-connect” command. In this command, the argument list includes the APN associated with the SIM.
$ mmcli -m 6 --simple-connect="apn=simplex.iot" successfully connected the modem
If we query the modem state again, we get the following. Several things have changed. State is now “connected”. A “Bearer” is now defined. And the 3GPP stanza is now filled out.
$ mmcli -m 6 -------------------------------- General | path: /org/freedesktop/ModemManager1/Modem/6 | device id: 27afe8013447674bbe67aec2dac663322e60a9d3 -------------------------------- Hardware | manufacturer: Telit | model: LE910-NA1 | firmware revision: 20.00.522 | supported: gsm-umts, lte | current: gsm-umts, lte | equipment id: 357766097873223 -------------------------------- System | device: /sys/devices/pci0000:00/0000:00:01.2/0000:01:00.0/0000:02:08.0/0000:05:00.1/usb1/1-4 | drivers: cdc_acm, cdc_ncm | plugin: telit | primary port: ttyACM0 | ports: ttyACM0 (at), ttyACM1 (ignored), ttyACM2 (ignored), | ttyACM3 (at), ttyACM4 (ignored), ttyACM5 (ignored), wwx000011121314 (net) -------------------------------- Status | unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10) | state: connected | power state: on | access tech: lte | signal quality: 71% (recent) -------------------------------- Modes | supported: allowed: 3g; preferred: none | allowed: 4g; preferred: none | allowed: 3g, 4g; preferred: none | current: allowed: 3g, 4g; preferred: none -------------------------------- Bands | supported: utran-5, utran-2, eutran-2, eutran-4, eutran-5, eutran-12, | eutran-13, eutran-17 | current: utran-2, eutran-2 -------------------------------- IP | supported: ipv4, ipv6, ipv4v6 -------------------------------- 3GPP | imei: 357766097873223 | operator id: 310410 | operator name: AT&T | registration: roaming -------------------------------- 3GPP EPS | ue mode of operation: csps-1 -------------------------------- SIM | primary sim path: /org/freedesktop/ModemManager1/SIM/0 -------------------------------- Bearer | paths: /org/freedesktop/ModemManager1/Bearer/1 But we are not yet in a usable state. The network interface is not enabled. $ ip addr list ... 9: wwx000011121314: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:00:11:12:13:14 brd ff:ff:ff:ff:ff:ff
So let’s bring up the network interface:
$ nmcli device show ... GENERAL.DEVICE: ttyACM0 GENERAL.TYPE: gsm GENERAL.HWADDR: (unknown) GENERAL.MTU: 0 GENERAL.STATE: 30 (disconnected) GENERAL.CONNECTION: -- GENERAL.CON-PATH: --
and then we use this info to create a NetworkManager connection
$ nmcli c add type gsm ifname ttyACM0 con-name TELITModem apn simplex.iot Connection 'TELITModem' (a5609382-2ab3-4cd9-af27-ed5d77adc2f7) successfully added.
Now we have a PPP interface with an IP on it:
$ ip addr list ... 14: wwx000011121314: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:00:11:12:13:14 brd ff:ff:ff:ff:ff:ff 16: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 3 link/ppp inet 10.64.2.1/32 scope global ppp0 valid_lft forever preferred_lft forever inet6 fe80::817f:6769:45f4:ce82 peer fe80::5874:5120:c11d:e152/64 scope link noprefixroute valid_lft forever preferred_lft forever inet6 fe80::8912:4f56:caf1:2ab7/64 scope link noprefixroute valid_lft forever preferred_lft forever
If we query in using nmcli again, we see a more complete picture of the situation:
$ nmcli device show
…
GENERAL.DEVICE: ttyACM0 GENERAL.TYPE: gsm GENERAL.HWADDR: (unknown) GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: TELITModem GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/11 IP4.ADDRESS[1]: 10.64.2.1/32 IP4.GATEWAY: 10.64.2.1 IP4.ROUTE[1]: dst = 10.64.2.1/32, nh = 0.0.0.0, mt = 20700 IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 10.64.2.1, mt = 700 IP4.DNS[1]: 172.25.128.100 IP6.ADDRESS[1]: fe80::8912:4f56:caf1:2ab7/64 IP6.ADDRESS[2]: fe80::817f:6769:45f4:ce82/64 IP6.GATEWAY: fe80::5874:5120:c11d:e152 IP6.ROUTE[1]: dst = fe80::/64, nh = ::, mt = 700 IP6.ROUTE[2]: dst = fe80::817f:6769:45f4:ce82/128, nh = ::, mt = 700 IP6.ROUTE[3]: dst = fe80::5874:5120:c11d:e152/128, nh = ::, mt = 700 IP6.ROUTE[4]: dst = fe80::5874:5120:c11d:e152/128, nh = ::, mt = 256 IP6.ROUTE[5]: dst = ::/0, nh = fe80::5874:5120:c11d:e152, mt = 20700
Managing the connection
For the most part, the ModemManager commands above are not necessary. Once the connection is defined in NetworkManager, (in the original command set above, it was called TELITModem):
$ nmcli conn up TELITModem Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/23)
$ ip addr list ... 21: wwx000011121314: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:00:11:12:13:14 brd ff:ff:ff:ff:ff:ff 24: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 3 link/ppp inet 10.64.2.1/32 scope global ppp0 valid_lft forever preferred_lft forever inet6 fe80::212e:5f68:650e:a854 peer fe80::8c88:36a:1292:91f9/64 scope link noprefixroute valid_lft forever preferred_lft forever inet6 fe80::8912:4f56:caf1:2ab7/64 scope link noprefixroute valid_lft forever preferred_lft forever
And to bring the connection back down:
$ nmcli conn down TELITModem Connection 'TELITModem' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/23)
Order your Simplex Test SIM card here!
Questions or comments? Drop us a line.
Best regards,
James Hudgens
CTO Simplex Wireless