yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Android Development] trevd:
Hmmm, That's a bit irritating, It's making it all the way to making the call and failing on the datacall.

I'll set mine up from scratch and check that it's nothing that i've missed and just tweaked out during the course of my testing.

one more thing to try as Android was still handling the data calling. The total manual method!!

1. Reset the tab

2. Power on without the dongle plugged in

3. adb shell stop hotplugd

4. adb shell stop ril-daemon

5. Plug the dongle in

6. adb shell usb_modeswitch -c/etc/usb_modeswitch/12d1_1446 -v12d1 -p1446

7. adb setprop ril.pppd_tty /dev/ttyUSB0

8. adb shell /etc/init_pppd_gprs

Thanks Again
[Nexus 7 Android Development] laz2336:
I'll give it a test when i get home. just curious, how are you managing to run adb commands when the dongle is plugged in? is it connectable via some thing other than usb? I've been running all this through terminal emulator.
[Nexus 7 Android Development] mateorod:
I have a tool that ports mods and tweaks like your across devices.

It decompiles specific portions of update zips and then outputs flashable zips. I saw your above concerns about flashing through recovery and thought I would give you a shout.

It is used to port stuff like this, where there is some modifying of source code needed and where users wouldn't be likely to do it one their own. I just today finished porting PDroid to AOSP (using my Nexus 7 as a base). This requires patching and editing of the boot.img, just like what you have above.

The advantage to the Auto-Patcher is just like what you said above, that this way they can flash it in recovery while leaving their existing stuff (TabetUI, or insecure boot.img or whatever) intact. It is also pretty much certain that this way your 3G dongle mod could be ported not only across ROMs for Nexus 7, but very likely across to most other devices. It is a no-stress way to get your work to people who want to keep their custom kernel and stuff like that,

For your work, I would think the Auto-Patcher could very likely port it to almost all devices and roms, with perhaps some forking for devices with various network capabilites for the framework-res patches.

My tool isn't to take the place of your work, or take any credit. I am trying to use it as a distribution method for developers/themers.

Let me know if you want to talk about adding support.
[Nexus 7 Android Development] twistedh:
This is epic! Great work buddy - I've been looking at getting a mobile hotspot so I don't have to use my phone, but the issue was battery life. If I can get a usb stick to plug into my nexus, that would be awesome!!

Will be getting this 4g dongle next week when I can get to the shop: http://shop.telia.dk/telia/Huawei-E392u-12/product.dt?product=HuaweiE392u-12

Huawei E392u-12 - I seriously hope it works, would be very nice for my nexus to have 4g speeds :)
[Nexus 7 Android Development] trevd:
ahhhh, yes caught me out there. :)

You can use an Hub, my is broken at the minute though :(

like you have, install terminal emulator on the device and run the commands through the shell sans " adb shell "

you will have to run "su" as the first command to gain super user access

Adb is also connectable via wifi via tcp, obviously I'm recommending turning your wifi off in this case to ensure the routing gets setup properly so it's not much help
[Nexus 7 Android Development] laz2336:
right took a couple of goes but here it is typos and all

u0_a109@android:/ $ export PATH=/data/local/bin:$PATH
u0_a109@android:/ $ si
/system/bin/sh: si: not found
127|u0_a109@android:/ $ su
u0_a109@android:/ # stop hotplugd
u0_a109@android:/ # stop ril-daemon
u0_a109@android:/ # usb_modeswitch -c/etc/usb_modeswitch/12d1_1446 -v12d1 -p1446

Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found devices in default mode, class or configuration (1)
Accessing device 002 on bus 002 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mass Storage
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Huawei Technologies
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01
Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.

u0_a109@android:/ # serprop ril.pppd_tty /dev/ttyUSB0
sh: serprop: not found
127|u0_a109@android:/ # setprop ril.pppd_tty /dev/ttyUSB0
u0_a109@android:/ # /etc/init_pppd_gprs
sh: /etc/init_pppd_gprs: not found
127|u0_a109@android:/ #
[Nexus 7 Android Development] trevd:
not my typos tho :)

last command should /etc/ppp/init_pppd_gprs
[Nexus 7 Android Development] laz2336:
should have really spotted that. her's one with it done right the first time

