Startup sound and LED

Build/modify/repair equipment and improve systems performance by yourself

Startup sound and LED

Postby alex.penkov » 29 Aug 2015, 03:15

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.
alex.penkov
 
Posts: 4
Joined: 27 Aug 2015, 01:44

Re: Startup sound and LED

Postby sumondigi » 15 Jan 2016, 05:22

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?
sumondigi
 
Posts: 2
Joined: 14 Jan 2016, 18:37

support RuneAudio Donate with PayPal


Return to DIY and tweaks

Who is online

Users browsing this forum: No registered users and 1 guest