EmonTX - EmonBase Watchdog


Hope someone could help me with that…

I’ve modified an EmonTX to connect directly to EmonBase ( Raspberry Pi Zero ) via serial port.

My EmonTX version only uses 3 CTs inputs and it’s a shield that connect over an Raspberry Pi Zero using only RX,TX, 5V and GND. with and USB Ethernet and optional WIFI.

The hardware works great, but I’m having a random crash of the Raspberry from time to time that it’s easily solved with a hard-reset.

Since this must be a completely un attended system, I can’t afford manually rebooting the raspberry every time it crash.

So I’ve prepared a watchdog in the AT328 code that expect to receive a character via serial from the raspberry every few seconds. If it does not receive the correct character from the Raspberry, it will pull to high a digital pin in arduino and activate the hard reset pin in the raspberry.

My question is, where is the best place/file in EmonSD image to include the code for sending back to the arduino a serial character together with the rest of process running?

Thanks in advance!