What I want - an iPhone Serial App

rgooge

Member
I thought I'd throw this around for discussion...

I would like to have some sort of interface to an iDevice (iPhone/iPad). Something like a bluetooth serial interface... i.e. microcontroller <-> Serial to Bluetooth or WiFi Converter <-> iPhone.

This is just a pie in the sky idea (unless someone has developed this already). At the iPhone end have a sort of sandbox creator program to make an interface screen with meters, pushbuttons, pots, etc to which serial commands could be attached. The microcontroller could be anything (Picaxe, Arduino, etc). I'm saying wireless, because that *seems* to be easiest and removes the electrical foul ups.

You could create some great (dare I say - trendy) interfaces for projects that anyone could access. Our school is already using iPads, so this could be a great educational tool as well. Having a group, even, contributing and controlling.

Almost tempted to have a go myself except for the knowledge stall at the iDevice end.

Probably wacky for sure, but I can't see why it's not doable!

Just an idea...
 
iDevice connectivity

that sounds like a great idea especially for experimenting / tuning variables in a project on the run. My understanding with iDevices is that you need an Apple Mac with appropriate licenced software in order to write your own apps. Then Apple has to approve the app for release on the app store. I'm not sure but if you were to write your own apps, I think you can use them on your own iDevices without AppStore approval. I had wanted to write my own apps but I refuse to buy an Apple Mac! I decided to made do with macros/ formulas in spreadsheets and also the use of websites on my own server to perform the functions I wanted.

Anyway, good luck with the idea. It definately has potential.
 

manuka

Senior Member
I've not (yet!) used them, but have heard good things about Serialio's cross platform wireless offerings (both BT & WiFi),especially their WiSnap AAA.

What's your budget however? Are you locked in on iPad/iPhone iOS? Android devices are much cheaper,and applications for them (many free) increasingly abound. Are you up with the likes of this Audio Serial Out offering, which outputs serial commands (suiting PICAXE control) from the Android device audio port?! Stan.
 

papaof2

Senior Member
I've been using NSBasic App Studio to develop some Android programs. App Studio also supports the iSeries of devices (those with WebKit).

No available serial ports on any of the devices I've seen and no to-the-hardware access in App Studio yet (although the free PhoneGap add-on has some of that capability = GPS, camera etc). PhoneGap processed apps are can be sold on the Apple app store.

App Studio is currently $99US http://www.nsbasic.com/app/

No connection with NS Basic except as a user and an unpaid occasional beta tester.
 

cdngunner

Senior Member
I would like to see an Android app first for interfacing with the Picaxe series of microchips.

I don't have much use for that iCrap stuff
 

hippy

Ex-Staff (retired)
Let's keep it civil and non-derogatory; everyone will have their own preferences, likes and dislikes, and let's respect that.

In principle a terminal program, even a more graphical program along the lines of StampPlotPro and the like, should be a simple job of making it work, no matter what target platform is chosen. Reality can however be quite different.

First there's having the skills and knowledge to do it, having the development tools, a development platform, needing to know how to gain access to the necessary interfaces, plus complying with licenses and T&C's. All that can be quite an adventure, and at the end of it you've got to have something which is practical which potential users consider usable with reasonable cost and effort.
 

cdngunner

Senior Member
Let's keep it civil and non-derogatory; everyone will have their own preferences, likes and dislikes, and let's respect that.

.
And that is why I kept my remarks to the product and not the people using it.

Assuming that remark was aimed at me ;)

btw I hate everyone equally, totally independant of the products they use, like or dislike. :eek:
 

manuka

Senior Member
For initial insights that Android audio serial approach seems to have merit, especially since it's free. Enhancing ones "firepower" (as the needs,available technology & budget justify it) is often a sound strategy in any field of course. Learn to walk before you climb... Stan.
 

Attachments

Last edited:

rgooge

Member
I'm not a teacher, the school I have a close relationship with have embarked on a pilot program using iPads in the curriculum.

Agreed, I don't want this to turn into an iDevice vs. Android vs. Sharp Organizer :) melee. The school has chosen this path and it has a lot of merit in that the Apple devices lend themselves very well to that application. More schools are going this way and the thought processes led me to thinking that this would be a great way to bring in the Picaxe (or as I said *any* serial/even USB micro devices).

I've had a look at the audio/serial this but it appears to be only one way. Implementing bluetooth as a wireless serial link would be better, as I said, even having a group of four-five students all collaborating around one project.

There is OSC (Open Sound Control) and this sort of App http://hexler.net/ (for Android as well!!) has the look of the idea I've got. The Arduino has libraries for OSC using a WiFi link, I was more interested in a gravelly nuts and bolts, simple serial implementation.
 

manuka

Senior Member
I'm not a teacher, the school I have a close relationship with have embarked on a pilot program using iPads in the curriculum.
Good for them, BUT (at iPad2 $$$ prices) just how is this being funded (and supported), & what ages are the students? I've been down similar paths in my 40 year educational career, & well recall emotive issues arising from the likes of "calculator wars" in the late '70s. Stake holders were often at each others throats when -gasp- considering computers in the '80s, and -horror- the internet in the mid '90s...
 
Last edited:

Adamey

Senior Member
I've been looking at something like this as well. Serious to the point that I actually bought an iMac (first MAC I've ever owned) specifically so I could run the Apple SDK to develop iOS apps. Haven't got my iPad 2 yet since I don't feel like standing in line, so I'll wait until stores have regular stock.

There are a couple ways I can see doing this. First is the Apple Accessory Protocol which uses serial data on a Tx/Rx pair of lines in the 30 pin dock connector. This is used for things like remote controls and there are a list of commands (data bytes) and what functions they do. I haven't found out yet if you can only send data conforming to Apple's protocol, or if you can send any serial bytes through these lines. I have heard of people making their own remote controls for iPods using an Arduino connected to these lines.

The other is through USB. Perhaps a 30 pin dock connector to serial with a USB/Serial convertor built into the cable.
 

rgooge

Member
Good for them, BUT (at iPad2 $$$ prices) just how is this being funded (and supported), & what ages are the students? I've been down similar paths in my 40 year educational career, & well recall emotive issues arising from the likes of "calculator wars" in the late '70s. Stake holders were often at each others throats when -gasp- considering computers in the '80s, and -horror- the internet in the mid '90s...
Every year 12 (final year high school) student has an iPad1, this is not a state run school, BTW but it is certainly not one of the elite schools either. The iPad is used in place of the student diary, it is also used for immediate web access, some subjects have their text books on them, students use them for note taking as an adjunct to pen and paper. This is all alongside regular PCs (Windows based, I might add). The school is in the process of writing its own specific school based Application as well.

But I seem to have gone off on a tangent, I like the Picaxe/iDevice/Android idea across the board for all users, I think it would add huge flexibility, popularity and entice a whole lot of new souls into the micro-controller world!
 

Adamey

Senior Member
Has anyone seen this? Don't see why they couldn't also make one for iOS as well. Perhaps they'll wait and see how well this sells and if they get any iOS requests.

IOIO for Android
 

hippy

Ex-Staff (retired)
The situation for iOS and Android is somewhat different, but there is some commonality.

As I understand it, iOS supports serial RX and TX on the iPhone / iPad connector. The problem is that Apple do not provide a mechanism to access it without jail-breaking or being an authorised Apple partner.

For Android, some hardware supports serial RX and TX, some doesn't, but there's no software support within Android which provides access to it if it were there.

The commonality is that, to overcome the problems for both, people are trying to work out how to jump through hoops to provide serial port connectivity in some other way. It's like buying a PC which has no USB or COM ports but has a LAN connector; if you can find a LAN-serial interface, can fool the OS or application into thinking some LAN-serial solution is available and can be controlled then job done.

For Android, there's a thing called Android Debug Bridge (ADB) which is what the IOIO board seemingly hooks into which does the job of a LAN-serial interface as described above but via USB. ADB is part of Android so should be available for all devices. Android devices can send debugging reports to ADB and IOIO effectively hooks in, grabs those reports, then acts upon them. It's not clear if an Android app can read stuff the other way via ADB but I would guess so.

