• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hardware watchdog in a container
#1
The netPI CPU supports a hardware watchdog. Once triggered by software it monitors in a time frame of 10 seconds if it was retrigger again else it resets the CPU and forces a reboot of the device.

This behaviour is good for monitoring your netPI software if it is running stable. For example the Docker daemon or simply said if a container is running.

All you need to do is to deploy a container that has the host device "/dev/watchdog" mapped. With the mapping the device gets accessible in the container.

Mapping alone does not start the watchdog. This needs to be initialized by software and if started periodically retriggered.

Here is a a simple script you should run in the background in your container that triggers the watchdog every 5 seconds

Code:
#!/bin/bash
while [ true ]; do
    echo 1 > /dev/watchdog
    sleep 5
done

But please keep in mind once the watchdog is triggered it is active and in case stop the container for any reason your device will reset.

To disable the watchdog use the embedded console function of netPIs Docker web UI that allows you to enter the container, kill the watchdog calling bash script process first and then call

Code:
echo 'V' > /dev/watchdog

This will deactivate the watchdog until it is retriggered again.

Thx

Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Messages In This Thread
Hardware watchdog in a container - by Armin@netPI - January-7th-2021, 07:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Ethernet trouble(Hardware failure?) m-yoshikawa 13 6,834 June-28th-2021, 08:43 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)