Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

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

Geschrieben

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".

Geschrieben
  • Autor

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

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...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.