yvo Geschrieben July 19, 2024 at 08:00 Geschrieben July 19, 2024 at 08:00 Dear list For a measurement-device, I had to implement a delayed shutdown of the entire device. The device is a RPi in combination with a HAT. The delayed shutdown and power-cut is realized using a manual switch and a IndustrialDualRelais. You will find a more detailed description in the following thread (last entry): Combined power-supply of HAT and RPi Reason for the delay is, to provide more time to the RPi to write all data to the disk. The approach described in the link above works perfectly. But ... I am cutting the power-supply of the RPi the hard-way without running a proper shutdown of the RPi. But if I am calling a correct shutdown of the RPi by os.system("sudo shutdown now") the HAT will not react anymore and the used HAT-funktion hat.set_sleep_mode(0, 2**32-1, True, True, False) is not working/called anymore. Question: Any ideas to combine a shutdown of the RPi, the hat.set_sleep_mode and the following cut of the entire power-supply? Looking forward to any ideas and hints. Cheers. Yvo Zitieren
MatzeTF Geschrieben July 19, 2024 at 10:49 Geschrieben July 19, 2024 at 10:49 The first parameter of set_sleep_mode() is the sleep delay. If you don’t pass 0 but guess how long it takes to shut down the system and then enter that, it should work as expected. For example, if the shutdown usually takes 10 seconds, just pass 15 to set_sleep_mode() and then call "shutdown now". Zitieren
yvo Geschrieben July 19, 2024 at 12:47 Autor Geschrieben July 19, 2024 at 12:47 Dear MatzeTF Ahh, sometime the solution is to easy to be found. Thank you very much for the hint. Works perfectly. Cheers and a nice weekend. Yvo Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.