Setup WiFi on Photon without using iOS Setup Library

Dear All,

Just received my Photons :smiley:
I have been waiting for them in order to be able to setup my production device using the SoftAP. I will be having apps for iOS, Android and WP8,1/10 using xamrian c#. What’s the best way to setup the device? Also, I would like to get your ideas on what’s the best way to handle

  1. The Setup
  2. Claiming the Photon
  3. Handling Access tokens
  4. Mapping each customer product to their respective Photon

Thank you

Drop an email to sales@particle.io.

Gonna ping @danjamieson here to follow up with you :smile:

1 Like

I’m also interested in this.

I think the beauty of Soft AP means even a javascript library could be used in an HTML5 web app, for cross platform compatibility.

I am also interested in this - can we not open this up, rather than an email to sales?

I am particularly interested in changing the current mobile flow so it can use a claimed device - I want all the devices to belong to my company and customers simply map themselves to a device (my code will manage this) and setup wifi (using the particle code). I need this for both Android and iOS.

I am also hearing that perhaps a web based solution is on the horizon - any definite dates before I start the expensive task of getting mobile apps involved (simply to setup the wifi connection)?

@ido are you the mobile rep for Particle? If so, as mentioned, I have have the following queries.

  1. I plan to claim all the devices, the send out to customers. I need a mobile flow that allows an existing claimed device to be setup on Wifi. I can provide e.g. device ID via a call to my application server.

  2. Are there dates for the delivery of a web based approach to the above?

1 Like

Hi Kevin,

  1. I am working on a solution (major change in Device Setup library) so the authentication process and the setup process will be separate so the app creator can choose when to run each part - that way the uses can choose to skip login/signup and then still set up the device successfully without changing its ownership (just connecting it to Wifi). Then I’ll make the official Particle Tinker app embrace this change and post a new version of the app.

  2. ping @nexxy

3 Likes

hey @ido, @Kevin,

I don’t have any dates on delivery for something web-based, but I could point you in the direction of:

https://cordova.apache.org/

ionic recently hit 1.0, which makes it a much more attractive candidate for a ‘hybrid’ approach to web/mobile development of your app. I’m hoping to get the chance to work up a proof-of-concept using cordova + ionic, so if this would be helpful to you, let me know!

1 Like

OK. this is great news. But just to confirm - the current setup process does not allow an owner (me) to set up and test a particle, and then send this to a customer to set up on their wifi?

@Kevin,

That is currently the case with the mobile SDK. I know that @ido is working hard on making that possible, though!

1 Like

Basically if the customer has his own Particle login - he can setup the device on his wifi without changing ownership. If he does not have a username - he can signup easily and then setup the device.

I am working on a solution where the customer can actually skip the authentication step. Will be ready soon (end of our current sprint in 2 weeks).

Hi @ido

Did I just read in the Sprint notes that this is now available?

@Kevin, the answer is yes, it works now.

I was just experimenting with the claiming process and fell upon the discovery that one does not have to be the owner of the device to set up the WiFi, THEN I read @ido’s comment above…

In short, as @ido has said, put the Photon into listening mode, run the Particle App, create a new Particle account, then connect to the PHOTON xxxx SoftAP access point, then select “Change Owner” on the “Change Owner?” message box, even though you know you that it will not work.

The app will then move onto the “Select your Wi-Fi network” screen, fill in the blanks and let it go through the connecting process.

It will fail at the last step, “Verifying product ownership”, and then finally display the “Oops!” page. But no matter, the end result after resetting the device is that it should now connect to your selected WiFi even though you are not the owner of the Photon.

How good is that?!

Actually, that does work. Pressing that will transfer ownership to the account your're trying to set it up with. Just tested that.

OK, thats great. But not a great user experience for customers! I would need to explain that the process will seem broke, but actually works. So what we really need is the solution where an claimed device can be (re) set with Wifi.

To set the device into listening mode - I presume you can set the RST low for 3 seconds?

A solution like that is in the works, whereby the device can be reconfigured for wifi without having to have a Particle account.

Well, close, but try the SETUP button instead :wink:

@Moors, I should have been more specific. In my case I did not want the ownership to change hands and therefore had not removed the claim on the device.

In other words, device is claimed by “A” (say the manufacturer), but the device is in the customer’s hands, “B”. “B” can set up the WiFi without owning the device. All good!

Actually, with the Photon, ownership will be transfered automatically, regardless of who currently owns it. Physical ownership = virtual ownership.
The photon I tested it with was claimed to my “main” account, but now belongs to my test account, after I pressed the “transfer ownership” button, without confirming that from my main account (the original owner). @zachary once explained this in great detail, he should know more about it, should you be interested.

Hi Kevin

Yes, this feature is now available - I completed it last night for iOS. Android is still pending (next 2 weeks).
Read here:


and here:

Still need to push new SparkSetup pod v0.3.0 to cocoapods (it is currently only on our github repo, but feel free to clone/pull and use it).

Feedback welcome

Now that is surprising and unexpected, and sounds like out of spec…!

Wonder why my transfer did not work?

Yes, am very interested I will look up @zachary’s posts to find this mention, or if you have the link, that would be appreciated.

TL;DR

  1. Ownership transfer on the Photon is fluid. Physical ownership is virtual ownership. This solves one of the most common issues experienced on the Core.
  2. End user ownership is completely separate from a product manufacturer’s ability to control her devices in the field.

Longer Explanation

If you’ve ever been at a hackathon where a hundred Cores were set up via the mobile app using TI’s Smart Config and everyone claimed the wrong Core or one person claimed all the Cores, then you understand the problem we needed to solve.

In those cases, there is no way to be able to control a Core you are holding in your hand and are the rightful owner of. The only recourse is to find the person who owns it, and ask her to unclaim it so you can claim it. Eventually we automated this process in Particle Build to reduce the burden on our support team and allow users to take care of the issue quickly themselves.

With the Photon’s soft AP setup process, only one Photon can be claimed at a time so no one can take over a whole roomful of devices in an instant.

More importantly, if you have a Photon in your possession, and it is claimed by someone else, you just need to perform setup to claim the device. If you are borrowing the device from a friend, you can claim it from your friend, and then when you give it back, the friend can simply claim it again.

It is important to know that building a product on the Particle platform requires additional steps that one does not normally take when prototyping with Photons. Products identify themselves to the cloud, and the team members that belong to the organization that created the product always have the ability to control the devices regardless of which end user has claimed each one. Product management for organizations is completely separate from claiming.

These product management capabilities are exposed in the organization dashboard that is in private beta right now.

Photon Claiming Flow

As part of the soft AP setup process (technical docs), in addition to sending Wi-Fi credentials, we transfer something called a “claim code”. At a high level the process looks like this:

  1. Mobile app (with user access token) gets a claim code from the cloud
  2. Mobile app gives Photon (both offline) the claim code
  3. When Photon connects to cloud it publishes the claim code, which the device service uses to make the association between the Photon and the user.

Another important thing to know—the cloud is the source of truth for ownership. Sometimes I notice people implying that the device knows who its owner is—it does not. We control access through the cloud.

And one last important thing to remember about soft AP setup—both the mobile app and the Photon are offline during soft AP and can not know for certain the current status of ownership.

@jeiden just came up with this great diagram today — we’ll be incorporating this or some revision of it into some product creator documentation soon, but he suggested it could be helpful here. :+1: It describes one specific way (out of many) that product creators can manage customer authentication. It’s not the whole story, but it’s helpful info in this conversation.

3 Likes