Resolved] Cannot move spark-core to local cloud

I have installed a local cloud server and successfully connect my first core to it.

However, I have problems with my second core, it does not connect to my local cloud server, here the output from “main.js”:

Connection from: 192.168.178.85, connId: 2
1: Core disconnected: get_hello timed out { coreID: '53ff6a065075535151551487', cache_key: '_1' }
Session ended for _1
Connection from: 192.168.178.85, connId: 3
onSocketData called, but no data sent.
1: Core disconnected: socket close false { coreID: '53ff6a065075535151551487', cache_key: '_2' }
Session ended for _2

From this I conclude that the WIFI connection is working, but there may be a problem with the keys.

Now I tried a factory reset, but again cannot get it working (after performing a reset, for a second it shows cyan - then starts blinking green, then blinking yellow, then blinking red, then blinking cyan, …)

What are the correct steps to bring a spark-core in “unknown” condition to a local cloud server? And “what key” has to be “where”?

Do you have a manual which describes step by step the addition of a core to a local cloud, like:

1. factory reset and reconfigure WLAN with android app.
2. ...
3. ...
4. copy keys with ....
5. ...

?

thanks for you help,
michael.

Maybe this helps:

Thanks, Kenneth, step 6 of this instruction does not work with my core/my setup:

spark keys save 53ff6a065075535151551487
running dfu-util -l
FOUND DFU DEVICE 1d50:607f
running dfu-util -d 1d50:607f -a 1 -s 0x00002000:1024 -U 53ff6a065075535151551487
running openssl rsa -in 53ff6a065075535151551487 -inform DER -pubout  -out 53ff6a065075535151551487.pub.pem
Error saving key from core... Error: Command failed: unable to load Private Key
140110099629728:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1319:

I lost the overview about the keys… in the spark directory of my PC (not the server), I now have a bunch of different keys and don’t understand, what key is placed on the CORE and what on the server (192.168.178.84 is the server IP):

$ls
53ff6a065075535151551487
53ff6a065075535151551487_new.der
53ff6a065075535151551487_new.pem
53ff6a065075535151551487_new.pub.pem
default_key.pub192_168_178_84.der
default_key.pub.der
default_key.pub.pem
pre_53ff6a065075535151551487_new.der

Which of these keys need to be in the servers js/core_keys directory ?

thx, michael.

I copied the key

53ff6a065075535151551487_new.pub.pem

as

53ff6a065075535151551487.pub.pem

into the servers …spark-server/js/core_keys directory - however, this does not seem to be the right one.
??
How do I get the key from the core to the server?

Seems like there’s an issue copying out the private key from your core.

can you delete all the keys and retry the command again?

You will need the core_id.pub.pem file in the core_keys directory

I removed all the keys and tried the “spark key save core.der” command again, again the error is

..
Error saving key from core... Error: Command failed: unable to load Private Key
..

?

I tried to create new keys with the “key doctor”, as described here:

http://support.spark.io/hc/en-us/articles/203038434-How-do-I-backup-restore-change-my-Core-s-Key-

But this also does not work, same error

Error saving key to core... Error: Command failed: unable to load Private Key

? What else can I do ?

I solved the issue by storing news keys to the core using dfu-util as described here:

https://community.spark.io/t/troubleshooting-my-core-is-flashing-yellow-red-lights-after-it-connects-to-wifi/627/2

Alright glad you solved it!