RPi GPIO High at boot time and keep high when booted

All,

how can I put my RPi GPIO in the state high during bootup and as initial state in cayenne

I use cayenne to control my pond infrastructure but when I boot the RPi all relais are going to the low state and will shut down the power on all my pumps, which I should avoid after a reboot, they should come directly into the high state. In version 1 you could revert the state when you created the relais, but I don’t know how to do it in version 2.

Thanks in advance

Yves

At powerup the GPIOs are pulled either high or low through the internal resistors. Whether the pull is high or low for a particular GPIO is detailed on page 102 of https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf You can write a python script or bash script which manually sets the pin to HIGH and schedule a cron job to run at every boot.

Like you mention I made a script which I have put in the crontab and at each reboot I set the GPIO pin to high with a delay of 15 sec, this gives it the time to start the cayenne service and then change the setting to be high.

Thanks for the advise.

PS : would be easy if we could do this from inside the software itself.

will take this into consideration.