View Single Post
  #10   Spotlight this post!  
Unread 20-11-2013, 20:15
BBray_T1296's Avatar
BBray_T1296 BBray_T1296 is offline
I am Dave! Yognaut
AKA: Brian Bray
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Rockwall, TX
Posts: 947
BBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond repute
Re: Keeping a Server alive

Quote:
Originally Posted by yash101 View Post
Hey guys,
My RPi Web server always crashes at the wrong times (when I am not at home). I came up with this solution to reset it automatically:

Here is the sequence:
i2c interface between MCU and Pi
MCU controlling power to Pi via relay
MCU keeps pinging the Pi via i2C (sending a packet and waiting for response)
If the MCU fails the ping 5 times in a row, calls the reboot command (sudo reboot)
MCU waits 2 minutes
MCU pings the Pi a few times to see if it is alive again
Otherwise, MCU resets Pi by unplugging it and plugging it back in (relay)
MCU calls command to clear our corruptions on the HDD
MCU reboots server
Server up again!
What happens if your MCU crashes?
__________________
If molecular reactions are deterministic, are all universes identical?

RIP David Shafer: you will be missed