u0_a109@android:/ $ export PATH=/data/local/bin:$PATH
u0_a109@android:/ $ su
u0_a109@android:/ # stop hotplugd
u0_a109@android:/ # stop ril-daemon
u0_a109@android:/ # usb_modeswitch -c/etc/usb_modeswitch/12d1_1446 -v12d1 -p1446

Looking for target devices ...
No devices in target mode or class found
Looking for default devices ...
Found devices in default mode, class or configuration (1)
Accessing device 002 on bus 002 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
Vendor String: HUAWEI
Model String: Mass Storage
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: Huawei Technologies
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Resetting response endpoint 0x81
Resetting message endpoint 0x01
Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.

u0_a109@android:/ # setprop ril.pppd_tty /dev/ttyUSB0
u0_a109@android:/ # /etc/ppp/init_pppd_gprs
u0_a109@android:/ #

didn't manage to connect, tried with chrome and just get the message that its disconnected. probably going to have to restore to last back up and try again, my nexus is getting quite unstable. had a couple of random reboots and a few times i'll pick it up and it plays dead and wont wake up. hold the buttons to get to the boot loader and it fires eventually though tends to hang if you try to continue the boot. hold the power button for a bit and it reboots and comes up.

update

restored and reinstalled so were back to where we were.

also you missed the permissions in post 2 for hotplugd ;)

update2

restoring again, still likes to play dead, posibly happening when it goes to sleep with the modem connected.

seems to mess up CWM as well, cant get into it from the device its self, been needing to remote boot it to be able to restore.
[Nexus 7 Android Development] nightmareachim:
hi,

I would update my boot.img manually but i couldn't find /boot in the archive.

could i take the three files (init.rc; init.dongle.rc and uevent.grouper.rc) out of the boot-jro03d-3.1.10-g52027f9.img or are there any other files i have to modify?
[Nexus 7 Android Development] trevd:
It is only those files that need updating
[Nexus 7 Android Development] nightmareachim:
So i've got my bot image running. but i couldn't push all the files. If I push the framework-res.apk my device wouldn't boot.

I think it is becaus i'am on an cm10 KANG

ATM I pushed all files without the apk. But can not test it yet. my OTG kalble comes tomorrow.

Would this work without the framework-res.apk or could someone update my apk from the cm10 rom?

EDIT: okay, got several other problems with the custom rom so i will go back to stock an give your update second try. One quastion i've got. could i change the kernel after i've made it running?
[Nexus 7 Android Development] trevd:
You can swap out the kernel as long as you either have a kernel which has the functionality built in or you have usb_wwan.ko and option.ko kernel drivers with the right magic you will be good to go.

The major part of the enabling this functionality is in the framework-res. It can be enabled on any rom, personally I've done it with the nexus 7 and motorola xoom plus adding sms functionality to the Archos G9 series...

I found the best way is to unpack the framework-res off the device with apktool edit the bools and the arrays xml values, repack with apktool ...... take the recompiled resources.arsc ( or whatever the extension is :) ) and 7zip update the existing framework-res.apk with the new file...

Doing it that way gets around have to resign your framework-res and enables the new functionality, I would say this is a massive security hole but meh, if it's there I'm going to use it.
[Nexus 7 Android Development] trevd:
Its worth giving it a go, I would look in to whether it works on Linux, if it does then it can be probably made to work on Android. I don't have a clue whether 4G requires different drivers or even if the dongle works the same way. We are bit backward in the UK so we don't have the luxury of 4G coverage quite yet :(

When You say battery life was an issue, was that on the phone? or the tablet? Obviously these dongles decrease your battery life somewhat as they require 500mA when being used on the USB port, I've not got any hard and fast figures on battery usage, I suppose power management etc is that's the next stage of this development work.

I think at the very least the framework-res would need tweaking a little more to enable 4G/LTE as I think that the Setup UI is different for 4G.
[Nexus 7 Android Development] kizaros2g:
hi there, this a good news for people who deciding to buy nexus 7 in the future, at least for me :)

i don't have Nexus 7, and this going to be the tie breaker for me whether to buy or not. i have some question and hope you can answer it for me :)

