Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Cellphones Hardware Hacking Iphone Apple Build Technology

HiJacking the iPhone's Headset Port 96

An anonymous reader writes "Researchers at the University of Michigan describe how to hijack the iPhone's headset port to power peripherals, establish bi-directional communications with them, and interface various sensors, all without jailbreaking your iPhone or having to pay thousands to access to the Apple Dock Connector. This makes it possible for students, hackers, and DIYers to extend the phone's functionality to the physical world. The team is giving away 20 HiJack modules/programmers to enable new apps."
This discussion has been archived. No new comments can be posted.

HiJacking the iPhone's Headset Port

Comments Filter:
  • Question: (Score:2, Funny)

    by Pojut ( 1027544 )

    Could you rig up something similar to Android's "back" button with this? The lack of a back button and the lack of the notification pull-down are the major things that would ever prevent me from getting an iPhone...

    • by tlhIngan ( 30335 )

      Could you rig up something similar to Android's "back" button with this? The lack of a back button and the lack of the notification pull-down are the major things that would ever prevent me from getting an iPhone...

      But then you'll need apps to actually support it.

      Then again, as someone who used iOS, I find the extra back and menu buttons kinda annoying because I'm never remembering to use those buttons - they're just out of the way things - why can't the devs put the damn option on the screen like it is in

      • Apple's way is more discoverable because it isn't hiding, Android's way is more efficient because it doesn't waste valuable screen space drawing back buttons and menu selections always on screen.

        Discoverable? Both are valid, I agree, but trying to say that a pentagon facing left is "more intuitive" than an arrow is kind of silly. Even before I started using an Android phone I was constantly annoyed by the iPod Touch UI and the need to find/press the little back choice in the app instead of using the "one button", which given the lack of multitasking (until recently) had the nice side effect of completely closing the app.

      • by Belial6 ( 794905 )
        I get that you may prefer the iPhone, but how could you possibly think that a back button that is always there because it is a physical button that is always in your field, is "hiding" is beyond me. It also amazes me that using an arrow that is a curvy line with a point at the end would be so much harder for you to use than an arrow that is a pentagon. They are both arrows, and they both take you back the way you came....
        • by s73v3r ( 963317 )

          The back button on Android isn't consistent in what it does. It varies from App to App, and can switch you between apps. A back button on an iPhone app is going to be consistent in what it does.

          • by Belial6 ( 794905 )
            When it switches you between apps, it is following your trail back the way it came. On the iPhone, the button isn't even consistently there. As far as consistency goes, Androids back button sweeps the floor with iPhone's.
            • by s73v3r ( 963317 )

              With a press of the Android back button, you don't know if it is going to take you back a webpage, if it is going to switch an app, or if it is going to switch to another screen on the same app. When it is there, the back button on the iPhone will always do the same thing: Take you back a screen in the app.

              • So in iOS when you open a web page from your RSS reader, how to you then go back to RSS?

                • by zn0k ( 1082797 )

                  The vast majority of RSS readers simply include a web browser. It takes a minimum amount of code to make use of the built in control that lets you do essentially everything the built in stand alone web browser does. The same is true for email forwarding.
                  If you do exit the app, you have to either use the task switcher or re-open the RSS app from the home screen.

                  • Sure but for me the android shell is better suited to integration between applications, while iOS encourages monolithic apps.

      • http://www.appbrain.com/app/button-savior-(root)/com.smart.swkey [appbrain.com]

        Shame you have to root to use it, but as I have rooted (typical geek with Android, rooted and perma-rooted custom Froyo ROM) it works great.
        Up and down, left or right, the trigger pixels are mostly undetectable in daily use and there are a few themes included.
        I can't see my < £100 phone's buttons lasting very long so this is a great option.


        PS If the developer reads this; saviour. That is all.
      • by t2t10 ( 1909766 )

        Apple's way is more discoverable because it isn't hiding,

        Are you kidding? There are three big buttons on Android devices, always in the same place, consistently doing the same thing; they aren't "hiding".

        iOS apps are totally inconsistent in how you invoke menus, navigate back, search, and even invoke settings.

        both are valid UI design methodologies

        Apple's design methodology is that Jobs hates buttons, it's as simple as that.

    • by Kadagan AU ( 638260 ) <kadaganNO@SPAMgmail.com> on Friday January 14, 2011 @12:40PM (#34880102) Journal
      So you want to have a 1 cubic inch device hanging out of your headphone jack with a "back" button on it? Seems like it would be a pain in the ass, and make it more difficult to store your phone in your pocket or holster or wherever you like to carry it.. Or keeping the device in your pocket and only inserting it when you need to hit "back" is also tedious.
      • Seems like it would be a pain in the ass, and make it more difficult to store your phone in your pocket or holster

        Purse. That's the word you're looking for.

    • Re: (Score:3, Insightful)

      by Grizzley9 ( 1407005 )

      "Back button"

      In all my use on the iPhone, I'm not sure this has ever been needed? I'm not even sure where you would use a back button besides in Safari and it already has one.

      • If you put a back button on the phone, the developers are going to use it. iPhones don't have back buttons, thus you never notice one is missing because the devs accomplish the effect through different ways.
    • by Graff ( 532189 )

      The lack of a back button and the lack of the notification pull-down are the major things that would ever prevent me from getting an iPhone...

      You could always just use a 3rd party web browser [macworld.com], some of them have back buttons and other features not found in Mobile Safari.

      As for a notification pull-down menu, submit the idea to the folks at Apple. Believe it or not they do take suggestions and over the years they have made many modifications based on those suggestions. It certainly can't hurt.

      • by Graff ( 532189 )

        Oh, and I probably misconstrued what you were asking for. Are you looking for a physical button that would activate a "back" feature? I'm not so sure that would be necessary since it's just as simple to have a software button on the touchscreen. I just looked and Mobile Safari does indeed have a software back button.

        It seems to me that since you are already interacting with the program on the screen a hardware button designed just to go "back" wouldn't be that useful.

  • Seems like the Square credit card swipe dongle is doing something similar. Does anyone know if the method is same as Hijack?
    • I was thinking the same thing. The case in the pictures in TFM even looks like the Square dongle.
    • by Belial6 ( 794905 )
      Yep, the "Researchers" have discovered that it is possible to do something that has been in commercial use since last year.
      • Yes, the "researchers" back-engineered and hacked something that probably would have required a non-disclosure agreement and licensing fees to get the specs for. Welcome to Slashdot.
    • by Jake73 ( 306340 ) on Friday January 14, 2011 @01:32PM (#34880868) Homepage

      Probably. This is called a modem.

    • by a_sdh ( 621518 )
      It's actually pretty different -- square is a simpler, passive device that essentially uses the mic and a tape head (remember those!) to read out the magnetic stripe on the card. This is actually much more sophisticated, since it harvests enough power from the audio signal to power simple sensors and a microcontroller, as well as giving you two-way communication. Also, it's not iphone-specific -- there are billions of cheap devices that you can now target with the same hardware; from this point of view th
  • by Anonymous Coward

    The credit card reader Square [squareup.com] does this and it has existed for about a year.

  • This is a modem (Score:4, Interesting)

    by Anonymous Coward on Friday January 14, 2011 @12:28PM (#34879944)

    These guys have rediscovered the modem, circa 1982.

    I've done something similar using a Bluetooth headset. Open up the headset and remove the microphone. Use a PWM output of an embedded microprocessor to read the sensor and drive the microphone input. Send data to the host with FSK modulation.

    With the Bluetooth headset, your sensor is wireless as well.

    • Hey, at least this time they are working around an entirely arbitrary restriction(since the dock connector has a perfectly good logic-level serial port, among other things), rather than advancing the state of the art in data transmission over the legacy copper infrastructure.

      Surely that, um, makes it better?
    • Re:This is a modem (Score:4, Insightful)

      by Announcer ( 816755 ) on Friday January 14, 2011 @01:01PM (#34880448) Homepage

      I think their idea of driving one of the audio channels at 22Khz, and converting that to DC for (a tiny amount of) power, is darned clever! This is "Hacking" in it's purest form! You are working completely within the parameters of the existing hardware, and yet doing stuff the original designers never intended. Bravo for creativity and inventiveness!

      To borrow from Mr Spock; "Fascinating."

      • by pz ( 113803 )

        I think their idea of driving one of the audio channels at 22Khz, and converting that to DC for (a tiny amount of) power, is darned clever! This is "Hacking" in it's purest form! You are working completely within the parameters of the existing hardware, and yet doing stuff the original designers never intended. Bravo for creativity and inventiveness!

        To borrow from Mr Spock; "Fascinating."

        Clever, yes, but pretty standard stuff. There are lots of ICs that are so-called 2-wire: one wire is ground, and the other is power *and* bi-directional communication. Mostly the idea is that when sending a command to the remote IC, you end up toggling the data line enough times that it can provide crude power on the receiving side by rectification and capacitive filtering of the incoming signal in addition to digital decoding of the command. The power typically lasts just long enough for the remote IC t

        • by Anonymous Coward

          But then, to bring it a couple of generations back, old-style whisker AM radios work the same way: the power to drive the ear piece is actually coming from the radio signal.

          I see, that's very clever! Maybe we could use this hack to send an audio signal to drive some kind of ear piece or small speaker.

        • by matfud ( 464184 )

          Sort of true. Most of those systems maintain an inactive high on the data/power line though as the devices can store an internal charge from that along with drawing energy from the signal when it is high. which brings me to ask why they are using 22KHz to generate the power. Is there something in the Audio hardware that causes a series of FF written to that channel to cause the output to deviate from its max value (I can imagine a number of hypothetical reasons) but most audio hardware I have used (very low

          • They're probably generating a 22KHz sine wave and running it through a transformer to boost the voltage from ~0.7 volts (more or less what you'd get if you drove the output DAC at the highest power output it could sustain with a non-fully-charged battery without clipping) to 3.3 or 5.0 volts. Yeah, you can do the same thing with about $10 worth of active components, but if you can easily generate a real sine wave to start with, you can basically replace the solid-state charge pump with a transformer, two di

            • by matfud ( 464184 )

              - They're probably generating a 22KHz sine wave and running it through a transformer to boost the voltage from ~0.7 volts
              That is a very good point. I was presuming the login would be working at a level compatable with the max out voltage from the audio system. I think a solid state voltage coverter may be more efficent though. Mind you that is a good hack if it is what they are doing (I am not sure if the pics shown where of the 22KHz output or not as they are definately not sine waves.

              - one way I know of i

            • by matfud ( 464184 )

              SPI
              UARAT
              1-Wire

              all can be done as long as you can satisfy the lowest baud rates they require (ie you can reasonably hit the required baud specs they have) and don't care about signal levels. Sig levels are easy to change but as you posted; not if you are using parasitic power.

              That does add an interesting aspect. Power and data on less than 0.7 volts. Much of what I've been playing with (FPGAs) are runinning on 1.2 volts core but most of the surrounding hardware is 2.5v (mostly handled by the fpga) and then o

          • by pz ( 113803 )

            Nearly all audio hardware is AC coupled at interfaces, that is, there are DC blocking capacitors in serial with the output. Writing 0xFF will not produce V_max for an indefinite time but only for the period allowed by the filter characteristics of the final stage. Low-frequency cutoffs are typically in the range of 0.1 to 10 Hz.

            The reason DC blocking capacitors are used is, among other things, to limit the output current since many loads are fundamentally resistive at low frequencies, and to limit the hea

            • by matfud ( 464184 )

              cheers,
              I think the low freq cutoff for audio is probably the best reason. I think you have answerd my question. I think I was biased as most of my work was on DC coupled DACs. So yes if you drove them to max out they would produce max out but they did have have analog stages after that were designed to be band blocking in the 20 to 0.5 KHz range (to get rid of the AC currents induced by machinery in the analog sections of the devices)

              I think that may be the answer I was looking for

              Cheers

              Matt

            • "PZ" you pointed it out correctly - there is a DC blocking capacitor, so you can't just pull the channel high, it MUST toggle.

              Although limiting heat buildup in voice coils is what is happening, that's not quite the right explanation. ;) Without the DC blocking cap, one of the semiconductors in the output (either comp-pair, or "totem-pole") stage would be forcing a (relatively) large current through that voice coil. This would severely unbalance the transistors, resulting not only in severe distortion, but h

              • by matfud ( 464184 )

                Thanks for the response.
                That would explain it. Are you involved with the project? Most of the stuff I do does not have audio band pass filters after it. Even when it does I'm normally using probes on the DAC output.The analog stuff after that alwyas confuses me I know how it works, I know how it should work but in reality It does odd things and messes with my head. In this case it is more a case of "I did not remember that"

                Matt

                • No, I'm not involved with the project, but I wish I was. ;) I totally "get it", tho! I have been tinkering with electronics since I started connecting flashlight bulbs to batteries with wire, when I was just a little kid.

                  Yes, analog electronics can, certainly, be fertile ground for MURPHY! That's why what looks fantastic on paper, seldom works right in the real world! There's ALWAYS SOMETHING that's going to need some major tweaking to "get it right".

                  • by matfud ( 464184 )

                    I started with electronics in a similar way, light bulbs and wires yes done that. I know all the theory behind analog but more often than not it just does not work out that way. How can a simple band pass filter screw up as it is only a few caps and resistors? I've constrained myself to the digital domain as it is far simpler. Oddly I like analog as there is so much to learn. Even digital work eventually results in analog fiddling if only to rule out the chances that it will affect you.

                    I'm mostly a software

                    • That's really cool! Well beyond my current experience... my CPU knowledge is still back in the 80's! ;) I was writing simple ML code for 6502 and Z80 back then. I still dabble with GWBASIC now and then.

                      I need to "get with the program" at some point, I know.

                      For now, I continue to tinker with analog electronics, and basic logic ckts. It's fun... that's what matters!

        • Yes, your point is valid, of course. Using one of those IC's would be "standard stuff". This project goes outside that... the idea here, was to take advantage of the existing hardware inside the phone, making NO modifications to the hardware of the phone, whatsoever.

          This isn't like the crystal set, because in that case, the modulated RF carrier is converted directly to a varying DC level by the detector. That varying DC level drives the crystal earpiece to recreate the sound. You want power supplies to be s

    • by kcitren ( 72383 )
      It's not just a modem. The interesting thing is the part about providing power to the devices.
  • Thousands to access the dock connector? What does tha mean? You can get one at OverStock.com for 6 and half [overstock.com] American dollars.

    Or did you mean developers pay thousands by having to buy licenses and Apple machines to develop on? Confusing. Unclear.

    • by Anonymous Coward

      Thousands to access the dock connector? What does tha mean? You can get one at OverStock.com for 6 and half [overstock.com] American dollars.

      Or did you mean developers pay thousands by having to buy licenses and Apple machines to develop on? Confusing. Unclear.

      Wow. Are you really confused? Yes. It means they have to buy a very expensive license to make a product that uses the Apple dock connector. There isn't any confusion for anybody else, just you.

      • No, they have to buy a very expensive license to essentially get permission to use Apple's trademarks, and to say that they are compatible. Which frankly is a bunch of bullshit. Anyway it's clear that they don't have to. Reverse-engineering for the purposes of compatibility is protected by the DMCA. The law explicitly permits you to figure out what is going on in there and do it yourself.

      • You only need to pay for a licence if you want to display the "Made for iPod" / "Made for iPhone" logos.

        I have several devices that use the dock connector that don't display the logo's, but they work just fine.

  • AKA a modem (Score:4, Funny)

    by mrnick ( 108356 ) on Friday January 14, 2011 @12:49PM (#34880270) Homepage

    Who would have ever thought you could hook a phone up to a modem? OMG! LOL

    • Who would have ever thought you could hook a phone up to a modem? OMG! LOL

      "When it's oversimplified, it sure sounds stupid!"

      I wish Slashdot registration required that you pass an Are-You-A-Nerd test.

      • Who would have ever thought you could hook a phone up to a modem? OMG! LOL

        "When it's oversimplified, it sure sounds stupid!"

        I wish Slashdot registration required that you pass an Are-You-A-Nerd test.

        One could create a captcha system which consists of questions like

        • What are the color codes for a 2K2 resistor?
        • What sequence of keys brings up the AT prompt on a modem
        • What are first six key labels on an AZERTY keyboard?
        • Heh. My ideal test would be something like:

          "Click to see Ben Heck's latest portable device."

          "Enter desired Username and Password..."

          If you click the second link it just takes you to Yahoo.

    • That was my first thought. Gee, someone's rediscovered digital/analog conversion... funny how in this industry things that were ubiquitous 20 years ago sometimes pop up as the next new groundbreaking thins 20 years later. (Accessing centralized systems from relatively dumb/low-powered clients, I'm thinking of you, too! ;-)
  • But couldn't you send a more useful waveform such as a 1-Wire [wikipedia.org] data stream? You could have all sorts of standard sensors/etc on the dev board with an 1-Wire bus.

    At 16KHz max clock rate, you probably could just send the 1-Wire waveform directly and square up any audio filter-induced droop in the receiver.

  • Won't Apple just reject any app that tries this kind of "mis"-use of the headphone jack? I doubt that they would allow this...
    • There certainly are apps that use it with Apple's blessings. Square [squareup.com] is the obvious and rather cool one (works on the iPod, iPad, and some 'droids, too).
    • by Belial6 ( 794905 )
      Nope. The Square credit card reader has been out for almost a year, and it uses this method. One of the benefits is that the same hardware works on android. Heck, it would be trivial to make it also work on a PC.
  • all without jailbreaking your iPhone or having to pay thousands to access to the Apple Dock Connector. This makes it possible for students, hackers, and DIYers to extend the phone's functionality to the physical world

    Or if you're a genius hacker, you can buy something with an ADC connector and... cut the cable, strip the wires, and have access to all its functions [nuxx.net] for a few dollars. Or maybe I'm missing something.

    • by s73v3r ( 963317 )

      Not if you have any inclination of marketing it commercially. The thousands mentioned in the article is for the license to be able to develop something for the dock connector.

  • ...that are proven to use the headset port for accessing peripherals? Given their obsession with control, that seems like exactly the kind of thing they might want to restrict with T&C's.
  • by PPH ( 736903 )

    Thank goodness the (closed source) iPhone is more secure [slashdot.org] than those nasty open source devices.

    • by Graff ( 532189 )

      Thank goodness the (closed source) iPhone is more secure than those nasty open source devices.

      In what way does this have anything to do with security? They are essentially outputting an audio signal for power and taking in an audio signal for data input. No security was needed or involved, any application can output and input sound via the audio jack.

      Seems to me you are making a security issue out of nothing. Either that or you are completely misconstruing the point of the article. Then again the submission did over-sensationalize the original web site, since there is absolutely no mention there of

  • Now with "headset port" removed, integrated w/ dock port 3.0.

    <EG>

  • by Anonymous Coward

    Why doesn't Apple just open up the spec for the dock connector already? It's absurd that practically every stereo, car, etc comes with one nowadays even though it only works with products from one vendor.

    Heck they managed it with mini DisplayPort, although I suspect that was because it was they only chance for the connector they already used on their laptops to face wide adoption. If Apple is ever open it's only to benefit themselves and not the industry as a whole which is worrying given their size.ominanc

    • It's not that no one knows how to use the dock connector, it's that Apple has a patent on the actual connector itself, you so you can't sell a product that uses the dock connector without paying Apple royalties.

      For your own use it's possible to buy a $4 30-pin connector and wire it up to whatever you want:
      http://www.allpinouts.org/index.php/Apple_iPod,_iPad_and_iPhone_dock [allpinouts.org]

      So I have to assume the summary talking about commercial third-party iPod accessory development rather than personal-use hacking, though

  • USB (Score:5, Insightful)

    by markdavis ( 642305 ) on Friday January 14, 2011 @03:21PM (#34882258)
    Stupid Android phones with their easy, accessible, standard USB ports and connectors!!! Takes all the fun out of it!
    • Hey, it worked for Kinect. If it had come with PC drivers and without the challenge [wikipedia.org] of being "locked up for your own good", it would have been ignored.
  • "thousands to access to the Apple Dock Connector."

    why? is there some kind of testing hardware you have to get to use the dock connector API's?

    • "thousands to access to the Apple Dock Connector."

      why? is there some kind of testing hardware you have to get to use the dock connector API's?

      Scroll back up where several folks already point out the reason. Apple has a patent on the connector and you can't produce and sell that connector without a license from Apple.

  • Kids, in order to build hot mobile apps, get yourself a piece of locked down hardware from a control freak company. Then, reinvent 50 year old technology to circumvent the restrictions that company put on it. Then, write software in a weird variant of the C language, software that you can install on your own device in development mode but that won't ever make it in the real world because the control freak company won't let you install it.

    Wow, great education!

  • Not sure if this was possible without this hack, but one could record audio through the headset jack as is possible in the Sony PSP's headset jack. An iPhone could easily replace a Tascam/Marantz field cassette recorder. (remember those, from the '70s and '80s?)

Keep up the good work! But please don't ask me to help.

Working...