首页 > Android, Linux Usage, Other > Configure-USBNet-For-Android-Device

Configure-USBNet-For-Android-Device

2009-11-21 22:35 星期六    浏览: 1,438    绿 发表评论 阅读评论

 1.Setup your USBNet on Ubuntu8.04

(0)Connect target device to PC by USB wire

 

(1)Make sure the g_ether.ko and its dependency net2280 inserted. If there are not these modules,you need apt-get install linux-kernel-src, uncompress it and configure the kernel and compile the kernel.

[yang@VM4:...el/drivers/usb/gadget] $> cat /proc/modules

or

[yang@VM4:...el/drivers/usb/gadget] $> lsmod

Module                  Size  Used by

cp2101                 14980  0

usbserial              35816  1 cp2101

cdc_ether               7168  0

usbnet                 20232  1 cdc_ether

net2280                22416  0

 

(2) if not inserted, insert them:

 

check where the modules reside

[yang@VM4:...ut/host/linux-x86/bin] $> modprobe -l|grep gadget

 

[yang@VM4:...el/drivers/usb/gadget] $> pwd

/lib/modules/2.6.24-22-generic/kernel/drivers/usb/gadget

 

show the info of a module

[yang@VM4:...el/drivers/usb/gadget] $> modinfo ./g_ether.ko

 

[yang@VM4:...el/drivers/usb/gadget] $> sudo insmod net2280.ko

[yang@VM4:...el/drivers/usb/gadget] $> sudo insmod g_ether.ko

 

(3)Configure USBNet adapter

[yang@VM4:...el/drivers/usb/gadget] $> sudo ifconfig usb0 192.168.1.2

 

(4)Setup usb0 on the target device:

# insmod /system/lib/modules/pnx67xx_udc.ko

# insmod /system/lib/modules/g_ether.ko

# ifconfig usb0 192.168.1.1

# ifconfig usb0 up

 

(4)Check the connection to target device

[yang@VM4:...el/drivers/usb/gadget] $> ping 192.168.1.1

 

2.Using ADB

(5)On Pc side:

[yang@VM4:...el/drivers/usb/gadget] $> export ADBHOST=192.168.1.1

[yang@VM4:...ut/host/linux-x86/bin] $> pwd

/home1/yang/android_1.5/out/host/linux-x86/bin

 

[yang@VM4:...ut/host/linux-x86/bin] $> ./adb kill-server

[yang@VM4:...ut/host/linux-x86/bin] $> ./adb devices

List of devices attached

PNX67XX-5554 device

 

Note: If you cannot find the target device, you need restart adb server daemon again and again by the above two commands.

 

(6) Install an apk application:

[yang@VM4:...ut/host/linux-x86/bin] $> adb install /mnt/hgfs/UNIX_HOME/GPSUI.apk

 

3.Setup USBSerial on Ubuntu8.04

(reference: http://hi.baidu.com/youjim/blog/item/d4338dc4ec54ddc339db4990.html)

(7)create device node

[yang@VM4:...el/drivers/usb/gadget] $> sudo mknod /dev/ttyUSB0 c 188 0

[yang@VM4:...el/drivers/usb/gadget] $> sudo mknod /dev/ttyUSB1 c 188 1

 

(8)configure minicom

[yang@VM4:...el/drivers/usb/gadget] $> sudo minicom -s

->serial port: /dev/ttyUSB0/115200/no flow control

 

(9) if failed, try it again until successful

[yang@VM4:...el/drivers/usb/gadget] $> minicom /dev/ttyUSB0

 

4 Use telent login in android system

When we configured the USBNet on both device side and PC side

we can use telnet login in the system.

telnet 192.168.1.1

enter usrname “root”, then we can login

本文链接地址: http://blog.redwolf-soft.com/?p=616

原创文章,版权©红狼博客所有, 转载随意,但请注明出处。

    分享到:

相关文章:

  • 无相关文章
分类: Android, Linux Usage, Other 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.
订阅评论
  欢迎参与讨论,请在这里发表您的看法、交流您的观点。