[SOLVED] Another case of "Variable not found"


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() {


  "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!

Could you check if these variables really don’t exist with one of these interfaces

It might also be that you need to wait a few seconds after rebooting your device for the cloud to register the new variables.
Also make sure your code actually gets replaced on the device (e.g. add some different D7 blink patterns or Serial.print() statements)
You can also look at the device events via

BTW, I assume you adapted your URL along with the variable names


No I haven’t :sweat:

That was the problem, thanks a lot for your help!

1 Like