Scripts after rc.local?

Until last week I had a perfectly working setup with Volumio 1.55, where the rc.local included the following lines:

[code]/var/www/command/player_wdog.sh startup & > /dev/null 2>&1

echo “23” > /sys/class/gpio/export
echo “out” > /sys/class/gpio/gpio23/direction
echo “0” > /sys/class/gpio/gpio23/value
/usr/local/bin/gpio/handle_speakers.sh > /dev/null 2>&1 < /dev/null &
disown

/usr/local/bin/llctl/llctl f0
/usr/local/bin/llctl/llctl l0
/usr/local/bin/llctl/llctl d0

/opt/vc/bin/tvservice -off

echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor’
echo 200000 > /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq

exit 0
[/code]

The first group enables GPIO23 that I’m using to turn on and off external speakers whenever sound is playing/stopped.
The second group turn off the ethernet LEDs, because they attract insects and because they affect the stability of the USB voltage.
Then I turn off HDMI and I enable frequency scaling.

Two days ago I installed HiFiBerry DAC (not DAC+ because I have R-Pi B) and sound seems to be working, but:

  • GPIO is not set anymore (the GPIO23 is not enabled after boot), but if I run again the same three lines as root afterwards (from SSH) it works fine. HiFiBerry does NOT use GPIO23, it is also provided on the expansion port on the top.
  • the ethernet LEDs are clearly turned off during boot (I see them going off) but then they are enabled again. This one too, if I disable them manually via SSH, then they stay off forever.

The only change seems to be HiFiBerry DAC.
Do you have any idea what could be causing the issues? I already tried changing the sequence of the groups in rc.local.

Strange, I rebooted and now the GPIO block at the beginning works.
Still, the network LEDs are on.

very interesting idea

Actually now the Ethernet LEDs don’t stay off even if I execute the commands via SSH.
Either something in Volumio 1.55 (compared to 1.51) or in the new DAC cause them to return to default.

maybe need some delay fos use?

What do you mean?

I suspect that this is due to DTB pin configuration:
raspberrypi.org/documentati … uration.md

Basically, with the new Device Tree loading of i2s dacs (they are invoked trough a dtb file, instead of loading modules at startup) the GPIOs you were using before may have been reserved or their default state is different.

So you need to recompile the DT-BLOB with your custom pin configuration…
Let me know!

Thanks for the effort, but it looks too much work for some simple LEDs… Especially since I am not using the USB anymore and the periodic change of voltage from the LEDs is not affecting the external DAC (probably not even back then…). And for the light, I can find simpler solutions.