iPhone, jailbreak, ssh, car controller
I’m working on a new car controller. It’s based on aftermarket remote start, a jailbroken iphone and some open source hardware. This post covers setting up the iPhone for that use. It’s really just a nice, cheap (if you have it) script-able serial telemetry platform.
iPhone jailbreak notes:
I used an iPhone 3g, downloaded 4.2.1 iphone firmware and used pwnageTool_4.2 to build jailbroken firmware.
(then did it all over again to build unlockable firmware – update baseband to 6.10: (add link)
First stop was to configure wireless to talk to my home network.
Then I hit Cydia (the app that’s loaded when jailbroken.) and updated everything it wanted.
Get cell service (you can do this later):
Install ultrasn0w and get a pay as you go t-mobile account activated on it.
Now it’s time for software:
Install openssh via cydia.
ssh onto the phone and change the passwords for the root and mobile users.
I also install veency – it’ll allow you to vnc onto your iphone, making it much easier to do all your work from your computer. Set a password in settings if you like.
We want perl, so add the coredev.nl repo:
download http://coredev.nl/cydia/coredev.pub on your machine. Then scp it to root@yourphonesip:/var/root
ssh to the phone and run: apt-key add coredev.pub
then run: echo ‘deb http://coredev.nl/cydia iphone main’ > /etc/apt/sources.list.d/coredev.nl.list
Now when you load cydia next, you can get perl installed.
Use Cydia to install the following packages. Instead of confirm after each, just hit continue queuing and add things to be installed. Then you can go to manage or just hit confirm on the final package you want to install.
minicom
perl
perl-dbd-sqlite(search for dbd::sqlite)
perl device serial (search for device::serial)
vimproved (This is vim, find something else if you don’t do vi.)
Later we’ll want a command line sms sender, but for now I haven’t decided which to use yet.
Set things up:
Set up Minicom:
As root mkdir /usr/etc
Run minicom -s, set serial to /tty.iap, set 9600 N81, turn off flow control
Save config as default.
install vi (or vim for the search to work) (I like vim. deal.)
If you have a serial port dock built, now’s the time to test your port. My first phone had a bad dock connector, so no serial on it. Luckily I had a spare laying around with a bad home button. I swapped the screens and was good to go.
If you’re getting a data plan, it might be nice to ssh into the phone over the nat’d edge/3g/whatever you paid for:
install autossh.
Follow this how-to: http://llemarie.wordpress.com/2009/09/05/tip-connect-to-your-iphone/
install p5-Device-modem (which gets you device::serial)
Congratulations. Now you have the equivalent of a funky linux (yeah, it’s bsd. I know.) box with geolocation, 3g, wifi and a serial port. Muhahah.