Jump to content


Photo

PL2303 and other USB-to-Serial Modules


  • Please log in to reply
47 replies to this topic

#1 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 11 January 2011 - 09:14 AM

I build PL2303 (Usb-To-Serial) converter module. Need for most GPS Receivers.
But I can't test it.
Can you check? I have no PL2303 devices in this time. =(

http://webfile.ru/5042988
http://rapidshare.co...3/pl2303.ko.zip

Module load without errors.

Add
I compile another famous USB-to-Serial modules CP2101, ARK3116 and FTDI
All of them loaded OK!

<6>pl2303: Prolific PL2303 USB to serial adaptor driver

<6>USB Serial support registered for ark3116
<6>cp2101: v0.07:Silicon Labs CP2101/CP2102 RS232 serial adaptor drive
<6>ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver


http://rapidshare.co...B-to-Serial.zip
http://webfile.ru/5043692


Please, try it if you can =)

#2 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 12 January 2011 - 09:05 AM

It's WORK!
<6>android_usb gadget: high speed config #1: android
<6>usbcore: registered new interface driver pl2303
<6>usb 1-1: new full speed USB device using tcc-ohci and address 2
<6>usb 1-1: configuration #1 chosen from 1 choice
<6>usb 1-1: pl2303 converter now attached to ttyUSB0

# ls /dev | grep ttyUSB
ttyUSB0

External USB-GPS with PL2303 may work in this MID.  ::) ;)

#3 Loonix

Loonix

    Advanced Member

  • Hero Member
  • PipPipPip
  • 880 posts

Posted 12 January 2011 - 09:55 AM

Makes me wish i had a USB-GPS dongle =)
I am still hoping for a way to connect my Bluetooth Stick and use that to connect to a Bluetooth GPS device.

Great work, thank you!

#4 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 12 January 2011 - 10:03 AM

I'm build BT modules too  ::)
But when I insert my USB-BT in MID it freeze and adb disconnect.

Try it, if your device not freeze after inserting BT-USB, I will think how use it =)

First load - bluetooth.ko
Second - btusb.ko

http://webfile.ru/5045881


Sorry for my English, I'm Russian. =)

#5 Loonix

Loonix

    Advanced Member

  • Hero Member
  • PipPipPip
  • 880 posts

Posted 12 January 2011 - 11:24 AM

