Hi,
gilles951 wrote:i want to make a alarm
I went trough your message a couple of times to get your issue, so let me see if I understand:
- RasPi is monitoring something (external alarm system) with its GPIO pin
- the RasPi is running web server where you'd like to monitor this alarm system thing,
- you have concerns that RasPi crashes, so you need to automatically restore its state to working one.
Correct ?
My approach would be to add a small circuit (hardware), which is isolated as much as possible from monitored RasPi.
Let's call this hardware a watchdog.
Setup:
- the watchdog has input connected to RasPi's GPIO pin.
- the watchdog has output connected to RasPi's reset header (first RasPi versions don't have it).
Operation:
- RasPi needs to toggle watchdog-monitored GPIO pin in regular intervals
- if the pin is not triggered within some amount of time (eg. 3 minutes), then the watchdog resets the RasPi.
Details:
- Watchdog timeout interval needs to be long enough to enable RasPi to boot and start programs
- it is important that the watchdog requires GPIO's pin transitions low-to-high and high-to-low (not just level of the pin, to prevent undetected crash).
This circuit could be done with discrete components (logic gates, few capacitors, etc.) or to build it around a small microcontroller.
I'd assume that these circuits have been already described in details on some web pages (ask google).
Best wishes, Ivan Zilic.