The task was to use two Raspberry Pi computers to interpret when a microphone in the studio is ‘live’ and to display a ‘mic live’ warning on a monitor hanging in the reception area of the Radio Studio.
The Studer Micro Core sound desk can be setup to send a GPO whenever a mic fader is raised from its end stop. This means that I can use the Raspberry Pi’s GPIO pins to interpret this signal and update the signage as necessary.
One Pi is located with the Studer Micro Core running a Python script listening to the rise and fall of the GPIO pins. I adapted from the tutorial I found here https://learn.sparkfun.com/tutorials/raspberry-gpio/python-rpigpio-example. If the mic is live I set a local “mic.txt” to true, and if not live to false.
From the second Raspberry Pi, located on the studio information board, I use this true/false information to decide which html document to load into a space on the screen.
Each of the boxes at the bottom use jQuery to load a separate html document to display the status of the studio and mics. The html, for example mic1.html is re-written by a shell script that checks to see if the earlier text file is a 1 or 0. mic1on/off.sh is just another shell script that writes the new html code to file.
#!/bin/bash file="/home/pi/Info/status/mic1.txt" STATUS=$(cat "$file") if [ $STATUS == "0" ] then /bin/bash /home/pi/Info/status/mic1off.sh fi if [ $STATUS == "1" ] then /bin/bash /home/pi/Info/status/mic1on.sh fi
Other useful tutorials I used to complete this project are:
Boot Raspberry Pi to a full screen kiosk browser – https://blog.gordonturner.com/2017/07/22/raspberry-pi-full-screen-browser-raspbian-july-2017/
Circuit wiring and general explanation of GPIO pins on the Raspberry Pi – http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/robot/buttons_and_switches/