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

Error: Unable to obtain claim code #45

Closed
ukd1 opened this issue Jun 20, 2015 · 14 comments
Closed

Error: Unable to obtain claim code #45

ukd1 opened this issue Jun 20, 2015 · 14 comments

Comments

@ukd1
Copy link

ukd1 commented Jun 20, 2015

I get Error: Unable to obtain claim code when trying to claim my photon.

russ$ particle setup
                  _   _      _        _
 _ __   __ _ _ __| |_(_) ___| | ___  (_) ___
| '_ \ / _` | '__| __| |/ __| |/ _ \ | |/ _ \
| |_) | (_| | |  | |_| | (__| |  __/_| | (_) |
| .__/ \__,_|_|   \__|_|\___|_|\___(_)_|\___/
|_|                     https://particle.io/

> Setup is easy! Let's get started...
> It appears as though you are already logged in as [email protected]
? Would you like to log in with a different account? No

! PROTIP: Hold the MODE/SETUP button on your device until it blinks blue!
! PROTIP: Please make sure you are connected to the internet. 

> No devices detected via USB.
? Would you like to scan for nearby Photons in Wi-Fi setup mode? Yes

! PROTIP: Wireless setup of Photons works like a wizard!
! PROTIP: We will automagically change the Wi-Fi network to which your computer is connected.
! PROTIP: You may lose your connection to the internet for a moment.

? Found "Photon-EWVK". Would you like to perform setup on this one now? Yes

! PROTIP: You will need to know the password for your Wi-Fi network (if any) to proceed.
! PROTIP: You can press ctrl + C to quit setup at any time.

> > [Error: Unable to obtain claim code]
! PROTIP: We need an active internet connection to successfully complete setup.
! PROTIP: Are you currently connected to the internet? Please double-check and try again.

I found this, but there is no solution there.

Any ideas?

I'm on a 2012 MBP Retina, running 10.10.3. particle cli version info;

$ npm info particle-cli

{ name: 'particle-cli',
  description: 'Simple Node commandline application for working with your Particle devices and using the Particle Cloud',
  'dist-tags': { latest: '1.5.11' },
  versions: 
   [ '1.5.0',
     '1.5.1',
     '1.5.2',
     '1.5.3',
     '1.5.4',
     '1.5.5',
     '1.5.6',
     '1.5.7',
     '1.5.8',
     '1.5.9',
     '1.5.10',
     '1.5.11' ],
  maintainers: 
   [ 'nexxy <[email protected]>',
     'brycekahle <[email protected]>' ],
  time: 
   { modified: '2015-05-28T20:22:12.441Z',
     created: '2015-05-15T04:30:10.272Z',
     '1.5.0': '2015-05-15T04:30:10.272Z',
     '1.5.1': '2015-05-15T22:24:23.845Z',
     '1.5.2': '2015-05-16T00:42:54.971Z',
     '1.5.3': '2015-05-16T07:31:02.698Z',
     '1.5.4': '2015-05-18T00:32:09.649Z',
     '1.5.5': '2015-05-18T22:14:21.533Z',
     '1.5.6': '2015-05-19T00:59:47.326Z',
     '1.5.7': '2015-05-20T00:14:47.082Z',
     '1.5.8': '2015-05-20T00:23:31.297Z',
     '1.5.9': '2015-05-22T02:19:09.094Z',
     '1.5.10': '2015-05-22T02:25:27.158Z',
     '1.5.11': '2015-05-28T20:22:12.441Z' },
  homepage: 'https://github.com/spark/particle-cli#readme',
  repository: 
   { type: 'git',
     url: 'git+https://github.com/spark/particle-cli.git' },
  contributors: 
   [ 'Kenneth Lim (https://github.com/kennethlimcp)',
     'David Washington (https://github.com/dwcares)',
     'TJ Hunter (https://github.com/Hypnopompia)',
     'Udo Kramer (https://github.com/optikfluffel)',
     'vk2tds (https://github.com/vk2tds)',
     'Emily Rose (https://github.com/emilyrose)',
     'Kyle Marsh (https://github.com/kylemarsh)',
     'Harrison Jones (https://github.com/harrisonhjones)',
     'Bryce Kahle (https://github.com/brycekahle)' ],
  author: 'David Middlecamp',
  bugs: { url: 'https://github.com/spark/particle-cli/issues' },
  readmeFilename: 'README.md',
  license: 'LGPL-3.0',
  version: '1.5.11',
  bin: { particle: './bin/particle.js' },
  main: './app.js',
  engines: { node: '^0.10.0' },
  dependencies: 
   { chalk: '^1.0.0',
     'cli-spinner': '^0.2.1',
     glob: '^4.2.1',
     'hogan.js': '^2.0.0',
     inquirer: '^0.8.2',
     moment: '^2.9.0',
     'node-wifiscanner2': '^1.0.0',
     request: '^2.46.0',
     serialport: '^1.5.0',
     'softap-setup': '^1.1.4',
     when: '^3.7.2',
     xtend: '^4.0.0' },
  preferGlobal: true,
  gitHead: '579715a0f46ea5d17bb3cc3b0a12e929c91ae3be',
  scripts: {},
  dist: 
   { shasum: '769d9f4ac86977f4901a0beb790f833adfa13ecc',
     tarball: 'http://registry.npmjs.org/particle-cli/-/particle-cli-1.5.11.tgz' },
  directories: {} }
@KarbonDallas
Copy link
Contributor

hey @ukd1!

Sorry to hear you're having trouble! Are you by chance already connected to the Photon when executing this command?

EDIT: Connected as in connected to the Photon-EWVK Wi-Fi network?

@ukd1
Copy link
Author

ukd1 commented Jun 22, 2015

@emilyrose thanks! nope - I was connected to my home wifi network :)

@jnm2
Copy link

jnm2 commented Jul 11, 2015

We are having this issue too. Latest spark-server and latest particle-cli. Not sure if this is a server issue or a client issue. Any workarounds?

The particle-cli command line shows exactly what @ukd1 posted (except with Photon-CWYC).

The server terminal window shows:

[Sat, 11 Jul 2015 23:46:12 GMT] "POST /v1/device_claims HTTP/1.1" 404 9 "-" "-"

@ukd1
Copy link
Author

ukd1 commented Jul 13, 2015

@emilyrose this is still happening. I've worked around it by pairing using the iPhone app; but still your tooling appears broken.

I tried over wifi, plus usb.

  Model Name:   MacBook Pro
  Model Identifier: MacBookPro10,1
  Processor Name:   Intel Core i7
  Processor Speed:  2.3 GHz

@dmiddlecamp
Copy link
Contributor

Hi @ukd1,

Are you using the local cloud, or the main Particle cloud?

I've noticed some people mention the local cloud, and as far as I know, the claim_code functionality hasn't been extended to the local cloud yet. You can claim photons using the normal process of particle core add device_id when working locally.

Thanks,
David

@ukd1
Copy link
Author

ukd1 commented Jul 13, 2015

@dmiddlecamp no idea what that is; I was using the web interface; I tried in the downloadable one after this and thats broken too.

For the error reported, I'm just using the CLI tool (this project) and I just typed

particle setup

that's all 👍

@jnm2
Copy link

jnm2 commented Jul 13, 2015

I can see from the code the local cloud has the API /claim_device (source link) set up which looks like an oversight since it does not match /device_claims (source link). If it behaves the same for the public cloud like @ukd1 is saying, it sounds like the issue is on the particle-cli side.

I didn't know about particle core add. Mine's a Photon, so I'll have to see if there's an equivalent for that when I get my hands on it again.

@dmiddlecamp
Copy link
Contributor

core add will still work for a photon, the claim code is just a new way of registering devices meant to simplify claiming for consumer devices, as well as solve some issues when using devices at big conferences / hackathons.

@brycekahle
Copy link
Contributor

@ukd1 I've seen that error when the access token is expired or invalid. Can you try to logout and then login?

@ukd1
Copy link
Author

ukd1 commented Aug 18, 2015

@brycekahle I did that at the time, also I fixed for myself by using the app. I don't really have much time to play, so likely won't be able to help any further now I've worked around it for me...sorry.

@dmiddlecamp
Copy link
Contributor

we saw this recently during the hackathon, I don't have more details, but I think we saw it with a good access token.

@jordanh
Copy link

jordanh commented Sep 19, 2015

Hiya, just ran into this myself this evening with my new Internet Button. Installed node 0.12.7 using nodenv and set it as my global environment. Then fresh npm install -g particle-cli and finally particle setup. My particle module was blinking blue and plugged into my local USB port. Error message was "[Error: Unable to obtain claim code]". I will try provisioning using the iOS app and report back...

@jordanh
Copy link

jordanh commented Sep 19, 2015

I was able to claim the device successfully with the iOS app. @emilyrose let me know if you'd like me to debug it with you, here to help!

@miql
Copy link

miql commented Aug 10, 2016

After logging out, then logging back in, I was successfully able to claim my Photon.

I, originally, logged in earlier today around noon on my work network, then tried to claim my Photon at home, hours later.

Similarly, I encountered:

! PROTIP: There was a network error while connecting to the cloud...
! PROTIP: We need an active internet connection to successfully complete setup.
! PROTIP: Are you currently connected to the internet? Please double-check and try again.

and

{ error: 'invalid_token',
  error_description: 'The access token provided is invalid.' }

A friendly message about invalidation would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants