How to set default power state to off on a pi in the cluster-stack?

24 views
Skip to first unread message

capnrob97

unread,
Jun 7, 2021, 3:30:53 PMJun 7
to ClusterHAT
I see this on the cluster-stack page:

Connecting the ClusterCTRL Controller (via the Micro USB connector) you can use our "clusterctrl" tool which allows you to:

Configure power on state (each individual Pi can be set on/off by default).

I have the pi closest to the stack controller running the clusterctrl software, 

but what command set's the default power state of P5 to off?

I can use 'clusterctrl off p5' to turn it off, but when I unplug the stack and power back on P5 restarts.


Chris Burton

unread,
Jun 7, 2021, 4:44:52 PMJun 7
to ClusterHAT
Hi, 
First you need to get the "order" of the ClusterCTRL Stack (20 by default) - see the clusterctrl output docs.

Then set the power state you want at power on with "clusterctrl on ..." / "clusterctrl off ..." as normal and run "clusterctrl savepos 20" (replacing 20 with the "order") to write it to the EEPROM.

It should then power up based on the saved state.

Any problems let me know.

Chris.

capnrob97

unread,
Jun 7, 2021, 5:58:59 PMJun 7
to ClusterHAT
Works like a champs, thanks!

One other question, is the 1 second delay between starting each pi in the stack configurable?

The reason I wanted to have some down at restart is I rarely get all 5 booted successful and think the 1 second delay may be too short for my setup, and would like to change it to 1 minute delay.

Chris Burton

unread,
Jun 9, 2021, 3:47:17 AMJun 9
to ClusterHAT
Hi, 
One other question, is the 1 second delay between starting each pi in the stack configurable?

Not without editing the config.h file, recompiling and then writing the updated firmware to the IC. But this isn't something I'd advise doing with large delays (more than a couple of seconds) otherwise when you boot the controller Pi it won't detect the ClusterCTRL Stack as the communication interface on the ClusterCTRL Stack isn't available until after the power on delay(s).

The reason I wanted to have some down at restart is I rarely get all 5 booted successful and think the 1 second delay may be too short for my setup, and would like to change it to 1 minute delay.

If you want such a long delay I'd probably set only P1 to power on by default if you're using that for the controller.

Then add something similar to the lines below to the pi/root users crontab to power them on.

@reboot (/usr/bin/sleep 1m;/usr/sbin/clusterctrl on p2)
@reboot (/usr/bin/sleep 2m;/usr/sbin/clusterctrl on p3)
@reboot (/usr/bin/sleep 3m;/usr/sbin/clusterctrl on p4)
@reboot (/usr/bin/sleep 4m;/usr/sbin/clusterctrl on p5)

Your clusterctrl script might be in /sbin/clusterctrl or /usr/sbin/clusterctrl currently you can check by running "which clusterctrl" and then alter the lines above if needed.

Chris.

capnrob97

unread,
Jun 9, 2021, 10:51:12 AMJun 9
to ClusterHAT
That should work, thanks!
Reply all
Reply to author
Forward
0 new messages