Jump to content

hat.set_sleep_mode and "sudo shutdown" in combination


Recommended Posts

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

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...