Well, I thought I had done that, so I went back and started the whole process again. See if you can find the problem:
Log into server and grab the default_key.pub.pem:
scp jason@xxx.xxx.xxx.xxx:/home/jason/spark-server/js/default_key.pub.pem /Users/jason/Documents/localFolder
jason@xxx.xxx.xxx.xxx's password:
default_key.pub.pem 100% 451 0.4KB/s 00:00
Then write that key to the core:
$ spark keys server default_key.pub.pem xxx.xxx.xxx.xxx
Creating DER format file
running openssl rsa -in default_key.pub.pem -pubin -pubout -outform DER -out default_key.pub.der
running dfu-util -l
checking file default_key.pubXXX_XXX_XXX_XXX.der
spawning dfu-util -d 1d50:607f -a 1 -i 0 -s 0x00001000 -D default_key.pubXXX_XXX_XXX_XXX.der
dfu-util 0.7
Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Filter on vendor = 0x1d50 product = 0x607f
Opening DFU capable USB device... ID 1d50:607f
Run-time device DFU version 011a
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=1, name="@SPI Flash : SST25x/0x00000000/512*04Kg"
Claiming USB DFU Interface...
Setting Alternate Setting #1 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
No valid DFU suffix signature
Warning: File has no DFU suffix
DfuSe interface name: "SPI Flash : SST25x"
Downloading to address = 0x00001000, size = 1024
.
File downloaded successfully
Okay! New keys in place, your core will not restart.
Then I ran spark identify
just to be sure I had the correct ID. Then ran spark keys save
$ spark keys save 53ff6b0REDACTED72267
running dfu-util -l
FOUND DFU DEVICE 1d50:607f
running dfu-util -d 1d50:607f -a 1 -s 0x00002000:1024 -U 53ff6bREDACTED72267
running openssl rsa -in 53ff6bREDACTED72267 -inform DER -pubout -out 53ff6bREDACTED72267.pub.pem
Saved!
So, that all looks good . . . went ahead and reset WiFi credentials on the core as they had been overwritten at some point . . . then sent the new token over to the server
$ scp 53ff6bREDACTED72267.pub.pem jason@xxxx.xxx.xxx.xxx:/home/jason/spark-server/js/core_keys
jason@xxx.xxx.xxx.xxx's password:
53ff6bREDACTED72267.pub.pem 100% 272 0.3KB/s 00:00
And that completed successfully . . . started up the spark-server
$ node main.js
RolesController - error loading user at /home/jason/spark-server/js/users/npm-debug.log
connect.multipart() will be removed in connect 3.0
visit Connect 3.0 · senchalabs/connect Wiki · GitHub for alternatives
connect.limit() will be removed in connect 3.0
Starting server, listening on 8080
static class init!
found 53ff6bREDACTED72267 <-- it found it!
Loading server key from default_key.pem
set server key
server public key is: -----BEGIN PUBLIC KEY-----
blah, blah, blah, blah, blah
blah, blah, blah, blah, blah
blah, blah, blah, blah, blah
blah, blah, blah, blah, blah
-----END PUBLIC KEY-----
Your server IP address is: XXX.XXX.XXX.XXX
server started { host: 'localhost', port: 5683 }
Connection from: xxx.xxx.xxx.xxx, connId: 1
on ready { coreID: '53ff6bREDACTED72267',
ip: 'xxx.xxx.xxx.xxx',
product_id: 0,
firmware_version: 7,
cache_key: '_0' }
Core online!
Yea!, it's online, let's go over and check spark list on the local machine . . .
$ spark list
Checking with the cloud...
Retrieving cores... (this might take a few seconds)
No cores found.
So, the core is online and yet cannot be found . . . Heisenberg?