gilles951
Posts: 2
Joined: Fri Jul 11, 2014 8:38 am

What happens when server crash

Fri Jul 11, 2014 9:08 am

i want to make a alarm that you can control true a webpage. the webpage is been worked on but that 's not realy the problem.
the GPIO have constantly been checked when the alarm is on. what happens when my server crasht ? i'm thinking about 3 solutions but do not know which i need to choose for security. because the system needs always to work !

- using PHP on the webserver and controlling the GPIO on this way
- using a C++ program that get his data from the webpage and control the GPIO ( do not know if it still works when server crash ?
because will the rpi still performance good or what happens ? )
- using external hardware with a I2C connection and just use the rpi only for the webpage and the controlling for I/O will happen without the rpi.

my english is not so good :D

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: What happens when server crash

Fri Jul 11, 2014 1:57 pm

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.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

gilles951
Posts: 2
Joined: Fri Jul 11, 2014 8:38 am

Re: What happens when server crash

Fri Jul 11, 2014 5:55 pm

thats what i meant. thank you for the reply. i was hoping that i could use only the rpi so there will no extra cost.
but your idea is better than mine. i was just thinking if the server crasht that it wil auto reboot and that on that way there where no problems. but this watchdog / controller of i/o is a great idea

thank you :D

Return to “Networking and servers”