Timer 1 Yun Process not working!

I hope somebody can help!

I want to open a process every 5 seconds on my yun using the timer1 library. But it seems that when i have a process talking to linino side of the yun the timerInterrupt routine does not work. Has anyone an idea why?

You probably have something blocking execution (waiting for something) but without seeing your sketch it is almost impossible to say what.

Try to make the simplest example that demonstrates the problem and post it here. Many times I find problems just by trying to reduce the problem to its simplest state.

The timer1 library dosn't work on the Yun/leonardo

You could try this solution:

http://www.suspectdevices.com/blahg/arduino/using-the-timer1-and-timer3-libraries-with-the-arduino-leonardo/

i know! i have included the file of the link you suggested! :wink:

Sketch looks something like this!
Tested it with just bridge.begin() and a blink sketch in the interrupt routine. Works great!
But if i add the process it won't work!

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



#define analogPin A0
void setup() {
  Bridge.begin();
  //Timer1.restart();
  Timer1.initialize(5000000);
  Timer1.attachInterrupt(LightSensor);
  pinMode(analogPin,INPUT);
  digitalWrite(13,HIGH);
  delay(1000);
  digitalWrite(13,LOW);
}

void loop() {
  

}

void LightSensor () {

  // read analog value 
  int sensor = analogRead(analogPin);
  String sens = (String)sensor;
  
  Process p;
  p.begin("/usr/bin/python");
  p.addParameter("/mnt/sda1/lookup_lightVal.py");
  p.addParameter(sens);
  p.run();
  
  char result = p.read();

  if(result == '1') {
    digitalWrite(13,HIGH);
    delay(100);
    digitalWrite(13,LOW);
  }
}

It seems to me you are over complicating things.
You could put the call to your function in the loop, and drop the timer1 library

void loop() {
 LightSensor();
delay(5000); 
}

And for debug you could use the serial monitor

while (p.available() > 0) {
    result = p.read();
    Serial.println(result);
  }

I agree with Erni that the Timer1 approach is complicated for what your example is doing but I will assume you have good reasons to use it. I don't see the need to use one of the hardware timers in most cases. I think starting with what Erni posted would lead you to the answer.

The p.Run() is blocking http://arduino.cc/en/Reference/YunProcessRun, this means it won't return until the process has completed. What happens if you put a Serial.println(result); after the p.Run();?
Does it ever print something on the Serial Monitor?
How long does it take? A Serial.println(millis()); before and after the p.Run(); will tell you.
What happens if you replace your process with something like:

p.begin("echo");
p.addParameter("hello");
p.run();
char result = p.read();
Serial.println(result);

?