Quick question to see if someone has a good solution:
I am trying to do a project that requires an iPhone pairing to a SparkCore… Multiple SparkCores can pair to multiple iPhones. (Many to many). However each iPhone has to know the spark device name and the spark device has to be in pairing mode to be added to the iPhone app…
Here’s how it works in a nutshell:
You put the Core in a special mode using a button (Pairing Mode)… When the core is in that mode, you are allowed to add it to your app for quering and controlling some features of my firmware…
-The paring sequence goes like this:
- Put the core in pairing mode.
- Go to the app and type the core name and then press pair in the app.
- You are done!
I am handling this right now with logic in the iPhone… Where the iPhone asks the spark core if its in pairing mode… If it is… It will add it… if it’s not… It will tell the user that the core is not in pairing mode. All iPhones share the same usr/pass spark cloud account of me the developer… (I don’t know if this is a good idea for a small batch deployment [50 or so devices], but I don’t know how else to…)…
Here’s the issue: In my view… this is not safe! Anyone can query the spark device even if it’s not paired. Because only the iPhone app knows its not paired. (When I say anyone, I mean anyone with access to my spark cloud account, which is unlikely… But still it doesn’t sound right)…
Since we don’t have access to the spark core server to add some middleware logic… Does someone have a better idea for me to implement this feature?
Another idea would be for the spark to remember a token from the iPhone app when initially paired… but this will limit (maybe only in theory) the amount of iPhones that can be paired, and it would require writing to the persistent memory. (This is a feasible solution in my view, but maybe there’s another!)
Another way is some custom server (local cloud) implementation of my own… Or maybe a way for my clients to have their own account in spark cloud… Which I don’t want them to go thru the hassle of registering their personal information just for pairing… Specially if they have to go to spark site to do it!..
I want a quick… Press the device pairing mode… Go to the app, type the device name and Boom… it’s paired!.
Any ideas welcomed!