Raspberry Pi Alpine a USB modem - nejde připojit

Raspberry Pi Alpine a USB modem - nejde připojit
« kdy: 19. 03. 2022, 17:19:14 »
Ahoj,
snazim se na Raspberry Pi 3B s Alpine Linuxem 3.16 aarch64 pripojit pomoci USB modemu na internet.

Zkousim dva modemy:
- Huawei E3372, ktery mi na notebooku s Ubuntu funguje
- ZTE MF669, ten mi na notebooku s ubuntu nejde

staci mi 2G, takze by mi i ten ZTE stacil.

Nainstaluji vse potrebne a zapnu modemmanager:
Kód: [Vybrat]
apk add raspberrypi modemmanager usb-modeswitch modemmanager-bash-completion ppp libqmi qmi-utils
rc-update add modemmanager
rc-service modemmanager start

Modem musim prepnout rucne, nevim proc se to nestane automaticky. Ale to me ted tolik nevadi.
Kód: [Vybrat]
# Huawei E3372
usb_modeswitch -J -v 12d1 -p 14fe

# ZTE MF669
usb_modeswitch -v 19d2 -p 0154 -V 19d2 -P 0117 -M "5553424312345678000000000000061b000000020000000000000000000000"

Pote se mi hned zobrazi wwan0 zarizeni, ukazka pro Huawei modem:
Kód: [Vybrat]
rpi:~# usb_modeswitch -J -v 12d1 -p 14fe
Look for default devices ...
 Found devices in default mode (1)
Access device 014 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)
Using standard Huawei switching message
Looking for active drivers ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Response reading failed (error -1)
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!

rpi:~# ip a s wwan0
7: wwan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:1e:10:1f:00:00 brd ff:ff:ff:ff:ff:ff

Jenze dal s tim nejsem schopny pohnout, modemmanager nevidi zadne modemy, qmcli take nefunguje:
Kód: [Vybrat]
rpi:~# mmcli -L
No modems were found

rpi:~# ls /dev/ | grep "USB\|cdc"
cdc-wdm0
ttyUSB0
ttyUSB1

rpi:~# qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-start-network="ip-type=4,apn=internet.t-mobile.cz" --client-no-release-cid
[19 Mar 2022, 17:10:47] -Warning ** [/dev/cdc-wdm0] couldn't detect transport type of port: unexpected usb driver detected: huawei_cdc_ncm
error: couldn't open the QmiDevice: Cannot automatically select QMI/MBIM mode
rpi:~# qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-manufacturer
[19 Mar 2022, 17:10:53] -Warning ** [/dev/cdc-wdm0] couldn't detect transport type of port: unexpected usb driver detected: huawei_cdc_ncm
error: couldn't open the QmiDevice: Cannot automatically select QMI/MBIM mode
rpi:~#