Very impressive!
I am not a prodigy like you so bear with my clumsynes.
I pushed those two files to /system/lib/modules
(why not /lib/modules/ ?)
and rebooted my m701-HDMI (so i only have one USB port)
and pulled this log via WLAN with 'adb logcat':
D/vold    (  927): [UEVENT] Sq: 1630 S: usb A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1
D/vold    (  927): MAJOR=189
D/vold    (  927): MINOR=132
D/vold    (  927): DEVTYPE=usb_device
D/vold    (  927): PRODUCT=1131/1004/373
D/vold    (  927): TYPE=224/1/1
D/vold    (  927): BUSNUM=002
D/vold    (  927): DEVNUM=005
D/vold    (  927): No uevent handlers registered for 'usb' subsystem
D/vold    (  927): [UEVENT] Sq: 1631 S: usb A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0
D/vold    (  927): DEVTYPE=usb_interface
D/vold    (  927): PRODUCT=1131/1004/373
D/vold    (  927): TYPE=224/1/1
D/vold    (  927): INTERFACE=224/1/1
D/vold    (  927): MODALIAS=usb:v1131p1004d0373dcE0dsc01dp01icE0isc01ip01
D/vold    (  927): No uevent handlers registered for 'usb' subsystem
D/vold    (  927): [UEVENT] Sq: 1632 S: bluetooth A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/bluetooth/hci0
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/bluetooth/hci0
D/vold    (  927): DEVTYPE=host
D/vold    (  927): No uevent handlers registered for 'bluetooth' subsystem
D/vold    (  927): [UEVENT] Sq: 1633 S: usb_endpoint A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/usb_endpoint/usbdev2.5_ep81
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/usb_endpoint/usbdev2.5_ep81
D/vold    (  927): MAJOR=251
D/vold    (  927): MINOR=4
D/vold    (  927): No uevent handlers registered for 'usb_endpoint' subsystem
D/vold    (  927): [UEVENT] Sq: 1634 S: usb_endpoint A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/usb_endpoint/usbdev2.5_ep02
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/usb_endpoint/usbdev2.5_ep02
D/vold    (  927): MAJOR=251
D/vold    (  927): MINOR=5
D/vold    (  927): No uevent handlers registered for 'usb_endpoint' subsystem
D/vold    (  927): [UEVENT] Sq: 1635 S: usb_endpoint A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/usb_endpoint/usbdev2.5_ep82
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0/usb_endpoint/usbdev2.5_ep82
D/vold    (  927): MAJOR=251
D/vold    (  927): MINOR=6
D/vold    (  927): No uevent handlers registered for 'usb_endpoint' subsystem
D/vold    (  927): [UEVENT] Sq: 1636 S: usb A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.1
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.1
D/vold    (  927): DEVTYPE=usb_interface
D/vold    (  927): DRIVER=btusb
D/vold    (  927): PRODUCT=1131/1004/373
D/vold    (  927): TYPE=224/1/1
D/vold    (  927): INTERFACE=224/1/1
D/vold    (  927): MODALIAS=usb:v1131p1004d0373dcE0dsc01dp01icE0isc01ip01
D/vold    (  927): No uevent handlers registered for 'usb' subsystem
D/vold    (  927): [UEVENT] Sq: 1637 S: usb_endpoint A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.1/usb_endpoint/usbdev2.5_ep03
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.1/usb_endpoint/usbdev2.5_ep03
D/vold    (  927): MAJOR=251
D/vold    (  927): MINOR=7
D/vold    (  927): No uevent handlers registered for 'usb_endpoint' subsystem
D/vold    (  927): [UEVENT] Sq: 1638 S: usb_endpoint A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.1/usb_endpoint/usbdev2.5_ep83
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.1/usb_endpoint/usbdev2.5_ep83
D/vold    (  927): MAJOR=251
D/vold    (  927): MINOR=8
D/vold    (  927): No uevent handlers registered for 'usb_endpoint' subsystem
D/vold    (  927): [UEVENT] Sq: 1639 S: usb A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.2
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.2
D/vold    (  927): DEVTYPE=usb_interface
D/vold    (  927): PRODUCT=1131/1004/373
D/vold    (  927): TYPE=224/1/1
D/vold    (  927): INTERFACE=254/1/0
D/vold    (  927): MODALIAS=usb:v1131p1004d0373dcE0dsc01dp01icFEisc01ip00
D/vold    (  927): No uevent handlers registered for 'usb' subsystem
D/vold    (  927): [UEVENT] Sq: 1640 S: usb_endpoint A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/usb_endpoint/usbdev2.5_ep00
D/vold    (  927): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/usb_endpoint/usbdev2.5_ep00
D/vold    (  927): MAJOR=251
D/vold    (  927): MINOR=9
D/vold    (  927): No uevent handlers registered for 'usb_endpoint' subsystem
so since 'No uevent handlers registered for 'usb' subsystem' i guess i need to load these drivers manual somehow or somehow register these handlers?

p.s. i am german so my english is probably not so good as well '^^

