Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serial command for claim code #602

Closed
kennethlimcp opened this issue Sep 11, 2015 · 13 comments

Comments

@kennethlimcp
Copy link
Contributor

commented Sep 11, 2015

This is related to a discussion about having a photon claimed via Listening mode as a failback from softAP. An update to the CLI is also required once this feature is available

(1) get a claim code from the cloud via CLI,
(2) send the claim code over serial
(3) have the device connect to the cloud

Proposing c as the command to be sent over serial

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2015

I see why you want this, but given that the claim code can already be set via the SoftAP interface, do we need to duplicate this over serial?

With the Photon in listening mode, the cli is able to get the claim code from the cloud and send this to the Photon using the SoftAP interface. The CLI could also use the SoftAP interface to configure WiFi on the photon, which will be more reliable in the long run - the serial interface is intended to be a H2M interface, while the SoftAP TCP/HTTP server is a M2M interface.

@kennethlimcp

This comment has been minimized.

Copy link
Contributor Author

commented Sep 13, 2015

This allows a user to claim the Photon in an event that the mobile app and CLI claiming via softAP fails.

We have see it fail for a handful of users and the workflow of claiming becomes very tedious once the preferred softAP method fails. It becomes something like this:

  • particle serial identify
  • particle serial wifi
  • particle device add deviceID
  • particle device rename deviceID deviceName

Even with all these steps, the Photon did not go through the planned claiming process with claim code.

With the ability to send claim code via serial, we can also verify if the Photon is claimed under another account using the CLI

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2015

Understood. Could you please specify further how the c command would work, in particular how we set the claim code and verify if the photon is claimed?

@kennethlimcp

This comment has been minimized.

Copy link
Contributor Author

commented Sep 13, 2015

I will have to ask ido about that. The mobile app is the only interface that is currently having this feature but i can check if the CLI has the same feature built-in or not via particle setup

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Sep 27, 2015

I clearly wasn't thinking straight with my previous comment. 😊 The softAP API has the ability to set the claim code and determine if a device has been claimed. I envisage this for serial:

c
Device claimed: no
C
Enter 63-digit claim code: 04589.....

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2016

Hey @kennethlimcp! what's the story here - do you still need this?

@kennethlimcp

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2016

It is used when unboxing fails using CLI. That way we can go through the entire process as though softAP method is used without the user having to retrieve the deviceID, claim and rename.

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Jan 29, 2016

Ok, understood. How does the suggested syntax above look?

@towynlin: is it ok to expose the claim code setting via serial?

@kennethlimcp

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2016

Sounds ok as long as there's some way communicate the information back and forth between the device and CLI

@m-mcgowan m-mcgowan added this to the 0.6.x milestone Mar 18, 2016

@monkbroc

This comment has been minimized.

Copy link
Member

commented Apr 6, 2016

I support this. When I connect a Photon to USB and do particle setup I expect to be able to set it up even if my computer doesn't have a WiFi antenna.

@m-mcgowan m-mcgowan referenced this issue Apr 14, 2016
4 of 4 tasks complete
m-mcgowan added a commit that referenced this issue Jun 6, 2016
m-mcgowan added a commit that referenced this issue Jun 6, 2016
Feature/serial claim code (#960)
* adds claim code registration via setup mode.

* adds a space so the label is separated from the input

* adds #602 to changelog

@technobly technobly closed this Aug 9, 2016

@towynlin

This comment has been minimized.

Copy link
Member

commented Aug 9, 2016

Just saw this for the first time, so to close the loop, yes 👍 it's totally fine to allow this over serial. The security requirementfor claiming is that one must have physical access to the device, that is, one must not be able to set the claim code remotely. Thanks much folks!

@mebrunet

This comment has been minimized.

Copy link

commented Feb 20, 2017

Is this confirmed to be working? I seem to be having issues using it. Going through the process the device (P1) behaves as expected and confirms the claim code was set. Replying:

Claim code set to: <claim_code_I_generated_and_passed>

But when it goes online it does not associate itself with the User's account.

I know the claim code I gave it was good. Because after confirming it has failed (e.g. by verifying on the dashboard), I can use the same claim code in a softap process to successfully claim the device.

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

commented Sep 14, 2017

@mebrunet - I can confirm this is working. Did you find a resolution for your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.