3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Android G1 Serial To Arduino Robot

Step 2Android G1 with serial output enabled

Android G1 with serial output enabled
«
  • devphone-large.png
  • cyanogenlogo.png
  • ttyMSM2.jpg
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.
« Previous StepDownload PDFView All StepsNext Step »
2 comments
Sep 23, 2011. 3:41 AMmahendar says:
i don't see /dev/ttyMSM2 on my phone. It is rooted though. what can I do?
Apr 3, 2010. 5:58 AMwenjiun says:
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

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
13
Followers
1
Author:mranalytical