//EDIT:
when enabeling bluetooth in settings i get this output:
D/AudioPolicyManagerALSA(  931): setOutputDevice() output 1 device 2 delayMs 0
D/AudioPolicyManagerALSA(  931): setOutputDevice() setting same device 2 for output 1
D/AudioHardwareALSA(  931): ~~~~ AudioStreamOutALSA::write() mode=0,dev=0x2,buffersize=4096,ch=0x2
D/ALSAModule(  931): ++++ open called for devices 00000002 in mode 0...
E/ALSAModule(  931): Device Name is AndroidPlayback_Speaker_normal
E/ALSALib (  931): external/alsa-lib/src/pcm/pcm.c:2201:(snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker
E/ALSAModule(  931): Device Name is AndroidPlayback_Speaker
E/ALSALib (  931): external/alsa-lib/src/control/setup.c:555:(add_elem) Cannot obtain info for CTL elem (MIXER,'PCM Volume',0,0,0): No such file or directory
E/ALSAModule(  931): Device Name is AndroidPlayback
E/ALSAModule(  931): s_open()  persist.sys.spdif_setting=0
E/ALSAModule(  931): Device Name is default
D/ALSAModule(  931): ++++ Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian)
D/ALSAModule(  931): ++++ Using 2 channels for PLAYBACK.
D/ALSAModule(  931): ++++ Set PLAYBACK sample rate to 44100 HZ
D/ALSAModule(  931): +++++++++ periodTime : 5804
D/ALSAModule(  931): +++++++++ Buffer size: 4096
D/ALSAModule(  931): +++++++++ Latency: 92879
I/bluedroid( 1010): [###### TCC BT #######] [/dev/tcc_bt_dev] open error[-1]
D/ALSAModule(  931): alsa.default.so: devices 2 mode 0
D/ALSAModule(  931): --------------- doRouting --------------- mode[0]routes[2]
D/ALSAModule(  931): Initialized ALSA PLAYBACK device default
V/BluetoothEventRedirector( 1275): Received android.bluetooth.adapter.action.STATE_CHANGED
V/BluetoothEventRedirector( 1275): Received android.bluetooth.adapter.action.STATE_CHANGED
D/AudioPolicyManagerALSA(  931): setOutputDevice() output 1 device 0 delayMs 186
i guess the "D/ALSAModule" is from the keyboard 'click' i activated but the "I/bluedroid" part could be interesting.

//EDIT2:
when using 'insmod' to insert the modules i get these errors:
# insmod /system/lib/modules/bluetooth.ko
insmod /system/lib/modules/bluetooth.ko
insmod: init_module '/system/lib/modules/bluetooth.ko' failed (Exec format error)
# insmod /system/lib/modules/btusb.ko
insmod /system/lib/modules/btusb.ko
insmod: init_module '/system/lib/modules/btusb.ko' failed (Invalid argument)
=(

#6 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 12 January 2011 - 12:02 PM

don't copy and reboot

Simple type in adb shell:

insmod /path/to/module.ko

As example for me (*.ko files on SD card)

insmod /sdcard/bluetooth.ko
insmod /sdcard/btusb.ko

After that connect your bt-stick to MID.

#7 Loonix

Loonix

    Advanced Member

  • Hero Member
  • PipPipPip
  • 880 posts

Posted 12 January 2011 - 12:20 PM

hmm...
i removed the files i copyed before.
then i used adb to push both files to the sc card ('adb push bluetooth.ko /sdcard')
then used adb shell to run the commands you quoted and still get the same error.
# insmod /sdcard/bluetooth.ko
insmod /sdcard/bluetooth.ko
insmod: init_module '/sdcard/bluetooth.ko' failed (Exec format error)
Maybe it is because i use a suposedly 'BT-enabled' firmware for my m701, maybe there is some other difference between your pad and mine.
I will make a backup and try again with a different firmware.

p.s. yes, i did 'adb remount' to gain write previleges and the pad is rooted. ='(

#8 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 12 January 2011 - 12:22 PM

Ok, if your firmware with bluetooth

try only btusb.ko module

insmod /sdcard/btusb.ko

#9 Loonix

Loonix

    Advanced Member

  • Hero Member
  • PipPipPip
  • 880 posts

Posted 12 January 2011 - 01:14 PM

sorry to throw this stuff at you like a callcenter trouble shooter  :-[

i tried insmod with the btusb.ko and failed.
Now i can say for shure it is caused by the #181 firmware i had installed (maybe i toyed too much with it).
i flashed back to stock #142 for my device and all your modules install fine!

Now i have exactly the same effect like you  ;D

insmod /sdcard/bluetooth.ko leads to:
D/vold    (  915): [UEVENT] Sq: 1482 S: module A: 0 P: /module/bluetooth
D/vold    (  915): DEVPATH=/module/bluetooth
D/vold    (  915): No uevent handlers registered for 'module' subsystem
D/vold    (  915): [UEVENT] Sq: 1483 S: class A: 0 P: /class/bluetooth
D/vold    (  915): DEVPATH=/class/bluetooth
D/vold    (  915): No uevent handlers registered for 'class' subsystem
and insmod /sdcard/btusb.ko to:
D/vold    (  899): [UEVENT] Sq: 1109 S: module A: 0 P: /module/btusb
D/vold    (  899): DEVPATH=/module/btusb
D/vold    (  899): No uevent handlers registered for 'module' subsystem
D/vold    (  899): [UEVENT] Sq: 1110 S: drivers A: 0 P: /bus/usb/drivers/btusb
D/vold    (  899): DEVPATH=/bus/usb/drivers/btusb
D/vold    (  899): No uevent handlers registered for 'drivers' subsystem
inserting the USB-BT dongle leads to a halt and this output:
D/vold    (  899): [UEVENT] Sq: 1212 S: usb A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1
D/vold    (  899): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1
D/vold    (  899): MAJOR=189
D/vold    (  899): MINOR=129
D/vold    (  899): DEVTYPE=usb_device
D/vold    (  899): PRODUCT=1131/1004/373
D/vold    (  899): TYPE=224/1/1
D/vold    (  899): BUSNUM=002
D/vold    (  899): DEVNUM=002
D/vold    (  899): No uevent handlers registered for 'usb' subsystem
D/vold    (  899): [UEVENT] Sq: 1213 S: usb A: 0 P: /devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0
D/vold    (  899): DEVPATH=/devices/platform/dwc_otg.0/usb2/2-1/2-1:1.0
D/vold    (  899): DEVTYPE=usb_interface
D/vold    (  899): PRODUCT=1131/1004/373
D/vold    (  899): TYPE=224/1/1
D/vold    (  899): INTERFACE=224/1/1
D/vold    (  899): MODALIAS=usb:v1131p1004d0373dcE0dsc01dp01icE0isc01ip01
D/vold    (  899): No uevent handlers registered for 'usb' subsystem
and makes me wish even more for a pl2303 usb GPS device xD

#10 fun_

fun_

    Advanced Member

  • Hero Member
  • PipPipPip
  • 525 posts

Posted 13 January 2011 - 12:23 AM

Now i can say for shure it is caused by the #181 firmware i had installed (maybe i toyed too much with it).


I think M701 #181 kernel already have btusb driver.

and makes me wish even more for a pl2303 usb GPS device xD


it may work if you change "setprop ro.kernel.android.gps tcc-uart5" to "setprop ro.kernel.android.gps ttyUSB0" in /init.tcc92xx.rc in boot.img in official eclair rom. but I'm not sure output format and port speed of your device/telechips device are same.

I have some code to support USB GPS (NMEA format) on my CyanogenMod port. it is not included in current snapshot because when I tried pl2303.ko(built myself) didn't work correctly ;)

I'll try module from eXell when I have a time.
please tell me what kind of USB GPS you have. esp. format/speed.

#11 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 13 January 2011 - 01:42 PM

fun_

I' have no GPS Receiver =(

But I connect my oldest Siemesn C55 to my X6D using PL2303 cable with sim-card inserted

load module and make command in adb

cat /dev/ttyUSB0

In other adb I make command

# echo 'AT+COPS=?' > /dev/ttyUSB0

Output in first adb:

AT+COPS=?


+COPS: (2,"CC 250 NC 35",,"25035"),(1,"MTS-RUS",,"25001"),(1,"BEE LINE",,"25099"),(1,"RUS MegaFon",,"25002"),(1,"RUS 17",,"25017"),,(0,1,3,4),(0,2)



OK


I think my pl2303.ko work fine ;)

#12 fun_

fun_

    Advanced Member

  • Hero Member
  • PipPipPip
  • 525 posts

Posted 14 January 2011 - 12:12 AM

I think my pl2303.ko work fine ;)


yup. I don't doubt your work :P
I tried myself before source is released ;)

