aparcar / openwrt

Staging tree of Paul Spooren
Other
8 stars 1 forks source link

FS#1424 - usbmode sits in loop after install #1231

Open aparcar opened 6 years ago

aparcar commented 6 years ago

sydney:

OpenWrt Snapshot r6397-7cc9914

Huawei ME909s-120 LTE Card (12d1:15c1) on a PC Engines APU2 (amd64) in MBIM Mode.

usbmode sits in a loop right after installation, doesn't switch the Modem in MBMI mode and thus no /dev/cdc-wdm0 device is created and prints constantly:

[ 59.838090] usb 1-1.3: usbfs: process 6946 (usbmode) did not claim interface 1 before use [ 60.048534] usb 1-1.3: usbfs: interface 1 claimed by usbfs while 'usbmode' sets config #0 [ 60.131996] usb 1-1.3: usbfs: process 7032 (usbmode) did not claim interface 1 before use [ 60.342459] usb 1-1.3: usbfs: interface 1 claimed by usbfs while 'usbmode' sets config #0

Install usb-modeswitch on OpenWrt Snapshot r6397-7cc9914

Tried LEDE 17.01.4 r3560-79f57e422d without success, but messages are only printed once after "usbmode -s" is called, also there isn't a cdc-wdm0 device created.

This HW config is working fine with cdc_mbim on Debian with a 4.9 Kernel and their usb-modeswitch implementation.

aparcar commented 6 years ago

sydney:

If i set "/sys/devices/pci0000:00/0000:00:13.0/usb1/1-1/1-1.3/bConfigura tionValue" manually to 3 (mbim mode), the device gets recongized as /dev/cdc-wdmX by the cdc_mbim driver but e.g. "umbim -d /dev/cdc-wdm0 caps" times out.

aparcar commented 5 years ago

yurtesen:

I am having the same issue. Did you find a solution?

Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.372202] usb 1-1: new high-speed USB device number 10 using xhci-mtk Tue Jun 11 13:42:09 2019 daemon.notice netifd: Interface 'rndis' is enabled Tue Jun 11 13:42:09 2019 daemon.notice netifd: Network device 'usb0' link is up Tue Jun 11 13:42:09 2019 daemon.notice netifd: Interface 'rndis' has link connectivity Tue Jun 11 13:42:09 2019 daemon.notice netifd: Interface 'rndis' is setting up now Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.550371] cdc_ether 1-1:2.0 usb0: register 'cdc_ether' at usb-1e1c0000.xhci-1, CDC Ethernet Device, 02:1e:10:1f:00:00 Tue Jun 11 13:42:09 2019 kern.err kernel: [ 928.552726] cdc_ether 1-1:2.0 usb0: kevent 12 may have been dropped Tue Jun 11 13:42:09 2019 kern.err kernel: [ 928.561338] cdc_ether 1-1:2.0 usb0: kevent 11 may have been dropped Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.577887] option 1-1:2.2: GSM modem (1-port) converter detected Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.584959] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4 Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.594331] option 1-1:2.3: GSM modem (1-port) converter detected Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.601199] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB5 Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.610425] option 1-1:2.4: GSM modem (1-port) converter detected Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.617510] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB6 Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.625909] option 1-1:2.5: GSM modem (1-port) converter detected Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.633115] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB7 Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.642333] option 1-1:2.6: GSM modem (1-port) converter detected Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.649134] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB8 Tue Jun 11 13:42:09 2019 daemon.notice netifd: Network device 'usb0' link is down Tue Jun 11 13:42:09 2019 daemon.notice netifd: Interface 'rndis' has link connectivity loss Tue Jun 11 13:42:09 2019 kern.info kernel: [ 928.854407] cdc_ether 1-1:2.0 usb0: unregister 'cdc_ether' usb-1e1c0000.xhci-1, CDC Ethernet Device Tue Jun 11 13:42:09 2019 kern.warn kernel: [ 928.962733] usb 1-1: usbfs: process 12789 (usbmode) did not claim interface 1 before use Tue Jun 11 13:42:09 2019 daemon.notice netifd: Interface 'rndis' is disabled Tue Jun 11 13:42:09 2019 kern.warn kernel: [ 929.192592] usb 1-1: usbfs: interface 1 claimed by usbfs while 'usbmode' sets config #0 Tue Jun 11 13:42:10 2019 kern.warn kernel: [ 929.430522] usb 1-1: usbfs: process 12946 (usbmode) did not claim interface 1 before use Tue Jun 11 13:42:10 2019 kern.warn kernel: [ 929.642549] usb 1-1: usbfs: interface 1 claimed by usbfs while 'usbmode' sets config #0 Tue Jun 11 13:42:10 2019 kern.warn kernel: [ 929.824890] usb 1-1: usbfs: process 13011 (usbmode) did not claim interface 1 before use Tue Jun 11 13:42:10 2019 kern.warn kernel: [ 930.042611] usb 1-1: usbfs: interface 1 claimed by usbfs while 'usbmode' sets config #0 Tue Jun 11 13:42:11 2019 kern.warn kernel: [ 930.381315] usb 1-1: usbfs: process 13104 (usbmode) did not claim interface 1 before use Tue Jun 11 13:42:11 2019 kern.warn kernel: [ 930.592867] usb 1-1: usbfs: interface 1 claimed by usbfs while 'usbmode' sets config #0

