The iPhone Serial Port Hack 217
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.'"
If u want linux in your smartphone (Score:5, Insightful)
Get a Nokia N900 or Android.
Re: (Score:2)
exactly, this differs from what you can do with a new moto (or other snapdragon) phone... how? I mean, maybe I miss something
Re: (Score:2)
Be careful which Android phone you get (Score:5, Informative)
More recent ones have anti-tamper (Droid X [androidpolice.com]) or auto-reflash (G2 [maximumpc.com]), 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.
Re: (Score:2)
The N900 is nice, but like the Nexus 1, it isn't sold in the US anymore, unless one buys it from an importer for an inflated price. Visit store.nokia.com and hit the US link... page not found, and it isn't offered anywhere on the site.
N900 purchase links (Score:3, Informative)
Dude, it's selling right now from major retailers. Ships today.
I got this after 5 seconds of googling:
Google Shopping [google.com]
Amazon [amazon.com]
Re: (Score:2)
I honestly think Google is very disingenuous to say Android is open when many currently-selling actual devices are locked tighter than the iPhone.
I'm sure there are some cheap Linux based routers out there loading from an unflashable ROM chip. Does that mean Linux isn't open? Claiming that software isn't open because you can find it on locked down hardware doesn't make sense.
ipad (Score:3, Funny)
i want to know why everytime i plug in my ipad the pc asks what kind of camera it is
Re: (Score:2)
It must see the magic photo directory on your iPad.
Re:ipad (Score:4, Informative)
That's because it's exposed as a PTP (Picture Transfer Protocol) device over USB. All iPhone/iPod Touch/iPads do this.
Re:ipad (Score:5, Funny)
Re: (Score:2, Funny)
You're plugging it in wrong.
My girlfriend used to tell me that. Now she likes it that way.
Re:ipad (Score:5, Funny)
You're plugging it in wrong.
To be more specific, you forgot to plug a Mac to the other end of the cable.
Most embedded devices have a serial port (Score:4, Informative)
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.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
I used to use an HP200LX [wikipedia.org] for that.
I've still got it somewhere, haven't switched it on for a while though.
Re: (Score:3, Insightful)
Re: (Score:2)
OK - That is COOL. No more being tied to the switch while trying to rewire? Killer.
Re: (Score:3, Interesting)
> How last century! (...snip...) cut the cable, and get an RS-232 - to Bluetooth adapter
Spoken by someone who's either a glutton for punishment, or has never experienced the joys of interacting with some piece of embedded hardware at low level through a bitchy, finicky translation layer like Bluetooth that was designed to fail rather than accidentally work without authentication and authorization.
Remember, people use the phone's serial port to do things that are almost by definition unsupported, undocume
Re: (Score:2)
More interestingly, on some of the HTC Android phones, the ExtUSB connector can apparently double up as a serial port if you use the correct cable. Not sure why - hardly anything uses that feature.
Re:Most embedded devices have a serial port (Score:5, Informative)
The Samsung Galaxy S family appears to have (among other things) a UART hidden on its USB port via the Fairchild FSA9480 chip.
This thread at xda-developers ( http://forum.xda-developers.com/showthread.php?p=8834946 [xda-developers.com] ) suggests that if you put a 150k resistor (1% tolerance) between pins 4 and 5 and power up the phone, the two pins normally used for USB data will be repurposed as a serial console for the bootloader.
You can also explicitly toggle the FSA9480's mode via software (though not necessarily without root and your own kernel extensions).
Note that it's not using USB as serial... it's acting as an electronic crossbar, disconnecting the D+ and D- pins from the USB circuit, and connecting them to pins elsewhere that are a real UART. Think: old-fashioned telephone switchboard with patch cables and jacks that dynamically establish and tear down circuits as needed so a few physical pins can be put to occasional niche uses that wouldn't merit full-time pins of their own.
Personally, I suspect two pins on the headphone jack can be nudged into acting as a UART as well. Sigh. What the mod community really needs is for someone to raise the cash to pay a company that does intelligence reports for consumer electronic devices to tear down the Epic4G (or some other variant) and draw up a schematic showing which externally-accessible pins are connected to what (and how) inside the phone. There's a lot of good stuff inside of these phones that's undocumented publicly or via the official kernel source. Lots 'o happy bitbanging ahead! :-)
Not a secret (Score:5, Informative)
Re: (Score:3, Informative)
THANK YOU!
This is so far from a secret it's not even funny. Imagine if we'd only just discovered what those two pins on the connector did?
Hell, even the breakout board the guy (who's original, non full page ad-encumbered article can be found here [blogspot.com]) bought has the bloody serial pins labelled.
It's not remotely surprising that an embedded device has a UART on it. It's even less surprising that a device designed to interface with very simple dock devices has a UART exposed via its peripheral connector.
What is su
More interesting if iPad also has it ... (Score:2, Interesting)
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.'
Personally I think it would be far more practical and useful to use an iPad. The iPhone screen is just too small for practical use, however in an emergency the iPhone could be quite useful. But for somewhat frequent normal use, I have doubts.
Re: (Score:2)
The iPhone screen is just too small for practical use
We're talking about a serial connection here. Is the iphone screen really too small to handle an 80x25 console?
Re: (Score:2)
The iPhone screen is just too small for practical use
We're talking about a serial connection here. Is the iphone screen really too small to handle an 80x25 console?
It's workable, but barely. There's already a bunch of SSH clients in the app store. If you want to actually interact, you need to have an app which has a translucent keyboard, and that takes some getting used to.
Re: (Score:2)
Android has a lot of good terminal emulator apps. However, the iPhone has a few ssh clients, and there are only two clients for jailbroken devices, one of them supports some gestures, one doesn't. Both are named Mobile Terminal, so good luck finding the right one. To boot, Cydia has a Mobile Terminal app, but will bomb out if installed and an attempted is made to be run.
I'd love to see a full featured terminal app that can both work as a ssh client, as well as locally on Cydia. This, I'd pay decent mone
Computer-Phone=Serial port? (Score:5, Funny)
Re:Computer-Phone=Serial port? (Score:5, Funny)
Re:Computer-Phone=Serial port? (Score:4, Funny)
Even more existentially, one of the desks has windows on it.
Re: (Score:3, Funny)
Even worse... MS BOB.
Re:Computer-Phone=Serial port? (Score:5, Insightful)
I really, really hate these Zen/internet/GNU Koans from the hackers dictionary.. They all sound like they were written by Renaissance Faire types and don't really impart anything to me except the mindset of people who thought Unix workstations were AWESOME and then proceeded to infight with 114 mutually different flavors of unix.
If You'd Rather Read the Article (Score:5, Informative)
Re: (Score:2)
Re:If You'd Rather Read the Article (Score:5, Informative)
Re: (Score:3, Informative)
Linux box? (Score:2, Insightful)
Just get a Nokia N900. Nothing hidden there.
Cease and Desist (Score:2, Informative)
Apple
Re:Cease and Desist (Score:5, Insightful)
How soon until you're just licensing that iPhone?
Re:Cease and Desist (Score:5, Insightful)
Never. There's no need. You can own the hardware. You just can't use any of the software included until you agree to the license, and thereby agree to Apple's restrictions on how you use the hardware.
That's the cleverness, really. They don't control your ownership of the hardware. So to a naive observer, you're completely in charge. But the moment you actually try to use any functionality embodied in the included software (i.e., anything capability beside "crappy doorstop" and "blender fodder"), Apple owns you. As long as your path coincides with Apple's decisions, you're golden. But try to do anything they don't want you to do... "You get nothing! you lose! Good day, Sir!"
Re: (Score:2)
Actually, you can now legally jailbreak your phone, and get your applications from the Cydia store. Then you can have your cake and eat it too.
Nice FUD though. Let me guess, Android fan?
Re: (Score:2)
yet another appleboy article... (Score:4, Funny)
as useful as a Linux box
Sure.
What next? They'll discover a hidden parallel port and what? It's supposed to stop world hunger?
Re:yet another appleboy article... (Score:4, Funny)
What next? They'll discover a hidden parallel port and what? It's supposed to stop world hunger?
Damn right, it'll feed people cereal in parallel.
Re: (Score:3, Funny)
Resistance is futile... or at least reduced by a factor of n assuming all the ports parallel to each other are exactly the same.
Re: (Score:3, Funny)
Oh Christ No!!!! (Score:5, Insightful)
<sobbing level="softly">I don't want to go back to carrying gender changes, null modems, 9/15 pin changers as well as worrrying about DCE/DTE and handshaking ..... </sobbing>
Re: (Score:3, Funny)
Pff. I’m still fiddling with gender changers, null modems, 9/15 pin changers, RS232 and RJ45 cables... oh, and this ancient boxy thing called a 1747-PIC...
Re: (Score:2)
I’m pretty sure that protocol is still implemented at least someplace in our system, too.
Re: (Score:2)
Re: (Score:2)
Probably software flow control. XON/XOFF or something like that...
Re: (Score:2)
I don't want to go back to carrying gender changes...
Changing gender is a life-long thing. While I got my new birth certificate with an F on it nearly 25 years ago, I will need a new hormone prescription (if nothing else) from my doctor every year as long as I live.
Parts is Parts (Score:2)
Steve Jobs: "NOOOOOOOOOOOOOOOOOOO!!!!"
I may be missing something, but... (Score:5, Informative)
...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 [ebay.co.uk] for an example.
Re:I may be missing something, but... (Score:5, Informative)
Yea, its rather well documented on Apple's website actually. Its how third party vendors can control the iPod/iPhone.
When you plug you iPod/iPhone into a car and start using your radio or steering wheel controls to change songs or whatever ... thats done through the serial port.
Its all documented on Apples website for registered developers, including the control protocol. You can also find the information elsewhere on the web by those people who reverse engineered it to avoid being bound to Apples rules.
Re: (Score:2, Interesting)
The person who "discovered" the serial port in the article was even using such a break-out board.
At last...... (Score:2)
......I can put the psion5 out to grass.
Re: (Score:2)
Old News (Score:5, Informative)
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};
OLD NEWS (Score:2)
Apple decided to allow devices to use serial over the dock connector in February 2010. Why does the summary list it as a "little known secret"? It's hardly a secret that the dock connector which uses USB communicates via a serial connector. That's what the S stands for in USB, btw.
Here's an article telling about the serial port OK from Apple last February:
http://www.ilounge.com/index.php/news/comments/apple-approves-serial-port-to-dock-connector-design/ [ilounge.com]
Next they'll discover the JTAG port (Score:5, Informative)
Yeah, it's got a serial port, with TTL levels, at its external connector. Big deal.
It's also possible to attach USB devices [arstechnica.com], which is somewhat more useful today. For example, you can plug a real keyboard into an iPad.
Re: (Score:3, Funny)
You mock, but it IS a big deal.
This means I can plug my iPhone into my Vic-20!
Re: (Score:2)
Seriously, a whole lot of embedded devices - sensors, microcontrollers, machinery, vehicles, booths - use RS232 (as simple, universal and VASTLY easier to program than USB)
It would be pretty exciting news... if it wasn't iPhone, a platform so locked down that it's nearly useless for homebrew like that.
Re:Next they'll discover the JTAG port (Score:5, Informative)
Seriously, a whole lot of embedded devices - sensors, microcontrollers, machinery, vehicles, booths - use RS232 (as simple, universal and VASTLY easier to program than USB)
Yes, when you do embedded work, you often find yourself going back 20 years in technology. There's progress, though. The trend in the embedded world is to put sensors and controllers on 10baseT. The traditional alternatives were either huge numbers of serial ports, or nonstandard proprietary networks. Both suck. 10baseT is quite robust electrically; it's noise-immune, balanced, and AC-coupled. This matters when you have heavy machinery around.
USB is making some headway in the embedded world, but there's a problem - the standard USB connector has no retention mechanism. Ethernet cables latch in place, but USB connectors do not. There are now "high retention" USB connectors (they're orange) for industrial use, and at least three incompatible latching mechanisms. This is not happy-making for embedded system designers, who would like to use USB more, but can't tolerate plugs falling out.
Wonderful (Score:2)
Re: (Score:2)
what I don't get about arduino is... why don't people just get the atmel chips and make their own boards? the arduino branding makes little sense to me since all of the boards are comparatively simple and all of the chips are readily available.
So why don't people just make their own designs?
Re: (Score:3, Insightful)
Because hardware "is hard". The bulk of the arduino crowd doesn't really want to play with hardware, they want to buy kits and write some glue code for premade libraries and pretend like they know microcontrollers.
Means to an end, and all that. They're more concerned with what they can do with it than how they accomplish it.
Re: (Score:2)
Its the quick and easy solution. I don't really do enough with it, or anything serious enough to actually justify to myself putting in any more effort. Kind of like how I have a macbook. I'm not exactly proud of it, but its nice to be able to take the easy road when I'm not feeling it.
Applies to iPad as well (Score:2)
Cool hack for an iPhone, but you could do the same thing with an iPad to USB adapter [apple.com] and a USB=>RS232 adapter [dealextreme.com] in a smaller form factor.
Two thumbs up for the hack though. I'm going to have to get a few of those breakout boards, my Sansa e200 has the same connector, just different pin outs.
Re:Fully functional computer? (Score:5, Funny)
Re: (Score:2, Funny)
Wirelessly?
Re:Vagina (Score:4, Funny)
Re: (Score:2, Insightful)
"Don't jailbreak your iPhone, that's stupid. You shouldn't have to do anything to run the software you want. Instead, get an Android phone. Yeah you have to root it to run the software you want, but that's totally different".
Re: (Score:2, Insightful)
Yeah you have to root it to run the software you want, but that's totally different
You're right, it is. Unless you Jailbreak your iPhone, you're stuck with the App store. I can install programs from wherever I want to on an Android phone by selecting an option built into the OS.
Re:Or (Score:4, Informative)
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.
Re: (Score:3, Interesting)
It is kind of long but I'm going to recycle a recent comment:
---
What's funny is, iOS jailbroken is actually a nerd's paradise. Much more so than android actually.
On the iPhone, you have a full apt package system, a terminal running bash, OpenSSH/OpenSSL tools, server, client, etc. a full GCC dev environement, etc.
A lot of this stuff is stuff you just don't get on Android at any level. You get a terminal out of the box with an
Re: (Score:2)
On the iPhone, you have a full apt package system, a terminal running bash, OpenSSH/OpenSSL tools, server, client, etc. a full GCC dev environement, etc.
On Android phones, you can install Debian. Not just apt, but a full Debian install with all the usual tools, etc.
Re: (Score:3, Insightful)
It is cool, nice to be able to do, etc, but not quite the same thing.
Re:Or (Score:4, Insightful)
Re:Or (Score:5, Informative)
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.
Re: (Score:2, Informative)
Rooting != jailbreaking.
Without root, I can run most apps I desire. I want to FTP out? Just fine. I want to compile zsh and slap it on the memory card, it will work. I want to run a P2P client? Frostwire and others are easily downloadable.
Rooting also doesn't modify the phone much. After I rooted my Droid X, the only files that are different are a su executable and an .apk for the UI frontend to always allow with a curtsy, allow, deny, or always tell an app to get fisted if it wants root. A jailbreak
Re: (Score:2)
What I would want, and even if this cost 10-25% more than normal phones, would be a unit with state of the art specs and completely unlocked in every way. I wish Google would come out with an ADP every quarter or two so developers can write and test code on a "modern" phone. When not developing, it would give modders a reference platform to write code on.
Re:Or (Score:5, Insightful)
Or, I dunno, a small netbook and a USB-to-serial cable. They're hardly massive.
It's not like you don't know in advance when you're going to need a terminal. If you can remember to bring that massive dongle thing along you can remember a netbook.
Re: (Score:3, Insightful)
But you need a 3G data card in the netbook if you want to just leave it in situ and ssh in to it; the iphone and this box can juat be plugged in and left there -- (for as long as the battery lasts) -- you can be wherever you like.
So your saying you can leave it somewhere running on it's battery for about an hour?
Re: (Score:2)
The iPhone battery would probably die before you got far enough away to need 3G to connect to it.
Re:No, thank you (Score:5, Insightful)
And yet, you are posting on Slashdot.
Re: (Score:2, Funny)
My time is worth too much to play with hidden features that the manufacturer won't even tell me about, much less support.
And yet, you are posting on Slashdot.
FUCK! I had no clue that /. had hidden features... I am guessing that's where all the good submissions end up?
Hidden features on /. ? (Score:2)
http://slashdot.org/zoo.pl?op=check&uid=666 [slashdot.org]
http://slashdot.org/my/comments [slashdot.org]
Re: (Score:2)
I am guessing that's where all the good submissions end up?
There are good submissions on
Re: (Score:3, Informative)
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?
Re:No, thank you (Score:4, Funny)
Re: (Score:2)
Amongst other things, I suppose.
It would be interesting to try listen on this serial port to see if the device emits any messages while booting up. Some trial and error on the baud rate may be required, of course.
Re: (Score:3, Informative)
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 app
Re: (Score:3, Insightful)
Alas, this hack won't do it:
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.
A USB-serial adapter like the CA-42 (powered from the PC on the other end) would be perfect for that purpose. Check out all the OpenWRT or similar "serial console" articles.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Does this serial port appear on /dev/tty(?) can you run a getty on it ?
However, if you meant /etc/ttys, which is what controls where getty is run, you could presumably put an entry for /dev/