Quantcast
Channel: xda-developers - Xoom Android Development
Viewing all articles
Browse latest Browse all 32

(DEV) USB 3G/4G-LTE MODEM via usb USB OTG cable

$
0
0
Hi everyone,
I am not a developer, i searched for finding how to make motorola xoom WIFI to connect with Huawei LTE 4G E392,
But i didn`t find.
So please if someone can help developing.

Here is what i found

Quote:

Originally Posted by zerox981 (Post 23987592)
This is the way I get my dongle (Vodafone K4605) working with the latest TeamEOS nightly wingray (84 atm :)).

Tools I use:
WinSCP - http://winscp.net/eng/index.php
SSHdroid - https://play.google.com/store/apps/d...sshdroid&hl=en
putty - http://www.chiark.greenend.org.uk/~sgtatham/putty/

1) Download the latest development overlay from this thread:
http://forum.xda-developers.com/show....php?t=1513490

2) Delete the drivers you don't need from the zip file. (xoom_dev_overlay_v4.zip\data\local\lib\modules\).
For my needs it's enough to keep only the option.ko and usb_wwan.ko.

3) Flash the dev. overlay.

4) Install pppd, usb_modeswitch and chat binary
Now you need to install pppd, usbmodeswitch and the chat binary the kernel is missing. You can google them or use my 3gdongle.zip file with my configs:).
Run sshdroid so you can ssh to your android device (or use adb shell etc.).
Connect to your andrid device with putty.
Then run
Code:

sysrw
so you can write to your system folder.
Copy the contents of the zip file in the root folder using WinSCP.
Add the execute permission on
/system/xbin/chat
/system/xbin/usb_modeswitch
/system/bin/pppd
/system/etc/ppp/ip-up
/system/etc/ppp/ip-down
(using WinSCP or with chattr via ssh)

5) Plug the dongle to your windows machine & using Vodafone windows application disable pin authentication. (You can let it enabled but you have to modify the gprs-connect-chat i guess).

6) Disable the CD-ROM mode (I think it's not required because we are using usb_modeswitch, but i did it a long time ago and I'm too lazy to enable it back:D).
Under Control Panel->Phone and Modem look in the Modems tab. There should be the COM port written in the "Attached To" column.
Using putty & connection type serial connect to your modem and disable the CD-ROM mode using the command
Code:

AT^SETPORT="A1;1,2,3"
You can also check if your modem is responding with the AT command (it should write back OK).
Using te ATI command you should get the modem information back.
ex:
Code:

Manufacturer: Vodafone (Huawei)
Model: K4605
Revision: 11.113.21.00.11
IMEI: 353148040378952
+GCAP: +CGSM,+DS,+ES

OK

7) Plug the modem into your android device. You can check if the necessary moodules are loaded with lsmod:
Code:

sh-4.1# lsmod
option 13380 0 - Live 0xbf016000
usb_wwan 8789 1 option, Live 0xbf00d000

8) Check the dmesg or use lsusb to get your devices vendor and product id
dmesg>
Code:

[ 1903.631599] usb 2-1: new high speed USB device number 3 using tegra-ehci
[ 1903.689362] usb 2-1: New USB device found, idVendor=12d1, idProduct=14c1
[ 1903.689606] usb 2-1: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 1903.689739] usb 2-1: Product: Vodafone Mobile Broadband (Huawei)
[ 1903.689970] usb 2-1: Manufacturer: Vodafone Group (Huawei)
[ 1903.695541] scsi1 : usb-storage 2-1:1.0
[ 1904.701649] scsi 1:0:0:0: CD-ROM            Vodafone CD ROM (Huawei)  2.31 PQ: 0 ANSI: 2

lsusb>
Code:

Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
Bus 002 Device 003: ID 12d1:14c1

9) Switch usb mode using usb_modeswitch and the config file for your device. In my case it's 12d1:14c1.
Code:

usb_modeswitch  -c /etc/usb_modeswitch.d/12d1_14c1
If the switch was succsessful you should see the correct productid now (in my case 14c6):
Code:

sh-4.1# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
Bus 002 Device 005: ID 12d1:14c6

10) optional - K4605 or other unrecognized devices
After the modeswitch you should see your device under /dev/ttyUSB*. But with the K4605 we don't because option.ko doesn't know our device. So we need to call
Code:

echo "12d1 14c6" >/sys/bus/usb/drivers/option/module/drivers/usb-serial:option1/new_id
and our device appears:).

11) check if modem is responding:
Code:

cat /dev/ttyUSB0 & echo AT > /dev/ttyUSB0
You should get an OK.

12) Set the config files. If you installed my 3gdongle.zip file you will find my config files under /system/etc/ppp .
You have to edit the gprs-connect-chat file and the peers/gprs file.
I will not go into detail about this config files. There is a lot of information about it on xda forums and google should be your best friend too ;).

bonus) I use this scripts to enable and disable internet via my 3G dongle using the scriptmanager app (https://play.google.com/store/apps/d...tmanager&hl=en)

01_init3g.sh - Run it after plugging the 3g dongle to your android device (k4605 specific)
Code:

# My modem Vodafone K4605 is unknown to option.ko so we manually add it
# you can delete this line if your modem is recognized by option.ko
echo "12d1 14c6" >/sys/bus/usb/drivers/option/module/drivers/usb-serial:option1/new_id
# switch modes with usb_modeswitch
usb_modeswitch  -c /etc/usb_modeswitch.d/12d1_14c1

02_connect via 3g.sh - Connect to the internet (you have to wait 10-20sec after using init because the modem has to initialize first)
Code:

#!/system/bin/sh
#save old route & primary dns
OLDROUTE=`/system/xbin/netstat -r | /system/xbin/grep default | /system/xbin/awk '{print $2}' | /system/xbin/head -n1`
OLDDNS=`/system/bin/getprop net.dns1`
/system/xbin/echo $OLDROUTE > /data/ppp/ppp0.route;
/system/xbin/echo $OLDDNS >> /data/ppp/ppp0.route;
# just some logging for debugging. Can be removed :)
/system/bin/log -pw -t zeroxPPPD "OldRoute: $OLDROUTE"
/system/bin/log -pw -t zeroxPPPD "OldDNS: $OLDDNS"

#connect to the internet
pppd call gprs

03_restore wlan.sh - Disconnect the 3g dongle & restore WLAN
Code:

#!/system/bin/sh
# restore the old route & primary dns (you can extend the script to add the secondary dns..
OLDROUTE=`cat /data/ppp/ppp0.route | head -n1`
OLDDNS=`cat /data/ppp/ppp0.route | tail -n1`

/system/bin/setprop "net.dns1" "$OLDDNS"
/system/xbin/route add default gw $OLDROUTE dev wlan0

# delete the settings file
/system/xbin/rm /data/ppp/ppp*.route


here is the link for it (http://forum.xda-developers.com/show...1494891&page=4)

It's also in the latest source (http://git.kernel.org/?p=linux/kerne...37b49c1753f33b)

I also found this (https://github.com/DerArtem/huaweigeneric-ril).

PLEASE DEVELOPERS TAKE A LOOK INTO IT, if possible fro the source please build a kernel patch or script




thanks to zerox981

Viewing all articles
Browse latest Browse all 32

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>