Safe shutdown of Core2-ROS

Hi,

Is there any way to safely shutdown core2-ROS from a GPIO signal. That means safely shutdown the RPI first and then give a feedback to an exernal microcontroller and then STM32 shutdown itself.

Thanks in advance.

Mehedi

Hello Mehedi,

To shutdown RPI with use of GPIO you will need to build your own script. You can use this tutorial to read GPIO state, then call shutdown with os.system().

STM32 controller require external switch to cut-off the power, there is no programmable way to set low-power mode.

Regards,
Łukasz

Hi Lukasz,

Thanks for the insightfil reply.

So, from your reply I understand that I have to do the following

  1. monitor one rpi gpio for shutdown signal with a script like in the tutorial. The rpi shutdown signal can come from stm32 or the external microcontroller.

  2. Shutdown stm32 by cutting the power with an external switch controller also by the micro controller. In this case, I can use a relay to cut the main supply for core2-ROS.

Is there any easy way to determine rpi actually properly shutdown after step 1 ? Do we have something in hframework that can check if the rpi is on or off ?

Thanks again.

Mehedi

Hi Mehedi,

hFramework does not provide such functionality.
There is a gpio-poweroff overlay which seems to do what you want, you can find appropriate manual here.

Regards,
Łukasz

Hi Lukasz,

Thanks again for the pointer.
Regards.

Mehedi