Duet 3 + raspberry: power management
-
What is the correct method to manage the raspberry shutdown sequence?
I'll connect a stop button (and probably a relay connected to the duet) to shutdown the 24v psu and the splidle psu mantaining the 5v line on.
So when the 24v line is disabled the duet and the raspberry will still be on. I know the duet does no have problems with power loss but for sure the raspberry will need a shutdown button.
Does DuetPi have some system to manage that or should I use a free gpio pin to trigger a shutdown script? -
I have a 5v coil relay with its contacts connected in parallel with the mains switch and configured as active low. The signal wire is connected to a spare rpi gpio pin.
I connected a home made 6 wire cable from the duet to raspberry pi so I can free up all the unused rpi gpio pins. I connected the relay signal input to gpio pin 18.
Then I simply wrote a script that upon start up sets gpio pin 18 low. This activates the relay and then lets me turn the power switch off.
To turn everything off I just simply shutdown the pi and the gpio pin stays low long enough for the pi to completely shut down.
This works great for me. The only downside is that upon start up, you have to wait for the pi to fully boot before the relay is latched but that is not a problem for me.
-
@chas2706 are you driving the relay directly from the Pi or does the relay have some sort of driver associated with it? What mechanism are you using to shut the pi down?
-
@gloomyandy said in Duet 3 + raspberry: power management:
are you driving the relay directly from the Pi or does the relay have some sort of driver associated with it? What mechanism are you using to shut the pi down?
Its a cheap relay module from amazon and has its own driver and protection circuitry.
Its power range is from 3v to 5v so I have powered it straight from the pi's 0v and 3.3v pins. -
@morgoth90 said in Duet 3 + raspberry: power management:
for sure the raspberry will need a shutdown button.
for now, your you can enable read-only file system on your own.
I did something slimiar to @chas2706 a while ago. Today I'd look into https://forum.duet3d.com/topic/13194/dsf-extension-exec-on-mcode-was-shutdown-sbc
-
I can shut the pi down in a number of different ways.
Using the pi's shutdown menu on the touchscreen, open a connection in VNC viewer or ssh into the pi.
I was using another option that uses @wilriker's Exec On Mcode which allows you to use a macro within the DWC to shutdown the pi but currently have removed this feature.
-
Thank for the ideas.
I will connect an arduino as led indicators and buttons controller to the raspberry's spi bus, that arduino probably will also trigger the shutdown event on the pi and wait for a signal (on a gpio pin?) to confirm the 5v cut.