Estou tentando usar um modem Huawei E3131 USB 3G em um sistema Raspberry Pi usando raspbian (Debian 8) e modemmanager. Eu tenho dois desses modems, e enquanto eles parecem os mesmos, para o sistema eles parecem um pouco diferentes. Eles poderiam ser diferentes revisões do mesmo modelo, talvez com um firmware ligeiramente diferente. Um funciona e o outro não, mas eu precisaria que ambos trabalhassem. A versão do kernel é 4.1.18-v7 + e a versão do modemmanager é 1.4.0-1.
Estou conectando com o modemmanager, usando este comando:
mmcli -m 0 --simple-connect="pin=1234,apn=internet"
O cartão SIM não deve estar causando esse problema, porque eu só tenho um e ele funciona com um modem.
De acordo com o modemmanager, ambos os modems se conectam, mas por alguma razão, o outro nunca recebe um IP adequado, ou seja, fica com 169.254.x.y.
Existem diferenças, pelo menos, nos ids de produto USB dos modems (antes que usb_modeswitch seja chamado, suponho) e revisões.
Eu sei que o modelo que não está funcionando para mim funcionou em algum sistema Debian mais antigo que estava usando um kernel 2.6, mas esse sistema não usava o modemmanager, mas algo menos automático.
O que poderia estar causando isso e como corrigi-lo?
O Google encontra muito material sobre o uso deste modem com o Linux, mas nada disso parece ser especificamente sobre o uso do modemmanager para conectar o modem.
O modelo dos modems, conforme impresso no próprio modem, é E3131, mas lsusb diz que ambos são E398. Além disso, o que funciona tem o número 0197 impresso logo após o símbolo CE no rótulo e o outro não tem o número 0979.
Para o modem que funciona, a saída do console contém estas linhas:
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
Para o que não funciona, a saída do console contém estas linhas:
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
Acho que essas linhas tiradas dos logs acima mostram a diferença entre o modelo de trabalho e o modelo não funcional (trabalhando primeiro, segundo sem trabalho). Quero dizer, o problema, seja lá o que for, é uma consequência da diferença nos ids dos produtos.
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
Aqui está o que o modemmanager relata como status do modem que funciona quando está conectado:
/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'
Aqui está o que o modemmanager (ou mmcli) informa como status para o modem que não funciona quando é suposto estar conectado:
/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'