Could not connect to the cloud variables?[SOLVED]

Hello to all!

I have read many tutorials here (thank you for that all), and its all clear. The spark code is very simple, I put a variable with spark.variable() in the cloud, it all works fine. In the Spark DEV I can check this.
But every html or Java Code I try (for example this or this) could not connect to my cloud or my Spark. For example this I tried exactly 1:1 with my ID and my token,… but nothing happen.
Is it necessary to install sparkjs or spark cli or other libraries to make it run? (I have problems with installing these and doesn’t found a solution yet)

greetings from Austria,

Hi @HH1

I am sorry you are having trouble. There are a couple of key things going on here. For a tutorial like mine, you don’t need to install anything–it just works in a browser, but it will only work with Chrome, Firefox or Safari, not with Internet Explorer.

You core id and access token are long hex numbers so you should cut-and-paste them if possible to avoid errors.

In Chrome etc. you can use the Javascript debugging console to see if you have a problem with the cloud connection–you will see error messages in the console window if you have a bad token or wrong core id etc.

Wow, thanks for the fast answer.
I use Firefox, and I insert my ID and my Token via copy and paste.
There is an addon for Firefox named “Firebug”. I think its an Java debugger, but the main problem is, I have the same knowlegde of Java like a dog of playing piano.
If I go step by step, it seems that there is no return from “$.getJSON(requestURL, function(json)”.

OK, in my desperation I tried to copy and paste the request URL from the Java Code in my Firefox to see what happen, and really I get a response from the spark cloud.
“error_description”: "The access token provided has expired."
I didn’t know that this could happen. I just read the forum entries and find out that the token expired every 90 days, … very interesting.
I have reset my token … and what a wonder … it works. So thank you for your help.
By the way its interesting that I try since 90 days to make my project run. 8-/

1 Like