Cannot register Electron; 'backend failure'

When I try to register my new Electron, I get to the 'here’s your free first 3 months cloud setup, so now enroll and activate your SIM."

But when I click on the latter button, I get a popup that reads,

“Error: Our back-end service could not process your request. If this message persists, please contact support.”

I’ve sent in a request to support (which unfortunately doesn’t have a link on that page and got assigned ticket #72827, but I’m wondering if anyone else has seen this before. I’m not finding it in the forums so far.

(Also, my antenna connector is broken, and I don’t know whether to request a new one, or scrounge one from a laptop Wifi chip and solder it onto the antenna. Whee!)

Thanks!

By looking at the HTTP transaction, it appears that my access token isn’t being set. So I’m trying to work atound this using the documentation at https://docs.particle.io/reference/device-cloud/api/ – but it’s not exactly rife with examples.

What are you using to try and claim your electron? Are you using setup.particle.io?

If so, make sure you are logged in to your particle account. Try logging out and back in again.

If you are doing this programmatically, here is sample python code for calling the Particle API:

import json
import requests

device_id = "YOUR_DEVICE_ID_HERE"
api_key = "YOUR_KEY_HERE"
headers = {"Authorization": "Bearer {}".format(api_key)}
url = "https://api.particle.io/v1/devices"
params = {"id": device_id}

response = requests.post(url, data=params, headers=self.headers)
response_json = response.json()

print("Received %s from particle claim.", response.status_code)
print("Response: %s", response_json)
if response.status_code >= 400:
   print("Unable to claim device with err: %s", response_json)
    raise Exception("Unable to claim device: {}".format(response.status_code))

If using a specific token, may be worth checking your token status using the particle cli or generating a new

Edit: Also can you post the entire HTTP transaction you are intercepting?

Yes.

Done; no change, not in Firefox nor in Chrome.

By device_id are you referring to the ICCID?

I'm not a Python coder. Is this Python2 or Python3? Either way,

Blockquote
$ python3 claim.py
Traceback (most recent call last):
File "claim.py", line 10, in
response = requests.post(url, data=params, headers=self.headers)
NameError: name 'self' is not defined

Changing the self.headers to simply headers changes this to

Blockquote
$ python2 claim.py
('Received %s from particle claim.', 404)
('Response: %s', {u'errors': [u'device not found'], u'ok': False})
('Unable to claim device with err: %s', {u'errors': [u'device not found'], u'ok': False})
Traceback (most recent call last):
File "claim.py", line 17, in
raise Exception("Unable to claim device: {}".format(response.status_code))
Exception: Unable to claim device: 404

Good on you for giving the python a shot even though it’s not your normal thing! It’s python3, and you correctly fixed that error (I was transferring it from a project and missed that deletion)

So the “device_id” is actually the Particle device ID which is different from the ICCID. You can get the device ID by putting the device into serial mode (hold down MODE button for 10 seconds) and then using the particle cli by typing particle serial identify.

Since you’ve already got the python code running, you can try it with the correct device_id and see what the new error is (if any).

Alternatively you can actually do this directly with the particle CLI once you have the id. See CLI Docs Here - particle device add {device_id}. I would use python though since it may give you the most specific error message :slight_smile:

When I hook the electron up to my Linux USB, I get this:

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

Setup is easy! Let's get started...
It appears as though you are already logged in as XXXXXXXXXXXXXXXX
? Would you like to use this account? Yes

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

I have detected a Electron connected via USB.
? Would you like to continue with this one? Yes

! Electron(s) cannot be setup via the CLI.

! We need to collect billing information, which we cannot do securely via the command line.
! Please visit https://setup.particle.io to setup your Electron.

And then we’re back where we started.

So I trued creating a new token:

]$ particle token list
Checking with the cloud...
? Using account Ken.Coar+Particle@GMail.Com
Please enter your password: [hidden]
error listing tokens:  [object Object]
Error while listing tokens: Server error

$ particle token create
? Using account Ken.Coar+Particle@GMail.Com
Please enter your password: [hidden]
New access token expires on Sun Apr 14 2019 11:45:13 GMT-0400 (EDT)
    XXXXXXXXX

$ particle token list
Checking with the cloud...
? Using account Ken.Coar+Particle@GMail.Com
Please enter your password: [hidden]
error listing tokens:  [object Object]
Error while listing tokens: Server error

I tried getting the serial ID, and updated claim.py with it and my new token, then running it:

$ python claim.py 
('Received %s from particle claim.', 404)
('Response: %s', {u'errors': [u'Device is not connected'], u'ok': False})
('Unable to claim device with err: %s', {u'errors': [u'Device is not connected'], u'ok': False})
Traceback (most recent call last):
  File "claim.py", line 18, in <module>
    raise Exception("Unable to claim device: {}".format(response.status_code))
Exception: Unable to claim device: 404

I’ve reworked the Python claim code a bit to:

import json
import requests

device_id = "XXX"

api_key = "XXX"
headers = {"Authorization": "Bearer {}".format(api_key)}
url = "https://api.particle.io/v1/devices"
params = {"id": device_id}

response = requests.post(url, data=params, headers=headers)
response_json = response.json()

print("Received %03i from particle claim." % response.status_code)
print("Response: '%s'" % response_json)
if response.status_code >= 400:
   print("Unable to claim device with err: \'%s'" % response_json)
   raise Exception("Unable to claim device: {}".format(response.status_code))

and now I get this:

$ python claim.py 
Received 404 from particle claim.
Response: '{u'errors': [u'Device is not connected'], u'ok': False}'
Unable to claim device with err: '{u'errors': [u'Device is not connected'], u'ok': False}'
Traceback (most recent call last):
  File "claim.py", line 18, in <module>
    raise Exception("Unable to claim device: {}".format(response.status_code))
Exception: Unable to claim device: 404

Also, since the supplied antenna connector was damaged and unusable, I cadged onw from a laptop Wifi card, trimmed it to the same length, and soldered it to the Particle antenna.

I won this Electron in a raffle at the All Things Open conference in Raleigh in October. I was excited to start, but the bloom is starting to come off the rose here…

Ok, this is helpful. So the way registering devices work is that they have to be connected to the particle cloud at the moment you try to claim them. You will know if the device is connected to the particle cloud if the RGB led (not the rapidly flashing red one for the modem) is breathing CYAN. If it is flashing GREEN it means it is trying to connect to the cellular network, breathing GREEN means it is successfully connected to the cellular network.

WiFi operates on a different signal band than Cellular 2g/3g/LTE. WiFi antennas are optimized for 2400MHZ and 5000MHZ. 2g/3g/LTE are optimized for 600-900MHZ and 1300-2300MHZ (broadly). Even though the connector is the same they are not compatible.

Assuming you have the Electron plugged in while trying this and that it is continuing to flash green, the problem is almost certainly your antenna. The Taoglas antennas provided is one of the best on the market for this application. You should order a new one, whether from Particle or a third party.

Does that make sense?

1 Like

It makes perfect sense – except that I unsoldered the Taoglas antenna from the samaged antenna lead, and replaced the lead with one I cadged from a Wifi card. So the antenna is still Taoglas, but the lead is from a Wifi card.
When I plug in the Electron, I get a fast red and a slooow cyan, then a solid red, then a fast blue.
Running the claim code repeatedly throughout the colour changes does nothing. And the Web side plan setup still gritches about back-end failures.

If it’s any help, I am having the exact same problem with my SIM. I’ve also sent a request to support today.

My Electron is blinking fast red and fast green at the moment.

@THX-1138 ahh, gotcha.

the “slooow cyan” is the correct state, commonly referred to as “breathing cyan” by the documentation.

Yeah, as per @DavidB I think at this point you should send a request to support. Tell them that your electron can’t be claimed even when breathing cyan and also link them to this post. There may be something wrong outside your control and they can help you out!

It doesn’t breathe very long… 15s then it needs life-support, I guess.

Re-notified support with a link to this thread. So far it’s not the
happy-happy joy-joy experience I was anticipating… :frowning:

Oh that’s interesting. Are you using the particle-supplied SIM card? Have you flashed any firmware or is this with tinker? Normally it should be sustain that state for a very long time.

I am using everything out-of-the-(sealed)-box I received from the raffle. Perhaps they raffled off some factory seconds. They had a Proton and an Electron. I haven’t done anthing except follow the directions on setup.particle.io and the stuff in this thread.
It’s a good thing I wear a loupe, because otherwise I wouldn’t be able to ready the bloody ICCID without a microscope.
Is there a ‘factory reset’ on this thing? Like press the ‘reset’ button for 35 minutes whilst waving a rubber chicken at the cardinal points and standing on one leg?

You don’t suppose this is getting silently b0rked because I’m using a + in my eddress, do you? <username>+Particle@GMail.Com. Because this seems really weird:

$ particle token list
Checking with the cloud...
? Using account username+Particle@GMail.Com
Please enter your password: [hidden]
error listing tokens:  [object Object]
Error while listing tokens: Server error

