I admit it. I’m SERIOUSLY confused about the Product info in the Guide.
Here’s what I’ve built: Photon talks to Particle cloud which talks to our cloud. Device to Particle to SSCloud (our cloud) is via IFTTT soon to be webhook once the problem is figured out with doing a GET webhook with 2 arguments. SSCloud to Particle to device is via Rest call to Particle cloud. Works great. When I get a message from the device, I look up the Dev ID and know “who” it is so there is the notion of an account in our system.
Now it gets complicated for me. Btw, I don’t have the company dashboard set up yet. I’m ready to buy, build and send a few gizmos to testers.
Questions:
-I assume I set up the device in my dashboard before I send it to them?
-If I buy an Internet Button from Particle or a Photon I assume I will have the DevID at point of sale? (I’ll need this to set up an account on our cloud.)
-Our application uses no mobile anything. However, in this case, sounds like the testers will have to download the Particle app and set up an account in order to provision the device for wifi. Does the Particle app also know about claim codes so that when they set up an account it can be associated with our company & product?
-I was super confused on the security topic in the Guide. I assume the company can use my Access Token which is hard coded in our cloud software. Can all field devices use just one Access Token? The documentation hints at an Access Token for every customer. I also don’t understand the oAuth section at all.
-Also does this Access Token expire?
There are probably other questions in there but I don’t know what I don’t know! Thanks for advice and pointers!
You can claim these devices to your own account, so the user won't need to have an account or claim the device (unless you want them to, but you haven't given enough detail of your use-case to be sure).
WiFi can be set up multiple ways, your use case limits or adds possibilities.
Access Token does not expire by default but can be set up to expire or can be revoked.
To answer this you'd need to clarify:
What company?
Depending on use-case (again) one AT for all or one per device/customer is possible, but which fits the bill better can't be said without further input.
Answers also differ for with or without dashboard - what way do you intend to go?
Firstly, we do plan on getting the dashboard (even though it is expensive for a little guy like us!) at least for now. Name of our company is Lifestate and the two products are SelfState “orbs”. The expected / hoped for logistics flow – at least for the testers:
We buy stuff from Particle
The DevID magically appear in our Dashboard PLUS I record the DevIDs and set up accounts in our cloud.
I receive the product from Particle, physically add our stuff to it and don’t do anything with the firmware (?) and ship it to the tester.
The tester has to associate a SSID with the Orb so downloads your app from one of the stores and sets it up for wifi? (The alternative for setting up wifi seems to be to do it via CLI which is a non-starter for our testers.) From their perspective, they don’t think they’ve set up an account they’ve just had to set up the gizmo for wifi.
Once the Orb is connected to Particle cloud, the P cloud recognizes the device and magically downloads the proper firmware image as specified in the dashboard (?).
At that point, the device boots which connects to the Particle cloud which does a webhook to our cloud which talks to the gizmo. And so forth.
Where the doc is and was confusing is all the convo around oAuth, setting up customer accounts, tokens expiring, etc. By the way, the target platform for one of the devices is the Electron and we need zero configuration by the end user. They won’t have a mobile device or wifi. Different story.
I’m not very familiar with the Dashbord for Products which would make some things easier, but you’d better contact Particle direct (as I’m only a community member).
But pulling the Device ID from the device, claiming it and flashing some version of your firmware plus “branding” it with your Product ID might be good to do inhouse before you send the devices out - at least for the testers.
With your initial firmware, you could also tweak the WiFi setup a bit to fit your users needs - and there are ways to do this via SoftAP even without the official Particle App.