Remote Heartbeat Monitoring
Ensuring continuous system uptime and internet connectivity is a critical safety requirement for the Training Village ecosystem. In the event of a localized power outage, an animal could potentially become trapped inside the operant box without access to water. Because a dead system cannot broadcast native alarms, a local failure would otherwise go unnoticed until the system fails to deliver its automated twice-daily status reports (sent during the day/night cycle transitions).
To detect system failures immediately, the Training Village utilizes an external “dead man’s switch” monitoring service called healthchecks.io.
Instead of the server reaching into your Raspberry Pi, the Training Village background service sends an outbound HTTP request (a “heartbeat” or “ping”) to healthchecks.io every hour. If the service does not receive this ping within the expected timeframe, it concludes that your system has lost power or internet, and instantly alerts your team.
Step-by-Step Setup Guide
Phase 1: Configure Healthchecks
Go to healthchecks.io and create a free account.
Once logged into your dashboard, click Add Check.
Configure the check’s timing parameters:
Period: Set this to
1 hour. This is how often your Raspberry Pi will check in.Grace Time: Set this to
5 minutes. This prevents false alarms caused by minor network lag or timing variations.Name: Give it a recognizable name, such as
Training Village - Lab Room X.
Look for the unique Ping URL generated for this check (it will look like
https://hc-ping.com/your-unique-uuid). Copy this URL to your clipboard.
Phase 2: Link Healthchecks to Your Telegram Group
To ensure all connectivity alerts arrive in the exact same Telegram group chat used by your system bot:
On your healthchecks.io dashboard, click on the Integrations tab at the top.
Locate the Telegram option and click Add Integration.
Follow the on-screen instructions provided by the healthchecks bot. It will prompt you to invite the healthchecks notification bot into your existing laboratory group chat and provide the same Group Chat ID you retrieved during the Telegram setup phase.
Send a test notification from the dashboard to verify that the group chat receives the alert successfully.
Phase 3: Update Your Village Settings
Open a terminal on your Raspberry Pi and launch the application interface by typing
village.Navigate to SETTINGS → TELEGRAM SETTINGS.
Locate the HEALTHCHECKS_URL field and paste your unique Ping URL there.
Save your changes and exit.
Uptime Verification
Once saved, the Training Village will immediately send its first heartbeat signal. Refresh your healthchecks.io dashboard web page; the status indicator for your check should turn from a grey “New” state into a green “Passed” state.