To configure Raspberry Pi system to interact with YKRUD2 you need to:
Start by downloading the YKRUD2_Linux_Scripts.zip package, which contains the scripts, available from the YKRUD2 product page.
After download extract the files to a folder of your choosing. In this setup ~/bin folder is used.
YKRUD2 uses GPIO 17 and 18 to control the RasPi soft-switching and these have to be correctly configured in RasPi operating system.
For more information on the Raspberry Pi GPIOs refer to this page.
To configure the GPIOs the gpio_setup.sh bash script should be executed.
The GPIOs should be configured automatically during the boot process. To ensure this add the following line to the /etc/rc.local script in your system.
The listener script will handle the interaction with YKRUD2 and trigger the poweroff Linux command when required. It will periodically monitor the YKRUD2 Out GPIO to check if the shutdown command has been triggered by the user (through the pressing of the push button in YKRUD2 board). If so, it will execute a confirmation communication protocol with YKRUD2 and if everything is OK it will issue the Linux poweroff command.
To setup the listener the ykrud2.sh script should be executed. This script should be called during the boot process. To achieve this add the following line to /etc/rc.local file.
To connect the YKRUD2 board to Raspberry Pi just insert it into the GPIOs header as shown in the image bellow.
Finally plug the 5V power to the YKRUD2 board as shown in the picture bellow.
With everything connected, just press the push-button to power up the Raspberry Pi. The LED will start blinking and once the boot process is complete the LED will stop blinking and stay continuously lighted.
To do a soft shutdown of the Raspberry just press once the push button. The LED will blink, halt for a short while and then it will start blinking again. If the LED suddenly stops blinking and stay continuously ON or OFF, press the push button again. Once the Raspberry Pi is off it will wait a short while and then it will cut the power to the Raspberry Pi board. At this point the YKRUD2 LED will turn off, but the YKRUD2 board is still powered on and working waiting for a press of the push button to power on the Raspberry Pi board triggering the boot process again.
For additional support, you can reach us through the form in our support page.
For more information and resources for the YKRUD2 board please visit the product page.