For iOS there is no Android Debug Bridge, and likely never will be, so the IOIO would be pretty useless with iOS, though there may be some similar technique which can be used with USB, WiFi, Bluetooth, Audio or any other mechanism which is supported. This is equally the case for Android had ADB not existed.

Additional to getting a hook into the hardware, there's that issue of your application being able to access it. For ADB that's an included part of Android so should be easy, assuming a particular device and Android implementation supports it but that's not guaranteed. For iOS you are limited to whatever Apple provides and allows unless jail-breaking, and if jail-breaking then you may as well simply access the physical ports which then become available directly with few or fewer hoops to jump through.

The issue isn't so much can it be done - the answer is usually "yes" - but a question of how best to and how to make it work.
 

Adamey

Senior Member
I was looking at devices that use iOS and found a few. There's a new scope (1 channel scope, 4 channel digital logic probe) that works with the iPhone or iPad. The scope itself is very simple, but they're obviously getting data in & out of an iDevice without jailbreaking.

What I found more interesting is the AR Parrot Drone. They are apparently releasing source code so people could adapt it to their own needs and/or port the code over to another platform (like Android). This is of more interest to me since they are sending both video from the Drone to the iPhone and data from the iPhone to the Drone to control flight, all over an ad-hoc Wi-Fi connection.
 

rgooge

Member
Yes, I've had a look at the AR Drone as well. The way it works is that the drone, running Linux, sets up a WiFi hot spot, your iOs device joins this network and the data flows over the WiFi network. Probably a bit of overkill for this idea, but it can be done.
I've also looked at the idea of BT human interface devices such as keyboards, but it seems a one way data flow.

... still trawling the 'net for ideas...
 

manuka

Senior Member
Aside from the juicy iPad/Android devices tech. possibilities, I'd again alert that such schools projects may become a white elephant unless supported long term. Hence START SIMPLY!

Schools are especially prone to enthusiasm fading when kids,parents & staff move on - I've seen cupboards & sheds crammed with dust covered $$$$($) gear that was purchased when a past mover & shaker whipped up enthusiasm...

I've experienced this myself back in the late '60s/early '70s space age, when I ran a significant observatory while working at a NZ school. The facility lapsed when I moved on, & the school eventually smashed up the elegant dome & scrapped the metal work (& 10" Newtonian reflector). The building now apparently houses lawn mowers-the "heavens to earth" symbolism being particularly poignant.
 

rgooge

Member
Stan, I agree with the whirlwind enthusiastic embrace of a new fad or even a useful piece of technology, that's got no plan or long term backing. The thing is that this iOS/iPad hardware is not being purchased for this application, its used right across the curriculum, right now. Finding a *simple* way to link this to, say, a Picaxe circuit would be ideal, even using an iPod touch. Given that capable hardware exists - how hard could it be? (;-P - tongue in cheek).

OK ignore the school thing. I've got an IPhone (and/or an Android - if necessary) and I've got a bit of Picaxe gear, an Arduino, the odd basic stamp, some raw PIC stuff, Z80s, you get the idea.

How would I link them up to one of these trendy devices? Serial - Pseudo RS232 would seem the easiest from the micro-controller point of view - they all can do it.

Hardware to do it?

a. Hardwired - this is not easy, different devices at both ends need different implementations and connections.

OR

b. Use Bluetooth serial - the application devices all have it, the micros can all have it - just need a Bluetooth to serial dongle at the micro end.

Then there's the software for the high order devices... this is the hard bit, from my point of view. E-Gad, Rev-Ed could even write an Application to program the Picaxes this way!!!

For my children (teenagers), I'd love to say unplug the earphones and plug into this... think about the ubiquitous flashing led demo, being controlled remotely, flash rate, on or off all via a simple serial data stream.

- Rob.
 

manuka

Senior Member
rgooge: OK- but keep my alert in mind! Bluetooth is certainly tempting, but the BT-serial dongles prices are not- see => http://www.gridconnect.com/blueport.html

