Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

Make: Projects

USB Watchdog for Linux with Arduino

Create a hardware watchdog device to reboot your Linux workstation if it locks up.

USB Watchdog for Linux with Arduino

A watchdog device monitors your computer to see if the OS is still running. If the system has locked up it will reset the system. High end servers come with built in watchdogs, for basic servers and workstations you can pick up a PCI card version for $100+ depending on features.

Basic watchdog cards receive a "Keep Alive" signal from the OS though a driver or a daemon process and they don’t hear from the process the basically hit the Reset button.

Instead of spending $100 or more, I built my own with a spare Arduino Board and $8.26 worth of parts from my local Radio Shack. Now I wouldn’t recommend this setup for an "Enterprise" environment, but its just fine for rebooting my home workstation automatically when my overclocked GPUs lock the system up while mining Bitcoins.

Steps

Step #1: Info

PrevNext
USB Watchdog for Linux with ArduinoUSB Watchdog for Linux with ArduinoUSB Watchdog for Linux with Arduino
  • Everything except for the Ardunio board is available from your local Radio Shack, or if you're not impatient like me, you can order cheaper online.
  • I used a proto shield , a mini bread board and some nice pre-terminated jumper wires to do the mounting, but that's all optional.

Step #2: Hardware: Wiring Arduino

PrevNext
USB Watchdog for Linux with ArduinoUSB Watchdog for Linux with ArduinoUSB Watchdog for Linux with Arduino
  • Assemble the components as shown in the diagram/pictures:
  • Green wires: ground -> transistor emitter, transistor collector -> relay coil.
  • Red wire: +5v -> relay coil.
  • Diode: relay coil (transistor side) -> +5v.
  • Black wire: Arduino Digital Pin 3 -> 1K resistor -> transistor base.
  • Yellow wires: Plug directly into the Reset pins on your PC motherboard, orientation doesn't matter. Don't hook this to the Motherboard until you have tested everything out.
  • HINT: Be aware that the RadioShack transistor is labeled from a "bottom view" on the package. I wired it backwards the first time and had to switch the wires around to compensate for the wire diagrams "top view". Good thing I started on a breadboard :)

Step #3: Code: Ardunio

PrevNext
USB Watchdog for Linux with Arduino

Download Watchdog.pde file and upload it to your Ardunio.

Step #4: Code: PC

PrevNext
USB Watchdog for Linux with Arduino
  • Download the "daemon" script and the startup/repair script
  • Daemon: USBwatchdog_keep_alive.pl
  • Start/Repair: repair_USBwatchdog.sh
  • As this is a poor forum for inputing simple code, please see the README for full installation instructions.

blog comments powered by Disqus

Featured Products from the MakerShed

Follow

Get every new post delivered to your Inbox.

Join 25,545 other followers