Your RevPi Connect is equipped with a hardware watchdog.
A watchdog is a timer that runs for 60 seconds after power up and then restarts the RevPi. Therefore, as long as your system is functioning properly, the watchdog must be restarted again and again. If an error occurs (e.g. if the application process crashes), this restart does not take place and the watchdog restarts the system.
We supply you with a plug that is already prewired. The watchdog is deactivated by the jumper on terminals 6 and 7.
The watchdog is active without this cable and the watchdog timer must be restarted cyclically by your application software so that your system is not restarted. Until you have such software, it makes sense to deactivate the watchdog. Otherwise it might disturb you during your development work.
- Remove the jumper cable from pin 0 to pin WD to activate the watchdog.
Monitor Connected Devices
A relay output makes it possible for devices connected to the X2 connector to be monitored by the watchdog.
You can switch the relay output bitwise in the process image (RevPiLED, bit 6). With this you can also set that the relay switches if the watchdog has reported an error, for example.
On your RevPi Connect you will find an example script.
You can find the file “watchdog.sh” in the directory “/etc/rc.local”.
You can execute the script by typing the following command in the command line:
This script is only an example and is not suitable for controlling watchdog or relays. However, you can use it as a template to create your own command in an application program (e.g. logiRTS).
This is how you use the watchdog to restart the relay:
- Patch the FTDI-EEPROM:
sudo /home/pi/connect/patch_eeprom d:1/$devnum 0x14=0xaa 0x15=0x00
You no longer have to do this step if you have already used the watchdog to control the relay.
- Restart RevPi Connect.
- Enter one of the following commands to turn the relay on or off when the watchdog responds:
You have to run the command again after each reboot.
If you have entered this command, it is possible that the interface “/dev/ttyRS485” will temporarily disappear.