Using mikroe "LTE IoT Click" aka u-blox SARA-R410M-02B with native serial UART
Alexander Dahl
ada at thorsis.com
Tue Apr 27 15:38:32 UTC 2021
Hello,
Am Mittwoch, 24. März 2021, 17:07:44 CEST schrieb Alexander Dahl:
> That looks promising, I'll see if I can register to the network if the
> correct SIM cards arrive.
I got the SIM cards now. Those are by German Telekom for business customers.
(German FAQ here: [1])
Recap: the modem is a u-blox SARA-R410M-02B, and it's connected through the
serial UART only (NOT through USB), meaning only two pins, txd and rxd,
classical uart, 115200 baud, /dev/ttyAT2.
I got ModemManager (1.16.4) to recognize the modem and this works:
mmcli -m 1 -e
mmcli -m 1 --simple-connect='apn=iot.telekom.net'
mmcli -m 1
The modem is shown in connected state with reasonable operator id 26201 and
signal quality 80%. Debug log even shows an IP address (in 10.0.0.0/8), the
same as listed in the web portal of Deutsche Telekom, which also confirms
modem/sim are registered to the network. So far so good.
However there's no network device listed, `ip addr show` shows only ethernet
and loopback.
In the hope NetworkManager (1.30.4) would create that device for me, I tried
to get a connection with NetworkManager like this:
nmcli connection add type gsm
nmcli connection modify gsm apn iot.telekom.net
And:
root at DistroKit:~ nmcli -a con up gsm
Error: Connection activation failed: The base network connection was
interrupted
Hint: use 'journalctl -xe NM_CONNECTION=0b5580ba-33f9-49f6-
bd17-33c14d38bb97 + NM_DEVICE=ttyAT2' to get more details.
I had NetworkManager monitor on a second console in parallel, which gave this:
root at DistroKit:~ nmcli m
ttyAT2: deactivating
ttyAT2: disconnected
ttyAT2: using connection 'gsm'
ttyAT2: connecting (prepare)
ttyAT2: unmanaged
ttyAT2: device removed
Now the interesting part, `journalctl -u ModemManager`:
```
Apr 27 14:49:46 DistroKit systemd[1]: Starting ModemManager.service...
Apr 27 14:49:47 DistroKit ModemManager[416]: <info> ModemManager (version
1.16.4) starting in system bus...
Apr 27 14:49:47 DistroKit systemd[1]: Started ModemManager.service.
Apr 27 14:49:50 DistroKit ModemManager[416]: <info> [base-manager] couldn't
check support for device '/sys/devices/platform/ahb/ahb:apb/
f8008000.ethernet': not supported by any plugin
Apr 27 14:50:05 DistroKit ModemManager[416]: <info> [device /sys/devices/
platform/ahb/ahb:apb/f8024000.serial/atmel_usart_serial.1.auto] creating modem
with plugin 'generic' and '1' ports
Apr 27 14:50:05 DistroKit ModemManager[416]: <warn> [plugin/generic] could
not grab port ttyAT2: Cannot add port 'tty/ttyAT2', unhandled port type
Apr 27 14:50:05 DistroKit ModemManager[416]: <warn> [base-manager] couldn't
create modem for device '/sys/devices/platform/ahb/ahb:apb/f8024000.serial/
atmel_usart_serial.1.auto': Failed to fi>
Apr 27 14:50:10 DistroKit ModemManager[416]: <info> [base-manager] couldn't
check support for device '/sys/devices/platform/ahb/ahb:apb/
f8008000.ethernet': not supported by any plugin
Apr 27 14:50:25 DistroKit ModemManager[416]: <info> [device /sys/devices/
platform/ahb/ahb:apb/f8024000.serial/atmel_usart_serial.1.auto] creating modem
with plugin 'generic' and '1' ports
Apr 27 14:50:25 DistroKit ModemManager[416]: <warn> [plugin/generic] could
not grab port ttyAT2: Cannot add port 'tty/ttyAT2', unhandled port type
Apr 27 14:50:25 DistroKit ModemManager[416]: <warn> [base-manager] couldn't
create modem for device '/sys/devices/platform/ahb/ahb:apb/f8024000.serial/
atmel_usart_serial.1.auto': Failed to fi>
Apr 27 14:50:50 DistroKit ModemManager[416]: <info> [base-manager] couldn't
check support for device '/sys/devices/platform/ahb/ahb:apb/
f8008000.ethernet': not supported by any plugin
Apr 27 14:50:58 DistroKit ModemManager[416]: <info> [device /sys/devices/
platform/ahb/ahb:apb/f8024000.serial/atmel_usart_serial.1.auto] creating modem
with plugin 'u-blox' and '1' ports
Apr 27 14:50:59 DistroKit ModemManager[416]: <info> [base-manager] modem for
device '/sys/devices/platform/ahb/ahb:apb/f8024000.serial/atmel_usart_serial.
1.auto' successfully created
Apr 27 14:50:59 DistroKit ModemManager[416]: <warn> [modem2] (u-blox)
unexpected AcT value: 7
Apr 27 14:50:59 DistroKit ModemManager[416]: <warn> [modem2] (u-blox)
unexpected AcT value: 8
Apr 27 14:50:59 DistroKit ModemManager[416]: <warn> [modem2] couldn't load
supported modes: No combinations built from +URAT=? response
Apr 27 14:50:59 DistroKit ModemManager[416]: <warn> [modem2] couldn't load
unlock retries: Unknown error
Apr 27 14:50:59 DistroKit ModemManager[416]: <warn> [modem2/sim0] couldn't
load list of emergency numbers: uninitialized emergency numbers list
Apr 27 14:50:59 DistroKit ModemManager[416]: <warn> [modem2] couldn't load
list of own numbers: Invalid characters in dial string
Apr 27 14:50:59 DistroKit ModemManager[416]: <warn> [modem2] couldn't load
current bands: Unknown error
Apr 27 14:50:59 DistroKit ModemManager[416]: <info> [modem2] state changed
(unknown -> disabled)
Apr 27 14:50:59 DistroKit ModemManager[416]: <info> [modem2] state changed
(disabled -> enabling)
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] simple connect
started...
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (4/8): wait to get fully enabled
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] 3GPP
registration state changed (unknown -> idle)
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] state changed
(enabling -> enabled)
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (5/8): register
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] 3GPP
registration state changed (idle -> registering)
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] 3GPP
registration state changed (registering -> roaming)
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] state changed
(enabled -> registered)
Apr 27 14:51:00 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (6/8): bearer
Apr 27 14:51:01 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (7/8): connect
Apr 27 14:51:01 DistroKit ModemManager[416]: <info> [modem2] state changed
(registered -> connecting)
Apr 27 14:51:01 DistroKit ModemManager[416]: <info> [modem2] state changed
(connecting -> connected)
Apr 27 14:51:01 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (8/8): all done
Apr 27 14:51:06 DistroKit ModemManager[416]: <warn> [modem2] couldn't load
network timezone from the current network
Apr 27 14:51:12 DistroKit ModemManager[416]: <info> [base-manager] couldn't
check support for device '/sys/devices/platform/ahb/ahb:apb/
f8008000.ethernet': not supported by any plugin
Apr 27 14:55:36 DistroKit ModemManager[416]: <info> [modem2] state changed
(connected -> disconnecting)
Apr 27 14:55:45 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 2 consecutive times
Apr 27 14:55:48 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 3 consecutive times
Apr 27 14:55:51 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 4 consecutive times
Apr 27 14:55:54 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 5 consecutive times
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2] state changed
(disconnecting -> registered)
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2/bearer0]
connection #1 finished: duration 302s, tx: 0 bytes, rx :0 bytes
Apr 27 14:56:04 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 6 consecutive times
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2] simple connect
started...
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (4/8): wait to get fully enabled
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (5/8): register
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (6/8): bearer
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (7/8): connect
Apr 27 14:56:04 DistroKit ModemManager[416]: <info> [modem2] state changed
(registered -> connecting)
Apr 27 14:56:09 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 7 consecutive times
Apr 27 14:56:12 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 8 consecutive times
Apr 27 14:56:15 DistroKit ModemManager[416]: <warn> [modem2] port ttyAT2
timed out 9 consecutive times
Apr 27 14:56:18 DistroKit ModemManager[416]: <warn> [modem2/bearer0] couldn't
initialize context: Serial command timed out
Apr 27 14:56:18 DistroKit ModemManager[416]: <warn> [modem2/bearer0]
connection attempt #2 failed: Serial command timed out
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2] state changed
(connecting -> registered)
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2/bearer0]
connection #2 finished: duration 0s, tx: 0 bytes, rx :0 bytes
Apr 27 14:56:18 DistroKit ModemManager[416]: <error> [modem2] port ttyAT2
timed out 10 consecutive times, marking modem as invalid
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2] simple connect
started...
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (4/8): wait to get fully enabled
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (5/8): register
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (6/8): bearer
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2] simple connect
state (7/8): connect
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2] state changed
(registered -> connecting)
Apr 27 14:56:18 DistroKit ModemManager[416]: <warn> [modem2/bearer1]
connection attempt #1 failed: Operation was cancelled
Apr 27 14:56:18 DistroKit ModemManager[416]: <info> [modem2/bearer1]
connection #1 finished: duration 0s, tx: 0 bytes, rx :0 bytes
```
From my naïve understanding, commands and data stream have to be multiplexed
over the same serial uart, right? Is it a problem of ModemManager or
NetworkManager?
I have not much experience with these kinds of devices, so each hint to
proceed would be helpful. I can build and run MM and NM from source, even most
recent master. I can provide debug logs. I would provide patches, but
currently I don't even know where to start. O:-)
Is there a way to get this modem running on Linux over that single UART at
all?
Greets
Alex
[1] https://business-portal-smart-connect.telekom.de/tdg-shop/faq
More information about the ModemManager-devel
mailing list