FWIW Andrew Hornblow & I have been pondering rustling up an Android tablet app. to 38 kHz serial encode & pulse an IR LED connected to the 3.5mm audio outlet jack.(Android applications are written in Java – a relatively easy to learn & friendly language.) It may however perhaps be an overkill, as just a coin shop universal IR remote may do for basic PICAXE control !
 

Technical

Technical Support
Staff member
b. Use Bluetooth serial - the application devices all have it, the micros can all have it - just need a Bluetooth to serial dongle at the micro end.
Apple do not support the bluetooth 'serial protocol'. They support bluetooth 'audio protocol' for headsets etc., but deliberately do not support the bluetooth serial protocol. This is because it would then be too easy to produce a third party hardware device without the Apple accessory chip, which Apple insist is incorporated into any official third party hardware. This is the main problem with producing hardware for the Apple devices, Apple specify you must incorporate their accessory chip in your hardware.
 

papaof2

Senior Member
Apple do not support the bluetooth 'serial protocol'. They support bluetooth 'audio protocol' for headsets etc., but deliberately do not support the bluetooth serial protocol. This is because it would then be too easy to produce a third party hardware device without the Apple accessory chip, which Apple insist is incorporated into any official third party hardware. This is the main problem with producing hardware for the Apple devices, Apple specify you must incorporate their accessory chip in your hardware.
Sounds like a case for a "Restraint of Trade" suit by the US Federal Govt. To me, it's the same thing as when IBM required the use of their card stock in the data card punches or Xerox required the use of their paper in copiers. Anyone have a friend in the US Attorney General's office?

John
 

slimplynth

Senior Member
I've done the first couple of Android/app inventor tutorial programs.. (recently acquired an HTC wildfire) App inventor, although basic does support bluetooth, which is what i'm hoping to do using the fairly cheap modules (serial link) I bought a while back.. start simple and grow.
 

techElder

Well-known member
And people like us are the main reason a manufacturer (Apple in this case) would want to protect and control their product's reputation.

It isn't too much different than the PICAXE program download with the serial interface. Unprotect the innards of the product and lose control of the manufacturing.

Apple do not support the bluetooth 'serial protocol'. They support bluetooth 'audio protocol' for headsets etc., but deliberately do not support the bluetooth serial protocol. This is because it would then be too easy to produce a third party hardware device without the Apple accessory chip, which Apple insist is incorporated into any official third party hardware. This is the main problem with producing hardware for the Apple devices, Apple specify you must incorporate their accessory chip in your hardware.
 

slimplynth

Senior Member
I see the analogy but a product that costs a few pounds sterling vs a product that's made in a third world country for a pittance then sold at a massively marked up price is a different kettle of fish... imo
 
Last edited:

moxhamj

New Member
I've not got any apple products but my kids have them for school. I think it would be great to be able to plug things in and do "real world" like flash a led or move a servo.

I bought an android 'pandapad' a few months back - cost $110 including shipping. Superficially it looks like apple pads but the android takes way too long to boot up and the touch screen is not as responsive as apples.

I thought I would hack the audio output to transmit some data, and indeed this is possible. I used a version of Basic http://www.basic4ppc.com/ Basic4Android and the instructions would be familiar to picaxe users. It certainly is possible to send data at 1200 baud and tell a picaxe to do something. The catch (as of a couple of months ago, maybe it has changed) is that Basic4Android can't talk directly to the audio. You need to create an audio file, save it to the sd card, then play it back. This means the sd card is wearing out every time a byte is sent.

Also the data only goes one way. There is no way to get data back into the device. I looked at using the microphone but the audio drivers don't exist yet, or even the video camera, reading picaxe lights.

It is a pity it is so hard, because this pad has all sorts of clever things, including being able to be programmed wirelessly with wifi. I don't think picaxe can talk wifi though.

The last, and probably best option might end up being bluetooth. However the bluetooth enabled androids are more expensive. Adding an external bluetooth dongle to the android pad does not work as the drivers haven't been written (by trial and error I found there are USB drivers for USB memory sticks and for a keyboard, but not for a mouse).

