Rabu, 04 Januari 2012

[Android] Success with USB 3G modems

Hello there,

[Update 9th Aug 2011: Now get the latest versions of usb_modeswitch and data packages from its mother site, or use the links posted on Tabletroms.]

I am very happy to note that with crucial help from committed hackers, we now have a working solution for using 3G USB modems on the Adam tablet made by Notion Ink.

The most important requirements, as things stand now are:

1. A running instance of Android with inbuilt kernel support for usb-serial, ppp, option, slhc and ppp_generic, on a tablet with root access. For example, a ROM for Honeycomb (originally hacked out from the Transformer) with a modified kernel, provided by user WinnerGold here.

The current method of installation is to copy the file to the root folder of your SDcard / external SDcard, rename it to update.zip, and run recovery (reboot with Vol ‘+’ key pressed), clear cache, select update and flash.

2. Precompiled ARM binary of usb_modeswitch, available here

3. Configuration of the USB modem inserted in a config file typically called usb_modeswitch.conf, to be copied from the reference file here

Now, with these tools by your side, proceed with the following steps to get the modem working on your Adam tablet. I hope these steps will also provide a good guide for other Android tablets.

Option A

1. Install the HC16 ROM provided by WinnerGold, as it includes the drivers in the kernel, and working dialer scripts.

2. Download the precompiled ARM binary usb_modeswitch and device_reference.txt from http://draisberghof.de. Well, I pointed you to them earlier, didn’t I?

3. Install Android Terminal Emulator and Jota text editor on the Adam. They’re there, on the Android market.

4. Find out your modem’s vendor and device ID pairs using the internet, the Device Manager under Windows, or using dmesg on the tablet. Remember that the device IDs would be different under the ZeroCD mode and the modem mode. What you’re looking for is the device ID under the modem mode.

5. Look for the ID pairs in the device_reference.txt file, and copy the block that pertains to your device. Paste it to a text file and name it usb_modeswitch.conf (or any other file name that you prefer for brevity).

6. remount the /system folder on the tablet to a read-write mode using the command

Code:

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system


You need to be root in order to do the above. Also, this is required after each reboot, until a better alternative is found

7. Copy the files usb_modeswitch and usb_modeswitch.conf to /system/xbin (or to /etc/ppp, but I haven’t tried this yet)

8. Make sure both the files have all executable and access rights

Code:

chmod 777 usb_modeswitch


[CODE chmod 777 usb_modeswitch.conf[/CODE]
You could try 766 too.

9. Mount the usbfs file system to /proc/bus/usb. This is necessary to avoid the “Couldn’t opendir()” error you get otherwise on running usb_modeswitch

Code:

mount -t usbfs usbfs /proc/bus/usb


Again, this is currently necessary after each reboot.

10. Plug in your modem to the normal sized USB port on the tablet. You can check if it is identified in ZeroCD mode by running dmesg from the command line

11. From the shell, cd to the directory where you copied the usb_modeswitch files, and issue the command, as root, to switch the mode

Code:

usb_modeswitch -I -W -c usb_modeswitch.conf


If you’re in another directory, it would make sense to embed the full path, e.g

Code:

/system/xbin/usb_modeswitch -I -W -c /system/xbin/usb_modeswitch.conf


12. Issuing the above command should get you an output showing usb_modeswitch searching for your device, matching it against the likely ID pairs in the .conf file and hopefully, succeeding in switching the mode. Run dmesg at the command line to see if the mode has been switched and the device linked to /dev/ttyUSB0, /dev/ttyUSB1 etc., which are the nodes for USB modems.

13. Assuming that you were successful in getting the dongle recognised as a modem, now read the dialer script pair.

The dialing script, according to WinnerGold’s implementation, is /etc/ppp/peers/gprs. It has two lines for your UserID and Password given to you by your service provider.

14. Edit the file /etc/ppp/peers/gprs with Jota editor, replace the ‘cmnet’ user ID with yours, and the ‘cmnet’ password with your password. Save and close the file. You need to do this just once.

15. Open the file /etc/ppp/gprs-connect-chat, which is the config script, and look at the line containing OK ATDT. The part following OK ATDT is the number you have to dial to connect the modem. If you have an EVDO modem, the default number is #777, and for GSM modems, it can be *99# or *99****1# or something like that. Please check your user manual or instructions on the internet, and change the default dialing number with what is applicable in your case. Save and close the file. You need to do this just once.

16. In case you get a ‘could not save’ error for steps 14 or 15, you did not have write permission. Get it.

17. Now close your eyes, say a word of thanks to free software developers, and run the command

Code:

pppd call gprs


where pppd is the PPP daemon, gprs is the dialer script, which also contains the link to the config script. If you decide to write your own alternate dialer, you’ll need to change the pointer to the correct config script too.

18. Look at the modem: does it show lights flashing to indicate dialing / successful connection?

19. Check from the command line with a ping to google.com if you are indeed connected. It helps to have the Hacker’s Keyboard installed so that you can ctrl+c to stop ping, or specify the number of attempts as a command parameter

20. If you can ping, you’re through. I hope at this moment you didn’t have your wifi working and giving you a false positive

21. Enjoy. Else, rinse and repeat step 17, 18, 19 till you’re successful.

22. Ask someone what to do when you want to disconnect. It may not be safe to pull out the modem, as it might damage the circuitry on the rare occasion.

Option B:

1. Instead of WinnerGold’s ROM, you could try just his kernel, which is not yet available separately. In this case, you might need to edit the file /etc/ppp/ip-up to include the following, as suggested by WinnerGold:


You have to add to /etc/ppp/ip-up
on the bottom

Code:

/system/bin/setprop "net.dns1" "$DNS1"
/system/bin/setprop "net.dns2" "$DNS2"
counter=`/system/bin/getprop net.dnschange`
counter=$[counter+1]
/system/bin/setprop "net.dnschange" $counter





Then follow the other steps as per Option A.

Source: http://freedune.wordpress.com/2011/06/23/success-with-usb-3g-modems-on-android/
◄ Posting Baru Posting Lama ►
 

Copyright © 2012. informativeonmigraine - All Rights Reserved inovLy media online by inforZa