14.04 - ModemManager 配置串行调制解调器

14.04 - ModemManager 配置串行调制解调器

我正在使用 Ubuntu 14.04 LTS,我想连接一个Cinterion调制解调器通过串行端口 - 在本例中为 ttyS0 -。

当发出以下命令时,调制解调器工作正常:

pppd call OPERATOR

在 /var/log/syslog 中获取一些类似于以下的跟踪:

NetworkManager[911]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
NetworkManager[911]:    SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
NetworkManager[911]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...

按照此操作后AskUbuntu 链接我为 udev 添加了一条规则,以允许 ttyS0 作​​为“串行网络设备”启用:

SUBSYSTEM=="pnp", ACTION=="add", KERNEL=="00:08", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"

由于这些输出:

# udevadm info /dev/ttyS0
P: /devices/pnp0/00:08/tty/ttyS0
N: ttyS0
E: DEVNAME=/dev/ttyS0
E: DEVPATH=/devices/pnp0/00:08/tty/ttyS0
E: ID_MM_CANDIDATE=1
E: MAJOR=4
E: MINOR=64
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=87154

# udevadm info /sys/devices/pnp0/00\:08
P: /devices/pnp0/00:08
E: DEVPATH=/devices/pnp0/00:08
E: DRIVER=serial
E: ID_MM_PLATFORM_DRIVER_PROBE=1
E: SUBSYSTEM=pnp
E: USEC_INITIALIZED=87046

此外,由于我想测试 ModemManager 的调试输出,因此我停止了网络管理器服务。然后,在输出中我获得了如下跟踪:

    #ModemManager --debug    
    [...]
    ModemManager[3170]: <debug> [1473157920.412477] [mm-device.c:298] mm_device_grab_port(): (/sys/devices/pnp0/00:08) could not get vendor/product ID

    ModemManager[3170]: <debug> [1473157920.412643] [mm-plugin-manager.c:576] build_plugins_list(): (Plugin Manager) [ttyS0] Found '5' plugins to try...

    ModemManager[3170]: <debug> [1473157920.412662] [mm-plugin-manager.c:580] build_plugins_list(): (Plugin Manager) [ttyS0]   Will try with plugin 'Cinterion'

    ModemManager[3170]: <debug> [1473157929.569356] [mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): Parsing AT got: 'Serial command timed out'
    ModemManager[3170]: <debug> [1473157929.569369] [mm-port-probe.c:161] mm_port_probe_set_result_at(): (tty/ttyS0) port is not AT-capable

    [...]
    ModemManager[3170]: <debug> [1473157935.569494] [mm-plugin-manager.c:417] plugin_supports_port_ready(): (Plugin Manager) (Generic) [ttyS0] found best plugin for port
    ModemManager[3170]: <debug> [1473157935.569507] [mm-plugin-manager.c:285] port_probe_context_finished(): (Plugin Manager) 'ttyS0' port probe finished, last one in device
    ModemManager[3170]: <debug> [1473157935.569514] [mm-plugin-manager.c:107] find_device_support_context_complete_and_free(): (Plugin Manager) [/sys/devices/pnp0/00:08] device support check finished in '15.157042' seconds
    ModemManager[3170]: <info>  [1473157935.569638] [mm-device.c:486] mm_device_create_modem(): Creating modem with plugin 'Generic' and '1' ports
    ModemManager[3170]: <warn>  [1473157935.569779] [mm-plugin.c:900] mm_plugin_create_modem(): Could not grab port (tty/ttyS0): 'Cannot add port 'tty/ttyS0', unhandled serial type'
    ModemManager[3170]: <debug> [1473157935.569805] [mm-base-modem.c:1556] finalize(): Modem (Generic) '/sys/devices/pnp0/00:08' completely disposed
    ModemManager[3170]: <warn>  [1473157935.569816] [mm-manager.c:145] find_device_support_ready(): Couldn't create modem for device at '/sys/devices/pnp0/00:08': Failed to find primary AT port
    [...]

所以,该过程以错误结束并且未找到调制解调器在 pnp0/00:08。

还需要采取哪些其他步骤?

答案1

根据:

ModemManager[3170]: <debug> [1473157929.569356] [mm-port-probe-at.c:43] mm_port_probe_response_processor_is_at(): Parsing AT got: 'Serial command timed out'
ModemManager[3170]: <debug> [1473157929.569369] [mm-port-probe.c:161] mm_port_probe_set_result_at(): (tty/ttyS0) port is not AT-capable

您的串行连接超时。检查发送了哪些 AT 命令。

此外,Cinterion 模块通常默认以 115200 波特率运行,而 ModemManager 使用 57600(至少在我使用时)。

尝试通过执行以下命令将模块波特率更改为 57600:

AT+IPR=57600

& 重新启动。如果还有其他问题,您需要跟踪串行连接并检查接口上发送的内容。

相关内容