Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
tristanc
Posts: 4
Joined: 17 Feb 2015, 13:44

Huawei E8278 - 12d1:14fe - switch to ppp mode?

Post by tristanc » 17 Feb 2015, 18:59

Hello all,

A novice here looking for help with the Huawei E8278 4G dongle. I have this working on Raspbian and OpenWRT via USB_modeswitch with zero interaction, as expected. Superb. The interface appears as wwan0, I can use screen on /dev/ttyusb0 to issue AT commands.

However, as this seems to be a HiLink device(?), it has its onboard DHCP server providing the connection on a 192.168.1.x subnet. This plays havoc with uPnP etc if the modem is set as the WAN on a router, with a 2nd subnet on the internal side (192.168.3.x in my case).

So, I was wondering if it is possible to 'switch' this modem to use a differing mode (ppp?) to bypass the onboard DHCP and hopefully avoid double NAT issues etc whilst keeping the 4G connection speeds?

Below are dmesg & lsusb outputs from before and after a 'normal' switch with nothing modified:

BEFORE

Code: Select all

[    5.967523] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    6.194895] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=14fe
[    6.203445] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[    6.212330] usb 1-1.2: Product: HUAWEI Mobile
[    6.218270] usb 1-1.2: Manufacturer: HUAWEI Technology
[    6.347154] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[    6.355397] scsi0 : usb-storage 1-1.2:1.0
[    6.361765] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[    6.369876] scsi1 : usb-storage 1-1.2:1.1
[    6.991295] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    7.388988] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[    7.400842] scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[    7.476869] sd 1:0:0:0: [sda] Attached SCSI removable disk
[    9.666025] NET: Registered protocol family 10
[    9.731660] nf_conntrack version 0.5.0 (7042 buckets, 28168 max)
[    9.744107] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    9.781995] hidraw: raw HID events driver (C) Jiri Kosina
[    9.828440] usbcore: registered new interface driver cdc_ether
[    9.837810] usbcore: registered new interface driver cdc_ncm
[    9.848023] ip_tables: (C) 2000-2006 Netfilter Core Team
[    9.904024] usbcore: registered new interface driver usbhid
[    9.911084] usbhid: USB HID core driver
[    9.937517] usbcore: registered new interface driver usbserial
[    9.944863] usbcore: registered new interface driver usbserial_generic
[    9.952844] usbserial: USB Serial support registered for generic
[    9.978338] xt_time: kernel timezone is -0000
[    9.991617] PPP generic driver version 2.4.2
[    9.999148] NET: Registered protocol family 24
[   10.010859] usbcore: registered new interface driver option
[   10.017935] usbserial: USB Serial support registered for GSM modem (1-port)
[   13.491772] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   13.500993] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.063437] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   15.073957] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1

Code: Select all

Bus 001 Device 004: ID 12d1:14fe Huawei Technologies Co., Ltd. 
AFTER

Code: Select all