Huh, I suppose it is possible! Wouldn’t explain the issues with the python call, since that should be independent of the email address.

FWIW I never read the ICCID directly, always scrape it with particle identify in serial mode.

So you can flash firmware to the device, update system firmware, the whole 9 yards without having claimed the device. Can all be done over serial with DFU mode using the particle cli.

however, if your device is getting to the breathing cyan and then resetting after 15 seconds that is suspect. Why don’t you try doing the following:

  1. Put the electron into DFU mode (While holding down the MODE button, tap the RESET button and wait ~5 seconds for the LED to turn from magenta to flashing yellow)
  2. Using the particle cli, type: particle update and let the device’s system firmware get updated for about a minute.
  3. Put the electron into DFU mode again.
  4. Using the particle cli, type: particle flash --usb tinker

See if the device will maintain connection / cyan after that. Or just wait for support to get back to you, though they may have you do something similar.

Meh.

I don't see that as an option. None of serial list, identify, mac, or inspect seem to include the ICCID in their output. And mac gived me all zeros for the MACA.
[/quote]

So far so good.

Got some babble about needing to update UDEV rules; told it to go ahead. Then

$ particle update
You are missing the permissions to use DFU without root.
? Would you like to install a UDEV rules file to get access? Yes
sudo cp '/home/coar/.particle/node_modules/particle-cli/dist/lib/../../assets/50-particle.rules' '/etc/udev/rules.d/'
UDEV rules for DFU installed.
Physically unplug and reconnect the Particle device.
Then run the particle command again.
!!! There was an error trying execute DFU utilities.

!!! For help with installing DFU Utilities, please see:
 https://docs.particle.io/guide/tools-and-features/cli/#advanced-install

!!! You may also find our community forums helpful:
 https://community.particle.io/ 

> Error code: unknown 
$ particle update
Physically unplug and reconnect the Particle device and try again.
!!! There was an error trying execute DFU utilities.

!!! For help with installing DFU Utilities, please see:
 https://docs.particle.io/guide/tools-and-features/cli/#advanced-install

!!! You may also find our community forums helpful:
 https://community.particle.io/ 

> Error code: unknown 

and


$ particle identify
Serial err: Error: Error: Device or resource busy, cannot open /dev/ttyACM0
Serial problems, please reconnect the device.
Serial problems, please reconnect the device.

So I can't seem to get to the last oart of your instructions:

Worse and worse. Since it’s frobbing devices, it would seem to want to be root. So:

# bash ./install-cli 
Installing the Particle CLI to /root/bin/particle
particle: Installing plugins (retrying)...
 ▸    Error reading plugin: particle-cli
 ▸    exit status 1
 ▸    module.js:327
 ▸        throw err;
 ▸        ^
 ▸    
 ▸    Error: Cannot find module 'particle-cli/package.json'
 ▸        at Function.Module._resolveFilename (module.js:325:15)
 ▸        at Function.Module._load (module.js:276:25)
 ▸        at Module.require (module.js:353:17)
 ▸        at require (internal/module.js:12:17)
 ▸        at [eval]:3:15
 ▸        at Object.exports.runInThisContext (vm.js:54:17)
 ▸        at Object.<anonymous> ([eval]-wrapper:6:22)
 ▸        at Module._compile (module.js:397:26)
 ▸        at node.js:611:27
 ▸        at nextTickCallbackWith0Args (node.js:452:9)
Get started by running "particle login"
If that doesn't work, open a new terminal and make sure /root/bin is in your shell path.
If you previously installed the CLI with npm, run "npm uninstall -g particle-cli"
[root@iodine tmp]# particle login
particle: Installing plugins (retrying)...
 ▸    Error reading plugin: particle-cli
 ▸    exit status 1
 ▸    module.js:327
 ▸        throw err;
 ▸        ^
 ▸    
 ▸    Error: Cannot find module 'particle-cli/package.json'
 ▸        at Function.Module._resolveFilename (module.js:325:15)
 ▸        at Function.Module._load (module.js:276:25)
 ▸        at Module.require (module.js:353:17)
 ▸        at require (internal/module.js:12:17)
 ▸        at [eval]:3:15
 ▸        at Object.exports.runInThisContext (vm.js:54:17)
 ▸        at Object.<anonymous> ([eval]-wrapper:6:22)
 ▸        at Module._compile (module.js:397:26)
 ▸        at node.js:611:27
 ▸        at nextTickCallbackWith0Args (node.js:452:9)

What the flying moose ears is going one here???