我正在尝试使用 raspbian (Debian 8) 和 modemmanager 在 Raspberry Pi 系统上使用华为 E3131 USB 3G 调制解调器。我有两个调制解调器,虽然它们看起来相同,但对于系统来说它们似乎略有不同。它们可能是同一型号的不同版本,固件可能略有不同。一个有效,另一个无效,但我需要它们都工作。内核版本为 4.1.18-v7+,modemmanager 版本为 1.4.0-1。
我正在使用以下命令与调制解调器管理器连接:
mmcli -m 0 --simple-connect="pin=1234,apn=internet"
SIM 卡不应该导致此问题,因为我只有一张并且它适用于一个调制解调器。
根据 modemmanager 的说法,两个调制解调器都已连接,但由于某种原因,另一个调制解调器永远无法获得正确的 IP,即只剩下 169.254.xy
至少在调制解调器的 USB 产品 ID(我假设是在调用 usb_modeswitch 之前)和修订版本方面存在差异。
我知道这个不适合我的模型可以在一些使用 2.6 内核的较旧的 Debian 系统中工作,但该系统没有使用 modemmanager,而是使用不太自动化的东西。
造成这种情况的原因是什么以及如何解决?
Google 找到了很多有关在 Linux 上使用此调制解调器的材料,但似乎没有一个是专门关于使用 modemmanager 连接调制解调器的。
调制解调器本身打印的调制解调器型号是 E3131,但 lsusb 说它们都是 E398。此外,有效的一款在其标签上的 CE 标志后面印有编号 0197,而另一款则没有编号 0979。
对于正常工作的调制解调器,控制台输出包含以下几行:
usb 1-1.3: new full-speed USB device number 6 using at91_ohci
usb 1-1.3: New USB device found, idVendor=12d1, idProduct=14fe
usb 1-1.3: New USB device strings: Mfr=2, Product=1, SerialNumber=0
usb 1-1.3: Product: HUAWEI Mobile
usb 1-1.3: Manufacturer: HUAWEI
usb-storage 1-1.3:1.0: USB Mass Storage device detected
scsi host3: usb-storage 1-1.3:1.0
usb-storage 1-1.3:1.1: USB Mass Storage device detected
scsi host4: usb-storage 1-1.3:1.1
scsi 3:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
scsi 3:0:0:0: Attached scsi generic sg0 type 5
scsi 4:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
sd 4:0:0:0: Attached scsi generic sg1 type 0
sd 4:0:0:0: [sda] Attached SCSI removable disk
usb 1-1.3: USB disconnect, device number 6
usb 1-1.3: new full-speed USB device number 7 using at91_ohci
usb 1-1.3: New USB device found, idVendor=12d1, idProduct=1506
usb 1-1.3: New USB device strings: Mfr=3, Product=2, SerialNumber=0
usb 1-1.3: Product: HUAWEI Mobile
usb 1-1.3: Manufacturer: HUAWEI
option 1-1.3:1.0: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB1
huawei_cdc_ncm 1-1.3:1.1: MAC-Address: 58:2c:80:13:92:63
huawei_cdc_ncm 1-1.3:1.1: setting rx_max = 16384
huawei_cdc_ncm 1-1.3:1.1: setting tx_max = 16384
huawei_cdc_ncm 1-1.3:1.1: cdc-wdm0: USB WDM device
huawei_cdc_ncm 1-1.3:1.1 wwan0: register 'huawei_cdc_ncm' at usb-at91-1.3, Huawei CDC NCM device, 58:2c:80:13:92:63
option 1-1.3:1.2: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB3
option 1-1.3:1.3: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB4
usb-storage 1-1.3:1.4: USB Mass Storage device detected
scsi host5: usb-storage 1-1.3:1.4
usb-storage 1-1.3:1.5: USB Mass Storage device detected
scsi host6: usb-storage 1-1.3:1.5
scsi 5:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
scsi 5:0:0:0: Attached scsi generic sg0 type 5
scsi 6:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
sd 6:0:0:0: Attached scsi generic sg1 type 0
sd 6:0:0:0: [sda] Attached SCSI removable disk
对于不起作用的情况,控制台输出包含以下几行:
usb 1-1.3: new full-speed USB device number 4 using at91_ohci
usb 1-1.3: New USB device found, idVendor=12d1, idProduct=15ca
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.3: Product: HUAWEI Mobile
usb 1-1.3: Manufacturer: HUAWEI
usb 1-1.3: SerialNumber: FFFFFFFFFFFFFFFF
usb-storage 1-1.3:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1.3:1.0
usbcore: registered new interface driver usb-storage
scsi 0:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
scsi 0:0:0:0: Attached scsi generic sg0 type 5
scsi 0:0:0:1: Direct-Access HUAWEI TF CARD Storage 2.31 PQ: 0 ANSI: 2
sd 0:0:0:1: Attached scsi generic sg1 type 0
sd 0:0:0:1: [sda] Attached SCSI removable disk
usb 1-1.3: USB disconnect, device number 4
usb 1-1.3: new full-speed USB device number 5 using at91_ohci
usb 1-1.3: New USB device found, idVendor=12d1, idProduct=1506
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.3: Product: HUAWEI Mobile
usb 1-1.3: Manufacturer: HUAWEI
usb-storage 1-1.3:1.4: USB Mass Storage device detected
scsi host1: usb-storage 1-1.3:1.4
usb-storage 1-1.3:1.5: USB Mass Storage device detected
scsi host2: usb-storage 1-1.3:1.5
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
option 1-1.3:1.0: GSM modem (1-port) converter detected
usbcore: registered new interface driver cdc_ncm
usbcore: registered new interface driver cdc_wdm
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1.3:1.2: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB1
option 1-1.3:1.3: GSM modem (1-port) converter detected
usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB2
huawei_cdc_ncm 1-1.3:1.1: MAC-Address: 00:1e:10:1f:00:00
huawei_cdc_ncm 1-1.3:1.1: cdc-wdm0: USB WDM device
huawei_cdc_ncm 1-1.3:1.1 wwan0: register 'huawei_cdc_ncm' at usb-at91-1.3, Huawei CDC NCM device, 00:1e:10:1f:00:00
usbcore: registered new interface driver huawei_cdc_ncm
scsi 1:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
scsi 1:0:0:0: Attached scsi generic sg0 type 5
scsi 2:0:0:0: Direct-Access HUAWEI TF CARD Storage 2.31 PQ: 0 ANSI: 2
sd 2:0:0:0: Attached scsi generic sg1 type 0
sd 2:0:0:0: [sda] Attached SCSI removable disk
我认为从上面的日志中提取的这些行显示了工作模型和非工作模型之间的区别(首先工作,其次非工作)。我的意思是,无论问题是什么,都是产品 ID 差异造成的。
usb 1-1.3: New USB device found, idVendor=12d1, idProduct=14fe
usb 1-1.3: New USB device found, idVendor=12d1, idProduct=1506
usb 1-2: New USB device found, idVendor=12d1, idProduct=15ca
usb 1-2: New USB device found, idVendor=12d1, idProduct=1506
以下是调制解调器管理器报告的调制解调器在连接时工作的状态:
/org/freedesktop/ModemManager1/Modem/2 (device id 'b73c90e8e59da46b3739331c98a33d33e109f0c1')
-------------------------
Hardware | manufacturer: 'huawei'
| model: 'E3131'
| revision: '21.157.11.00.264'
| supported: 'gsm-umts'
| current: 'gsm-umts'
| equipment id: '862732015998367'
-------------------------
System | device: '/sys/devices/soc0/ahb/500000.ohci/usb1/1-1/1-1.3'
| drivers: 'huawei_cdc_ncm, option1'
| plugin: 'Huawei'
| primary port: 'ttyUSB6'
| ports: 'cdc-wdm0 (at), ttyUSB3 (at), wwan0 (net), ttyUSB6 (at)'
-------------------------
Numbers | own : 'unknown'
-------------------------
Status | lock: 'none'
| unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
| state: 'connected'
| power state: 'on'
| access tech: 'hspa-plus'
| signal quality: '70' (recent)
-------------------------
Modes | supported: 'allowed: 2g, 3g; preferred: none
| allowed: 2g, 3g; preferred: 2g
| allowed: 2g, 3g; preferred: 3g
| allowed: 2g; preferred: none
| allowed: 3g; preferred: none'
| current: 'allowed: 2g, 3g; preferred: 3g'
-------------------------
Bands | supported: 'unknown'
| current: 'unknown'
-------------------------
IP | supported: 'ipv4, ipv6, ipv4v6'
-------------------------
3GPP | imei: '862732015998367'
| enabled locks: 'sim'
| operator id: '24405'
| operator name: 'elisa'
| subscription: 'unknown'
| registration: 'home'
-------------------------
SIM | path: '/org/freedesktop/ModemManager1/SIM/2'
-------------------------
Bearers | paths: '/org/freedesktop/ModemManager1/Bearer/2'
以下是调制解调器管理器(或 mmcli)报告的调制解调器在应该连接时不起作用的状态:
/org/freedesktop/ModemManager1/Modem/1 (device id 'e8157c68e00ab6a13b1b9a67d42acdd180af8d81')
-------------------------
Hardware | manufacturer: 'huawei'
| model: 'E3131'
| revision: '21.521.17.00.865'
| supported: 'gsm-umts'
| current: 'gsm-umts'
| equipment id: '864716020730798'
-------------------------
System | device: '/sys/devices/soc0/ahb/500000.ohci/usb1/1-1/1-1.3'
| drivers: 'huawei_cdc_ncm, option1'
| plugin: 'Huawei'
| primary port: 'ttyUSB4'
| ports: 'ttyUSB1 (at), ttyUSB4 (at), wwan0 (net)'
-------------------------
Numbers | own : 'unknown'
-------------------------
Status | lock: 'none'
| unlock retries: 'sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)'
| state: 'connected'
| power state: 'on'
| access tech: 'edge'
| signal quality: '100' (recent)
-------------------------
Modes | supported: 'allowed: 2g, 3g; preferred: none
| allowed: 2g, 3g; preferred: 2g
| allowed: 2g, 3g; preferred: 3g
| allowed: 2g; preferred: none
| allowed: 3g; preferred: none'
| current: 'allowed: any; preferred: none'
-------------------------
Bands | supported: 'unknown'
| current: 'unknown'
-------------------------
IP | supported: 'ipv4, ipv6, ipv4v6'
-------------------------
3GPP | imei: '864716020730798'
| enabled locks: 'sim'
| operator id: '24405'
| operator name: 'elisa'
| subscription: 'unknown'
| registration: 'home'
-------------------------
SIM | path: '/org/freedesktop/ModemManager1/SIM/1'
-------------------------
Bearers | paths: '/org/freedesktop/ModemManager1/Bearer/1'