[    3.197671] usb 1-1.3.2: new high-speed USB device number 5 using dwc_otg
[    3.299819] usb 1-1.3.2: New USB device found, idVendor=12d1, idProduct=1506
[    3.308320] usb 1-1.3.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[    3.318538] usb 1-1.3.2: Product: HUAWEI Mobile
[    3.324494] usb 1-1.3.2: Manufacturer: HUAWEI Technology
[    3.334483] usb-storage 1-1.3.2:1.2: USB Mass Storage device detected
[    3.343053] scsi0 : usb-storage 1-1.3.2:1.2
[    3.349580] usb-storage 1-1.3.2:1.3: USB Mass Storage device detected
[    3.358106] scsi1 : usb-storage 1-1.3.2:1.3
[    4.348892] scsi 0:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
[    4.362298] scsi 1:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 2
[    4.377905] sd 1:0:0:0: [sda] Attached SCSI removable disk
[    7.465159] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   10.032942] NET: Registered protocol family 10
[   10.100273] nf_conntrack version 0.5.0 (7042 buckets, 28168 max)
[   10.117682] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.156177] hidraw: raw HID events driver (C) Jiri Kosina
[   10.205209] usbcore: registered new interface driver cdc_ether
[   10.221820] usb 1-1.3.2: MAC-Address: 0c:5b:8f:27:9a:64
[   10.229584] cdc_ncm 1-1.3.2:1.1 wwan0: register 'cdc_ncm' at usb-bcm2708_usb-1.3.2, Mobile Broadband Network Device, 0c:5b:8f:27:9a:64
[   10.244592] usbcore: registered new interface driver cdc_ncm
[   10.260953] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.303045] usbcore: registered new interface driver usbhid
[   10.310074] usbhid: USB HID core driver
[   10.318392] usbcore: registered new interface driver usbserial
[   10.325702] usbcore: registered new interface driver usbserial_generic
[   10.333636] usbserial: USB Serial support registered for generic
[   10.393826] xt_time: kernel timezone is -0000
[   10.406511] PPP generic driver version 2.4.2
[   10.427729] NET: Registered protocol family 24
[   10.448429] usbcore: registered new interface driver option
[   10.455556] usbserial: USB Serial support registered for GSM modem (1-port)
[   10.464568] option 1-1.3.2:1.0: GSM modem (1-port) converter detected
[   10.473749] usb 1-1.3.2: GSM modem (1-port) converter now attached to ttyUSB0
[   14.111248] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   14.120638] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   14.161110] IPv6: ADDRCONF(NETDEV_UP): wwan0: link is not ready
[   14.168818] cdc_ncm: wwan0: 50 mbit/s downlink 150 mbit/s uplink
[   14.176540] cdc_ncm: wwan0: network connection: connected
[   14.183681] IPv6: ADDRCONF(NETDEV_CHANGE): wwan0: link becomes ready
[   15.516167] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   15.527221] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xDDE1

Code: Select all

Bus 001 Device 005: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
*NOTE these are taken from two installs of OpenWRT; one in-use, remote, in situ device (the switched dmesg) and one test device I have spare (non-switched dmesg), so there are slight differences...

**Side note, "[ 14.168818] cdc_ncm: wwan0: 50 mbit/s downlink 150 mbit/s uplink" seems to indicate the speeds the wrong way round... The spec indicates 150 down and 50 up. Is this a bug?

I ran AT^SETPORT=? over screen /dev/ttyUSB0 and got:

Code: Select all

^SETPORT:2: 3G PCUI
^SETPORT:3: 3G DIAG
^SETPORT:5: 3G GPS
^SETPORT:A: BLUE TOOTH
^SETPORT:16: NCM
^SETPORT:A1: CDROM
^SETPORT:A2: SD
^SETPORT:12: 4G PCUI
^SETPORT:13: 4G DIAG
^SETPORT:14: 4G GPS
with the output of AT^SETPORT? as: ^SETPORT:A1,A2;12,16,A1,A2

^SYSINFO:2,3,0,5,1,0,4

ATI

Manufacturer: huawei
Model: E8278
Revision: 21.261.67.00.105
IMEI: <-xxxxxxxx->
+GCAP: +CGSM,+DS,+ES

Given the above information, is it possible to bypass the HiLink part and run it as, say, ppp to avoid double NAT?

Many thanks,

Tristan

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Huawei E8278 - 12d1:14fe - switch to ppp mode?

Post by Josh » 17 Feb 2015, 19:34

I don't recommend playing around with the SETPORT command. It's possible to screw up some modems permanently.

Fortunately, Huawei modems do have a PPP fallback mode.
Just change the "MessageContent" in the config file for your modem to

"55534243123456780000000000000011063000000100010000000000000000"

The target ID for that mode is usually "12d1:1001".

tristanc
Posts: 4
Joined: 17 Feb 2015, 13:44

Re: Huawei E8278 - 12d1:14fe - switch to ppp mode?

Post by tristanc » 17 Feb 2015, 21:50

Thanks Josh, you've given me a glimmer of hope!

So I've created a usb-mode.json file for OpenWRT containing only:

