I’m using volumio on a pi with a hifiberry dac.
I’m also using the gpio (via two extra soldered pins) to turn on the amp and speakers remotely.
Currently, I have a shell script (which I can run via ssh) to turn on the speakers, but I’m about to start trying to add an extra button or menu option to the volumio web interface to allow me to run the batch script.
Full disclaimer - I’ve not taken a look at the code for the volumio interface yet, so I’ve no idea what technologies it’s using, but if anyone can give me a heads up on where I should be looking that would be kind.
Also if anyone has executed any custom processes from within volumio, or can tell even what webserver is running, and if there are any permission issues to contend with…
I’ll take a look at these things myself in the next few days and post back what if I find - but if anyone else has already done anything similar to this, then any pointers would be great.
Volumio is serving its web interface from nginx, which is already supporting php5.
I’ve added a new .php file at /var/www which is served as the root context of volumio.local/
Nginx is running its master and worker processes as root, however it appears to execute php as www-data (the same user apache commonly uses)
I’ve already got a batch file in /usr/sbin called flash-gpio-0.sh which does what I want, but needs to run as root to control gpio.
I can add permissions for www-data to use sudo without a password by editing /etc/sudoers.d/README (see web for instructions - this can trash your sudo command if you mistype, and create security vulnerabilities)
I can use passthru and call ‘sudo /usr/sbin/flash-gpio-0.s’ from my php file, and now I can execute my .sh script by visiting /volumio.local/speakerPower.php
Now I need to look at the structure of the volumio interface to figure out where I can add a link to this.
Anyone got any pointers?
General question - I know some setting files get wiped over with templates at boot. Is this also true of the web files in /var/www? Are there going to vanish out from under me? Should I be editing some template somewhere else?
I am of no help here, but interested in what you come up with. I’d love to do the same. Even better, if I could come up with a method of driving a digital potentiometer with the pi, I could replace the software volume control with a direct hardware control of volume on my amp. Looks like there’s potential for doing this here
raspberrypi.org/forums/viewt … 44&t=34869
Further, I’d love to add Pi temperature reporting into the interface to the interface using some of the work here
raspberrypi.org/forums/viewt … 91&t=34994
My Pi is going outside and in a box with power supply and amp, so I’d like to easily check and make sure the temp is OK.