There are quite a few hacking possibilities to explore!
 
Last edited:

manuka

Senior Member
Dr_A: Make that "a LOT of hacking possibilities to explore"! The B4A approach you've mentioned looks meritorious,& they offer a free 30 day trial. Some of the swish applications produced look quite persuasive (refer "e-droid" sample below)! FWIW a quick Google shows such B4A alternatives as RFO BASIC!- free.

I've no Android or Apple gear of any kind,having far too much regular PC (& idle cell phone) hardware here to justify yet another device, but am intending to grab something "PICAXEable" in the near future. It'll probably be Android based, as they offer for "bang for buck" value and general compatibility.

For those considering me a sellout skinflint,I'll mention that I've long been an Apple fan,and can proudly relate considerable & enthusiastic usage late 1970s (Apple 2E) - 1984 (Apple Mac). Stan.
 

Attachments

Last edited:

Adamey

Senior Member
I have a colleague going to the Apple developers conference this summer. Over 1,000 Apple engineeers and staff on hand to provide plenty of one-on-one time for iOS developers to go over ideas and code. I wanted to go but tickets sold out in record time (that's what I get for deciding to wait until I got home from work to register). :(

I talked to him about this and explained what people would like (simple access to get serial data in and out of an iPhone). He's going to bring it up and try to get some answers for me as to what would be the easiest way (from an Apple engineers point of view). Unfortunately he's not very "electrically minded" so I hope he's able to convey what we want and understand the answers he's given.


What I specifically want do to is to be able to program EEPROMs. Programming a PICAXE or PIC directly would be incredible, but also something extremely difficult to accomplish. I want to store variables in the EEPROM that are used by the PIC to control how the software runs. You would use the iPad/iPhone as a "menu system" to "program" your device and control how it runs. This would eliminate the expense of an LCD screen and buttons on the device itself to perform setup functions. It would also be much quicker to have all your options on one screen instead of having to scroll through multiple screens on a tiny LCD.

Of course the next step would be to actually download software into the EEPROM and have your PICAXE load it using the booti2c command. While you couldn't develop software on your iPad, you could have a library of existing programs (that were previously read from an EEPROM) that you could load into a module. With revision #'s this could get a little complicated, so for now I'm going to concentrate on reading/writing data from an EEPROM.




As to why I picked Apple and iOS over others (Playbook & QNX, Android, WebOS), well there are several (keep in mind I come from a software development background and only recently got into electronics).

- First is really obvious, and that's market share. Apple owns the tablet market and there's no signs of them letting up. If I'm going to gamble on developing a product, I want the maximum number of possible customers to potentially use my product. As to the phone side, although Android has higher numbers than iOS (and Blackberry is close to Apple), these numbers are skewed. Both Android and BB phones encompass many devices at various price points from affordable up to the high-end smartphones with large touchscreens. Apple only makes one phone and it falls into the high-end category. Apple actually outsells everyone else if you only count the high-end touchscreen phones, and this is what type of device I want to run my software on.
- Fragmentation. This is the one people hate talking about, but it's a very valid point. There are so many Android devices out with so many different hardware configurations and versions of software, that developing software to run on all of them is much more difficult. iOS is tightly controlled by Apple, and although this can mean less flexibility when developing software it also means greater compatibility. Also, I don't want to invest in a dozen (or more) phones and tablets just so I can test my software on each of them. With iOS I only need to buy two devices, an iPhone and iPad (and maybe two more when iPhone 5 and/or iPad 3 come out). I'm also more interested in the tablet (simply because of the size of the screen) and there's no way to predict which of the many Android tablets coming out (as well as the Playbook and TouchPAD) are going to be a success and which will disappear (last year when the iPad 1 came out there were also many competing tablets anounced and they all disappeared from the market).
 

slimplynth

Senior Member
I've been impressed by the android market. Many developers seem to offer a lite version which has either restricted functionality or adverts.. upgrading to the paid version when you know it works satisfactorily on your phone.

I read today that Android is expected to have 38% of the market by 2015... I'm not an android developer but surely 38% is an incentive to try for many people.. what's 38% of a bazillion squids?
 

slimplynth

Senior Member
well thats thats what I thought and apologies for the rhyming but i thought Android would spread like verucas.
 

manuka

Senior Member
FWIW "manuka" is the NZ Maori name of a very hardy & prolific bushy scrub-type native forest lower canopy tree. Nectar from it's early summer flowers makes enormously esteemed honey, & the pole type trunk is prized for firewood or garden stakes. The prickly leaves infuse for a great bush tea, & even the sawdust is highly valued for smoking fish etc. I took to using the name when bee keeping in the 1980s,as the honey became far & away my favourite type.
 

Attachments

fritz42_male

Senior Member
FWIW "manuka" is the NZ Maori name of a very hardy & prolific bushy scrub-type native forest lower canopy tree. Nectar from it's early summer flowers makes enormously esteemed honey, & the pole type trunk is prized for firewood or garden stakes. The prickly leaves infuse for a great bush tea, & even the sawdust is highly valued for smoking fish etc. I took to using the name when bee keeping in the 1980s,as the honey became far & away my favourite type.
Not to mention the use of the honey for dressing wounds - cut myself fishing over there a few years back and used the honey as an antibacterial under a plaster/bandage. Seemed to heal quicker and with less scarring!
 

manuka

Senior Member
Right - utilising inbuilt GPS, 3G, WiFi or Bluetooth naturally tempts, but given their 3.5mm stereo jack, perhaps initially develop an Android application based around this humble socket? As few Android devices offer IR data sending, maybe sound output could be used to drive IR LEDs (perhaps at 38kHz) for IR wireless transmission. With the Android then able to "speak IR" a TV, DVD etc could be controlled, or (with the usual 3 leg IR receiver) perhaps a PICAXE device. Sure -a cheap coin shop remote could do this too, BUT the Android device would be a 1 stop approach.

Extra: Google shows this has very recently been explored with a clever "IRDroid" => www.irdroid.com , but the 6V battery used is a bit oddball ?!
 

Attachments

pete20r2

Senior Member
This doesn't seem like a big problem to do, Android is just linux, and we all know linux, right>;)
and iStuff is a Darwin system, OS x I think is the closest relative to iOS.
A serial terminal is a pretty fundamental system feature.
iStuff which has been, shall we say, used in ways apple didn't intend, have root access and a terminal, all ready to go for a first version beta serial interface, all you need is the hardware!:cool:

Biggest problem will probably be drivers lol.
 

rgooge

Member
You don't seem to understand what I was on about.

The Android applications are well and good from linux/enthusiast/single user point of view (me included in there somewhere), and maybe a controlled multi-user environment. Ultimately the introduction of Android devices just for this purpose is exactly what Stan was alluding to in his earlier posts, orphaned, expensive equipment.

BUT the hardware permutations and combinations are all over the place. Apple, much to the chagrin of many, have a tightly controlled platform. This is bad and good. The bad is the rantings and points made above, to which I agree from their respective point of views. The good is that it is a universal platform, the same here as in the USA as in France as in Argentina as in ...

As I have pointed out it is right now being used in education simply because of this one fact. One hardware, one OS, one set of apps. Tech support, "oh your iPad stopped working, well here's a replacement" which will look and feel exactly the same. No headaches, no hardware compatibility issues and educators around the world are developing for the platform and it will work the same way there as here. Android may get there but it is a "noisy" environment at the moment.

My whole point was to make use of this and perhaps have an easy way to integrate Picaxe into this platform for the masses (how you define masses is up to you! :) ). But as Technical has pointed out, due to the exclusive nature of Apple Inc and their hardware controls, this is and will be hard.
 

manuka

Senior Member
Check a similar FLPR (Fast Learning Programmable Remote) iPad/Phone IR controller device now available. You probably won't want to know the price I'm afraid (US$80).

I certainly take your point re apparent iOS ubiquity, but also caution that many schools (even in the "lucky country") have per head technical budgets at the $($) level, & can hardly stretch to a box of AA batteries in some cases...
 

Attachments

Last edited:
Top