Hello, there is someone who has already had experience with watchdog and pimatic? I would like to know which file you should monitor best. So which file is used permenent.
-
Watchdog and pimatic
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
You can write a script
PIDFILE=/home/pi/pimatic-app/pimatic.pid if (kill -0 `cat $PIDFILE`) then echo "it's alive!" >; /dev/null else rm $PIDFILE pimatic.js start > /dev/null echo "PIMATIC restarted at `date`" >> /var/log/pimatic-crash.log fi
And check with the crontab
*/5 * * * * /usr/local/bin/pimaticchk >/dev/null 2>&1
-
I got something similar
#!/bin/sh SERVICE='pimatic' if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo "$SERVICE service running, everything is fine" else echo "$SERVICE is not running" | gpio mode 5 out && gpio write 5 0 echo "$SERVICE is not running!" | echo "Failed" >> /home/pi/log/failed.log echo "$SERVICE is not running!" | sudo service pimatic restart fi
scheduled every 15 minutes
This also switched of my heating in case of pimatic crash
Follow my domotica project on http://maredana.nl
-
@incmve said:
Hello , after a long time , I would like once again to ask you something about this topic .I would like to know what causes this line :
gpio mode 5 out && gpio write 5 0
Can I change this line:
sudo service pimatic restart
to the following line ?
sudo shootdown 0 -r
Lately I had some problems with the wifi connection to Rpi . Therefore, I could not get a connection. Also not via ssh. The Wifi adapter no longer flashing . Unfortunately, I do not know if the Rpi was down or pimatic no longer ran .
Maybe an external system for monitoring would be better ?
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
@Thrusty Have a look at https://mmonit.com/monit/
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@Thrusty said:
Lately I had some problems with the wifi connection to Rpi . Therefore, I could not get a connection. Also not via ssh. The Wifi adapter no longer flashing . Unfortunately, I do not know if the Rpi was down or pimatic no longer ran .
Better to try and address the wifi issue. Do you know which chipset your wifi dongle is using? The popular realtek 8192 is notorious, but disabling powersaving modes can help.
If you idenas root/sudo edit /etc/modprobe.d/8192cu.conf and add the following line
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0use lsusb and lsmod command to identify your wifi adapters chipset.
oh, and yeah, you can change the restart service command with shutdown -r or reboot command.
And to sort of get back on track with the watchdog theme, i would add an external watchdog in the form of an arduino connected to uart/i2c that will toggle the pi’s reset pin if it failed to pet the watchdog, or even an esp8266 connected to the reset pin, and pet it over wifi. I wouldn’t trust anything but external hardware if the pi was in a hard to reach place.
-
@beikeland
Hello ,
unfortunately, I do not know if the WiFi adapter is the problem. This is just my indicator that the Rpi is no longer accessible. The LED of WiFi adapter no longer blinks.Is there somewhere a howto for the use of esp8266 in conjunction with the Rpi reset pin? And an explanation on how the esp8266 then works?
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
@Thrusty I have the same problem with the wifi adapter. For me Pimatic is still running which I can see that a homeduino controlled switch is working by a rule. Till now I only had the solution to plug in and off the adapter.
For non-developers it would be nice to have a simple solution like controll the wifi by pimatic rule ( if wifi is off and some other condition then switch wifi on).
-
i use monit
very cool tool to monitor everything on your pi.
pimatic
check process pimatic with pidfile /opt/pimatic-app/pimatic.pid
group webservice
every 2 cycles
start program = "/usr/sbin/service pimatic start"
stop program = "/usr/sbin/service pimatic stop"
if failed port 80 protocol http
with timeout 240 seconds
then restart
if failed port 443 type tcpssl protocol http
with timeout 240 seconds
then restart
if 1 restarts within 1 cycles then alertpimatic + MySensors + Homeduino + z-way
https://github.com/n3roGit/MySensors_n3ro -
@Thrusty said:
@beikeland
Hello ,
unfortunately, I do not know if the WiFi adapter is the problem. This is just my indicator that the Rpi is no longer accessible. The LED of WiFi adapter no longer blinks.Try unplugging and re-plugging the wifi-adaper without restarting the PI next time it “stops” If you can access it again, then lets look at the wifi in more detail. In my experience its a common problem because the beforementioned chipset is quite common.
Is there somewhere a howto for the use of esp8266 in conjunction with the Rpi reset pin? And an explanation on how the esp8266 then works?
I don’t know if there is any such tutorial, but I can try and make a rough outline for you over the weekend if I find some time (Searching binngs up to much noise with resetting the esp and or pi by itself for me at least) -
@beikeland
Hello and thanks. It would be really nice if it works on weekends with time."Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
Hello , now I’ve found the reason for the pimatic crashes , I think . It was probably due to the power supply. Some devices operate on the pimatic . Among other things, I use a 2.5 " HDD as storage . My power supply brings 2.1A - obviously too little .
Sometimes more power is needed than is available from the power supply. This apparently makes it at least .Now the HDD gets an additional supply and for some time no longer crash .
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
Unfortunately, so far I could still find no good instruction , which I can use the esp8266 to monitor Raspberry and pimatic .
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
What you could think of is an esp8266 connected via a relay to your reset pins P6 on your RPi.
Let your RPi and/or pimatic send “something” to a webserver/tcp-server on your esp8266 every 10-15 minutes (or so).
If it times out (12-17 minutes?) let your esp8266 via the relay simply reset the RPi and your RPi will reboot.Note that this is a hard reset, not a clean reboot.
(and no I don’t have code ready. you can have a look here but that one uses a button to reset both instead of a gpio/relay to reset the RPi).
I want to look into that myself as well
-
Hi,
sometimes my pimatic crashes, but i don’t know the reason. The problem is that the pid is still running but i can not connect to the frontend. If i try to stop the service it is not possible. Only the command sudo kill -9 pid stops pimatic. Then i can restart it but it shows no error messages. Has anyone a watchdog witch looks for the webserver and kills and restarts pimatic if it is not responding?
Regards daice
-
Hello, for some time running “Monit” on my Rpi and it works well.
Every now and then Monit Pimatic has restarted.
Unfortunately, recently the Wifi has failed. Thus I had no access to the Rpi. It only helped to pull the plug.Now I have the following entered in Monit conf:
check process ifplugd with pidfile /var/run/ifplugd.wlan0.pid startProgram = "/ sbin / ifup eth0: 0" stop program = "/ sbin / ifdown eth0: 0" #if Failed host "192.168.178.1 protocol http then restart # If 5 restarts within 5 cycles then timeout if 1 restarts within 2 cycles then alert
Unfortunately it does not work that way. Possibly, the network brings no new IP from the router.
What should I so submit Monit that starts Wifi new and it works? Does anyone have experience with it?The same problem occurs when the router is restarted. The Rpi examined the Wifi not new when the router was short of.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
Check this reference mentioned by @Yves911 in this post.
-
@Harry-van-der-Wolf
Thanks for the answer.
But I would not generate a reboot. I think the wifi restart would be the cleaner solution."Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
-
Hi, I have finally found a working solution for my Wifi restart without Rpi restart.
A solution to monit, unfortunately I could not find.This script checks the Wifi and starts the new Wifi and calls for a new IP from the router:
#!/bin/bash IP=192.xxx.xxx.x DEV=wlan0 ping -q -W5 -c3 $IP >/dev/null if [ ! $? -eq "0" ] then ifdown $DEV sleep 15 ifup $DEV sleep 2 dhclient -1 -nw wlan0 sleep 3
And with this entry in the global crontab run the script every 5 minutes:
*/5 * * * * /bin/bash --login /usr/local/bin/iptest.sh
For me, this variant works.
Maybe someone else can also do something with it"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)