Code: Select all

{
	"messages" : [
	    	    "55534243123456780000000000000011063000000100010000000000000000",
],
"devices" : {
		"12d1:14fe": {
			"*": {
				"t_vendor": 4817,
				"t_product": [ 4097 ],
				"msg": [ 0 ]
			}
		},
	}
}
A bit of unplugging and restarting later we have:

Code: Select all

Bus 001 Device 007: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem

Code: Select all

[  460.084144] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=14fe
[  460.092837] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[  460.101888] usb 1-1.2: Product: HUAWEI Mobile
[  460.107926] usb 1-1.2: Manufacturer: HUAWEI Technology
[  460.208521] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[  460.257371] scsi4 : usb-storage 1-1.2:1.0
[  460.263985] usb-storage 1-1.2:1.1: USB Mass Storage device detected
[  460.277354] scsi5 : usb-storage 1-1.2:1.1
[  460.751395] usb 1-1.2: USB disconnect, device number 6
[  460.997605] usb 1-1.2: new high-speed USB device number 7 using dwc_otg
[  461.217838] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1001
[  461.226409] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[  461.235343] usb 1-1.2: Product: HUAWEI Mobile
[  461.241269] usb 1-1.2: Manufacturer: HUAWEI Technology
[  461.297003] option 1-1.2:1.0: GSM modem (1-port) converter detected
[  461.317512] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[  461.326698] option 1-1.2:1.1: GSM modem (1-port) converter detected
[  461.336284] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[  461.345466] option 1-1.2:1.2: GSM modem (1-port) converter detected
[  461.354820] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
Success? Perhaps a bit premature. I started to try and configure it with my operators settings. These then popped up:

Code: Select all

[ 1130.217461] option1 ttyUSB0: option_instat_callback: error -2
[ 1195.222918] option1 ttyUSB0: option_instat_callback: error -2
[ 1461.227988] option1 ttyUSB0: option_instat_callback: error -2
and

Code: Select all

root@OpenWrt:/etc# gcom info -d /dev/ttyUSB0
##### Wireless WAN Modem Configuration #####
Product text:
====
huawei
Model: E8278
Revision: 21.261.67.00.105
IMEI: XXXXXXXXXXXXX
+GCAP: ???????????_???ۿ??
====
Manufacturer:           IMEI and Serial Number: 
Manufacturer's Revision: comgt 19:15:04 -> -- Error Report --
comgt 19:15:04 -> ---->                      ^
comgt 19:15:04 -> Error @982, line 56, String is shorter than second argument. (7)
Each time I run gcom I get another dmesg entry with the option_instat_callback error.

Any ideas on this?

tristanc
Posts: 4
Joined: 17 Feb 2015, 13:44

Re: Huawei E8278 - 12d1:14fe - switch to ppp mode?

Post by tristanc » 18 Feb 2015, 12:31

tristanc wrote:Thanks Josh, you've given me a glimmer of hope!
My hope is fading... I take it the 'switching' is working correctly, but there is an issue with the AT commands / configuration used on this modem?

ie, a command in the gcom info sequence doesn't work, and likely a command in the ppp dialling process doesn't work either? Showing my ignorance here! The below was the best I was able to get last night:

Code: Select all

