I'm a little confused with some Process.h methods.
I'm trying to run the command "nc 192.168.1.15 9911" to the Linux processor through a sketch.
The appropriate netcat listener is waiting on another computer. Arduino Yun is on the same network with thie computer via WiFi.
When I execute this command through SSH connection on Arduino Yun it works fine, but I can't figure out how it's done through a sketch.
This is my code:
#include <Process.h>
Process p;
void setup() {
Bridge.begin();
Serial.begin(9600);
delay(2000);
p.begin("nc");
p.addParameter("192.168.1.15 9911");
p.run();
//while (p.running()) {};
}
void loop() {
if (p.available() > 0) {
Serial.println("test");
}
}
I also tried p.runShellCommand("nc 192.168.1.15 9911");
What am I missing?