[Solved]-Resetting previous claimed device using Windows machine


#1

I got my device a few days ago and configured it and all was working with tinker until today I turn it on and it was blinking cyan fast with 3 red flashes in between. Tried to unclaim device to start over but then ran into other problems. Tried looking at the troubleshooting info for windows users and the instructions seemed very incomplete for resetting key for a previously claimed device (like where to get the public key file and that I needed to get openssl executable on my windows machine, and the instructions left out that I need to put device ID on the send command). OK anyway, I got all the steps to work except when I did this last command:
particle.exe keys send xxxx:xxxx photon.pub.pem.
I get:
attempting to add a new public key for device xxxx:xxxx (Im not sure if it is OK to use my real device id so i x-ed it out)
Error sending public key to server: Permission Denied

I have read several of the posting but I am not seeing the solution.
What am I missing??


#2

First, unclaiming a device is not doing anything useful when you yourself want the device to stay yours.

And I’m not completely sure you actually needed to go all the “complicated” keys procedure.

Have you tried this before anything else?

particle keys doctor <yourDeviceID>
particle keys server

If not, I’m not sure if this can still repair everything, but I’s worth a try.


#3

Thanks for the rely,
I have no idea what I am doing here. I’m just following information that I have come across with no idea what it is doing. I am hoping someone can help me be back to a clean state.

I ran the first command you suggested using the force flag because I got an error the first time saying a file existed. I get an error sending the public key to the server. See notes below as well.

C:\Users\Jimmy\AppData\Local\particle\bin>particle.exe keys doctor 2b04:d006 --force


Warning! - device id was shorter than 24 characters - did you use something other than an id?
use particle identify to find your device id


Found DFU device 2b04:d006
Found DFU device 2b04:d006
New Key Created!
Found DFU device 2b04:d006
Found DFU device 2b04:d006
Saved!
checking file 2b04:d006_rsa_new.der
spawning dfu-util -d 2b04:d006 -a 1 -i 0 -s 34:leave -D 2b04:d006_rsa_new.der
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device…
ID 2b04:d006
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #1 …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "DCT Flash "
Downloading to address = 0x00000022, size = 610
Download [=========================] 100% 610 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Saved!
attempting to add a new public key for device 2b04:d006
Error sending public key to server: Permission Denied
Make sure your device is in DFU mode (blinking yellow), and that your computer is online.
Error - undefined

Not sure if I am using the right ID.
I tried using particle identify command with the device in DFU mode and got:

C:\Users\Jimmy\AppData\Local\particle\bin>particle.exe identify

! serial: No devices available via serial

Since this first command failed I assumed that the second command you listed would not help so I did not run that one.

Thanks again, Jimmy


#4

The device ID is the long hex number that you’d see in your Web IDE when you select your device (if you hadn’t unclaimed it), the 2b04:d006 is the USB vendor ID and product ID, that’s not what you want there and --force doesn’t go there either.
Hence you got the message

Warning! - device id was shorter than 24 characters - did you use something other than an id?   use particle identify to find your device id

And since that’s not a valid device ID you won’t get a valid key nor will that key be permitted in the cloud.

In order to obtain the device ID via particle identify (mark the non-existent .exe?), you need to put your device into listening mode (blinking blue) by pressing SETUP for 3+ seconds first.


#5

Solved – I got it sorted out tonight doing the following:
I put in all the links I used but looks like I am only allowed to post up to 4 links as a new user.

went to photon troubleshooting
http://blog.jongallant.com/2015/08/particle-photon-setup-windows-putty.html

using windows and putty to connect to photon over usb serial connection
Download the putty executable from the INTERNET.
plug the photon into usb cable and into the usb port of the computer
Put photon in listening mode by pressing setup button (next to RX TX pins) for 4 seconds ( till it blinks blue. )
Open device manager for Windows. (one way on Windows 7 - click windows start button and - Type devmgmt.msc in the search or run box)
Under Action menu at the top of the device manager window select "Scan for hardware changes"
Look for photon device in device manager. (mine shows up under Ports (COM & LPT) as Poton (COM6))
Need to load the windows usb drivers for the photon device.
Install the Driver for photon (look for driver download on partical.io website as I could not put link here)
Unzip the Partical.zip files where you can find them (like in the download folder)
Right click the Photon item in the Device Manager window and select “update software dirver”. Select to browse to the folder with the unzipped photon drivers in it and click next to update the drivers.
Open putty executable
Select the serial radial button
type in under serial line the name of the com port you saw in device manager (for me it is COM6)
click the open button (You will get a blank black terminal window which was confussing at first)
press the letter i on your keyboard and you should get back the device id number that looks like this:
Your device id is 27002b000851355531349411 (your number will be different of course)

