# Photon fails cloud connect

**URL:** <https://community.particle.io/t/photon-fails-cloud-connect/41676>\
**Category:** Troubleshooting\
**Created:** [May 5, 2018, 11:31pm UTC](https://community.particle.io/t/photon-fails-cloud-connect/41676 "2018-05-05T23:31:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![norstar](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/norstar/32/22991_2.png) [@norstar](https://community.particle.io/u/norstar)\
**Post date:** [May 5, 2018, 11:31pm UTC](https://community.particle.io/t/photon-fails-cloud-connect/41676/1 "2018-05-05T23:31:31Z")

</div>

I have several Photons and all are working as expected on this network/router less one. This Photon was working fine September 2017 and then sat unused until yesterday. When I powered it up yesterday it failed to connect and was fast blinking cyan with intermittent red flash. I assume I have a corrupt key but have had no luck resolving that. Feedback welcomed.

**I tested the following;**  
uninstalled CLI reinstalled new (win7 installer)  
Particle update, success, still flashing cyan/intermittent red.  
Particle doctor [failed at very end with “New key created! The Doctor didn’t complete successfully. undefined”].  
Firmware 0.7.0, firmware flashed from CLI (part 1 & part 2), success, still did not connect to cloud.  
reflashed bootloader-0.7.0-photon

**flashed clouddebug.bin from rickkas7;**  
Opening serial monitor for com port: "COM17"  
Serial monitor opened successfully:  
configured credentials:  
ssid=Pupcreek security=wpa2 cipher=1  
available access points:  
SSID=Pupcreek\_r security=wpa2 channel=5 rssi=-65  
SSID=Pupcreek security=wpa2 channel=5 rssi=-57  
connecting to WiFi  
connected to WiFi!  
localIP=192.168.1.20  
subnetMask=255.255.255.0  
gatewayIP=192.168.1.1  
dnsServerIP=0.0.0.0 (often 0.0.0.0)  
dhcpServerIP=0.0.0.0 (often 0.0.0.0)  
ping gateway=1  
ping addr 8.8.8.8=1  
device.spark.io=34.207.234.253  
connected to device server CoAP (testing connection only)  
connecting to cloud  
hung at this point

particle keys server, OK new keys in place.  
particle keys doctor [my device ID]  
New Key Created!  
Make sure your device is in DFU mode (blinking yellow), and that your computer i  
s online.  
Error: Error writing key to device… Error saving key from device… Unable to  
generate public key from the key downloaded from the device. This usually means  
you had a corrupt key on the device. Error: Command failed: C:\Windows\system32  
cmd.exe /s /c "openssl rsa -in backup\_rsa\_[my device]_rsa\_new.der -  
inform DER -pubout -out backup\_rsa_[my device]\_rsa\_new.pub.pem"  
unable to load Private Key  
8520:error:0D0680A8:asn1 encoding routines:asn1\_check\_tlen:wrong tag:crypto\asn1  
\tasn\_dec.c:1112:  
8520:error:0D06C03A:asn1 encoding routines:asn1\_d2i\_ex\_primitive:nested asn1 err  
or:crypto\asn1\tasn\_dec.c:676:  
8520:error:0D08303A:asn1 encoding routines:asn1\_template\_noexp\_d2i:nested asn1 e  
rror:crypto\asn1\tasn\_dec.c:609:Field=version, Type=RSA  
8520:error:04093004:rsa routines:old\_rsa\_priv\_decode:RSA lib:crypto\rsa\rsa\_amet  
h.c:72:  
8520:error:0D0680A8:asn1 encoding routines:asn1\_check\_tlen:wrong tag:crypto\asn1  
\tasn\_dec.c:1112:  
8520:error:0D06C03A:asn1 encoding routines:asn1\_d2i\_ex\_primitive:nested asn1 err  
or:crypto\asn1\tasn\_dec.c:676:  
8520:error:0D08303A:asn1 encoding routines:asn1\_template\_noexp\_d2i:nested asn1 e  
rror:crypto\asn1\tasn\_dec.c:609:Field=version, Type=PKCS8\_PRIV\_KEY\_INFO

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [May 5, 2018, 11:36pm UTC](https://community.particle.io/t/photon-fails-cloud-connect/41676/2 "2018-05-05T23:36:34Z")

</div>

Try running `particle doctor` from a non-system directory.  
Maybe it’s a permission problem to generate the key file inside `C:\Windows\system32`

You can also try to send the keys “manually” this way

```nohighlight
particel keys server
particle keys doctor <enterYourDeviceID>

```

---

<div class="post-metadata">

**Author:** ![norstar](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/norstar/32/22991_2.png) [@norstar](https://community.particle.io/u/norstar)\
**Post date:** [May 5, 2018, 11:49pm UTC](https://community.particle.io/t/photon-fails-cloud-connect/41676/3 "2018-05-05T23:49:12Z")

</div>

Thank you for the prompt response. I tested a non-system dir for particle doctor, failed as before. Also tested particle key server and doctor same, **Error: Error writing key to device… Error saving key from device.**
