Is it possible to send OSC commands to an iPad via the Camera Connection Kit? - objective-c

I'm building a small controller device that I'd like to partner with a computer. I've settled on using OSC out from my custom built hardware and am pretty satisfied with what I can get from WOscLib. Two goals I'd like to achieve are portability and a very nice ratio between battery:computing power, and this has lured me towards using iPhoneOS to accomplish my goals.
I think the iPad would suit my needs perfectly, except that using wifi to broadcast OSC out from my device requires that device to be connected to a third device with a wifi chip, and this would destroy the goal of portability, whilst also introducing potential latency and stability headaches. My question is pretty simple: Can I push OSC commands FROM my controller TO an iPad via USB and the Camera Connection Kit? If I could accomplish this, the two major goals of my project would be fulfilled very nicely.
This seems like it should be a simple little question, but researching this obsessively over the past few weeks has left me more almost more uncertain than if I had done no research at all. I'd really like some more confidence before I go down this route, and it seems like it should be possible. Any insight would be very, very appreciated.

The simple answer is that you can't :-(
In order to interface your custom hw you'll have to
obtain a license from apple.

no third device is required. you can click "create network" on your wifi menu in osx and then you ipad can connect directly to that. many apps now use osc over wifi on the ipad. some are done in java. im not sure about objective c.

You could connect a USB ethernet device to the iPad Camera Connection Kit and send OSC over ethernet from your custom controller.
Somewhere along the line since this question was asked, USB ethernet devices became officially supported over the CCK.

Related

Is it possible to communicate mobile to embedded devices through ultrasonic audio signal

I am looking for a wireless communication technology for exchanging data between devices via sound in ultrasonic frequencies.It is possible to communicate with two mobile devices.I want to communicate a mobile and an embedded device.Is it possible?Any device is working with this protocol?
Of course it is possible. Back in the 1970's my TV remote control used ultrasound to change the channel and turn the TV off. The control was somewhat rudimentary IIRC a short press changed the channel up and a long press turned the TV off. It worked quite reliably for these functions.
Providing more functionality would require a more complicated modulation scheme which, as has been said in another answer, would be prone to interference from other sound sources. This probably explains why infra-red communucation signals are used in more modern remote control systems.
It is possible - why shouldn't it be? Smartphones are just embedded computers too. I imagine getting CE/FCC/etc certifications with such an embedded device will not be so easy. And production testing ...
But is it feasible? Probably not. Power consumption is a lot higher than with any RF-link, it's more susceptible to noise (quite literally) and the required components (microphone+speaker) are bigger than RF-components (antenna).
And then there's a whole bunch of other things you need to keep in mind when working with ultrasound, starting with the plastic design of the embedded device. But also things like the effect of ultrasound on people and their pets etc.

Why is Bluetooth Low Energy not connecting on some devices?

I'm quite new to Objective-C programming and I have a problem with my app.
It connects to a device (an electronic board) through a Bluetooth Low Energy interface. My iPad is acting as a Central Manager, and the device it gets the data from acts as a Peripheral.
I use the CoreBluetooth framework.
It connects perfectly when I run the app on my iPad (iOS 7.02), but on any other device it hardly ever succeeds. I tried it in four other devices, all of them with the same iOS (7.02) and they hardly ever connect successfully to the electronic board (they managed to connect in a couple of chances).
I'm lost and don't know where to open a path to find the solution to that problem.
I don't know which other information could be useful to solve that problem.
Well there is the obvious, but worth mentioning. You bluetooth is on and you've scanned and picked up the Smart Device with your Smart Ready device. Given a yes to all of the above it just won't connect?
Have you ensured that it's not auto connecting to one of your other devices that you've previously connected with? Unless you've made some extraneous adjustments to your smart device's firmware it will only connect to one device at a time.

How to catch bluetooth peripheral's command

I want to catch commands from bluetooth peripheral in iOS.
Could anyone help me out?
There are a few ways of doing Bluetooth on iOS, and different ones have different methods:
An accessory that's part of the Made for iPhone program (see the answer to this question if you want to know what that entails)
A device that uses Bluetooth 4.0 Low Energy mode
Talking to another iPhone with GameKit
A device using one of the Bluetooth profiles Apple support natively: Hands-free profile, headset profile, A2DP, AVRCP, etc.
To answer those in order:
If you're part of the Made for iPhone program, you'll already know where to find this information, and it's not public: ask your contact at Apple for help.
If your device uses Bluetooth 4.0 Low Energy, look into the Core Bluetooth framework.
If you're trying to get two iPhones talking together, look into GameKit.
If you're working with a device that uses an Apple provided profile, you shouldn't have to do anything, it'll just work. For example, an A2DP device will stream audio played from the phone without needing programmer intervention. You can do a few things to control it: there's a Core Audio function somewhere that lets you choose whether to send audio to a Bluetooth device. If you're trying to support AVRCP, look into handling remote control events.
If your device doesn't fall into any of the above categories, you're probably out of luck and can't use it with iOS.

Korg Nanokey MIDI Controller for Arduino?

I have a Korg NanoKey which I'd like to use to control a simple synthesizer I've designed on the Arduino platform. (I have an Arduino Uno.) Basically, I don't care about MIDI, I just want to read what note the keyboard has pressed down, but if MIDI is the only way I can do that, then it's okay with me. So my big question is, how do I do this? I haven't been able to find anyone else on the Internet who has already done this.
But more specifically, I see two challenges: First, I'd like to plug my NanoKey directly into the Arduino's USB port, but then I'm wondering if the Arduino would provide the necessary power to the NanoKey. Second, I'm not sure what protocol I would be reading. Can I just read MIDI signals as described in this tutorial?
I don't want to curb your enthusiasm but what you're attempting might be a bit hard basket. A USB system consists of a host controller and one or more peripheral devices. It's the host that controls traffic flow to the devices which means that devices can't transmit data on the bus without an explicit request from the host controller.
I'm not familiar with either the nanoKey or the Arduino platform but I'd be fairly confident that the nanoKey is a USB "device", normally connected to a computer which would act as the host. So what you would need for this system to work is for the Arduino to act as the host when communicating with the nanoKey. The Arduino schematic shows that the Arduino Uno uses an ATmega8U2 for USB coms. Unfortunately the ATmega8U2 is a USB device, so you've got two peripheral devices but no host controller to facilitate the transfer of data between them. You'd be better off using a development board for a micro that provides either USB Host or USB On-the-Go.
I opened up a Korg Nano controller yesterday and was surprised to discover that there's an AVR mega32 inside. It would be a significant undertaking, but with a bit of work you could probably work out the schematic and reprogram it yourself using their programming header breakout. You might not end up with much more functionality than you've got this other way, but it would be very educational.
I agree with the Jono - you are biting off a lot - it might even end up easiest to hook the keys up to the Arduino directly - tearing out the electronics and figuring out a way to multiplex the keys into a single channel without losing polyphony (resistor 'ladder' maybe). I any case, good luck. Amusingly, you'd making an analog keyboard to plug into a digital synthesizer.
Quick and Dirty Arduino MIDI Over USB demonstrates how to send/receive MIDI out over USB, but unfortunately, this probably isn't any help for what you are trying to do, since he's found a way to send and receive MIDI signals from a USB host, not act as a USB host himself - the opposite of your problem. However, I thought perhaps it would be of use, if you ever wanted to control your device from a computer.
As mentioned in the other posts, you would need to use a separate chip to provide the USB Host interface. Here's a great guide to using the USB Host shield by Circuits#Home to interface with an Akai LPK25 (USB Midi Keyboard).
http://blog.makezine.com/2010/11/30/usbhacking/
The Arduino sketch is provided, so you should be able to try it out, however debugging the USB Host connection could get tricky real fast if it doesn't work out of the box.

How can I do bi-directional communication with a custom USB device?

I'm planning to build a USB device that has buttons that some software needs to respond to, and indicators that the software needs to control. I'm new to USB, so I'm looking for any pointers that will get me started.
When I did some USB development a while ago, I found the information at USB Central extremely valuable.
For low bandwidth requirements, you can use something like the FT232R which is a single-chip USB serial implementation. The FTDI drivers are readily available and make the device appear as a regular serial port to the host computer. This is orders of magnitude easier than rolling your own USB implementation (for either end!).
Kinda vague, but in the past I've done a little bit of USB development. The easiest stuff tends to be HID related device as the subset of USB used to commincate is very to implement on both sides. There are hardware devices which are essentially stubbed out to work with HID, you just customize some circuity and go.
The USB standard is actually quite readable. Though it might be a bit overkill if you just want to create a simple device. You could probably get something like this, which is basically an 8051 controller with a USB connector together with firmware and a DLL.
Checkout WinDriver, which is a commercial multiplatform tool what give you easy way to implement usb drivers in user mode, source code compatible between Linux and Windows.