#13 akeake

akeake

    Newbie

  • Jr. Member
  • Pip
  • 1 posts

Posted 17 January 2011 - 08:37 AM

Hi!

I have a Android tablet, with no Bluetooth and no GPS chips on board.
It has only one USB port and WLAN support.

I also would like to get GPS support.

Either by connecting a GPS dongle direct to the USB port or
by connecting a Bluetooth dongle to the USB port and then communicate with a GPS dongle over Bluetooth.

I tried to load the modules you compiled.

Unfortunately insmod fails with a version mismatch error:

e.g after 'insmod btusb.ko' i can see the following with dmesg:

btusb: version magic '2.6.29 mod_unload ARMv6 ' should be '2.6.25 mod_inload ARMv5'

Can the code be compiled to work with my version?
Is there any way to force the module to load, maybe it would work?

br ake

#14 geoRG77

geoRG77

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 59 posts

Posted 17 January 2011 - 05:02 PM

@akeake: This is Telechips specific subforum and your tablet doesn't seem to have this CPU, so therefore you can't use modules compiled by Telechips BSP. As far as I know, 2.6.25 kernel indicates another CPU, maybe Rockchip?

#15 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 19 January 2011 - 10:14 AM

CP2101.ko work too.  :)
I try it on CP2102 USB-to-COM converter  ::)

