iPhone RS232 data transfer over WiFi/BT - iphone

I would like to write a simple app that displays weight values sent from a scale.
The scale sends data (with a defined protocol) through RS232 port: considering that I cannot connect the iPhone to the Serial port, I was thinking to use a RS232/WiFi adapter (or RS232/BT adapter).
The iPhone should act as a Master and the scale a Slave: the iPhone sends a command (a simple text string) to the scale and the scale answers with the weight value.
Is the WiFi/BT a possibile solution to exchange the serial data between the iPhone and the scale ?
If yes, how can I establish the connection with the scale and then exchange the data with it ?
I'm a newbie so I would need very basic information and possibly some links to tutorials or sample code to understand how to write this app.
Thanks.

Have you heard about using the audio jack as a receiver of data?
iPhone # 1200BAUD

With Wifi it's not possible cause iOS is not supporting peer-to-peer. Not sure you can do that with BT - you will have to do regular pairing and transmit over the available profiles.

It's not wireless but you can checkout http://www.redpark.com/c2db9.html.
The other option I would recommend is to add a ethernet serial server, then you can access the scale with the browser on your iPhone.

Related

How to send data to iPhone from external device

I have an external device that we manufacture that basically monitors 4 voltages, converts them to a 16 bit digital number then streams this info back to a PC every 100mS or so, using a serial over USB style chip. Basically a data logging system.
We would now like to collect this information on an iPhone and I am wondering what is the best way to get the data into the iPhone?
I am assuming there is no way we can physically connect directly to the iPhone dock connector as the protocol to do this is not available to iOS developers?
Obviously we could do it over a WiFi network but there will not always be one and we want to keep the external hardware fairly simple, i.e. no need for a computer or Wireless router etc.
If we add Bluetooth connectivity to our hardware would this work? I read that only 'Made for iPod' type Bluetooth devices will connect, in which case how can we achieve 'made for iPod' status? It would be relatively easy to add the necessary Bluetooth chips to get the system up and running.
In an ideal world we would like to do this without having to use a 3rd party interface.
I have been thinking about trying to digitise data as an audio signal – like a modem, and send it into the line input jack, but I don’t think it will be fast enough – this would be new territory for me.
Anyway all suggestions gratefully received!
Thanks!

How can I create a small Mac app that receives data over the WiFi network from an iOS app?

What I need is to have a simple screen in this Mac app that just prints a string as the iPhone is transmitting strings through the WiFi network.
This string is simply a string value from a slider being adjusted up and down by the user on the iPhone. The data will be sent to the Mac app and then the Mac app will receive this signal from the WiFi network and simply print the values.
This is a constant connection. I'm not trying to sync once. I'm trying to listen to the iPhone device from the Mac to see if the iPhone is sending any more strings as the user slides the UISlider up and down from the iPhone app.
How can I create the client side? Do I need to use Bonjour or something?
In my answer to this question, I provide a link to a sample application that has a Mac component and an iPhone one. These components communicate between one another over a WiFi network, with changes in a label on one being reflected in the other. This is done using Bonjour discovery and the standard networking APIs.
With simple modifications, this could be used to send the continuous updates you need for your particular case.
Use the CFNetwork framework, you can use bonjour for discovery and then handle a persistent connection through native sockets for passing data back and forth.
http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/Introduction/Introduction.html
Here is an excellent tutorial to get started, its for iOS but CFNetwork is available in OS X too.
http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/

Sending data between OSX and iPhones/iPads

I am wondering how I can send data between a machine and a mobile device. I know about the game kit an have read a bit about bonjour (but don't know to much about it), but would like to know some expert thoughts on what the best way is.
What I basically want to build is a one way traffic application that sends data from OSX to the mobile device (iPhone, iPod touch or iPad). The data send is either pictures, text (of a certain size and position ect) or video. The mobile device just has to receive this data and display it... nothing more.
My guess is that a WiFi solution would be best.
How could I best do this? Are there any tutorials that might help me putting this together?
Thanks in advance!
Best regards,
Paul Peelen
As no reply yet . . .
Bonjour is more focused on LAN networks, so would restrict you to WiFi.
It's also more of a service discovery standard - your Mac app would advertise the service on the LAN, and clients could see it - but your actual app communications will run on a different TCP socket, using whatever protocol is appropriate.
This linked answer may be helpful (although you will want CFNetwork in reverse - pushing from Mac to phone)
[iPhone]: How send output stream via wireless network?
For video you are probably better off looking for higher level frameworks (i.e. the AV ones).
Without knowing the full details of what you want to do, I wonder if rather than pushing data to the iPhone, the best thing would be to send a lightweight notification to the iPhone (AMQP, XMPP, or similar protocol) passing a URL back to the resource on the Mac - that way you could use standard HTTP GET for images, video, etc, on the iPhone side, throw the URL at a webkit view to display - and on your Mac side you could then use an off-the-shelf web server (Apache, or an embedded HTTP server within your code).

can iphone use as a receiver?

Can iphone use as a receiver ? Let's say, there will be one app which can connect with a hardware that can send RDF signal. Is that possible iphone to receive signal without any additional hardware ? Thanks.
It's not possible without any additional hardware.
In order to make peripherals work with iPhone you need to contact Apple and become a registered peripheral developer, the membership that allows manufacturers to use the "Made for iPhone" etc labels.
Once you're a member you can get access to the peripherals SDK which allows you to develop for devices that connect to the iPhone using the 30 pin dock connector.
Without developing a device that receives RDF signal that can connect to the iPhone either using the dock connector or a network connection, there's no other way to make the iPhone receive that signal.
If the RDF hardware is able to communicate using standard UDP or TCP/IP based methods then the iPhone can communicate with it using network communication classes. This could be CFNetwork or higher level classes such as NSURLConnection.

How to integrate iPhone with other non iPhone devices using serial port?

Anybody knows how to integrate iPhone with other non-iPhone devices using serial port?
You can't directly. There may be some sort of serial line (i2c) on the dock connecter, but it is not exposed through the SDK, the Made for iPhone/ExternalAccessory.framework stuff is only for USB and BT.
You could conceivably use a WiFi/serial bridge (such things do exist) since you can send whatever you want over a TCP tunnel, but I doubt that is what you want.
Underlying ExternalAccessoryFramework for 30-pin connector it's the real UART handshaking (using Tx, Rx, Gnd, Vcc and some detect pins and no flow control) but not USB. Those pins of USB are only used for iTunes, Xcode and powering. The iOS app does not need to understand UART and only needs to send/receive bytes through NSOutputStream and NSInputStream.
But you need to pay Apple for MFi(Made For iPhone) Program first and buy some confidential IC to enable your accessory to communicate with iOS. They will require you to propose a product plan and expected sales and consider whether they would accept you as a MFi manufacturer.
You can get the info on using the ExternalAccessory framework from apple's developer portal.
You can't get the required serial handshake(?) info without joining the Made for iPhone program. This requires that you are developing a commercial device.
I have tried to get information on this protocol from apple through my university and have thus far failed.
I successfully received serial communication from the Arduino on the iPhone. I made a google doc explaining my process.
https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC-Dnuc58VIULa81Q/edit