1) is this mod only application to stock rom? if any other custom rom/kernel, will it work?

2) i don't have huawei dongle, but i have d-link dongle and it come with sd card slot, will it able read the sd card slot?

3) do you have any feedback regarding other brand usb dongle? if it working, this will be great!

thanks and cheers! :)
[Nexus 7 Android Development] trevd:
Hi

1. The mod should work with any rom/kernel. If the kernel is a derived from stock then the GSM Modem drivers are compiled in the kernel it's self. If not usb_wwan.ko and option.ko are the kernel modules required for Huawei Dongles at least. The modifications to framework-res.apk can also be made to any rom and I'm currently looking into the best way to make this mod available across all available roms

2. I'm unsure whether the SDCard slot would work straight off as I've not tested that functionality, Some of the Huawei Dongles I'm testing with have an SDCard slot and I will test them when I get a chance and may well add that feature If it doesn't auto mount.

3. I'm thinking about implementing the functionality for the Archos 3G Stick, which is a rebranded Alcatel as I've got one of those to hand. I don't have any information regarding any other dongles. What is the model number of the D-Link Dongle? As a general rule I would say If it's working on Linux Desktop then It can be made to work on Android ( at a native level at least ).

I would search xda and see if your dongle or similar has been enabled on any other devices because It probably would need a custom/tweaked Radio Interface Library and it's always easier if it's already been done before, There a lot to be said for "Standing on the Shoulders of Giants" :)
[Nexus 7 Android Development] laz2336:
i struggled with the dialing out bit but i can confirm that a zte mf112 dongle was recognised and both it and a huawei e353 did attempt to mount the built in sd card readers.
[Nexus 7 Android Development] nightmareachim:
hmm i can't get it flying.

I will grap the logs tonight. Maybe this gives me an answer.
[Nexus 7 Android Development] trevd:
The logs always have the answer, well nearly always :) , don't forget to grab dmesg as well as that will tell you if the dongle has been recognized , What is the dongle model number?
[Nexus 7 Android Development] nightmareachim:
Uah sry forgot to wrote the model number. It is a Huawei E1550
[Nexus 7 Android Development] kizaros2g:
Thanks for replying, i think you should find more simple way to apply this mod as person that does not familliar with adb command able to apply it ;)

I see, sdcard storage is just an optional as it comes with my dongle. Btw, my dongle is d-link dwm-156. I haven't test it on my ubuntu, right now i having wifi at home. I'll search for it later and confirm it later.

Cheers!
[Nexus 7 Android Development] trevd:
Thanks for the input, As I've indicated in the thread title and going by the feedback I've had so far this is still very much a Work In Progress. As development and Testing moves forward on this I will make it easier to install and obviously the end goal is a recovery flashable update.zip which your mom can flash, however it's only the "cool kids" who know adb that are allowed to play at the moment :rolleyes: LOL

With Regards your dongle, If your going to try it with this mod, I'd be suprised if it works of the box, but you never know.
[Nexus 7 Android Development] laz2336:
make sure you set hotplugd executable (caught me out when i had to restore and re-apply)
[Nexus 7 Android Development] nightmareachim:
so here are the logs....

I think the dongel would be recognized but i'am not so experienced in this area.

Maybe you could help me out.

btw: i could search after networks but nothing happens. (no network found / search never ends); APN would disappear after setting up.
[Nexus 7 Android Development] nightmareachim:
yep done this before
[Nexus 7 Android Development] budde2:
I'm a little late but wow android devs amaze me I'm speechless that this works why don't you work for Google you could easily take like 5 peoples jobs I'm sure great job I'm speechless :):):)
[Nexus 7 Android Development] trevd:
Thanks for the ego-stroke :) However I really cannot take any credit as half of this is derived from work done by other XDA Devs, Mainly DerArtem, whose authorship of the Radio Interface Layer Library and his orginal work on Toshiba-Folio 100 has been Invaluable, I think his was the earliest implementation of this functionality by an XDA Dev. The other half Is Inspired by the Work Done by the Archos OEM's Devs ( French Tablet Maker) to Implement their 3G Stick

The apktool authors need a name check as well for making it nice and simple when It comes to modifying the framework-res as do the folks who maintain usb_modeswitch

