raspberry pi hangs after not using for 1-2 days, then we have to forcibly reboot or restart the device. I have connected hardware of magnetic door lock, relay, RFID and Dual smps to the raspberry pi. But I cannot recognize the issue of why it is hanging when it is not used for 2 days. please suggest some solutions to fix the issue.
free
command every minute and log the results. You can do that with a root crontab line*/1 * * * * /usr/bin/free >> /var/log/freemem.log
.