使用 Quectel EC21 的调制解调器管理器

使用 Quectel EC21 的调制解调器管理器

我在 Raspberry Pi Compute Module 3(和 IO 板)上运行 Ubuntu Core,并通过 USB 连接了 Quectel EC21 LTE 调制解调器。我很难让它工作。

下列的Ubuntu Core 文档网站上的指南,我可以看到调制解调器出现:

$ sudo modem-manager.mmcli -L

Found 1 modems:
    /org/freedesktop/ModemManager1/Modem/1 [Quectel] EC21

我可以看到一些关于它的好信息:

$ sudo modem-manager.mmcli -m 1

/org/freedesktop/ModemManager1/Modem/1 (device id 'a7dea8991786834fd4f5937baf2bae98f64e16dd')
  -------------------------
  Hardware |   manufacturer: 'Quectel'
           |          model: 'EC21'
           |       revision: 'EC21AUTFAR02A03M4G'
           |      supported: 'gsm-umts, lte'
           |        current: 'gsm-umts, lte'
           |   equipment id: '861108030174782'
  -------------------------
  System   |         device: '/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2'
           |        drivers: 'option1'
           |         plugin: 'Generic'
           |   primary port: 'ttyUSB2'
           |          ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), ttyUSB3 (at)'
  -------------------------
  Numbers  |           own : 'unknown'
  -------------------------
  Status   |           lock: 'none'
           | unlock retries: 'unknown'
           |          state: 'connected'
           |    power state: 'on'
           |    access tech: 'lte'
           | signal quality: '80' (recent)
  -------------------------
  Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
           |        current: 'allowed: 2g, 3g, 4g; preferred: none'
  -------------------------
  Bands    |      supported: 'unknown'
           |        current: 'unknown'
  -------------------------
  IP       |      supported: 'ipv4, ipv6, ipv4v6'
  -------------------------
  3GPP     |           imei: '861108030174782'
           |  enabled locks: 'none'
           |    operator id: '50501'
           |  operator name: 'Telstra Mobile Telstra'
           |   subscription: 'unknown'
           |   registration: 'home'
  -------------------------
  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/1'

  -------------------------
  Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/0'

如果我遵循本指南的其余部分,即:

$ sudo nmcli c add type gsm ifname ttyUSB2 con-name 4G apn telstra.internet
Connection '4G' (7640a17c-c7f4-40c7-9490-bfb0d22e28f1) successfully added.

$ sudo nmcli r wwan on

我似乎获得了一个 IP 地址:

$ ip addr
4: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
    link/ppp 
    inet 10.98.27.23/32 brd 10.98.27.23 scope global ppp0
       valid_lft forever preferred_lft forever

这是日志的输出:

$ sudo journalctl --no-pager -u snap.network-manager.networkmanager.service

Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.0949] settings: Failed to add 7640a17c-c7f4-40c7-9490-bfb0d22e28f1/'4G': Plugin does not support adding connections
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.0984] keyfile: loading from file "/var/snap/network-manager/265/conf/system-connections/4G"...
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.0987] settings-connection[0x12b6590]: constructed (NMKeyfileConnection)
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1014] settings-connection[0x12b6590,7640a17c-c7f4-40c7-9490-bfb0d22e28f1]: replace settings from connection 0x754040c0 (4G)
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <info>  [1523928492.1049] keyfile: add connection /var/snap/network-manager/265/conf/system-connections/4G (7640a17c-c7f4-40c7-9490-bfb0d22e28f1,"4G")
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1055] settings-connection[0x12b6590,7640a17c-c7f4-40c7-9490-bfb0d22e28f1]: failed to read connection timestamp: Key file does not have key '7640a17c-c7f4-40c7-9490-bfb0d22e28f1' in group 'timestamps'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1088] ++ connection 'new connection' (0x12b6590/NMKeyfileConnection): [/org/freedesktop/NetworkManager/Settings/2]
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1090] ++ connection                [ 0x12fd2a8 ]
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1091] ++ connection.id             = '4G'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1092] ++ connection.interface-name = 'ttyUSB2'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1093] ++ connection.permissions    = []
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1094] ++ connection.secondaries    = []
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1095] ++ connection.type           = 'gsm'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1096] ++ connection.uuid           = '7640a17c-c7f4-40c7-9490-bfb0d22e28f1'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1097] ++ gsm                       [ 0x1332b30 ]
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1098] ++ gsm.apn                   = 'telstra.internet'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1099] ++ gsm.number                = '*99#'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1100] ++ ipv4                      [ 0x1310bc8 ]
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1101] ++ ipv4.addresses            = ((GPtrArray*) 0x1303660)
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1102] ++ ipv4.dns                  = []
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1103] ++ ipv4.dns-search           = []
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1104] ++ ipv4.method               = 'auto'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1105] ++ ipv4.routes               = ((GPtrArray*) 0x12f7fc8)
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1106] ++ ipv6                      [ 0x1310c90 ]
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1107] ++ ipv6.addresses            = ((GPtrArray*) 0x12f8180)
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1108] ++ ipv6.dns                  = []
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1109] ++ ipv6.dns-search           = []
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1110] ++ ipv6.method               = 'auto'
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1111] ++ ipv6.routes               = ((GPtrArray*) 0x12f7478)
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1127] create NMAuditManager singleton (0x75300d50)
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <info>  [1523928492.1129] audit: op="connection-add" uuid="7640a17c-c7f4-40c7-9490-bfb0d22e28f1" name="4G" pid=3186 uid=0 result="success"
Apr 17 01:28:12 localhost.localdomain NetworkManager[1489]: <debug> [1523928492.1168] Saving secrets for connection /org/freedesktop/NetworkManager/Settings/2 (4G)
Apr 17 01:28:28 localhost.localdomain NetworkManager[1489]: <debug> [1523928508.6772] manager: (WWAN): setting radio enabled by user
Apr 17 01:28:28 localhost.localdomain NetworkManager[1489]: <info>  [1523928508.6842] audit: op="radio-control" arg="wwan-enabled:1" pid=3201 uid=0 result="success"

但是,如果我使用界面执行诸如 ping 之类的操作ppp,则什么也得不到:

$ sudo ping -I ppp0 8.8.8.8

我需要做什么才能使 WWAN 接口正常工作?

答案1

实际上,最后相当简单 - 我所要做的就是通过以太网删除默认网关。我不确定为什么我的绑定地址ping不起作用,但无论如何,在我运行后它起作用了:

$ sudo ip route delete default via 192.168.30.254

(该 IP 是我所在 LAN 的默认网关)

现在 Quectel EC21 会自动连接!鉴于 Quectel 缺乏有用的文档,这让我非常惊讶 - 但事实就是如此。

相关内容