Page 1 of 1

Startup sound and LED

PostPosted: 29 Aug 2015, 03:15
by alex.penkov
I made some modifications to indicate the web-interface become available after power one. It is includes playing of a sound and using LEDs connected to GPIO.
First, we need script wich will perform the actions:
Code: Select all
nano /usr/bin/startup.sh

The content could be the following:
Code: Select all
#!/bin/sh
# LEDs firts.

for i in 97 108  #This is for Odroid C1+. Put desired GPIO pins here
do
echo $i > /sys/class/gpio/export
echo out > /sys/class/gpio$i/direction
echo 1 > /sys/class/gpio$i/value
done

#play a sound
mpg123 -a hw:1,0 /srv/http/startup.mp3

exit 0


Put your startup sound file to /srv/http folder. Make the command
Code: Select all
chmod +x /usr/bin/startup.sh

Now, we should modify the Rune to launch this script after initial loading.
Code: Select all
nano /srv/http/command/rune_SY_wrk

Find the line
Code: Select all
runelog('--- NORMAL STARTUP');

Insert above that line the following:
Code: Select all
// Startup sound
sysCmd('/usr/bin/startup.sh > /dev/null 2>&1 &');

That's all. Then the system will be ready, it will swith LEDs ON and play the sound.

Re: Startup sound and LED

PostPosted: 15 Jan 2016, 05:22
by sumondigi
Hello!!
That is great attempt . I want to add up some led bar graph with RPI's GPIO, but no clue.Can u help me to sharing some method- codes or links?