Vodafone K5160 on OpenWrt

I try to use Vodafone K5160 on my openwrt router. In NCM mode, openwrt logs say

Tue Apr 26 16:57:43 2022 daemon.notice netifd: 4g1 (13289): ls: /sys/devices/platform/1e1c0000.xhci/usb1/1-1/1-1:1.2/ttyUSB2/../../*/net: No such file or directory
Tue Apr 26 16:57:43 2022 daemon.notice netifd: 4g1 (13289): The interface could not be found.
Tue Apr 26 16:57:43 2022 daemon.notice netifd: 4g1 (13316): Stopping network 4g1
Tue Apr 26 16:57:45 2022 daemon.notice netifd: 4g1 (13316): WARNING: Variable 'vodafone' does not exist or is not an array/object
Tue Apr 26 16:57:45 2022 daemon.notice netifd: 4g1 (13316): Unsupported modem
Tue Apr 26 16:57:45 2022 daemon.notice netifd: Interface '4g1' is now down

Any suggestion to fix the issue. Please help me.

https://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?t=2994

https://www.rychly.org/post/huawei-k5160/

sudo usb_modeswitch -v 12d1 -p 1f1e -M 55534243123456780000000000000011062000000101000100000000000000

I followed the guilde : https://www.rychly.org/post/huawei-k5160/ .But changing in usb-mode.json is not working. Id does not change to

Vendor=12d1 ProdID=155e Rev= 1.02

It still is:

Vendor=12d1 ProdID=1001 Rev= 1.02

That's all I can help with as I have no experience with this. I just use a Huawei B818-263 in bridge mode. Hopefully someone else can chip in on this? Any ideas @frollic, @trendy or @lleachii?

mv /etc/usb-mode.json /etc/usb-mode.json.bak
cat << EOF > /etc/usb-mode.json
{
	"messages" : [
		"55534243123456780000000000000011063000000100000000000000000000",
		"55534243123456780000000000000011060000000100000100000000000000",
		"55534243123456780000000000000011062000000101000100000000000000",
		"55534243123456780000000000000011063000000000010000000000000000"
	],
	"devices" : {
		"12d1:1001": {
			"*": {
				"t_vendor": 4817,
				"t_product": [ 4097, 5503, 5470 ],
				"msg": [ 3 ]
			}
		}
	}
}
EOF
/etc/init.d/usbmode restart

Unplug-replug.

3 Likes

I think the solution, it's worked. But after some seconds, ProdID will be changed back to 1001

hi,

I also have a Vodafone K5160 which comes with a different product id:


T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=ff MxPS=64 #Cfgs=  2
P:  Vendor=12d1 ProdID=15ee Rev= 1.02
S:  Manufacturer=Vodafone (Huawei)
S:  Product=Vodafone (Huawei)
S:  SerialNumber=0123456789ABCDEF
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=125us
C:  #Ifs= 3 Cfg#= 2 Atr=a0 MxPwr=  2mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=
E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=
I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 2 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=125us


usb-modeswitch switches to

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=1c28 Rev= 1.02
S:  Manufacturer=Vodafone (Huawei)
S:  Product=Vodafone (Huawei)
C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=02 Prot=32 Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=31 Driver=option
E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:  If#= 2 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=02 Prot=46 Driver=huawei_cdc_ncm
E:  Ad=86(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
I:* If#= 2 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=46 Driver=huawei_cdc_ncm
E:  Ad=86(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

even with Kernel module for CDC MBIM installed

[   17.102046] usbcore: registered new interface driver cdc_wdm
[   17.310328] usbcore: registered new interface driver cdc_ether
[   17.352986] usbcore: registered new interface driver cdc_ncm
[   17.509348] huawei_cdc_ncm 1-1:1.2: MAC-Address: 00:1e:10:1f:00:00
[   17.515640] huawei_cdc_ncm 1-1:1.2: setting rx_max = 16384
[   17.529340] huawei_cdc_ncm 1-1:1.2: NDP will be placed at end of frame for this device.
[   17.537763] huawei_cdc_ncm 1-1:1.2: cdc-wdm0: USB WDM device
[   17.544692] huawei_cdc_ncm 1-1:1.2 wwan0: register 'huawei_cdc_ncm' at usb-101c0000.ehci-1, Huawei CDC NCM device, 00:1e:10:1f:00:00
[   17.557122] usbcore: registered new interface driver huawei_cdc_ncm
[   19.431364] usbcore: registered new interface driver cdc_mbim
[  409.457681] huawei_cdc_ncm 1-1:1.2 wwan0: unregister 'huawei_cdc_ncm' usb-101c0000.ehci-1, Huawei CDC NCM device
[  705.315376] huawei_cdc_ncm 1-1:1.2: MAC-Address: 00:1e:10:1f:00:00
[  705.321694] huawei_cdc_ncm 1-1:1.2: setting rx_max = 16384
[  705.357269] huawei_cdc_ncm 1-1:1.2: NDP will be placed at end of frame for this device.
[  705.365775] huawei_cdc_ncm 1-1:1.2: cdc-wdm0: USB WDM device
[  705.372739] huawei_cdc_ncm 1-1:1.2 wwan0: register 'huawei_cdc_ncm' at usb-101c0000.ehci-1, Huawei CDC NCM device, 00:1e:10:1f:00:00

It seems that /dev/cdc-wdm0 does not respond on AT commands and I tried to use one of the serial interfaces

config interface 'LTE'
	option apn 'internet.t-d1.de'
	option dialnum '*99#'
	option proto 'ncm'
	option ifname 'wwan0'
	option ipv6 'auto'
	option metric '40'
	option delegate '0'
	option disabled '0'
	option mode 'preferlte'
	option pdptype 'IP'
	option device '/dev/ttyUSB1'
	option auto '0'

device is now talking with me but ...

Sat Jul 23 15:28:36 2022 daemon.notice netifd: LTE (5525): WARNING: Variable 'vodafone' does not exist or is not an array/object
Sat Jul 23 15:28:36 2022 daemon.notice netifd: LTE (5525): Unsupported modem

so I tried a dirty edit in /etc/gcom/ncm.json and replaced "huawei" wie "vodafone" with the following result

Sat Jul 23 15:38:50 2022 daemon.notice netifd: LTE (2273): sending -> AT
Sat Jul 23 15:38:51 2022 daemon.notice netifd: LTE (2273): sending -> ATZ
Sat Jul 23 15:38:51 2022 daemon.notice netifd: LTE (2273): sending -> ATQ0
Sat Jul 23 15:38:52 2022 daemon.notice netifd: LTE (2273): sending -> ATV1
Sat Jul 23 15:38:53 2022 daemon.notice netifd: LTE (2273): sending -> ATE1
Sat Jul 23 15:38:53 2022 daemon.notice netifd: LTE (2273): sending -> ATS0=0
Sat Jul 23 15:38:54 2022 daemon.notice netifd: LTE (2273): sending -> AT+CGDCONT=1,"IP","internet.t-d1.de"
Sat Jul 23 15:38:55 2022 daemon.notice netifd: LTE (2273): Configuring modem
Sat Jul 23 15:38:55 2022 daemon.notice netifd: LTE (2273): Setting mode
Sat Jul 23 15:38:55 2022 daemon.notice netifd: LTE (2273): sending -> AT^SYSCFGEX="030201",3fffffff,2,4,7fffffffffffffff,,
Sat Jul 23 15:38:56 2022 daemon.notice netifd: LTE (2273): Starting network LTE
Sat Jul 23 15:38:56 2022 daemon.notice netifd: LTE (2273): Connecting modem
Sat Jul 23 15:38:57 2022 daemon.notice netifd: LTE (2273): sending -> AT^NDISDUP=1,1,"internet.t-d1.de"
Sat Jul 23 15:38:58 2022 daemon.notice netifd: LTE (2273): Setting up wwan0
Sat Jul 23 15:38:58 2022 daemon.notice netifd: Interface 'LTE' is now up
Sat Jul 23 15:38:58 2022 daemon.notice netifd: Network device 'wwan0' link is up
Sat Jul 23 15:38:58 2022 daemon.notice netifd: Network alias 'wwan0' link is up
Sat Jul 23 15:38:58 2022 daemon.notice netifd: Interface 'LTE_4' is enabled
Sat Jul 23 15:38:58 2022 daemon.notice netifd: Interface 'LTE_4' has link connectivity
Sat Jul 23 15:38:58 2022 daemon.notice netifd: Interface 'LTE_4' is setting up now
Sat Jul 23 15:38:59 2022 daemon.notice netifd: LTE_4 (3081): udhcpc: started, v1.35.0
Sat Jul 23 15:38:59 2022 daemon.notice netifd: LTE_4 (3081): udhcpc: broadcasting discover
Sat Jul 23 15:38:59 2022 user.notice firewall: Reloading firewall due to ifup of LTE (wwan0)
Sat Jul 23 15:39:02 2022 daemon.notice netifd: LTE_4 (3081): udhcpc: broadcasting discover
Sat Jul 23 15:39:05 2022 daemon.notice netifd: LTE_4 (3081): udhcpc: broadcasting discover

here ends my story with that device... interface does not get an IP or even any packets

wwan0     Link encap:Ethernet  HWaddr 00:1E:10:1F:00:00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1291 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:441522 (431.1 KiB)

I give up for now....

device is working in mbim mode together with modemmanager

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=1c28 Rev= 1.02
S:  Manufacturer=Vodafone (Huawei)
S:  Product=Vodafone (Huawei)
C:* #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=  2mA
A:  FirstIf#= 2 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=02 Prot=32 Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=31 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
E:  Ad=87(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
I:  If#= 3 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I:* If#= 3 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

1 Like