Python script with runShellCommand not working...

Hi…

So I’ve been trying to get the Yun to do something it’s seemingly designed to do… run Python scripts.

I am trying to trigger the script from the Arduino side using the runShellCommand but nothing happens.

Process p;
p.runShellCommand(“python /mnt/sd/arduino/py/foo.py”);

I know nothing happens because I’m watching the Linino via SSH and see nothing printed from my Python script.

However, when I manually run the command from the Linux side the script runs and data flows to the Arduino.

Am I doing something wrong? Any help would be greatly appreciated… this has been boggling my mind for a few days now.

Here’s a simplified version of my Arduino code:

#include <Bridge.h>
#include <Process.h>

char time[2];

void setup() {
Bridge.begin();
Serial.begin(9600);

while (!Serial);

Serial.println(“NextBus\n”);
}

void loop() {
Process p;
p.runShellCommand(“python /mnt/sd/arduino/py/foo.py”);
while (p.running());

Bridge.get(“A”, time, 2);
int seconds = atoi(time);
Serial.println(seconds);
}

Try it with the full path to python:

p.runShellCommand("/usr/bin/python /mnt/sd/arduino/py/foo.py");

Bob

That worked... in a way... I had a typo in my directory that running the script this way pointed out!

Ooops... but problem solved!

Thanks.