Using curl to reconnect a "stuck" Electron


#1

Hello Community,

I’m trying to run a curl command to force a cloud disconnect from an electron.

I have a device that is not able to accept a firmware flash but currently uploading just fine to Ubidots just fine.

Today is 12-12-18 and while the device has been on continuously, the last handshake is 10-1-18.

I think the 2 month old handshake is the problem,

Particle support suggested using a curl request to force the disconnect.



But that didn’t work and I was curious if others have used this command? Did it work for you?

My first goal is to get the forced disconnect feature working. Then evaluate if it updates the handshake.

Thank you!


#2

I was able to run

curl https://api.particle.io/vi/devices?access_token = <access_token> 

But! i am noticing that this is just devices in my general account. NOT for the devices in my product. The access token I am using I pulled from particle build.

How can I find out the access token for my particle console product?


#3

For product devices:

curl -X PUT https://api.particle.io/v1/product/<product_id>/devices/<device_id>/disconnect?access_token=<product_bearer_token>

#4

For the non-product version, the angle brackets are only for the example, make sure you don’t include them. Make sure all of the letters are lower-case in device ID.

And the access_token must be for the account that claimed the device.

Since in many cases electron product owners claim all of their devices to a single account, you can use either the product or non-product endpoint if you have the appropriate access token.


#5

Thanks Rickkas7,

Thank you for the update,

I’m having trouble understanding where I can find the Product_Bearer_Token.

I was expecting it to be as easy as getting the token from Particle Build.

I tried creating a new “client” in my product, but that didn’t seem to work either.


#6

Instructions for getting a product bearer token are here:


#7

Hi @rickkas7 Thanks for the help with the bearer token.

I think I am now asking correctly for disconnecting the stuck device id.

The error I get is “Timed out.”

Are there additional steps I can try to reset the handshake? I am very very certain the device is powered on right now.


#8

You’re missing the -X PUT. Without it, it’s trying to get a variable, which is timing out because the devices isn’t responding, which is why you’re trying to reset the cloud connection.


#9
{"status":"disconnection initiated"}

Got good tone from the curl entry! (Typo curl -X PUT was fixed above) , but… I’m not seeing any change to the particle console handshake yet. :confused: Will update if it changes over the next few hours.


#10

Just one note: Seeing data arriving at Ubidots does not constitute proof that the device is connected to the cloud. Ubidots does not use the Particle cloud to send data to their servers. That’s done via direct UDP transfer.


#11

It can take up to a ping interval (23 minutes) or until a publish for the /disconnect to take effect.


#12

Ah! Hi @ScruffR I was using the Ubidots data as a way to confirm that it was connected to cellular.


#13

adam,
I read your thread about a stuck electron. I have exactly the same problem and also have the remote electron still reporting to Ubidots. Did you ever get the curl command to un-stick your electron? If not, did you find some other solution?
thanks,
john


#14

Hello @colemanjj

I don’t remember this being resolved.
I’m pretty sure I just replaced the Electron.
Sorry to hear you are in a similar situation! :confused:

Good Luck!