Failed when execute 'spark core remove' in local cloud

Seems spard core remove cannt be used in local cloud? it response me below in cli :

Are you sure? Please Type yes to continue: yes
releasing core 53ff74065075535141251681
server said Not Found

What does spark list say? Did you add your server IP address in spark.config.json?

hi @kennethlimcp,

server list result as below:

Checking with the cloud...
Retrieving cores... (this might take a few seconds)
null (53ff74065075535141251681) is online
Functions:
int digitalread(String args)
int digitalwrite(String args)
int analogread(String args)
int analogwrite(String args)

for the config file,

{
"access_token": "9325ae59aec2e49c403c91b94b2edfc130f3ff7b",
"username": "***@gmail.com",
"apiUrl": "http://192.168.1.100:8080"
}

in the server console it printed:

192.168.1.100 - - [Thu, 28 Aug 2014 12:20:48 GMT] "DELETE /v1/devices/53ff74065075535141251681 HTTP/1.1" 404 9 "-" "-"

Hmm… Can you do spark core add 53ff74065075535141251681 and see what happens?

The cores in the Local :cloud: is not tagged to any account yet and is available for everyone.

Try to add then remove again to see if it works. I will test it later after completing some dev work on the Spark. :wink:

@kennethlimcp Thanks your reply , I just added and then removed ,still the some issue.

B.T.W, I recoved Factory mode, and then It is first White(no flash), and then flash with Green ,and then flash Red when i plugin USB, and looped upon steps. below is logs in server console.

1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_151',
duration: 258.247 }
Session ended for _151
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_152',
duration: 25.01 }
Session ended for _152
Connection from: 192.168.1.106, connId: 154
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_153' }
Core online!
Connection from: 192.168.1.106, connId: 155
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_154' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_153',
duration: 25.004 }
Session ended for _153
Connection from: 192.168.1.106, connId: 156
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_155' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_154',
duration: 25.017 }
Session ended for _154
Connection from: 192.168.1.106, connId: 157
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_156' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_155',
duration: 25.013 }
Session ended for _155
Connection from: 192.168.1.106, connId: 158
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_157' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_156',
duration: 25.008 }
Session ended for _156
Connection from: 192.168.1.106, connId: 159
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_158' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_157',
duration: 25.021 }
Session ended for _157
Connection from: 192.168.1.106, connId: 160
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_159' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_158',
duration: 25.015 }
Session ended for _158
Connection from: 192.168.1.106, connId: 161
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_160' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_159',
duration: 25.003 }
Session ended for _159
Connection from: 192.168.1.106, connId: 162
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_161' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_160',
duration: 25.007 }
Session ended for _160
Connection from: 192.168.1.106, connId: 163
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_162' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_161',
duration: 25 }
Session ended for _161
Connection from: 192.168.1.106, connId: 164
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_163' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_162',
duration: 25.006 }
Session ended for _162
Connection from: 192.168.1.106, connId: 165
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_164' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_163',
duration: 25.015 }
Session ended for _163
Connection from: 192.168.1.106, connId: 166
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.106',
product_id: 0,
firmware_version: 7,
cache_key: '_165' }
Core online!

Are you on the latest spark-server?

Hi , @kennethlimcp , server download last week. Master branch.

You might want to perform a npm update since there is a new version 1-2 days back.

There should not be having so much disconnection. Anyways, will be switching over to my Local :cloud: now to test your issue. :wink:

@dave, the remove core API endpoint has not been added to the spark-server i supposed?

@yuanetking, i think the function is not available for now and you can delete the public keys of the core found in core_keys folder for now.

1 Like

@kennethlimcp, OK, i just test all the api described in document , :slight_smile: .

and , i am not skilled Git, i run the server from Souce , not Node npm, for the latest version , I just update master branch from git will be ok, right ?

you can simply cd to the spark-server folder and perform an npm update.

If you do git clone for the Spark-server, you will need to perform npm install in the js folder. :wink:

1 Like

@kennethlimcp still the same issues, The problem maybe come from firmware side, but not the server side , i suppose. Factory reset will cover the old version of firmware into hardware? So which firmware i should replace into hardware ? CC3000.bin , Tinker.bin, firmware.bin ?

and i checked one thread similar to my issue, Spark local Cloud (Beta) - Collection of issues - Troubleshooting - Particle , can i refer to this ?

Connection from: 192.168.1.107, connId: 1
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_0' }
Core online!
Connection from: 192.168.1.107, connId: 2
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_1' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_0',
duration: 25.009 }
Session ended for _0
Connection from: 192.168.1.107, connId: 3
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_2' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_1',
duration: 25.001 }
Session ended for _1
Connection from: 192.168.1.107, connId: 4
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_3' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_2',
duration: 25.004 }
Session ended for _2
Connection from: 192.168.1.107, connId: 5
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_4' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_3',
duration: 25.005 }
Session ended for _3
Connection from: 192.168.1.107, connId: 6
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_5' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_4',
duration: 25.001 }
Session ended for _4
Connection from: 192.168.1.107, connId: 7
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_6' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_5',
duration: 25 }
Session ended for _5
Connection from: 192.168.1.107, connId: 8
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_7' }
Core online!
1: Core disconnected: socket error Error: read ECONNRESET { coreID: '53ff74065075535141251681',
cache_key: '_6',
duration: 25.009 }
Session ended for _6
Connection from: 192.168.1.107, connId: 9
on ready { coreID: '53ff74065075535141251681',
ip: '192.168.1.107',
product_id: 0,
firmware_version: 7,
cache_key: '_8' }
Core online!

hi @kennethlimcp, i just flash tinker, cc300, and firmware bins by usb,seem hardware is working fine(Cyan led breathing now) , but when i spark list it result me:

Checking with the cloud...
Retrieving cores... (this might take a few seconds)
No cores found.

i have already added core by command 'spark core add core_id'

can you test for the senario ?

spark core add is definitely working for me.

You might want to test for spark list to see the results first. :wink:

Also, if you place your core in DFU mode, you can use spark flash --factory tinker to update the latest tinker firmware for factory reset purpose.

You might be facing some other issues and we have come to a conclusion that spark core remove is currently not available for the Local :cloud:.

Hi @kennethlimcp, seems , x times disconection is resolved, but the CLI or Local Server may have some problem , it is not stable, should be tested more. I just give the command ‘Spark list’ , but it responsed the correct result now .dont known why…

and , the api document should be separated by Cloud and Local Cloud… it will be clear more, i think.

thx
Chris.

Hi all, I am fully aware this is an old thread but – I have the same exact problem trying to remove cores, using the latest Tinker firmware, deep update and local cloud server code from GIT.

I can successfully add cores, and list cores, but when I try to remove them using

spark core remove core_ID

the CLI interface hangs, and the local server log says

192.168.1.100 - - [Wed, 25 Feb 2015 20:03:49 GMT] "DELETE /v1/devices/48ff6a065067555024122387 HTTP/1.1" 404 9 "-" "-"

just as the OP encountered. May I take it then, that this remove core operation still has not made its way into the local cloud code?

Hi, msolters,

no need to use that command, you just remove the file from your local server directory is fine .

Yeah, it seems to suffer from the same bug as local server spark add – it requires a shutdown and restart to take effect.

As my experiences, the add command wihout bug, the only is remove. Add command will copy the pem file into the local cloud dynamic, no need to restart the server ,you can try again.