Spark Core Flashes Green then red [Local cloud]

I tried to connect my core to a Local cloud using a Raspberry Pi and it worked fine for a short while then I unplugged it and came back to it in the morning. It then failed to connect and ever since I have had trouble getting it to connect to anything.

It has been factory reset, Loaded new firmware via DFU etc etc and now all I get is flashing Green then 3 red flashes and repeats.

I have looked and looked on forums and IRC etc etc and nothing so wondered if you have any ideas.

Thanks

Cliff.

To help explain the way the LED is flashing I decided that a picture or in this case a video is better than 1000 words so look here to see my core… Again I am desperate for a fix or to know if the core is dustbin material…

Thanks

Ok Fixed it so if your looking at this with the same fault here is what to do…

1.  Download the public cloud key from here:  https://s3.amazonaws.com/spark-website/cloud_public.der
2.  Then Connect to the core in DFU mode (Hold Mode button tap the reset and wait until the light turns yellow!)
3.  Use the following command to send the Public Key to the core:  Spark keys server could_public.der
4.  SIt back and smile... It should now connect to the web and the server...

Hope this helped…

Cliff.

What you did reverts the core to point at the Spark :cloud:

Not sure how that solves the issue for your local :cloud: connection?

@kennethlimcp The issue I had was that it would not connect to anything I had spent a lot of time today just trying to get it to connect to anything so now it’s connected to the Spark cloud I can start again and put it back onto my RPi.

Basically the issue is probably incorrect key public key or ip address so the fix…works. .but is not the correct procedure.

But reverting to the original setting and make sure it works sounds good as well. :wink:

@kennethlimcp Turns out I just need to rebuild the RPi server as it was crashing so now up and running again. The only issue I have now is I can’t find the access token for the local cloud so I can’t get any of the data from the Core.

for example: “http://192.168.1.200/v1/devices/” + deviceID + “/” + xName + “?access_token=” + accessToken;

What would go in the accessToken bit?

1 Like

Ok found the access token it’s shown when you setup the core with Spark Setup… Get to learn my way around this all now and my notebook is getting full so not been a bad day.

So put the access token into the Get call and the RPi is showing calls coming in but no data is being returned…

The core has a Spark.Variable line to push the data to the cloud (Local in this case) and I am reading the Variable by name in my GET call so what am I missing… @kennethlimcp

@Cliff,

look for the .spark directory in your User folder. There’s a json file inside that store the profile information for the different :cloud: profiles.

Variables should work well. Can you try spark list and see what’s the output?

@kennethlimcp thanks I have found the Access Token but when I use it I get

{
  "code": 400,
  "error": "invalid_grant",
  "error_description": "The access token provided is invalid."
}

So I am clearly using the wrong token, I have tried the one in the .spark folder as well (Which looked the same!) and still no luck.

The core is connecting to the local cloud fine and when I do the GET call there is a message on the RPi to show it has returned the 400 error so I must just need to change the access token to the right one if I can find it.

@Cliff,

if you followed my tutorial, there should be a .json file for your local :cloud: profile.

Should have around…3 files in the .spark directory`

The command is: spark config profile_name apiUrl xxxx.xxx.xxxxx

Using spark identify, you will be able to know which profile you are on. :wink:

@kennethlimcp I did follow and checked a few times before posting :smile:

I am in the Local profile and checking the profile in the .Spark folder on my laptop and the AccessToken is listed and this is what I am trying to use but as mentioned I am getting the 400 error.

Thanks for the help by the way it’s very much appreciated. :wink:

1 Like

Can you try to logout and login again :smile:

Look at the console.log at the RPi while you do that to be sure you are hitting the local :cloud: