SIMCOM SIM7070G UART Support

Jorge Solla jorgesolla at gmail.com
Sun Oct 23 21:37:48 UTC 2022


Hi,

Some progress on my fight with the SIM7070g:

1. Connection test with IPV6 disabled:

Created a new connection using the following command:
nmcli c add type gsm ifname ttyS4 con-name iot-modem apn iot.t-mobile.nl
ipv6.method "disabled"

Logs attached (MM_NM_logs.zip).
As you can see this time, modemmanager seems to be avoiding the ipv6 config
by passing the "noipv6" argument when launching ppp as shown in the
following log line:

<debug> [1666559451.6679] ppp-manager: command line: /usr/sbin/pppd
nodetach lock nodefaultroute noipv6 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

Unfortunately the connection never gets an IP and finally discards the
modem completely.

2. Tested exactly the same device, with the same SIM card using ppp + chat
combination and it works fine, im attaching the working ppp/chat files
(ppp_working_config.zip)


On Mon, Oct 17, 2022 at 10:43 AM Aleksander Morgado <
aleksandermj at chromium.org> wrote:

> 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.
>

I'm using a custom build with yocto. And the udev rule works fine, i can
see everything working as expected from MM side.
Btw, never mentioned it and just in case it could be relevant, my
ModemManager version is: 1.12.12, it is displayed in the logs, but I just
wanted to remark on it.


>
> > 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.
>

About the GPIO control of the modem: To start it, the solution is clear, I
can use systemd to launch some script to control the gpios before starting
MM. But I wonder if there is some option (dbus signal coming from MM?) to
detect a disconnection so I can trigger a reset operation on the GPIO just
in case. Might be it was just a coincidence, but I have observed the modem
doesn't respond very well to some commands and tends to "freak out" :)

Not important for now, this is candidate for workaround, asking just in
case there is a more stylish way rather than using the brute-FORCE.


>
> > 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
>


Thanks for helping!
Jorge.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20221023/8f56b30d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MM_NM_logs.zip
Type: application/zip
Size: 38931 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20221023/8f56b30d/attachment-0002.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppp_working_config.zip
Type: application/zip
Size: 693 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/modemmanager-devel/attachments/20221023/8f56b30d/attachment-0003.zip>


More information about the ModemManager-devel mailing list