All I've done is a sprinkle of custom code and some tweaks here and there to glue the whole thing together.

That Felt a bit like an award acceptance speech, but gotta give credit where it's due

With regards working for Google, I don't think even Google, with their casual dress code would let me turn up to work In my underwear and that I'm afraid is a Deal Breaker :laugh:
[Nexus 7 Android Development] kizaros2g:
luckily im one of the "cool kids" who has some adb knowledge, so lucky me LOL :p

for my dongle, I've try connect it with ubuntu 12.04, but it cannot be detected and connected. I've search the forum about this and still unable to connect it, seems like something broke with this dongle.

I might buy n7 within next month, so for the mean time, keep up the good work dude :highfive:
[Nexus 7 Android Development] trevd:
dmesg and lsusb will help here also have a look at the usb_modeswitch forums if anyone has made it work It's probably to be found on there.

If it's a fairly new device it may not be enabled in your kernel version.

lsusb is especially useful ( for me at least ) as that will give you the vendor and product Id which is used the identify the device and then I'll see If I can help you out some more once I know exactly what device you're dealing with.
[Nexus 7 Android Development] m3ritum:
I can confim that Huawei E173-u2 is working, also in the Polish free internet provider Aero2. Thanks mate !!!
[Nexus 7 Android Development] ZOMGsheikh:
Can someone pls give a more detail guide on this one ?
[Nexus 7 Android Development] rmclardy:
Hi OP and all,

I know this isnt "technically" the right place, but this post has been really helpful to get me to where i am currently. Thanks for all your hard work on this...

I basically am trying to get an ZTE MF627 working on the N7.

I flashed boot.img, and pushed all files, and changed permissions etc.

I have checked USB_Modeswitch website and changed the mode on the MF627 using HT, to get rid of the CD drive autorun.

I plug in the modem, and get a blue light to say its found network but nowt comes up on the N7..

it seems to be seeing it, here is a snip from dmesg

<6>[ 213.669905] usb 2-1: new high speed USB device number 2 using tegra-ehci
<6>[ 213.703378] usb 2-1: New USB device found, idVendor=19d2, idProduct=0031
<6>[ 213.703550] usb 2-1: New USB device strings: Mfr=2, Product=1, SerialNumber=3
<6>[ 213.703700] usb 2-1: Product: ZTE CDMA Technologies MSM
<6>[ 213.703783] usb 2-1: Manufacturer: ZTE, Incorporated
<6>[ 213.703862] usb 2-1: SerialNumber: 1234567890ABCDEF
<6>[ 213.705551] option 2-1:1.0: GSM modem (1-port) converter detected
<6>[ 213.705869] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
<6>[ 213.706304] option 2-1:1.1: GSM modem (1-port) converter detected
<6>[ 213.706651] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
<6>[ 213.707725] scsi0 : usb-storage 2-1:1.2
<6>[ 213.708859] option 2-1:1.3: GSM modem (1-port) converter detected
<6>[ 213.709687] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2
<3>[ 213.924409] MC_DECERR (0x2000000B): 03131000 gr2d_src (non-secure read )
<5>[ 214.701602] scsi 0:0:0:0: Direct-Access ZTE MMC Storage 2.31 PQ: 0 ANSI: 2
<5>[ 214.702250] sd 0:0:0:0: Attached scsi generic sg0 type 0
<5>[ 214.709011] sd 0:0:0:0: [sda] Attached SCSI removable disk

ive also attached the log files etc.

Any thoughts? im sure im almost within touching distance now. lol.

Any help appreciated. :)

Thanks

Ross.
[Nexus 7 Android Development] mynamesriz:
Huawei E367

Hi all,

I just wanted to say this is awesome! and you are a genius! Thank you so much for Sharing this.

After a lot of fiddling and following the instructions in the first post I got my E367 ( 3 branded with 3 sim) working with my Nexus 7.

Also I don't have to plug the modem in on boot it just works whenever I plug it in which is a big bonus.

