Android G1 Serial To Arduino Robot

 by mranalytical

Step 2: Android G1 with serial output enabled

G1's do not ship with the ability to send serial commands out of the USB port and there is no native option to enable it. If you are an advanced Android SDK user you could make your own build but I chose to use the Cyanogenmod 4.2.13. If you know of other Android devices with serial out working, add them to the comments.

Optionally, you can follow the links there to this instructable on talking to your G1 over USB from your PC. That serial to USB connection isn't required for this tutorial but I used it as a nice sanity check to verify the phone was sending serial out.

If you don't use the other intructable to verify serial output is working, you can try this simple check:
1. Open the Terminal app on the G1 (comes with Cyanogen but download one from the Market if you have a different image)
2. Navigate to the /dev/ directory by typing in cd /dev/
3. Type ls (that's an L) and look for ttyMSM2 in the list returned

The Python script we'll use later sends commands to '/dev/ttyMSM2' in order for them to go out the serial connection. Since that requires root access, you'll need to change permissions on that every time you reboot the phone. To do that:

1. Open the terminal app on the phone
2. Enter 'chmod 777 /dev/ttyMSM2'

Then you can run the Python script from the Android Scripting edit in the next step and it will have access to send serial output.
 
Remove these adsRemove these ads by Signing Up
mahendar says: Sep 23, 2011. 3:41 AM
i don't see /dev/ttyMSM2 on my phone. It is rooted though. what can I do?
wenjiun says: Apr 3, 2010. 5:58 AM
You can also choose the latest Super D 1.10.2 as well while older version 1.9.3 does not support the feature.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!