Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ==== Configuration of the Outputs of the control relays ==== File ''/etc/rc.local'' Edit the file with the command (Add this code at the end of the file just BEFORE "exit 0") <code bash> sudo nano /etc/rc.local </code> <code bash> #RELAYS OUTPUTS echo "20" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio20/direction echo "21" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio21/direction echo "22" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio22/direction echo "23" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio23/direction </code> ==== Tests of the Outputs of the control relays ==== You can verify the correct functioning of the outputs of the relays with the following code <code bash> sudo nano test-relays.sh </code> <code bash | test-relays.sh> #!/bin/bash # Sequence of testing the 4 relays for i in `seq 20 23`; do echo 1 > /sys/class/gpio/gpio$i/value sleep 1 done for i in `seq 20 23`; do echo 0 > /sys/class/gpio/gpio$i/value sleep 1 done for i in `seq 20 23`; do echo 1 > /sys/class/gpio/gpio$i/value done sleep 1 for i in `seq 20 23`; do echo 0 > /sys/class/gpio/gpio$i/value done </code> For running the code <code bash> sudo python test-relays.sh </code> root@f5uii-serveur:/var/www/dwiki/data/pages/en# cp essais_des_sorties_relais.txt /tmp/essais_des_sorties_relais.txt root@f5uii-serveur:/var/www/dwiki/data/pages/en# cat /tmp/essais_des_sorties_relais.txt ==== Configuration of the Outputs of the control relays ==== File ''/etc/rc.local'' Edit the file with the command (Add this code at the end of the file just BEFORE "exit 0") <code bash> sudo nano /etc/rc.local </code> <code bash> #RELAYS OUTPUTS echo "20" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio20/direction echo "21" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio21/direction echo "22" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio22/direction echo "23" > /sys/class/gpio/export & sleep 2 echo out > /sys/class/gpio/gpio23/direction </code> ==== Tests of the Outputs of the control relays ==== You can verify the correct functioning of the outputs of the relays with the following code <code bash> sudo nano test-relays.sh </code> <code bash | test-relays.sh> #!/bin/bash # Sequence of testing the 4 relays for i in `seq 20 23`; do echo 1 > /sys/class/gpio/gpio$i/value sleep 1 done for i in `seq 20 23`; do echo 0 > /sys/class/gpio/gpio$i/value sleep 1 done for i in `seq 20 23`; do echo 1 > /sys/class/gpio/gpio$i/value done sleep 1 for i in `seq 20 23`; do echo 0 > /sys/class/gpio/gpio$i/value done </code> For running the code <code bash> sudo python test-relays.sh </code> {{youtube>jdAb_zyPq0k?medium}} en/essais_des_sorties_relais.txt Last modified: 2020/07/05 17:13(external edit)