Hikey 960 4G dongle support


#1

Hi guys,

I need to connect a 4G dongle to my new Hikey960. I’ve read that to do so, there is a handy app called “ppp widget”. The problem is that this app doesn’t support direct .apk installation, but only Google Play installation. Then I need install google play… And here is where I get stuck, because I don’t figure out how install it.
Does anyone know how solve this problem? Or another way to install “ppp widget” or have 4G dongle support by other means?
My AOSP version is P, Kernel version 5.9.50.

Thank you in advance
BR
Alvaro


#2

I already used a Huawei E3372 (LTE) USB dongle which works very well with Linux, moreover you don’t need any ppp widget since the dongle is enumerated as an ethernet over USB device (HiLink mode) and can be configured via a basic web interface. Android should then detect an ethernet connection with internet access.


#3

Thank you for your response, Loic.

I need to run it on Android, it is not detecting any ethernet connection so far… :frowning:


#4

What 4G dongle are you currently using ? there are different dongles which can expose different interfaces, EEM, NCM, serial modem (ttyACM, ttyUSB)… Depending the interface you will have to configure the dongle in a certain way (AT commands…) and use or not ppp to encapsulate network packets.


#5

I have the Huawei E3272s-152 and the Samsung GT-B3730. Neither of them work.

BTW, any idea how to root the AOSP in Hikey960?

BR


#6

Ok, because your Huawei dongle is in stick mode (serial ACM + NCM) you will need to send some AT command to establish the link. It seems that ppp widget could do the job, what is the problem with installing it ? if you have the apk you can install it with adb after enabling unlknown sources in settings->security:
$ adb root
$ adb install application.apk

If your are running eng or usedebug version you should have root access. I suggest you to disable sepolicy for the first try ($ setenforce 0).

You can also try to convert your dongle from stick to Hilink mode, I cannot give any garanty on the procedure but there is an interesting article here: http://www.gnuton.org/blog/2016/02/how-to-get-the-best-out-of-your-huawei-e3372s/


#7

Thank you again for your kind response.

I did install widget ppp app via adb, but then it says that apk installation is not allowed, only Google Play Store installation. Then the problem is I don’t know how to install Google apps to do so. I have tried some versions of Google Framework, services… and they don’t work in this AOSP.

BR


#8

This can be a permission or sdk version issue, did you enabled unknown sources (int settings->security) ?


#9

In fact, it seems like I don’t have “enable unknown sources” in my Security tab. But the “ppp widget” is installed, I can see the widget. It is when I try to use it that a pop up message appears from the app saying the “apk installation is not available”.


#10

Indeed ppp widgets with version greater than 2 do not work if not installed via play store.


#11

Please, guys. I need help with this issue. I am a noob and I can’t figure out how to solve it. Anyone could provide insight into how to make a 4G dongle work in Hikey960/AOSP???


#12

Does anyone know if there’s any place that has collected the information about HiKey 960 compatible 4G dongle models?

Thanks in advance!


#13

There is nothing specific to Hikey-960 here, most of the dongles are USB and Hikey960 has USB.
This mainly depends on the OS, for Linux the compatible device are mostly the ones supported by usbmodeswitch:
https://wiki.ubuntu.com/NetworkManager/Hardware/3G

For Android, this a bit more challenging, this can request tuning the system a bit to install usbmodeswitch or using one of the ppp application (ppp widget) when possible. The easier way is maybe to use ‘smart’ dongles which usually expose a standard USB CDC Ethernet interface and embed a dhcp server, and web interface for the configuration (e.g. Huawey with Hilink mode).


#14

Thank you for your guidance!


#15

Hi Loic,

I dramatically failed trying to overcome this issue :P. If you succeed,
please share with mortals!! hehehe

Best Regards,

Alvaro


#16

Does anyone know the max. power consumption / max. working current of Huawei E3372? I must check if this dongle requires more current than that one USB Host port on HiKey 960 can provide, when the cell phone network’s signal is in poor condition.


