SIMCOM SIM7070G UART Support

Aleksander Morgado aleksandermj at chromium.org
Mon Oct 17 08:43:08 UTC 2022


Hey Jorge,

>
> So I did the requested testing: Logs attached.
>

I can see the "pppd timed out or didn't initialize our dbus module"
failure in NetworkManager as follows:

<info>  [1665939102.1936] ppp-manager: starting PPP connection
<debug> [1665939102.1944] ppp-manager: command line: /usr/sbin/pppd
nodetach lock nodefaultroute ipv6 , debug ttyS4 noipdefault noauth
usepeerdns lcp-echo-failure 0 lcp-echo-interval 0 idle 0 ipparam
/org/freedesktop/NetworkManager/PPP/1 plugin
/usr/lib/pppd/2.4.5/nm-pppd-plugin.so
<info>  [1665939102.2189] ppp-manager: pppd started with pid 1613
<info>  [1665939102.2216] modem["ttyS4"]: IPv6 configuration disabled
Plugin /usr/lib/pppd/2.4.5/nm-pppd-plugin.so loaded.
nm-pppd-plugin-Message: 18:51:42.264: nm-ppp-plugin: initializing
nm-pppd-plugin-Message: 18:51:42.306: nm-ppp-plugin: status 3 / phase
'serial connection'
<warn>  [1665939122.1174] ppp-manager: pppd timed out or didn't
initialize our dbus module
<debug> [1665939122.1255] kill child process 'pppd' (1613): wait for
process to terminate after sending SIGTERM (15) (send SIGKILL in 1500
milliseconds)...
<debug> [1665939122.1275] device[7af82be3978a2649] (ttyS4):
activation-stage: schedule activate_stage4_ip_config_timeout_4,v4 (id
368)
<debug> [1665939122.1335] device[7af82be3978a2649] (ttyS4):
activation-stage: invoke activate_stage4_ip_config_timeout_4,v4 (id
368)
<info>  [1665939122.1343] device (ttyS4): state change: ip-config ->
failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')

This could be a mismatched pppd config. When you manually test this
and get a data connection, how are you launching pppd?

>> > I'm trying to configure a SIMCOM7070G modem to work with ModemManager/NetworkManager.
>> >
>> > I've observed there is already a plugin and some support, but unless I'm mistaken, it looks like the current support expects this modem to be connected via USB (4 ports provided by usb: AT cmds, data, gnss, etc).
>> >
>> > My problem is I'm using it in a board where the modem is NOT connected to the CPU via USB: The regular UART (UART1) provided by the modem is used.
>> >
>> > So far, I already have some signals of life:
>> >
>> > 1. MODEM is detected by ModemManager as Generic GSM modem: I added the following rule to /etc/udev/rules.d/ and works fine:
>> >
>> > ACTION!="add|change|move|bind", GOTO="mm_whitelist_end"
>> > KERNEL=="ttyS4" ENV{ID_MM_DEVICE_PROCESS}="1"
>> > LABEL="mm_whitelist_end"
>> >
>>
>> There are several things missing here.
>>
>> The "simtech" plugin only expects USB modems right now. It should be
>> updated to have MM_PLUGIN_ALLOWED_VENDOR_STRINGS, so that after the AT
>> probing phase is run, ModemManager tries to guess the modem vendor
>> based on the given string. Once that works, the simtech plugin will
>> take control of your modem, with the simcom-specific features if any
>> needed.
>>
>> Then given you're using a pure RS232 port, please note that you should
>> explicitly configure how the TTY is supposed to work, in particular,
>> you need to define ID_MM_TTY_BAUDRATE and ID_MM_TTY_FLOW_CONTROL
>> explicitly. If your modem works fine AT-control wise, then probably
>> the default baudrate MM uses was good (57600), but you should better
>> explicitly define it. And if the data connection over PPP is not
>> working as expected as in your case, it may indeed because of the
>> missing ID_MM_TTY_FLOW_CONTROL (either "none", "xon-xoff" or
>> "rts-cts").
>
>
>
> New udev rules as follows:
>
> ACTION!="add|change|move|bind", GOTO="mm_whitelist_end"
> KERNEL=="ttyS4" ENV{ID_MM_DEVICE_PROCESS}="1", ENV{ID_MM_TTY_BAUDRATE}="115200", ENV{ID_MM_TTY_FLOW_CONTROL}="rts-cts"
> LABEL="mm_whitelist_end"
>

Those look fine, unless you're using openwrt, which I don't remember
if that's the case or not. In openwrt you need to have one "=" action
per line (so you would split that line in 3). Not an issue if not
using openwrt.

> As you can see I'm setting ID_MM_TTY_BAUDRATE to 115200. Reason for this is, the modem is capable of autobauding up to a maximum speed of 115200bps, later on (during ppp) higher bps rates can be set.
> I can see ModemManager talking to the modem on the AT stage without issues. So I'm assuming baudrate/flow control are fine.

Yes.

>> > 2. I Added a gsm connection to set the APN: (iot.t-mobile.nl)
>> > I can see in ModemManager logs how it exchanges a lot of AT commands, etc to finally launch PPP. And this is where I'm stuck.

Could you try to fully disable IPv6 in the networkmanager settings?
i.e. so that IP family ipv4 is requested exclusively and NM doesn't
try to bring up IPv6 over pppd.

> Some clarifications:
>
> 1. The GPIO operations discussed in previous posts: This is required only before using the modem. NOT during normal operation. For now I added a systemd service which starts before modemmanager and simply performs the required operations to guarantee the modem is operational whenever modemmanager boots.

That makes sense.

> 2. I'm attempting to connect to a "cat-m" network: Not sure how to "explain" this to ModemManager so it selects the proper band/network before attempting ppp

How are you doing that manually? Do you have explicit AT commands for that?

> 3. Baudrate: As it can be seen in the logs, AT commands are working fine at the configured baudrate, but would be great to change baudrate when starting ppp. Is this doable?

Nope, no. Baudrate settings in a RS232 device are assumed fixed always.

> 4. Following the "AT Commands Only" section on this site: https://docs.iotcreators.com/docs/simcom-sim7070g-waveshare-dev-kit. I can manage to ping a host from the modem.
>

Maybe try to compare that sequence with what MM does and see where they differ?

-- 
Aleksander


More information about the ModemManager-devel mailing list