I do have a question though, is there a way of pushing the 2 services to my boot partition rather than flashing your boot.img? I flashed your boot.img and it worked just fine but it means my Nexus is no longer OCed which did help when playing games. If that's not possible how do i run usb_modeswitch manually?
[Nexus 7 Android Development] walkamake:
Hi all. Can you say where can I find config.xml? I have framework-res.apk and see "values" folder, but there isn't config.xml
[Nexus 7 Android Development] mateorod:
Hey trevd. I am going to work on that tonight. Hope to have a test run for you by tomorrow at latest. We are still working out the inks of the update, but it is in shape enough to have you test something.

Before we can accomodate Windows users, we are going to have to build a static-linked library for the boot tools. We're on the lookout for a specific binary and then we should be cross-compatible.

Sorry for the delay, CM and aokp broke my patches and made life miserable.
[Nexus 7 Android Development] Divr:
Just curios, will this hack (I'm waiting for a recovery flash), only work for GSM, or will it work for dongle that used cdma?
[Nexus 7 Android Development] trevd:
Hi, Good to hear you've got this going.

There should be a readme in the download which explains the changes to the boot image.

But it's basically adding a "import init.dongle.rc" to the init.rc and adding permissions for/dev/ttyUSB* to ueventd.grouper.rc

the init.dongle.rc.

Probably the easiest way to run usb_modeswitch manually is to run "/system/bin/hotplugd preheated" This is the native service I wrote which listens for kernel uevents ( basically insertion of usb devices ) the preheated switch runs the check for any devices that are already inserted.

Running that will handle the mode switching of the usb device and starting the ril-daemon..... If you've worked all this out and followed my instructions than you're probably capable of moddin' your existing boot.img with these changes ;)

* I highlight the adding permissions part because it will not work properly without the correct permissions on those devices
[Nexus 7 Android Development] trevd:
Hi,

Config.xml is a the name of the file to use if you are building from source. if you've unpacked a framework-res have a look at the bools.xml and the arrays.xml
[Nexus 7 Android Development] MrManson666:
first of all:

awesome work!! really! :good:

but I think i'm too unexperienced to take a chance to follow your steps :rolleyes:

do you reckon that there is a possibility that there will be a more noobish solution to activate 3g dongles?
[Nexus 7 Android Development] trevd:
There will be at some point, I can't say when.
[Nexus 7 Android Development] MrManson666:
amazing! thank you for the reply and sorry for the noob-question ;)

have a great weekend!
[Nexus 7 Android Development] trevd:
I'd say yes.... but probably not will the ril library that I've included here, generally if you can get the dongle working in linux then it's should not be too much of a stretch to get it going with android or at least get a native connection working on the tablet.
[Nexus 7 Android Development] trevd:
Hi

Looks like you've got the modem found,

You say you've got a Solid Blue Light on the Dongle?

That would suggest you've got a good connection

Have you tried web browsing? can you expand on nowt? :laugh: ( a screen shot or two maybe )

Also run logcat as superuser it brings a lot more data ;) ( my bad, I'll update the troubleshooting with that one )
[Nexus 7 Android Development] walkamake:
Got it. Thanks.

But can you explain me something more. I need to copypast <resources> text to bools.xml and arrays.xml? Then I need to edit build.prop (ro.telephony...) and past next three strings into build.prop (/system/ .etc), right?
[Nexus 7 Android Development] gerardo66:
Hi

Any one know if there are any rom support 3G dongle already?
[Nexus 7 Android Development] trevd:
If you're referring to the first post there, you need to edit the build prop then copy the files ( the next 3 strings ) I mentioned into the correct directory, they do not belong into the build.prop you system will probably fail to load if you copy incorrect strings into the build.prop ......

It's great that you're having a go at this but It's not a step by step guide and by the sounds of it you're not quite sure what you're doing and not very familiar with Android ( my apologises if i'm wrong ). I'd get the basics down first before attempting this hack.
[Nexus 7 Android Development] walkamake:
Yep, you're right. I don't know android well, I just want to transalte and create step by step guide for other people on forum in our country. I don't have N7, that why I can't to do this things to understand how it works.

Oh, I understood. I read "files" as "lines". Oh my.

Okay, now I've looked into arrays.xml and found same strings as in first code-block in Stage 2. What I need to do with this strings if they are there now? So, I just need to edit build.prop and copy 3 files? That's all?