#17

I’ve spent some time today to test a Huawey E3372 dongle with Hilink mode. This dongle is enumerated as a mass storage device (for windows compatibility) and then needs to be switched to Hilink mode in order to get network access. This can be performed via usb_modeswitch or the ppp widget app (not operational on Hikey960), then I went for usb_modeswitch.

1. Build/Download usb_modeswitch for Android
There is no Android version of usb_modeswitch, so I created my own repository (https://github.com/loicpoulain/usb-modeswitch), copied the last version from official website (http://www.draisberghof.de/usb_modeswitch/) and applied minimal modification to make it buildable in Android tree. This project can be cloned in external AOSP directory and built with mm. I also uploaded the arm64 binary to https://github.com/loicpoulain/armbin/blob/master/android/aarch64/usb_modeswitch which can be directly pushable on Hikey960.

2. Plug the Huawey E3372 to Hikey960
As expected the dongle is enumerated as a mass storage:

[ 3212.692637] usb 1-1.1: New USB device found, idVendor=12d1, idProduct=1f01
[ 3212.699855] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3212.707882] usb 1-1.1: Product: HUAWEI_MOBILE
[ 3212.712417] usb 1-1.1: Manufacturer: HUAWEI_MOBILE
[ 3212.790387] usb-storage 1-1.1:1.0: USB Mass Storage device detected

3. Switch to HiLink mode
From root command line (serial or adb), I applied the following command:

> ./usb_modeswitch -J -v 0x12d1 -p 0x1f01

(-J is to switch to HiLink mode)

Then the usb dongle switched to cdc ethernet mode:

[ 3368.481808] usb 1-1.1: new high-speed USB device number 10 using xhci-hcd
[ 3368.593992] usb 1-1.1: New USB device found, idVendor=12d1, idProduct=14dc
[ 3368.601107] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3368.608904] usb 1-1.1: Product: HUAWEI_MOBILE
[ 3368.613730] usb 1-1.1: Manufacturer: HUAWEI_MOBILE
[ 3368.839554] cdc_ether 1-1.1:1.0 eth0: register ‘cdc_ether’ at usb-xhci-hcd.2.auto-1.1, CDC Ethernet Device, 0c:5b:8f:27:9a:64
[ 3368.894191] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

At this point network interface is ready and provisioned with an IP address:

ifconfig
eth0      Link encap:Ethernet  HWaddr 0c:5b:8f:27:9a:64  Driver cdc_ether
          inet addr:192.168.8.100  Bcast:192.168.8.255  Mask:255.255.255.0 
          inet6 addr: fe80::1c4d:503f:c9f6:69c4/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:85 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:23366 TX bytes:5321 

3. Configure the dongle
Android detects the dongle as a standard ethernet link (in the same way as a usb ethernet dongle). If your SIM card does not have PIN code internet is directly available, else you need to access the dongle web interface to configure it (IP is 192.168.8.1).

For sure ‘mode-switch’ can be scripted and enabled on uevent or at board init.


#18

This is an interesting question, but I would not be worried about that, the dongle is designed for usb2.0 and hikey960 is built to support usb3.0 which has higher current limitation.


#19

Hi Loic, I’ve pushed the arm64 to the Hikey: adb push usb-modeswitch /data/local (for example) but when I try to run ./usb_modeswitch… it says permission denied. I’ve also tried with “su” and it shows the same message. The developer options are enabled but I can not manage to run it…

I dont know how to build the project with “mm” either…

All the process of usb_modeswitch is known to me because I’ve done it in a Intel Edison board… but as I can not run it in my Hilink… I can not resolve the problem…

Ty!


#20

Could you retry with sepolicy disabled (setenforce permissive) ? I’ve personally tried from root console (via UART).
Any issue reported in dmesg when executing the command ? could you try to move binary to system partition ?