Dmesg a lsmod:
Kód: [Vybrat]
[ 2177.587196] usb 1-1.4: new high-speed USB device number 16 using dwc_otg
[ 2177.677286] usb 1-1.4: New USB device found, idVendor=12d1, idProduct=14fe, bcdDevice= 1.02
[ 2177.677314] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2177.677335] usb 1-1.4: Product: HUAWEI_MOBILE
[ 2177.677353] usb 1-1.4: Manufacturer: HUAWEI_MOBILE
[ 2177.677370] usb 1-1.4: SerialNumber: 0123456789ABCDEF
[ 2177.710863] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[ 2177.712058] scsi host0: usb-storage 1-1.4:1.0
[ 2178.738125] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[ 2178.739550] sr 0:0:0:0: Power-on or device reset occurred
[ 2178.742052] sr 0:0:0:0: [sr0] scsi-1 drive
[ 2178.746043] sr 0:0:0:0: Attached scsi CD-ROM sr0
[ 2178.754309] scsi 0:0:0:1: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[ 2178.758328] sd 0:0:0:1: Power-on or device reset occurred
[ 2178.759749] sd 0:0:0:1: [sda] Media removed, stopped polling
[ 2178.776331] sd 0:0:0:1: [sda] Attached SCSI removable disk
[ 2181.244080] usb 1-1.4: USB disconnect, device number 16
[ 2181.940226] usb 1-1.4: new high-speed USB device number 17 using dwc_otg
[ 2182.030191] usb 1-1.4: New USB device found, idVendor=12d1, idProduct=1506, bcdDevice= 1.02
[ 2182.030219] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2182.030241] usb 1-1.4: Product: HUAWEI_MOBILE
[ 2182.030258] usb 1-1.4: Manufacturer: HUAWEI_MOBILE
[ 2182.108916] option 1-1.4:1.0: GSM modem (1-port) converter detected
[ 2182.109560] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB0
[ 2182.111087] option 1-1.4:1.1: GSM modem (1-port) converter detected
[ 2182.112374] usb 1-1.4: GSM modem (1-port) converter now attached to ttyUSB1
[ 2182.210128] huawei_cdc_ncm 1-1.4:1.2: MAC-Address: 00:1e:10:1f:00:00
[ 2182.210214] huawei_cdc_ncm 1-1.4:1.2: setting rx_max = 16384
[ 2182.217639] huawei_cdc_ncm 1-1.4:1.2: NDP will be placed at end of frame for this device.
[ 2182.218099] huawei_cdc_ncm 1-1.4:1.2: cdc-wdm0: USB WDM device
[ 2182.219476] huawei_cdc_ncm 1-1.4:1.2 wwan0: register 'huawei_cdc_ncm' at usb-3f980000.usb-1.4, Huawei CDC NCM device, 00:1e:10:1f:00:00
[ 2182.221664] usb-storage 1-1.4:1.3: USB Mass Storage device detected
[ 2182.238389] scsi host0: usb-storage 1-1.4:1.3
[ 2182.252114] usb-storage 1-1.4:1.4: USB Mass Storage device detected
[ 2182.273552] scsi host1: usb-storage 1-1.4:1.4
[ 2183.286681] scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[ 2183.287988] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[ 2183.289012] sd 1:0:0:0: Power-on or device reset occurred
[ 2183.290005] sr 0:0:0:0: Power-on or device reset occurred
[ 2183.290310] sd 1:0:0:0: [sda] Media removed, stopped polling
[ 2183.293985] sr 0:0:0:0: [sr0] scsi-1 drive
[ 2183.297521] sd 1:0:0:0: [sda] Attached SCSI removable disk
[ 2183.302818] sr 0:0:0:0: Attached scsi CD-ROM sr0
[ 2183.504396] sr 0:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=DRIVER_OK cmd_age=0s
[ 2183.504439] sr 0:0:0:0: [sr0] tag#0 Sense Key : 0x3 [current]
[ 2183.504462] sr 0:0:0:0: [sr0] tag#0 ASC=0x11 ASCQ=0x0
[ 2183.504486] sr 0:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 8d e0 00 00 02 00
[ 2183.504508] blk_update_request: critical medium error, dev sr0, sector 145280 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[ 2183.584452] sr 0:0:0:0: [sr0] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=DRIVER_OK cmd_age=0s
[ 2183.584495] sr 0:0:0:0: [sr0] tag#0 Sense Key : 0x3 [current]
[ 2183.584518] sr 0:0:0:0: [sr0] tag#0 ASC=0x11 ASCQ=0x0
[ 2183.584542] sr 0:0:0:0: [sr0] tag#0 CDB: opcode=0x28 28 00 00 00 8d c0 00 00 02 00
[ 2183.584563] blk_update_request: critical medium error, dev sr0, sector 145152 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0

