Re: [PD] Watchdog: signaling pd

2019-05-29 Thread IOhannes m zmölnig
On 5/29/19 3:24 AM, Malcolm Jackson wrote:
> Hey I'm trying to open Pd through an SSH connection with Putty and I keep

you need an X-server running on your local system (your windows box), if
you want to display any remote application.
you could also run Pd in "-nogui" mode, but then you might not get what
you expect as "Pd will open" (as there won't be any GUI that opens).

if your watchdog problem is related to something else, you should first
get it to directly on the device (that is: not using a remote connection)


gmdf
IOhannes



signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread Peter P.
* michael strohmann  [2019-02-18 11:49]:
> wow, that looks interesting!
> so which object do you use to read out the gpio?
I use Miller's gpio object.

> would you be so kind as to share your gpioReading-demo.pd ?
Attached.
#N canvas 1 49 450 300 10;
#X obj 194 95 loadbang;
#X msg 194 121 open 1;
#X obj 162 187 outlet;
#X obj 162 154 gpio \$1;
#X obj 162 65 r pollPin;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 3 0 2 0;
#X connect 4 0 3 0;
#N canvas 306 67 553 819 10;
#X obj 363 30 loadbang;
#X obj 363 56 metro 100;
#X obj 363 81 s pollPin;
#X text 432 58 could be faster;
#X text 6 5 readPin: Argument is pin number in BCM fashion.;
#X obj 27 52 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X obj 27 31 readPin 2;
#X obj 27 93 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X obj 27 72 readPin 3;
#X obj 27 133 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 112 readPin 4;
#X obj 27 216 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 195 readPin 17;
#X obj 27 256 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 235 readPin 27;
#X obj 27 296 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 275 readPin 22;
#X obj 27 386 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 365 readPin 10;
#X obj 27 426 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 405 readPin 9;
#X obj 27 466 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 546 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 445 readPin 11;
#X obj 27 525 readPin 0;
#X obj 27 586 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 626 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 666 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 706 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 565 readPin 5;
#X obj 27 605 readPin 6;
#X obj 27 645 readPin 13;
#X obj 27 685 readPin 19;
#X obj 27 746 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 27 725 readPin 26;
#X obj 207 133 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 174 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 214 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 112 readPin 14;
#X obj 207 153 readPin 15;
#X obj 207 193 readPin 18;
#X obj 207 303 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 344 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 424 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 282 readPin 23;
#X obj 207 323 readPin 24;
#X obj 207 403 readPin 25;
#X obj 207 464 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 504 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 544 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 443 readPin 8;
#X obj 207 483 readPin 7;
#X obj 207 523 readPin 1;
#X obj 207 624 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 603 readPin 12;
#X obj 207 704 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 683 readPin 16;
#X obj 207 744 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 784 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 207 723 readPin 20;
#X obj 207 763 readPin 21;
#X text 48 53 high by default;
#X text 48 92 high by default;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 6 0 5 0;
#X connect 8 0 7 0;
#X connect 10 0 9 0;
#X connect 12 0 11 0;
#X connect 14 0 13 0;
#X connect 16 0 15 0;
#X connect 18 0 17 0;
#X connect 20 0 19 0;
#X connect 23 0 21 0;
#X connect 24 0 22 0;
#X connect 29 0 25 0;
#X connect 30 0 26 0;
#X connect 31 0 27 0;
#X connect 32 0 28 0;
#X connect 34 0 33 0;
#X connect 38 0 35 0;
#X connect 39 0 36 0;
#X connect 40 0 37 0;
#X connect 44 0 41 0;
#X connect 45 0 42 0;
#X connect 46 0 43 0;
#X connect 50 0 47 0;
#X connect 51 0 48 0;
#X connect 52 0 49 0;
#X connect 54 0 53 0;
#X connect 56 0 55 0;
#X connect 59 0 57 0;
#X connect 60 0 58 0;
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread Csaba Láng
Not sure if this is what you are looking for, but I use a python script to
run 2 pd instances connected via netsend. The main patch sends a ing every
second to the other patch, if the ping is stopped, the second kills the
main pd. What the script recognizes and restarts both pd patches.
Best,
Popesz
On Mon, 18 Feb 2019 at 10:50, michael strohmann 
wrote:

> wow, that looks interesting!
> so which object do you use to read out the gpio?
> would you be so kind as to share your gpioReading-demo.pd ?
> thanks!
>
>
> > On 18 Feb 2019, at 10:54, Peter P.  wrote:
> >
> > * michael strohmann  [2019-02-18 10:47]:
> >>
> >>> On 18 Feb 2019, at 10:36, Peter P.  wrote:
> >>>
> >>> * michael strohmann  [2019-02-18 10:22]:
>  good morning,
> >>> Guten Morgen!
> >>>
> >>> I know you didn't want this answer, but, is there a chance you can
> >>> figure out why you are getting the watchdog message in Pd in the first
> >>> hand place?
> >>
> >> yes, i think/hope i found the reason (network related) but still would
> be happy to have a safetynet.
> >> can only access wiringPI_gpio in sudo mode (raspberry…)
> >
> > On an RPi 1 I managed to read the gpio pins as normal user by executing
> > the following script, which starts pd at the end.
> >
> >   #!/bin/bash
> >
> >   # set the TX RX pins to become inputs as well
> >   gpio -g mode 14 in
> >   gpio -g mode 15 in
> >
> >   # set the following pins to low by default
> >   gpio -g mode 4 down
> >   gpio -g mode 5 down
> >   gpio -g mode 0 down
> >   gpio -g mode 6 down
> >
> >   gpio -g mode 15 down
> >   gpio -g mode 8 down
> >   gpio -g mode 7 down
> >   gpio -g mode 1 down
> >
> >   # export the pins to be read by a normal user
> >   # This numbering is already by BCM_GPIO number
> >   gpio export 2 in
> >   gpio export 3 in
> >   gpio export 4 in
> >   gpio export 17 in
> >   gpio export 27 in
> >   gpio export 22 in
> >   gpio export 10 in
> >   gpio export 9 in
> >   gpio export 11 in
> >   gpio export 0 in
> >   gpio export 5 in
> >   gpio export 6 in
> >   gpio export 13 in
> >   gpio export 19 in
> >   gpio export 26 in
> >
> >   gpio export 14 in
> >   gpio export 15 in
> >   gpio export 18 in
> >   gpio export 23 in
> >   gpio export 24 in
> >   gpio export 25 in
> >   gpio export 8 in
> >   gpio export 7 in
> >   gpio export 1 in
> >   gpio export 12 in
> >   gpio export 16 in
> >   gpio export 20 in
> >   gpio export 21 in
> >
> >   pd -rt gpioReading-demo.pd
> >
> >
> >
> > ___
> > Pd-list@lists.iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
>
>
>
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread michael strohmann
wow, that looks interesting!
so which object do you use to read out the gpio?
would you be so kind as to share your gpioReading-demo.pd ?
thanks!


> On 18 Feb 2019, at 10:54, Peter P.  wrote:
> 
> * michael strohmann  [2019-02-18 10:47]:
>> 
>>> On 18 Feb 2019, at 10:36, Peter P.  wrote:
>>> 
>>> * michael strohmann  [2019-02-18 10:22]:
 good morning, 
>>> Guten Morgen!
>>> 
>>> I know you didn't want this answer, but, is there a chance you can
>>> figure out why you are getting the watchdog message in Pd in the first
>>> hand place?
>> 
>> yes, i think/hope i found the reason (network related) but still would be 
>> happy to have a safetynet.
>> can only access wiringPI_gpio in sudo mode (raspberry…)
> 
> On an RPi 1 I managed to read the gpio pins as normal user by executing
> the following script, which starts pd at the end.
> 
>   #!/bin/bash
> 
>   # set the TX RX pins to become inputs as well
>   gpio -g mode 14 in
>   gpio -g mode 15 in
> 
>   # set the following pins to low by default
>   gpio -g mode 4 down
>   gpio -g mode 5 down
>   gpio -g mode 0 down
>   gpio -g mode 6 down
> 
>   gpio -g mode 15 down
>   gpio -g mode 8 down
>   gpio -g mode 7 down
>   gpio -g mode 1 down
> 
>   # export the pins to be read by a normal user
>   # This numbering is already by BCM_GPIO number
>   gpio export 2 in
>   gpio export 3 in
>   gpio export 4 in
>   gpio export 17 in
>   gpio export 27 in
>   gpio export 22 in
>   gpio export 10 in
>   gpio export 9 in
>   gpio export 11 in
>   gpio export 0 in
>   gpio export 5 in
>   gpio export 6 in
>   gpio export 13 in
>   gpio export 19 in
>   gpio export 26 in
> 
>   gpio export 14 in
>   gpio export 15 in
>   gpio export 18 in
>   gpio export 23 in
>   gpio export 24 in
>   gpio export 25 in
>   gpio export 8 in
>   gpio export 7 in
>   gpio export 1 in
>   gpio export 12 in
>   gpio export 16 in
>   gpio export 20 in
>   gpio export 21 in
> 
>   pd -rt gpioReading-demo.pd
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread michael strohmann
thanks for the clarification!
i must have imagined that sigup kills pd…indeed the rest of the system does not 
freeze.

i am still looking for a way automatically restart pd or the computer if pd 
freezes…


> On 18 Feb 2019, at 10:54, IOhannes m zmoelnig  wrote:
> 
> On 18.02.19 10:21, michael strohmann wrote:
>> i need help understanding this description of the pd-watchdog
>> 
>>> s_watchdog.c is the source of pd-watchdog, which was spawned in 
>>> sys_startgui(). 
>>> pd-watchdog monitors its stdin for any input, timing out after 5 seconds if 
>>> nothing was received.
>>> In this case it kills pd with a SIGHUP, but normally it will continue 
>>> looping as long as
>>> characters are received from pd' at a rate of at least one every 5 seconds. 
>>> So if pdtk_watchdog
>>> calls pd every 2 seconds and glob_watchdog() sends a CR each time through 
>>> the pipe, everything
>>> runs smoothly.  
> 
> which part of ths description gives you trouble to understand
> (yes, the description is pretty tech; but i don't know your personal
> background so it'hs hard to give an proper answer to *your* problem).
> 
>> "pd-watchdog monitors its stdin for any input” does this also work if i 
>> start pd with -stderr >2/dev/null ?
> 
> 'stdout' and 'stderr' are unrelated (well, they are related; but
> whatever you do with stderr does not have an effect on stdout).
> but anyhow: yes, this also works if you redirect your stderr.
> 
>> is the fact that i run pd as superuser responsible for pd NOT beeing killed 
>> by SIGHUP ?
> 
> ah well, Pd is not being "killed" by SIGHUP (btw, where did you get this
> from?).
> the watchdog sends a SIGHUP signal to Pd, and Pd *gracefully handles*
> this signal (by releasing the CPU; the idea of pd-watchdog is really to
> prevent a frozen *system*, in case a Pd with realtime-priorities goes
> havoc; the SIGHUP signal will give the *system* a chance to do their
> thing, whatever that is)
> 
> gfasdr
> IOhannes
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread Peter P.
* michael strohmann  [2019-02-18 10:47]:
> 
> > On 18 Feb 2019, at 10:36, Peter P.  wrote:
> > 
> > * michael strohmann  [2019-02-18 10:22]:
> >> good morning, 
> > Guten Morgen!
> > 
> > I know you didn't want this answer, but, is there a chance you can
> > figure out why you are getting the watchdog message in Pd in the first
> > hand place?
> 
> yes, i think/hope i found the reason (network related) but still would be 
> happy to have a safetynet.
> can only access wiringPI_gpio in sudo mode (raspberry…)

On an RPi 1 I managed to read the gpio pins as normal user by executing
the following script, which starts pd at the end.

#!/bin/bash

# set the TX RX pins to become inputs as well
gpio -g mode 14 in
gpio -g mode 15 in

# set the following pins to low by default
gpio -g mode 4 down
gpio -g mode 5 down
gpio -g mode 0 down
gpio -g mode 6 down

gpio -g mode 15 down
gpio -g mode 8 down
gpio -g mode 7 down
gpio -g mode 1 down

# export the pins to be read by a normal user
# This numbering is already by BCM_GPIO number
gpio export 2 in
gpio export 3 in
gpio export 4 in
gpio export 17 in
gpio export 27 in
gpio export 22 in
gpio export 10 in
gpio export 9 in
gpio export 11 in
gpio export 0 in
gpio export 5 in
gpio export 6 in
gpio export 13 in
gpio export 19 in
gpio export 26 in

gpio export 14 in
gpio export 15 in
gpio export 18 in
gpio export 23 in
gpio export 24 in
gpio export 25 in
gpio export 8 in
gpio export 7 in
gpio export 1 in
gpio export 12 in
gpio export 16 in
gpio export 20 in
gpio export 21 in

pd -rt gpioReading-demo.pd



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread IOhannes m zmoelnig
On 18.02.19 10:21, michael strohmann wrote:
> i need help understanding this description of the pd-watchdog
> 
>> s_watchdog.c is the source of pd-watchdog, which was spawned in 
>> sys_startgui(). 
>> pd-watchdog monitors its stdin for any input, timing out after 5 seconds if 
>> nothing was received.
>> In this case it kills pd with a SIGHUP, but normally it will continue 
>> looping as long as
>> characters are received from pd' at a rate of at least one every 5 seconds. 
>> So if pdtk_watchdog
>> calls pd every 2 seconds and glob_watchdog() sends a CR each time through 
>> the pipe, everything
>> runs smoothly.  

which part of ths description gives you trouble to understand
(yes, the description is pretty tech; but i don't know your personal
background so it'hs hard to give an proper answer to *your* problem).

> "pd-watchdog monitors its stdin for any input” does this also work if i start 
> pd with -stderr >2/dev/null ?

'stdout' and 'stderr' are unrelated (well, they are related; but
whatever you do with stderr does not have an effect on stdout).
but anyhow: yes, this also works if you redirect your stderr.

> is the fact that i run pd as superuser responsible for pd NOT beeing killed 
> by SIGHUP ?

ah well, Pd is not being "killed" by SIGHUP (btw, where did you get this
from?).
the watchdog sends a SIGHUP signal to Pd, and Pd *gracefully handles*
this signal (by releasing the CPU; the idea of pd-watchdog is really to
prevent a frozen *system*, in case a Pd with realtime-priorities goes
havoc; the SIGHUP signal will give the *system* a chance to do their
thing, whatever that is)

gfasdr
IOhannes



signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread michael strohmann

> On 18 Feb 2019, at 10:36, Peter P.  wrote:
> 
> * michael strohmann  [2019-02-18 10:22]:
>> good morning, 
> Guten Morgen!
> 
> I know you didn't want this answer, but, is there a chance you can
> figure out why you are getting the watchdog message in Pd in the first
> hand place?

yes, i think/hope i found the reason (network related) but still would be happy 
to have a safetynet.
can only access wiringPI_gpio in sudo mode (raspberry…)
is it that bad to run pd as superuser?

> 
> Did you already check the results of
>   aptitude search watchdog
>> 
>> is it possible to automatically restart pd (or the computer) whenever i get 
>> watchdog: signaling pd 
>> ?
>> 
>> in other words: what would be the proper way to monitor a linux system and 
>> act upon e.g. CPU usage greater than xy% ?
>> does anyone have experience with ps-watcher?
>> http://ps-watcher.sourceforge.net 
> I just found these:
> https://rt.wiki.kernel.org/index.php/RT_Watchdog
> 
>> i need help understanding this description of the pd-watchdog
>> 
>> s_watchdog.c is the source of pd-watchdog, which was spawned in 
>> sys_startgui(). pd-watchdog monitors its stdin for any input, timing out 
>> after 5 seconds if nothing was received. In this case it kills pd with a 
>> SIGHUP, but normally it will continue looping as long as characters are 
>> received from pd' at a rate of at least one every 5 seconds. So if 
>> pdtk_watchdog calls pd every 2 seconds and glob_watchdog() sends a CR each 
>> time through the pipe, everything runs smoothly.  
>> 
>> 
>> "pd-watchdog monitors its stdin for any input” does this also work if i 
>> start pd with -stderr >2/dev/null ?
>> is the fact that i run pd as superuser responsible for pd NOT beeing killed 
>> by SIGHUP ?
> Please forgive me, but why do you run Pd as root? Do you really need to
> do so?
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list




___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog -> force restart

2019-02-18 Thread Peter P.
* michael strohmann  [2019-02-18 10:22]:
> good morning, 
Guten Morgen!

I know you didn't want this answer, but, is there a chance you can
figure out why you are getting the watchdog message in Pd in the first
hand place?

Did you already check the results of
aptitude search watchdog
> 
> is it possible to automatically restart pd (or the computer) whenever i get 
> watchdog: signaling pd 
> ?
> 
> in other words: what would be the proper way to monitor a linux system and 
> act upon e.g. CPU usage greater than xy% ?
> does anyone have experience with ps-watcher?
> http://ps-watcher.sourceforge.net 
I just found these:
https://rt.wiki.kernel.org/index.php/RT_Watchdog

> i need help understanding this description of the pd-watchdog
> 
> s_watchdog.c is the source of pd-watchdog, which was spawned in 
> sys_startgui(). pd-watchdog monitors its stdin for any input, timing out 
> after 5 seconds if nothing was received. In this case it kills pd with a 
> SIGHUP, but normally it will continue looping as long as characters are 
> received from pd' at a rate of at least one every 5 seconds. So if 
> pdtk_watchdog calls pd every 2 seconds and glob_watchdog() sends a CR each 
> time through the pipe, everything runs smoothly.  
> 
> 
> "pd-watchdog monitors its stdin for any input” does this also work if i start 
> pd with -stderr >2/dev/null ?
> is the fact that i run pd as superuser responsible for pd NOT beeing killed 
> by SIGHUP ?
Please forgive me, but why do you run Pd as root? Do you really need to
do so?



___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog

2018-05-03 Thread Jack
Yes, it is good to add a "sleep 1" at the end of the while loop.
++

Jack


Le 03/05/2018 à 12:59, Roman Haefeli a écrit :
> On Thu, 2018-05-03 at 11:56 +0200, Jack wrote:
>> If you have several instances of Pd, it is also doable to do
>> something
>> like :
>>
>> pd -open yourpatch1.pd &
>> PID1=$!
>> pd -open yourpatch2.pd &
>> PID2=$!
>>
>> while true
>> do
>> if [ ! -d /proc/$PID1 ]
>> then
>> pd -open yourpatch1.pd &
>> PID1=$!
>> fi
>> if [ ! -d /proc/$PID2 ]
>> then
>> pd -open yourpatch2.pd &
>> PID2=$!
>> fi
>> done
> 
> If I'm not mistaken, this hogs the CPU as it will run as many
> iterations per second as possible. I think a 'sleep 1' would already
> help.
> 
> Roman
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list
> 




signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog

2018-05-03 Thread Roman Haefeli
On Thu, 2018-05-03 at 11:56 +0200, Jack wrote:
> If you have several instances of Pd, it is also doable to do
> something
> like :
> 
> pd -open yourpatch1.pd &
> PID1=$!
> pd -open yourpatch2.pd &
> PID2=$!
> 
> while true
> do
> if [ ! -d /proc/$PID1 ]
> then
> pd -open yourpatch1.pd &
> PID1=$!
> fi
> if [ ! -d /proc/$PID2 ]
> then
> pd -open yourpatch2.pd &
> PID2=$!
> fi
> done

If I'm not mistaken, this hogs the CPU as it will run as many
iterations per second as possible. I think a 'sleep 1' would already
help.

Roman

signature.asc
Description: This is a digitally signed message part
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog

2018-05-03 Thread Raphaël Ilias
Hello,

Maybe not as technical as your solution, but on a Windows machine for an
art installation, i did a quick "watchdog" that checked a "stillalive"
file, that was regularly modified by the pd patch. So when/if pd crashed,
the file wasn't updated anymore and the script would restart it. I think it
was done in python...

cheers

2018-05-03 11:56 GMT+02:00 Jack :

> If you have several instances of Pd, it is also doable to do something
> like :
>
> pd -open yourpatch1.pd &
> PID1=$!
> pd -open yourpatch2.pd &
> PID2=$!
>
> while true
> do
> if [ ! -d /proc/$PID1 ]
> then
> pd -open yourpatch1.pd &
> PID1=$!
> fi
> if [ ! -d /proc/$PID2 ]
> then
> pd -open yourpatch2.pd &
> PID2=$!
> fi
> done
>
>
> ++
>
> Jack
>
>
>
> Le 03/05/2018 à 11:46, Jack a écrit :
> > Hey list !
> >
> > Le 03/05/2018 à 09:42, Roman Haefeli a écrit :
> >> On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
> >>> Hello,
> >>> i wonder if it is possible to setup something on raspberry, so that
> >>> the puredata-watchdog will restart pd-0.48.0 automatically?
> >>> where could i look up the mechanics of this, unfortunatly i am not a
> >>> unix crack…
> >>
> >> Are you referring to the pd-watchdog binary, that comes with puredata-
> >> core? Is your Raspberry Pi running Raspbian?
> >>
> >> From what I understand, the purpose of the pd-watchdog is to pause Pd
> >> in regular intervals when running in real-time mode. I think this is
> >> measure to prevent Pd from locking up the system. Assume you
> >> accidentally trigger an [until] without a stopping mechanism, thanks to
> >>  pd-watchdog you're still able to move the mouse and quit Pd.
> >>
> >> Is your goal to make sure that Pd is running at any time, so that it is
> >> started again as soon as it stops?  Maybe you can achieve something
> >> like this wit a shell script. I haven't tested this, but it might give
> >> you an idea how to make it work:
> >>
> >> ---
> >> #!/bin/sh
> >>
> >> while true
> >> do
> >>   # We start pd and send detach it from the terminal ('&')
> >>   /usr/bin/pd -open yourpatch &
> >>
> >>   # we catch pd's process id
> >>   pdpid=$!
> >>
> >>   # now let's wait for the process to terminate
> >>   wait $pdpid
> >>
> >>   # once pd terminates, we start another iteration
> >>   # of our while-loop
> >> done
> >
> > I will do something like :
> >
> > while true
> > do
> > pd -open yourpatch # if pd crash the script continue to "sleep 1"
> > and a new loop start
> > sleep 1
> > done
> >
> > ++
> >
> > Jack
> >
> >
> >
> >> ---
> >>
> >> Roman
> >>
> >>
> >>
> >> ___
> >> Pd-list@lists.iem.at mailing list
> >> UNSUBSCRIBE and account-management -> https://lists.puredata.info/
> listinfo/pd-list
> >>
> >
> >
> >
> >
> > ___
> > Pd-list@lists.iem.at mailing list
> > UNSUBSCRIBE and account-management -> https://lists.puredata.info/
> listinfo/pd-list
> >
>
>
>
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/
> listinfo/pd-list
>
>


-- 
Raphaël Ilias
  ___
* phae.fr *
 17 places des Halles - Ingrandes
 49123 Ingrandes Le Fresne s/ Loire
 phae.il...@gmail.com / +33 (0) 6 04 45 79 78
  ___
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog

2018-05-03 Thread Jack
If you have several instances of Pd, it is also doable to do something
like :

pd -open yourpatch1.pd &
PID1=$!
pd -open yourpatch2.pd &
PID2=$!

while true
do
if [ ! -d /proc/$PID1 ]
then
pd -open yourpatch1.pd &
PID1=$!
fi
if [ ! -d /proc/$PID2 ]
then
pd -open yourpatch2.pd &
PID2=$!
fi
done


++

Jack



Le 03/05/2018 à 11:46, Jack a écrit :
> Hey list !
> 
> Le 03/05/2018 à 09:42, Roman Haefeli a écrit :
>> On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
>>> Hello, 
>>> i wonder if it is possible to setup something on raspberry, so that
>>> the puredata-watchdog will restart pd-0.48.0 automatically?
>>> where could i look up the mechanics of this, unfortunatly i am not a
>>> unix crack…
>>
>> Are you referring to the pd-watchdog binary, that comes with puredata-
>> core? Is your Raspberry Pi running Raspbian?
>>
>> From what I understand, the purpose of the pd-watchdog is to pause Pd
>> in regular intervals when running in real-time mode. I think this is
>> measure to prevent Pd from locking up the system. Assume you
>> accidentally trigger an [until] without a stopping mechanism, thanks to
>>  pd-watchdog you're still able to move the mouse and quit Pd.
>>
>> Is your goal to make sure that Pd is running at any time, so that it is
>> started again as soon as it stops?  Maybe you can achieve something
>> like this wit a shell script. I haven't tested this, but it might give
>> you an idea how to make it work:
>>
>> ---
>> #!/bin/sh
>>
>> while true
>> do 
>>   # We start pd and send detach it from the terminal ('&')
>>   /usr/bin/pd -open yourpatch & 
>>
>>   # we catch pd's process id
>>   pdpid=$!
>>
>>   # now let's wait for the process to terminate
>>   wait $pdpid
>>   
>>   # once pd terminates, we start another iteration
>>   # of our while-loop
>> done
> 
> I will do something like :
> 
> while true
> do
> pd -open yourpatch # if pd crash the script continue to "sleep 1"
> and a new loop start
> sleep 1
> done
> 
> ++
> 
> Jack
> 
> 
> 
>> ---
>>
>> Roman
>>
>>
>>
>> ___
>> Pd-list@lists.iem.at mailing list
>> UNSUBSCRIBE and account-management -> 
>> https://lists.puredata.info/listinfo/pd-list
>>
> 
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list
> 




signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog

2018-05-03 Thread Jack
Hey list !

Le 03/05/2018 à 09:42, Roman Haefeli a écrit :
> On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
>> Hello, 
>> i wonder if it is possible to setup something on raspberry, so that
>> the puredata-watchdog will restart pd-0.48.0 automatically?
>> where could i look up the mechanics of this, unfortunatly i am not a
>> unix crack…
> 
> Are you referring to the pd-watchdog binary, that comes with puredata-
> core? Is your Raspberry Pi running Raspbian?
> 
> From what I understand, the purpose of the pd-watchdog is to pause Pd
> in regular intervals when running in real-time mode. I think this is
> measure to prevent Pd from locking up the system. Assume you
> accidentally trigger an [until] without a stopping mechanism, thanks to
>  pd-watchdog you're still able to move the mouse and quit Pd.
> 
> Is your goal to make sure that Pd is running at any time, so that it is
> started again as soon as it stops?  Maybe you can achieve something
> like this wit a shell script. I haven't tested this, but it might give
> you an idea how to make it work:
> 
> ---
> #!/bin/sh
> 
> while true
> do 
>   # We start pd and send detach it from the terminal ('&')
>   /usr/bin/pd -open yourpatch & 
> 
>   # we catch pd's process id
>   pdpid=$!
> 
>   # now let's wait for the process to terminate
>   wait $pdpid
>   
>   # once pd terminates, we start another iteration
>   # of our while-loop
> done

I will do something like :

while true
do
pd -open yourpatch # if pd crash the script continue to "sleep 1"
and a new loop start
sleep 1
done

++

Jack



> ---
> 
> Roman
> 
> 
> 
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list
> 




signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog

2018-05-03 Thread Peter P.
* Roman Haefeli  [2018-05-03 09:42]:
> On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
> > Hello, 
> > i wonder if it is possible to setup something on raspberry, so that
> > the puredata-watchdog will restart pd-0.48.0 automatically?
> > where could i look up the mechanics of this, unfortunatly i am not a
> > unix crack…
> 
> Are you referring to the pd-watchdog binary, that comes with puredata-
> core? Is your Raspberry Pi running Raspbian?
> 
> From what I understand, the purpose of the pd-watchdog is to pause Pd
> in regular intervals when running in real-time mode. I think this is
> measure to prevent Pd from locking up the system. Assume you
> accidentally trigger an [until] without a stopping mechanism, thanks to
>  pd-watchdog you're still able to move the mouse and quit Pd.
> 
> Is your goal to make sure that Pd is running at any time, so that it is
> started again as soon as it stops?  Maybe you can achieve something
> like this wit a shell script. I haven't tested this, but it might give
> you an idea how to make it work:
> 
> ---
> #!/bin/sh
> 
> while true
> do 
>   # We start pd and send detach it from the terminal ('&')
>   /usr/bin/pd -open yourpatch & 
> 
>   # we catch pd's process id
>   pdpid=$!
> 
>   # now let's wait for the process to terminate
>   wait $pdpid
>   
>   # once pd terminates, we start another iteration
>   # of our while-loop
> done
> ---

I like 
until !!; do :; done
which restarts the last command from bash_history in case it exits
without a clean 0 exit status. Useful for all sorts of things. I guess
it can also be written as
until pd myCrashingPatch.pd; do; :; done

___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog

2018-05-03 Thread Roman Haefeli
On Thu, 2018-05-03 at 06:29 +0200, michael strohmann wrote:
> Hello, 
> i wonder if it is possible to setup something on raspberry, so that
> the puredata-watchdog will restart pd-0.48.0 automatically?
> where could i look up the mechanics of this, unfortunatly i am not a
> unix crack…

Are you referring to the pd-watchdog binary, that comes with puredata-
core? Is your Raspberry Pi running Raspbian?

From what I understand, the purpose of the pd-watchdog is to pause Pd
in regular intervals when running in real-time mode. I think this is
measure to prevent Pd from locking up the system. Assume you
accidentally trigger an [until] without a stopping mechanism, thanks to
 pd-watchdog you're still able to move the mouse and quit Pd.

Is your goal to make sure that Pd is running at any time, so that it is
started again as soon as it stops?  Maybe you can achieve something
like this wit a shell script. I haven't tested this, but it might give
you an idea how to make it work:

---
#!/bin/sh

while true
do 
  # We start pd and send detach it from the terminal ('&')
  /usr/bin/pd -open yourpatch & 

  # we catch pd's process id
  pdpid=$!

  # now let's wait for the process to terminate
  wait $pdpid
  
  # once pd terminates, we start another iteration
  # of our while-loop
done
---

Roman


signature.asc
Description: This is a digitally signed message part
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog: signaling pd...

2017-01-20 Thread Jaime Oliver La Rosa

Thanks all!

It seems that changes in [declare]'s behavior were creating problems 
finding certain libraries of externals. the -noloadbang flag allowed me 
to change this behavior and now things load normally...


best,

J



On 01/20/2017 08:01 AM, Antoine Rousseau wrote:


calling pd with -noaudio and -nomidi

- enable "-verbose -stderr"


also don't forget to try "-noloadbang", it could help too.


Antoine Rousseau
http://www.metalu.net  __ 
http://www.metaluachahuter.com/ 




2017-01-20 9:40 GMT+01:00 IOhannes m zmölnig >:


On 01/20/2017 04:18 AM, Jaime Oliver La Rosa wrote:
> This happens to certain patches and then I cannot open them
again, it is
> as if they were locked. It is currently happening to one I used
yesterday!

i guess one of the objects in their fails to create within reasonable
limits.
so i would do:
- disable rt (this will make the "signaling pd..." message disappear,
but the loading might still hang. I guess it is still worth trying
it out.
- enable "-verbose -stderr" to see what Pd is actually trying to do.
- get a list of all the objects used in the patch, and check whether
there's one in there that could block in the constructor.

fgmrdsa
IOhannes


___
Pd-list@lists.iem.at  mailing list
UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list





___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog: signaling pd...

2017-01-20 Thread Antoine Rousseau
>
> calling pd with -noaudio and -nomidi
>


> - enable "-verbose -stderr"


also don't forget to try "-noloadbang", it could help too.


Antoine Rousseau
  http://www.metalu.net  __
http://www.metaluachahuter.com/



2017-01-20 9:40 GMT+01:00 IOhannes m zmölnig :

> On 01/20/2017 04:18 AM, Jaime Oliver La Rosa wrote:
> > This happens to certain patches and then I cannot open them again, it is
> > as if they were locked. It is currently happening to one I used
> yesterday!
>
> i guess one of the objects in their fails to create within reasonable
> limits.
> so i would do:
> - disable rt (this will make the "signaling pd..." message disappear,
> but the loading might still hang. I guess it is still worth trying it out.
> - enable "-verbose -stderr" to see what Pd is actually trying to do.
> - get a list of all the objects used in the patch, and check whether
> there's one in there that could block in the constructor.
>
> fgmrdsa
> IOhannes
>
>
> ___
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/
> listinfo/pd-list
>
>
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list


Re: [PD] watchdog: signaling pd...

2017-01-20 Thread IOhannes m zmölnig
On 01/20/2017 04:18 AM, Jaime Oliver La Rosa wrote:
> This happens to certain patches and then I cannot open them again, it is
> as if they were locked. It is currently happening to one I used yesterday!

i guess one of the objects in their fails to create within reasonable
limits.
so i would do:
- disable rt (this will make the "signaling pd..." message disappear,
but the loading might still hang. I guess it is still worth trying it out.
- enable "-verbose -stderr" to see what Pd is actually trying to do.
- get a list of all the objects used in the patch, and check whether
there's one in there that could block in the constructor.

fgmrdsa
IOhannes



signature.asc
Description: OpenPGP digital signature
___
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list