Hi!
I have just started developing using the Photon and I am encountering an error using the Spark.variable. For some reason, every other variable name than “result” returns the "variable not found"error, regardless of the content of the Particle.variable. In the following example, I am able to read my data using https://api.spark.io/v1/devices/ID/result?access_token=TOKEN, using both the terminal (curl) or in a browser (Safari, Firefox):
void setup(){
Particle.variable("result", "0,1,2,3");
}
void loop (){
}
results in
{
"cmd": "VarReturn",
"name": "result",
"result": "0,1,2,3",
"coreInfo": {
"last_app": "",
"last_heard": "---",
"connected": true,
"last_handshake_at": "---",
"deviceID": "---",
"product_id": 6
}
}
However, any other name than “result”, e.g. “temp” or “data” gives an error:
void setup() {
Particle.variable("temp", "0,1,2,3");
}
void loop() {
}
Produces
{
"ok": false,
"error": "Variable not found"
}
It should be noted that I experience this problem with two individual Photons. I am absolutely perplexed. I have read numerous other “variable not found” threads, but none of them has provided me with a solution. I hope that someone is able to help! Thanks in advance!