Notice: The ability to use 3.3v ttl level serial is based off of google group discussions and a picture of a serial cable used by an alleged android dev. 2.8v level serial was determined via someone using a voltmeter. Build/use at your own risk and check the comments of this instructable too before beginning!
Information may be applied to build a 2.8v serial to RS232 converter to interact with RS232 devices, or a 2.8v serial to serial 5v level converter to interact with microcontroller such as an Arduino. I may post instructables on how to make these once I play around with the G1 kernel some more. :)
This tutorial assumes basic knowledge of soldering. If you don't have this skill you should find an instructable regarding it and practice a bit. The soldering required for this project isn't difficult, but needs to be done in a small amount of space which could be difficult for beginners.
This cable was created based off of information received from the Android-Platform Google Group.
... Specifically these two threads:
http://groups.google.com/group/android-platform/browse_thread/thread/f03730e25cc3fe55?fwc=1
http://groups.google.com/group/android-platform/browse_thread/thread/439d3f3af7a88a09/10a80eb835e8dbcc?lnk=gst&q=serial#10a80eb835e8dbcc
...This picture of a "mystical" g1 serial cable helped (and confused!) too:
https://www.noisebridge.net/wiki/Image:G1-two-usb-to-serial-cable.jpg
Please leave constructive criticism/comments if you find any steps wrong, confusing... or poorly written!
Remove these ads by
Signing UpStep 1: Items Needed
- Soldering Iron (Whatever Radioshack/online/etc has should work)
- Solder (Whatever Radioshack/online/etc has in stock that is 0.032 dia. or a little smaller will work)
- Wire Strippers (Don't buy these from Radioshack.. your local hardware shop should have them however)
- Wire cutters
- HTC ExtUSB Breakout board
- 22 AWG solid Wire - It would be best to get red,black and another color of your choice (white) but it is not necessary.
- USB to 2.8V (or 3.3v) serial level converter. It would be best if you could get one that lets you use the 5v line of the USB bus to power the G1, but it is not necessary. Any of the following should work (you only need ONE):
- (Has no 5v line for power) http://www.sparkfun.com/commerce/product_info.php?products_id=8772
- (May be difficult to modify to get 5v line for power) http://www.sparkfun.com/commerce/product_info.php?products_id=718
- (I used this one, has 5v connector) http://www.sparkfun.com/commerce/product_info.php?products_id=198
- (VCC pin should supply 5v... double check however!) http://www.sparkfun.com/commerce/product_info.php?products_id=199
- (This should have a 5v line (VCC).. but there is conflicting information between the store and company specs page) http://apple.clickandbuild.com/cnb/shop/ftdichip?productID=68&op=catalogue-product_info-null&prodCategoryID=47






































Visit Our Store »
Go Pro Today »




I tried that I connected G1 with Cisco console.
Android (T-Mobile G1) -> Serisl Port API -> TTL -> RS232C -> Cisco console
(my scene)
http://youtu.be/t4EuB8qhTvA
I've connected mine G1 to the PC via FTDI Basic Breakout (http://www.dfrobot.com/index.php?route=product/product&path=45&product_id=147) and managed to get full output from 'ps. However, it seem that G1 could not received my input from the keyboard most of the times.
I need to repeatly hit the keyboard to get the terminal emulator to echo it back!
Did anyone experienced it? Any tips will be helpful. Thanks
Chow.
Few pointers for those interested:
Headset cable already has the USB GND pin connected to what becomes the TX pin... obviously this won't work so I just hacked out all the normal usb pins (which solved the issue).
I've recompiled the 2.6.29-donut kernel and confirmed this works.
One issue though... when I use a custom kernel I cannot use it in normal USB mode :-(. Is this normal? Should you be able to use normal USB and this special serial mode at the same time?
http://garr.me/?p=315
Instructable coming soon.
Pin 4 is actually 2.8v or Data High which is required for some 2 way logic level converters.
Be warned, I haven't checked if it changes during data transmission. I will post my results when I get up to that stage.
www.ecrater.com/product.php
$ su
# echo 'hello' > /dev/ttyMSM2
It is also helpful to type 'ash' in so that you can recall commands:
$ su
# ash
/ # echo 'hello' > /dev/ttyMSM2
Then you can use ALT+trackball-up to recall previous commands.
how to dump the data on PC side ? tks
screen /dev/ttyUSB0 (or whatever)
Can any of you clever bods suggest a fix for me please? I have lots of spare components but no clue as to what they should be.
I have included some Pictures.
Thanks alot.
Sparkyuiop!
For those of us in the UK this seems to be the same board as the one used in the Guide
www.coolcomponents.co.uk/catalog/product_info.php
:-)
I've tried using "cat /dev/ttyMSM2" and it just hangs, as does doing file reads of that using Python from the Android Scripting Environment.
Anyway, its like, when I used the miniUSB, the "USB cable connected notification kept coming on and off. Sometimes it kept getting disconnected after I had mounted the card and all. I guess it must have been something wrong with the cable.
I think electrical interference could be at fault for the data corruption and the cable disconnect/connect notification toggling.
Have you tried outputting /dev/urandom to /dev/ttyMSM2 then attaching a buzzer between the G1's TX0 and ground?
Oh yea, cepr's comment earlier holds a good point. Headsets short a pin to ground on the g1 to allow the phone to identify that they are attached. If that pin happened to be the TX0 pin, that could cause problems. Off the top of my head I am not sure that it is though... I think grounding the audio ground to the chassis ground does the trick.
I built and tested a new kernel for cyanogen mod which you can grab from the downloads section of the google code serial api website. Try that!
I definitly think you need to install the new kernel, but I also think you have a second problem, and that is likely wiring (double check that everything is connected fine)
It uses the SDK and a little the NDK.
Anyway, you need a rooted device because the /dev/tty* do not have the read/write permissions for Android applications.
To do this you need to configure and rebuild the kernel to disable the serial debugger and htc handset detection drivers. Consequently after doing this, you probably won't be able to use your headset. This requires you to have a rooted phone too, preferably with the dev spi.
There's no android application level serial communication sdk stuff yet.. (Porting rxtx to android is on a todo list of mine) so you will need to compile a c app (search google for agcc.pl to learn how to compile c apps for android) in order to either use as a middle man between android apps and your uC.. or just to configure the serial port initially to whatever baud rate, stop bits, etc you need then interface with /dev/ttyMSM2 directly
SerialPort_0.7.apk features:
- detect all the serial ports of the phone (most are internal, do not use)
- select baudrate (4800, 9600, 115200)
- detect missing file permissions, and try to change it with "su" (does not work on all phones)
- terminal screen to receive and send text through the serial port
- "loopback test": the phone sends infinite 0x55555..., and display the count of received and sent bytes. If you connect RX and TX, you should have the same value.
Hmm, the NDK has me really excited now.. it has made some other things I have wanted to do way easier now.