Actually, editing /etc/usb-mode.json file seems to help. I changed it to show

"12d1:15c1": { "*": { "mode": "Huawei", "msg": [ ] } },

After the change, device is recognized as wwan0 and everything is good

aparcar commented 5 years ago

yurtesen:

Sydney, have a look at this https://bugs.openwrt.org/index.php?do=details&task_id=2319 You need to change the bConfigurationValue to 0 first, then to 3. It will work if you first switch to 0

aparcar commented 5 years ago

sydney:

Hello Evren,

have a look at this https://bugs.openwrt.org/index.php?do=details&task_id=2319

Thanks. I'm sorry for replying this late.

I am having the same issue. Did you find a solution?

No, not really.

IIRC, i "solved" it by having an rc.local script, something like echoing 0, sleeping for a few seconds, echo 3 the bConfigurationValue, like you already mentioned.

Also, my etc/config/network contained:


config interface 'wwan0' option proto 'mbim' option ifname 'wwan0' option device '/dev/cdc-wdm0' option pincode '1234' option apn 'internet.proximus.be' option mode 'preferlte' option delay '5' option auto '0'

config interface 'LTE' option proto 'dhcp' option ifname 'wwan0' option auto '0'

But this appeared, obviously, not as an ideal solution..

aparcar commented 5 years ago

yurtesen:

Yes, so if they fix usbmode then things should be working for you. You should vote the bugreport I created... :)

I am right now using 18.06.2 the default bConfigurationValue which is 2. It loads cdc_ether and creates wwan0. I just setup dhclient on wwan0 and that seems to be enough.

I use the /etc/init.d/ncm-network script I have which use NDISDUP to tell the device to make connection. The script is in this guide: https://openwrt.org/docs/guide-user/network/wan/wwan/ethernetoverusb_ncm

I am not exactly sure what mbim may have over what I am using right now. Perhaps it detects if connection goes offline? I also have a script which checks internet connectivity (which is the last script on that guide actually).

I think for now I will not do changes to my system as I need access to AT commands, although my solution is also not ideal. Just out of curiosity, you do not have /dev/ttyUSB0 etc. when you switch to bConfigurationValue 3 right? Because I see no serial parts when I switch to 3.

The problem for me is that I am sending an AT command

`AT^SYSCFGEX="00",3FFFFFFF,1,1,7FFFFFFFFFFFFFFF,,

to the modem to force it to use packet switched (PS) mode only. Because the SIM I use is a operator made clone of my normal SIM and when I receive a phone call, both SIMs receive it. If I allow circuit switched (CS) mode, then the router drops to 3G for ringing, freezing the connection for few seconds and in some cases do not go back to 4G.

About MBIM, I just didn't know how to configure it as there is literally no documentation about it and luci does not support it yet. But also I need to force modem to data only mode so I need the tty port so... tough luck for me :)