Hello,
I have a Rpi 3B+, counting output from a production machine. I want it to shut down and start in sync with the actual machine.
I have wired a relay from production machine with No contact to Rpi, where it is connected to the GPIO3 and GND pins. They are the standard 'on/off' -switch pins.
I don't want to pull out the 230v main directly with the relay, because I want the Rpi first to get the signal that it should shut down - It can first run the needed functions for saving data to MySQL etc.
This 'power switch' thing has been under testing for a week now. Once Rpi had not shut down at all in the evening, and today it didn't wake up in the morning. It has had successful shutdown/run cycles about 17/20 times now. Doesn't seem bullet proof.
The strange thing today morning when it hadn't started was that I did connect and disconnect the GPIO3 and GND several times, but the wake up didnt work. Only after I pulled off the main cord and plugged it in the Pi woke up. After this I tested it many times and it worked normally - shut down when the relay goes inactive, and while its shut it wakes up after a relay is triggered.
I know that this is little bit sensitive for quick state changes of the relay. If I shut down the main machine and the relay goes inactive, I need to wait for the pi to be totally shut down before the GPIO3 wake function works. If the relay is activated too early, it won't wake up. But today it didnt wake up at all until power cord was taken off.
Any ideas what could have effect on the reliability of this function?