Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Cloud function not getting executed in loop #58

Open
abhirocks550 opened this issue Nov 25, 2015 · 0 comments
Open

Cloud function not getting executed in loop #58

abhirocks550 opened this issue Nov 25, 2015 · 0 comments

Comments

@abhirocks550
Copy link

I have created cloud function using Parse.com Javascript SDK and i am calling those functions from Arduino.Following is code for function hello

Parse.Cloud.define("hello", function(request, response) {
response.success("This is hello function");
}); //hello function Block

I am calling this function from Arduino side using following code.

void setup() {

 Bridge.begin();
 Serial.begin(9600);

 while(!Serial);

 Parse.begin("***zE0uUjQkMa7nj5D5BALvzegzfyVNSG22BD***", "***Ssggp5JgMFmSHfloewW5oixlM5ibt9LBSE***"); 
      //commented my keys with * here only

 // In this example, we associate this device with a pre-generated installation
 Parse.getInstallationId();
 Parse.startPushService();

}

void loop() {

      Serial.println("Start loop");
      demoBasic("meeting",0);

}

void demoBasic(String functionname,int light){

  char fnname[11];
  functionname.toCharArray(fnname,11);

 Serial.print("In ");
 Serial.print(functionname);
 Serial.println(" Function");


 ParseCloudFunction cloudFunction;
 cloudFunction.setFunctionName(fnname);
 cloudFunction.add("light_sensor", light);
 cloudFunction.add("value", "Arduino Hello");//parameters

 ParseResponse response = cloudFunction.send();
 Serial.println(response.getJSONBody());

}//function block for demoBasic

Problem is that i am getting response 8 times only after that whole program flow gets blocked.What is the problem,can somebody help please?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants