p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional iOS Network Programming: Connecting the Enterprise to the iPhone and iPad (http://p2p.wrox.com/forumdisplay.php?f=708)
-   -   Chapter 13 - Bonjour without Wifi network (http://p2p.wrox.com/showthread.php?t=90604)

acsteester July 28th, 2013 02:12 PM

Chapter 13 - Bonjour without Wifi network
 
Hello,

Thank you for the great book. I am undertaking an iOS app that connects to a Wifi (zeroconf) enabled sensor. I expect this connection to take place outside in the wilderness without a Wifi router nearby. My understanding is that this is possible with zeroconf.

I am curious to see that from Chapter 13, the Consumer Help app does not find Associate Help when they are outside of a good Wifi network. Consumer Help is running on my iPhone and Associate Help is running on my iPad. Discovery occurs fine when both devices are setup to communicate with my home's Wifi network. However, if I disconnect either from the home network, the Bonjour discovery does not occur. Discovery also fails when they leave the range of my network as I had traveled to my partners to do a demo. Is this to be expected from this example?

What would I need to configure or code differently to allow them to communicate outside my home's Wifi network?

nathanhjones July 30th, 2013 09:54 AM

Bonjour requires a local network
 
Hey acsteester - I'm glad you're finding the book helpful, hopefully this post does the same.

Bonjour is a great networking technology, unfortunately it requires a local network to function. That network can be your typical wifi network or a Bluetooth personal area network (support added in iOS 3). It sounds like the latter may fit your particular use case.

Unfortunately, as of iOS 5, the policy changed such that apps must explicitly opt in to Bluetooth support. Bluetooth can still be used but Bluetooth control is not supported by the higher-level API (NSNetService and CFNetService) requiring you to drop down to the DNS-SD API to configure it. Tech Note 1753 contains more detail and links to sample code for the DNS-SD API.

If you are only targeting the iOS platform GameKit may be worth exploring. Chapter 12 covers GameKit and discusses it's suitability for use in situations other than just gaming.

acsteester July 30th, 2013 03:25 PM

Thank you for that information nathanjones. I will look further into that.

Since we are building our own wifi sensor. Do you suppose it is possible to build in the ability for the sensor to create a wifi network for the specific purpose of sharing data with the app? Then the iOS user can select the network from their Wifi settings and then run our app. Presumably the iOS device would later pick up this sensors network automatically, anytime it came in proximity.

We are looking at using PcDuino and a WiShield to quick prototype this.


Thank you

nathanhjones July 30th, 2013 10:30 PM

Hey acsteester -

Not being a hardware person I'm really not qualified to answer that question. I guess it could work in theory but the user experience of having to join a random network before interacting with a device may be perceived as a negative barrier.

Based on what it sounds like you need I would recommend exploring Bluetooth LE. It is secure, I believe it includes proximity support, and iOS provides an API.

Good luck!

acsteester July 30th, 2013 11:04 PM

I feel our use case would be within the range allowable by bluetooth, so I will dig into that.

Thanks so much!

nathanhjones July 31st, 2013 08:55 AM

Glad to help and happy to hear Bluetooth may be an option. Good luck!


All times are GMT -4. The time now is 04:11 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.