Overloading Yun causes a fatal hang. Using a watchdog to recover it.

Hi all.

I have 2 questions.

  1. Is there a way to stop the Yun Linux side from hanging up totally if it overloads. Should it not come back with an error stating it is low on resource and not start any more scripts ? I can simulate a hang by starting a lot of Python scripts all at once. The Yun will hangup and die and you have to cycle the power to get it back.

  2. To solve this problem I created a watchdog by using another Arduino. The Yun will close a SSR pulling pin 2 to ground on the Arduino Uno. This triggers an interrupt that resets the timer on the Uno. My second question is can I pull the interrupt directly from the Yun not having to use a SSR ? Can I make the interrupt look for a high and not a low?

Here is a video that shows it all.

jfourie:
can I pull the interrupt directly from the Yun not having to use a SSR ?

Sure you can. Just connect the grounds of the two systems together, and then run a connection directly from the output pin on the Yun to the input pin on the Uno. The only concern is the power supplies: this will only work if it's safe to connect the two power supply grounds together. (For example, you don't want to do that if one supply is grounded to earth ground, and the other is riding on top of the AC supply!)

Can I make the interrupt look for a high and not a low?

Probably, post your code so we can see what you're doing.

But why use an interrupt? What I would do is instead of having the Yun generate a short pulse, have it periodically toggle the line: set it high on the first update, and set it low on the next:

digitalWrite(PIN, !digitalRead(PIN));

That will still give you periodic transitions, but it will stay at the new level long enough that you can use a simple polling process in the Uno's loop() function, since all you would need to do is see whether the I out is different than the last time you checked.

Here is a video that shows it all.

Rather than mess with the AC line voltages, I would've put the NC relay on the low voltage side of the Yun's power supply - it would be much safer that way. It would also allow you to use the same power supply for the Yun and Uno (assuming it's rated for enough current to supply both of them.)

OK I would rather then use this method then. I do want 2 totally separate systems and reboot the power as well to make sure everything has been reset.