The iPhone Serial Port Hack
An anonymous reader writes "The iPhone's little known secret, a hidden serial port, is revealed. 'The real benefit in all of this is that there are so many console packages for iPhone in Cydia now that you can have a fully functional computer, as useful as a Linux box, but without carrying around a laptop.'"
I'm reminded of Linksys WRT-54G routers and such.
You might need to do some surface mount soldering to get to the required connections.
Very handy for booting up a Sun server.
This isn't a "secret"... it's been in the iPhone (and iPod for that matter) for quite a long time. This same serial port is how 3rd party docks and cables control the device from the outside: http://www.adriangame.co.uk/ipod-acc-pro.html
If you'd like to read the article instead of Computer World's stupid-ass slide show, it's at http://resolvehax.blogspot.com/2010/10/iphone-serial-port.html
Please don't use the hardware you purchased and is now yours for non-Apple authorized activities. Apple reserves the right to REMOVE and/or RESTRICT functionality in order to support our business model as we see fit.
Apple
And yes, I'm aware you have to root the phone to install a custom ROM...but you can still install apps from anywhere without having to void your warranty or hacking the phone.
Living With a Nerd
Alas, this hack won't do it:
To operate the serial port, we need to run an RS232 to TTL converter. Fortunately, there's a 3.3v output on the bottom of the phone that'll power our unit. Not useful if you want to get into the phone's serial console, since it only provides power once booted.
In other words, this design is powered with a power source that isn't even available until the iPhone/iPod is booted up.
I guess you could fix that with an appropriate external power supply; a little wall-wart and some appropriate voltage regulation.
Welcome to the Panopticon. Used to be a prison, now it's your home.
That's because it's exposed as a PTP (Picture Transfer Protocol) device over USB. All iPhone/iPod Touch/iPads do this.
...given that you can buy ipod breakout boards on ebay with the serial connectors clearly marked, it doesn't seem to be a particularly well kept secret.
See http://cgi.ebay.co.uk/Enhanced-Breakout-Board-Ipod-Iphone-Ipad-/370447835814?pt=UK_CE_MP3Access_RL&hash=item56406962a6 for an example.
This serial port has been around forever. All those cars with iPod integration use it for control and data. I've controlled the iPod functionality on every iPod I've had (since 3rd gen) as well as three iPhones using an Atmega controller. I year or so I shared some controller code for Arduino based atmega microconrollers.
Here's how you control your iPhone or iPod music with an Arduino, easy peasy:
Sheldon
* /* Control iPod/iPhones from Arduino
Sheldon Stokes
Jan 3, 2009
Standing on the shoulders of ipodLinux.org
http://ipodlinux.org/wiki/Apple_Accessory_Protocol
This send comands to the iPod as though it were a remote.
These are the simple 2 byte commands that should work on all
Apple iPods and iPhones starting with the 3rd Generation iPod
*********** Commands (array index, command value, command description) **************
0 0x00 Button Release
1 0x01 Play/Pause
2 0x02 Vol+
3 0x04 Vol-
4 0x08 Skip >
5 0x10 Skip
6 0x20 Next Album
7 0x40 Prev Album
8 0x80 Stop
*/
int commandBytes[]={0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
int checkSum;
int playPin = 2;
int stopPin = 3;
int fwdPin = 4;
int backPin = 5;
int playVal, stopVal, fwdVal, backVal;
void setup()
{
Serial.begin(19200);
pinMode(playPin, INPUT);
pinMode(stopPin, INPUT);
pinMode(fwdPin, INPUT);
pinMode(backPin, INPUT);
}
void loop()
{
playVal = digitalRead(playPin); // read play button // read stop button // read fwd button // read back button
stopVal = digitalRead(stopPin);
fwdVal = digitalRead(fwdPin);
backVal = digitalRead(backPin);
if (playVal == LOW) // send play command // send button release // send stop command // send button release // send stop command // send button release // send stop command // send button release
{
sendRequest(commandBytes[1]);
sendRequest(commandBytes[0]);
}
else if (stopVal == LOW)
{
sendRequest(commandBytes[8]);
sendRequest(commandBytes[0]);
}
else if (fwdVal == LOW)
{
sendRequest(commandBytes[4]);
sendRequest(commandBytes[0]);
}
else if (backVal == LOW)
{
sendRequest(commandBytes[5]);
sendRequest(commandBytes[0]);
}
delay(100);
}
void sendRequest(int val) {
checkSum = 0x100 - ((0x03 + 0x02 + val + 0) & 0xFF);
int request[] = {0xFF, 0x55, 0x03, 0x02, 0x00, val, checkSum};
Yeah, it's got a serial port, with TTL levels, at its external connector. Big deal.
It's also possible to attach USB devices, which is somewhat more useful today. For example, you can plug a real keyboard into an iPad.
More recent ones have anti-tamper (Droid X) or auto-reflash (G2), making it a pain to root.
I honestly think Google is very disingenuous to say Android is open when many currently-selling actual devices are locked tighter than the iPhone.
Perhaps Google is just happy that Android is "open to the carriers".
You want a sure bet for an open system, go with the N900.
Make sure everyone's vote counts: Verified Voting
Did you see the masthead? "News for nerds". This is what we do. This is our recreation. I personally found the article fascinating, even though I don't have an iPhone.
You say your time is worth too much to play with hidden features, but I'll bet it isn't worth too much time to watch a NASCAR race or a football game or a movie, now is it?
Free Martian Whores!
Dude, it's selling right now from major retailers. Ships today.
I got this after 5 seconds of googling:
Google Shopping
Amazon
Make sure everyone's vote counts: Verified Voting
Meh... or you could get a N900 that comes with those tools *ALREADY INCLUDED* in the base OS.
Package manager? Maemo is a modified Debian, and uses Apt.
Shell? Default is Busybox, but the full system is in the repos.
Build toolchain, including GCC? In the repos.
OpenSSH and sshd? In the repos (also dropbear, if you prefer).
Anything that's available as source and compiles on ARM? Go to town. You can even pull directly to the device using Subversion and other mackage managers.
Seriously, arguing over whether iOS or Android is more open is like arguing over whether a Prius or a sports car is better for off-road driving. You're both doing it wrong. Get the right tool for the job.
There's no place I could be, since I've found Serenity...