Arduino-Yun Wifi - Internet Commands?

So finally got it working properly- interestingly, here is where I found the problem- this line:

p.addParameter(""devid=vBECBF1F4A7D765"");

The curl command I have been trying to execute is:

curl -d "devid=vBECBF1F4A7D765" http://api.pushingbox.com/pushingbox/

and my runCurl(); loop had previously been:

void runCurl() {

 Process p;            
 p.begin("curl");
 p.addParameter("-d");
 p.addParameter("\"devid=vBECBF1F4A7D765\"");
 p.addParameter("http://api.pushingbox.com/pushingbox/");
 p.run();
 while (p.available()>0)
 {
   char c = p.read();
   Console.print(c);
 }
}

...which wasn't working. After many, many experiments, I finally figured out that all I needed to do was literally have the devid in quotes.

Now it works beautifully...

Here is the final version which works...

void runCurl() {

 Process p;            
 p.begin("curl");
 p.addParameter("-d");
 p.addParameter("devid=vBECBF1F4A7D765");
 p.addParameter("http://api.pushingbox.com/pushingbox/");
 p.run();
 while (p.available()>0)
 {
   char c = p.read();
   Console.print(c);
 }
}
1 Like