So I'm now trying to make this as simple as possible....
As we have confirmed- when I SSH into the Dragino Yun on top of an Arduino Leonardo board, and type the following at a command prompt:
curl -d "devid=vBECBF1F4A7D765" http://api.pushingbox.com/pushingbox
...it works like a champ.
Now, attempting to merge that curl command with a fairly typical (and working) button check, I have the following sketch:
// set pin number:
const int buttonPin = 3; // the number of the doorbell input
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
#include <Bridge.h>
#include <Process.h>
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
Bridge.begin();
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
runCurl();
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
void runCurl() {
Process p;
p.begin("curl");
p.addParameter("-d");
p.addParameter(""devid=vBECBF1F4A7D765"");
p.addParameter("http://api.pushingbox.com/pushingbox");
p.run();
}
And again, it compiles fine, and loads fine, and the button works properly (i.e. the LED on the Arduino lights up when the button is pressed etc), but the call (listed at top) is not effectively executed after the LED lights up.
Do you see anything that would otherwise cause it to not work correctly here? Thanks