1

I'm currently trying to get an iPad 4 to talk to an Arbotix RoboController (Arduino-like controller with lots of pins). I'm using iPad 4 with a Lightning to 30-pin Adapter connected to a RedPark C2-TTL cable. The cable is recognised correctly under

Settings -> General -> About -> Serial TTL Cable

.

But I've had no luck following the Serial Cable SDK / Users Guide from the RedPark SDK. The Arbotix was set up to write out 'Hello World' to serial every 300ms but the method

- (void) readBytesAvailable:(UInt32)numBytes {
    ...
}

is simply not being called. Also cableConnected was never called.

I'm certain that I've set the baud rate to 9600 on both sides, as the answer to this question suggested.

There's a possibility the lies with the usage of the adapter, though I have my doubts. Any ideas?

EDIT:

The solution is below: I re-tested it on the iPad 4 + Adapter and found that it works with no problem. Excellent!

1
  • I have obtained an iPad generation 1, and repeated the tests. I still have no luck: the RedPark SDK invokes cableDisconnected but does not invoke cableConnected. I know this because I set debug messages to show on screen when any of these methods are called.
    – fatuhoku
    Jun 3, 2013 at 11:48

2 Answers 2

1

I solved it! I did not declare the cable in the .plist file. After adding Supported external accessory protocols as instructed by this page's step 11, I was able to receive all the events as expected.

The reason I was so stuck was because both the link above AND in the book 'iOS Sensor Apps with Arduino', declaring the property was sort-of qualified as an optional step, which I chose to omit. I think it must have been timing or threading issues caused by the need to display an extra dialog box asking the user to visit the App Store that screws up the correct delegation of these events.

On the web page:

This step is optional, but it will avoid the problem of you seeing an error message ("This accessory requires an application...") each time you plug in the cable.

On the book:

Finally, we need to declare support for the cable in our application’s Info.plist file. If we don’t do this, we’ll get something that looks like Figure 2-13 every time we plug the cable into the device.
1

In the info.plist did you use "com.redpark.hobdb9" to declare the cable? I have been wondering if I need to declare the C2-TTL cable as something else, but have not found any resources online saying so.

2
  • Yes, that's right. Supported external accessory protocols should be set to com.redpark.hobdb9. Despite many sources saying it's optional, it's actually necessary. I'm using the TTL cable.
    – fatuhoku
    Jul 2, 2013 at 6:41
  • Facing same problem , some delegate methods like readBytesAvailable: does not call. I am using RedPark L2-DB9V. <plist version="1.0"> <array> <string>com.redpark.hobdb9v</string> <string>com.redpark.ser45v</string> <string>com.redpark.ser45</string> <string>com.redpark.nmeax</string> <string>com.redpark.appgps</string> <string>com.redpark.serdb9</string> <string>com.redpark.serEval</string> <string>com.redpark.hobdb9</string> <string>com.redpark.L2-DB9V</string> <string>com.redpark.DB9V</string> </array> </plist> But No Luck in receiving Data. Any Help will really be appreciated.
    – Aadil Ali
    Jul 22, 2015 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.