#16 graffiti333

graffiti333

    Newbie

  • Jr. Member
  • Pip
  • 2 posts

Posted 25 January 2011 - 04:06 PM

Hello

I tried load module bluetooth.ko and btusb.ko on my X6D but system halted when i connected the dongle.

But, i connect the gps module into serial port (tcc-uart5). It works :D



On this image i checkd where is RX and TX signals.

http://tabletyandroi...1/P10100672.jpg

#17 banders

banders

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 09 March 2011 - 07:56 PM

I build PL2303 (Usb-To-Serial) converter module. Need for most GPS Receivers.
But I can't test it.
Can you check? I have no PL2303 devices in this time. =(

http://webfile.ru/5042988
http://rapidshare.co...3/pl2303.ko.zip

Module load without errors.

Add
I compile another famous USB-to-Serial modules CP2101, ARK3116 and FTDI
All of them loaded OK!

<6>pl2303: Prolific PL2303 USB to serial adaptor driver

<6>USB Serial support registered for ark3116
<6>cp2101: v0.07:Silicon Labs CP2101/CP2102 RS232 serial adaptor drive
<6>ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver


http://rapidshare.co...B-to-Serial.zip
http://webfile.ru/5043692


Please, try it if you can =)

download links doesnt work can you pls send me PL2303.ko.zip or post anywhere else
thanks

#18 eXell

eXell

    Member

  • Jr. Member
  • PipPip
  • 17 posts
  • LocationNizhniy Tagil

Posted 10 March 2011 - 02:08 AM

All modules + SerialPort utility
http://ifolder.ru/22275087

#19 muonic

muonic

    Member

  • Jr. Member
  • PipPip
  • 26 posts

Posted 11 March 2011 - 01:34 AM

My device is haipad M701 with HDMI and 2G mem. I'm using 2.6.29 #181 firmware. When I ran "insmod pl2303.ko", I got this error

# insmod pl2303.ko
insmod pl2303.ko
insmod: init_module 'pl2303.ko' failed (Invalid argument)

Similarly, for bluetooth.ko and btusb.ko

# insmod bluetooth.ko
insmod bluetooth.ko
insmod: init_module 'bluetooth.ko' failed (Exec format error)
# insmod btusb.ko
insmod btusb.ko
insmod: init_module 'btusb.ko' failed (Invalid argument)


However, the other .ko files (ark3166.ko,cp3201.ko,ftdi_sio.ko) can be installed w/o any errors. Any idea?

Edited by muonic, 11 March 2011 - 04:18 AM.


#20 rkenders

rkenders

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 289 posts

Posted 12 March 2011 - 03:53 AM

All modules + SerialPort utility
http://ifolder.ru/22275087


Where is the actual download link on that page? Being that I read English and not Russian I was unable to determine what was what.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users