w (to setup wireless)
ssid: WirelessNetworkName (is the name of your network )
Security 0=unsecured, 1=WEP, 2=WPA, 3=WPA2: 2 (lookup what version of security you are running on your wireless network router to be sure of what you have)
Password: MyWifiPasswordHere
Thanks! Wait while I save those credentials…

Awesome. Now we’ll connect!

If you see a pulsing cyan light, your device
has connected to the Cloud and is ready to go!

If your LED flashes red or you encounter any other problems,
visit particle.io/support to debug.

Particle <3 you!

Trying to connect to the cloud fails and the device flashes several cyan and then red. This is my ongoing problem

If your LED flashes red or you encounter any other problems,
visit particalDOTio/support to debug. (can you figure out the real link?)

So it is in my case that I am having problems.
I go to particleDOTio/support

for this light pattern the support pages say to reset the public key
To do this I will do the following:

go to https://docs.particle.io/guide/tools-and-features/cli/photon/ Info is on this page
Get the particle CLI (command line interface) tool
I have windows so for me this is what I get:
See the link on this page to download the windows install file.
This is suppose to install node.js, partical-cli, and dfu-util
ParticleCLISetup will created a folder under my user name C:\Users\Jimmy\AppData\Local\particle\bin>

under advanced install it says to use key features I also need to get openssl.
I downloaded openssl already complied executable files for win32 in zip file from https://indy.fulgan.com/SSL/ and put the unzipped files into my folder C:\Users\Jimmy\AppData\Local\particle\bin>
I already have python installed and I don’t think I need visual Studio since i think that was needed for the un-compiled install of openssl.
So If you don’t have it I guess you need to install some version of python 2 (not version 3 or above)

The link below is suppose to have full details on windows install.


I installed nodejs using the link in the instructions to directory C:\Program Files\nodejs (default directory)
use the link on the tutorial page since I can’t listed it here.

ran the following command from the command line to install nodejs particle-cli package
C:\Program Files\nodejs>npm install -g particle-cli
C:\Program Files\nodejs>npm update -g particle-cli (to update if needed to latest version)

I tried running login and it worked.
C:\Users\Jimmy\AppData\Local\particle\bin>particle login
? Please enter your email address MyEmailAddress@gmail.com
? Please enter your password ********

Successfully completed login!

Tried listing devices and that worked:
C:\Users\Jimmy\AppData\Local\particle\bin>particle list
remote_play [1e0029000b47353335703438] (Photon) is offline (This is my other Photon that is already working)

Ran the keys doctor tool suggested by ScruffR above and now it works!
C:\Users\Jimmy\AppData\Local\particle\bin>particle keys doctor 27002b000851355531349411
Found DFU device 2b04:d006
Found DFU device 2b04:d006
New Key Created!
Found DFU device 2b04:d006
Found DFU device 2b04:d006
Saved!
checking file 27002b000851355531349411_rsa_new.der
spawning dfu-util -d 2b04:d006 -a 1 -i 0 -s 34:leave -D 27002b000851355531349411_rsa_new.der
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device…
ID 2b04:d006
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #1 …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "DCT Flash "
Downloading to address = 0x00000022, size = 610
Download [=========================] 100% 610 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Saved!
attempting to add a new public key for device 27002b000851355531349411
submitting public key succeeded!
Okay! New keys in place, your device should restart.

Guess What! I was able to claim my device and it is breathing beautiful cyan right now.
Tinker is working and all is well in the world.
Thanks for the help.


#6

Glad you were able to get it reclaimed! Thanks for the help @ScruffR