sorry that this is a pretty vague answer, but you could communicate through osc if you could get your arduino onto a wifi network, which sound complicated. also, you could communicate through osc to a computer and then serial that to an arduino… this is pretty inconvenient though depending on your setup.
also, i remember reading something about someone who had set up a code library to communicate via the headphone jack.
I guess you could just take apart part of an audio cable and plug one end into your iphone and the other end into an analog port on your arduino, generate some sounds with ofxALSoundPlayer, and see what the readings are. obviously having direct access to the sound buffer would be much better, and hopefully that’ll come soon in ofxiphone, but you might be able to communicate basic things without that
Wouldn’t Arduino BT allow for direct communication with the iPod Touch?
I believe I will need to have a self-contained iPod reading a couple of sensors and was wondering if attaching an Arduino BT to it would do the trick. I believe it would be easier than having the extra WiShield.
So, I need Arduino to send sensor data directly to iPod. No computer involved.
I also read that I could try to connect the Arduino to the iPhone directly via the serial cable but this is way beyond my humble knowledge on Arduno. I would have to hire someone to research and implement this for me.
Hi,
just to follow up on the iphone to arduino path using serial:
I have successfully been able to communicate using the iphone´s serial port from an iphone terminal program (minicom), and I am now trying to figure out if I am able to access the serialport also from openframeworks.
The oFserial for the iphone 0.6 version is not really configured for the iphone though, as there are no test cases for iphone, only osx, linux and windows. I just added target_iphone to the osx and linux parts. I was able to compile but so far no luck in connecting to the serial port.
It would be great if anyone has any info on specific iphone settings for the serial port. The name of the serialport when accessed from minicom is /dev/tty.iap.
Hi Stephan,
I didn´t really understand what they were doing in the iphone hacks series, I couldn´t find any reference to the serialport in the code? Are they modulating the audio signal to do the serial communication, or did I look in the wrong place in the code?
Anyway, it is supersimple to do the physical connection to the iphone if you have a breakout connector. You only need tx-rx,rx-tx,gnd-gnd and that´s it. If you are using the arduino on 5v you would need a 1k resistor between the tx of the arduino and the rx of the iphone.
Somebody wrote code for the iphone serialport back in 2007 but I have no idea if that would still work. If anybody wants to have a go at it the code is available at the bottom of this page: http://devdot.wikispaces.com/Iphone+Ser-…-t+Tutorial
Ideally I would like to include this code in my iphone app, but I am still very new to openframeworks so that´s not so easy for me to figure out yet.
This is as far as I get:
after doing some small modifications to oFserial.cpp I am able to see the serial ports:
device 0 - tty.iap
device 1 - tty.umts
device 2 - tty.bluetooth
device 3 - tty.debug
but if I try to open the serial port using open("/dev/tty.iap", O_RDWR | O_NOCTTY | O_NONBLOCK);
I have no luck with that.
Slightly annoying since it works from the terminal, but I guess I am missing something essential.
Does anybody know where I can find the documentation for the open command? Maybe there are some other parameters I need to set?
Hmm it could be that your app is running with different permissions than the terminal.
This would make sense as the apps are meant to be running in a jailed environment of sorts.
Even if you do have a jailbroken iphone there is probably some things you need to do to have your app run with the mobile or root user permissions.
I have been playing with different permissions the last few days, as the app needs to be run as root (something I found out through the xGPS developers). No matter what I tried, it didn´t make a difference.
But last night I had a breakthrough:
I moved the app to the same place as where the apps are installed by Cydia, and it worked straight away!
would it be possible to see you modified version of the serial example.
i am currently trying to follow you instructions on the above posted link but i get error messages like these:
ofSerial does not name a type
thanks,
stephan.
update:
ok i noticed i forgot to add the following line to testApp.h
#include “ofSerial.h”
But now i get new errors, like:
"ofSerial::readBytes(unsigned char*, int)", referenced from:
testApp::update() in testApp.o
"ofSerial::writeByte(unsigned char)", referenced from:
testApp::update() in testApp.o
"ofSerial::ofSerial()", referenced from:
testApp::testApp()in main.o
"ofSerial::~ofSerial()", referenced from:
testApp::~testApp()in testApp.o
testApp::~testApp()in testApp.o
"ofSerial::enumerateDevices()", referenced from:
testApp::setup() in testApp.o
"ofSerial::setup(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)", referenced from:
testApp::setup() in testApp.o
ld: symbol(s) not found