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");
}
}
This code doesn't seem to work, p.available() nerver executes even if I send data packets. I also tried p.runShellCommand("nc 192.168.1.15 9911"); with no luck.
It seems that the commands never reach the Linux command line.
Any insights?
Serialprint something at all? the examples for Yun have SerialUSB for Serial Monitor. github.com/arduino-libraries/Bridge/blob/master/examples/… . and I would add parameters with two addParameter