rpi:~# lsmod
Module                  Size  Used by    Tainted: G 
huawei_cdc_ncm         20480  0
cdc_ncm                36864  1 huawei_cdc_ncm
cdc_ether              20480  1 cdc_ncm
ppp_generic            49152  0
slhc                   20480  1 ppp_generic
qmi_wwan               36864  0
cdc_wdm                28672  2 huawei_cdc_ncm,qmi_wwan
option                 57344  0
usb_wwan               24576  1 option
usbserial              45056  2 option,usb_wwan
ipv6                  540672 18 [permanent]
af_packet              57344  0
uas                    24576  0
brcmfmac              262144  0
brcmutil               20480  1 brcmfmac
sha256_generic         16384  0
cfg80211              856064  1 brcmfmac
rfkill                 36864  1 cfg80211
sr_mod                 32768  0
cdrom                  45056  1 sr_mod
raspberrypi_hwmon      16384  0
bcm2835_isp            32768  0
bcm2835_codec          53248  0
v4l2_mem2mem           40960  1 bcm2835_codec
videobuf2_dma_contig    24576  2 bcm2835_isp,bcm2835_codec
bcm2835_v4l2           45056  0
bcm2835_mmal_vchiq     40960  3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
vc_sm_cma              36864  2 bcm2835_isp,bcm2835_mmal_vchiq
videobuf2_vmalloc      20480  1 bcm2835_v4l2
videobuf2_memops       20480  2 videobuf2_dma_contig,videobuf2_vmalloc
videobuf2_v4l2         32768  4 bcm2835_isp,bcm2835_codec,v4l2_mem2mem,bcm2835_v4l2
videobuf2_common       69632  8 bcm2835_isp,bcm2835_codec,v4l2_mem2mem,videobuf2_dma_contig,bcm2835_v4l2,videobuf2_vmalloc,videobuf2_memops,videobuf2_v4l2
videodev              258048  6 bcm2835_isp,bcm2835_codec,v4l2_mem2mem,bcm2835_v4l2,videobuf2_v4l2,videobuf2_common
mc                     61440  6 bcm2835_isp,bcm2835_codec,v4l2_mem2mem,videobuf2_v4l2,videobuf2_common,videodev
uio_pdrv_genirq        16384  0
uio                    24576  1 uio_pdrv_genirq
sdhci_iproc            16384  0
squashfs               49152  1

Co delam spatne?
"Kdo v zájmu bezpečí obětuje část své svobody, v konečném důsledku přijde o svobodu i svou bezpečnost."


k3dAR

  • *****
  • 2 248
  • porad nemam telo, ale uz mam hlavu... nobody
    • Zobrazit profil
    • E-mail
Re:Raspberry Pi Alpine a USB modem - nejde připojit
« Odpověď #1 kdy: 19. 03. 2022, 23:21:23 »
s Alpine mam minimalni zkusenosti, WWAN sem tam neresil...
ale obecne usb-modeswitch pro automaticke prepnuti potrebuje udev a jeho pravidlo,
v Alpine je koukam v oddelenem balicku usb-modeswitch-udev

k3dAR

  • *****
  • 2 248
  • porad nemam telo, ale uz mam hlavu... nobody
    • Zobrazit profil
    • E-mail
Re:Raspberry Pi Alpine a USB modem - nejde připojit
« Odpověď #2 kdy: 19. 03. 2022, 23:44:34 »
ten Huawei asi nebude Qualcomm, takze misto qmi by to asi chtelo mbim

Re:Raspberry Pi Alpine a USB modem - nejde připojit
« Odpověď #3 kdy: 20. 03. 2022, 14:02:04 »
Kdysi jsem něco podobného řešil s Huawejem (asi E3272) a do něj šel flashnout jiný firmware, aby se nemusel přepínat pomocí usb_modeswitch. Jinak souhlasím, že je přepnutí potřeba nastavit v /etc/udev/rules.d/pravidlo.

Nyní mám levný USB LTE modem, který umí i B20 a připojí se nejen jako CD-ROM, ale automaticky nastaví spojení přes RNDIS a hlásí se jako enp0s11u1.