Tue Feb 17 21:32:13 2015 daemon.notice netifd: Interface 'wan' is setting up now
Tue Feb 17 21:32:15 2015 kern.err kernel: [ 8463.376415] option1 ttyUSB0: option_instat_callback: error -2
Tue Feb 17 21:32:16 2015 daemon.notice netifd: wan (5291): SIM ready
Tue Feb 17 21:32:16 2015 daemon.notice netifd: wan (5291): PIN set successfully
Tue Feb 17 21:32:16 2015 kern.err kernel: [ 8464.728992] option1 ttyUSB0: option_instat_callback: error -2
Tue Feb 17 21:32:17 2015 daemon.notice netifd: wan (5291): Trying to set mode
Tue Feb 17 21:32:17 2015 kern.err kernel: [ 8466.052087] option1 ttyUSB0: option_instat_callback: error -2
Tue Feb 17 21:32:17 2015 daemon.notice pppd[5312]: pppd 2.4.7 started by root, uid 0
Tue Feb 17 21:32:17 2015 daemon.notice pppd[5312]: Removed stale lock on ttyUSB0 (pid 4977)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: abort on (BUSY)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: abort on (NO CARRIER)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: abort on (ERROR)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: report (CONNECT)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: timeout set to 10 seconds
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: send (AT&F^M)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: expect (OK)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: ^M
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: OK
Tue Feb 17 21:32:19 2015 local2.info chat[5314]:  -- got it
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: send (ATE1^M)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: expect (OK)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: ^M
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: ^M
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: OK
Tue Feb 17 21:32:19 2015 local2.info chat[5314]:  -- got it
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: send (AT+CGDCONT=1,"IP","everywhere"^M)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: timeout set to 30 seconds
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: expect (OK)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: ^M
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: ^M^M^M^MGDCOOTTTT,III""""""""weeee"^M
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: OK
Tue Feb 17 21:32:19 2015 local2.info chat[5314]:  -- got it
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: send (ATD*99***1#^M)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: expect (CONNECT)
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: ^M
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: ^MAAAAAAAAAAA^M
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: CONNECT
Tue Feb 17 21:32:19 2015 local2.info chat[5314]:  -- got it
Tue Feb 17 21:32:19 2015 local2.info chat[5314]: send ( ^M)
Tue Feb 17 21:32:19 2015 daemon.info pppd[5312]: Serial connection established.
Tue Feb 17 21:32:19 2015 daemon.info pppd[5312]: Using interface 3g-wan
Tue Feb 17 21:32:19 2015 daemon.notice pppd[5312]: Connect: 3g-wan <--> /dev/ttyUSB0
Tue Feb 17 21:32:50 2015 daemon.warn pppd[5312]: LCP: timeout sending Config-Requests
Tue Feb 17 21:32:50 2015 daemon.notice pppd[5312]: Connection terminated.
Tue Feb 17 21:32:50 2015 kern.err kernel: [ 8498.800682] option1 ttyUSB0: option_instat_callback: error -2
Tue Feb 17 21:32:51 2015 daemon.notice pppd[5312]: Modem hangup
Tue Feb 17 21:32:51 2015 daemon.info pppd[5312]: Exit.
Tue Feb 17 21:32:51 2015 daemon.notice netifd: Interface 'wan' is now down
Using the above approach, would I need the usb-net-cdc-* modules installed? Could they be interfering in any way?

I see there are methods of using the NCM protocol (https://sites.google.com/site/variousop ... awei-e3267 or https://forum.openwrt.org/viewtopic.php ... 12#p266012) directly, if that would make a difference?

Josh
Site Admin
Posts: 6570
Joined: 03 Nov 2007, 00:30

Re: Huawei E8278 - 12d1:14fe - switch to ppp mode?

Post by Josh » 18 Feb 2015, 19:58

The modem should work with nothing but the "option" driver in that mode.

Your problem looks rather like a fundamental USB issue. A short Google search brought up this:
https://dev.openwrt.org/ticket/17984

and this:
https://dev.openwrt.org/ticket/17249

tristanc
Posts: 4
Joined: 17 Feb 2015, 13:44

Re: Huawei E8278 - 12d1:14fe - switch to ppp mode?

Post by tristanc » 20 Feb 2015, 14:38

Josh wrote:The modem should work with nothing but the "option" driver in that mode.
The consensus is that what I am trying to achieve (to either bypass or place in bridge mode the built-in DHCP router of the dongle via an AT command) is simply not possible...

Using the latest OpenWRT or raspbian distros (3.18 kernel on the Pi) with the E3276 dongle (instead of the e8278) and suitable firmware (21.x version) loaded I should be able to achieve what I want - the dongle's external IP being passed to the router's WAN.

I think the e8278 is not that popular so there is less documentation / firmware work done on it.

Thanks for your help.

Post Reply