Newsletter – 08/28/2022

SPECIAL STRAND TECH TALK NEWSLETTER

Welcome to the special edition of our Strand Weekly Newsletter.   Today we are talking about technical upgrades to the theater.    This is heavy duty stuff, you have been warned!

ELECTRONIC MESSAGE CENTERS

We have our electronic posters in the front windows.   There are two of these.  The displays have been there for several years.   The way we control those displays, however,  has changed.    Before each display was updated by loading in the images to be displayed on a flash drive.  Not only was this a time consuming process, but the images had to be rotated 90°.    It was no fun.  That is now in the past as the images can now be updated remotely.

Our principal volunteer marketer lives in Bloomington, Indiana, so she isn’t around to update the displays.   Our local volunteers receive emails, we then check to make sure the format is correct and rotation is proper.   The process of downloading the images from Bloomington, then uploading them onto the proper flash drive begins the process.  Those flash drives are then installed in one of three displays.   The display then needs to be set to scroll through the images.  This happens each and every time.  Whew!

Below is the code our technical guru Cody Veerkamp wrote to control the displays.   This is what makes the system tick.  Enjoy!

Note: To satisfy our email newsletter platform validation, curly braces in the code below had to be replaced with parenthesis.

#!/bin/bash

#Script Name:    Strand Poster TV Update Script

#Description:    Script designed to be ran at intervals (ex. every 15min) that queries a URL with a specially designed page, reads the hash

#                from the first line of the page, and compares it to the locally stored hash, and if they differ, the local images are deleted

#                and new images are downloaded and the slideshow restarted

#Author:         Cody Veerkamp

#Origin Date:    8/1/2022

#Version:        1.0

#Version Date:   8/6/2022

#Author URI:     http://www.avtechy.com

#Query the website for the current hash version and image URLs

current=$(wget http://strand-theatre-shelbyville.org/#######/ -q -O -)

#Save the hash on the first line to its own variable

revision=`echo “$(current)” | head -1`

#Read locally stored hash to variable

myrev=$(<rev.md5)

#If script was not able to read URL (i.e. no internet, website down, etc.) then set “revision” equal to “myrev”, 

#to trick the script into thinking it is up-to-date & rest of script is skipped

if [ “$current” == “” ]; then

    revision=”$(myrev)”

fi

#Check if current does not equal myrev

if [ “$revision” != “$myrev” ]; then

    #Posters need updated

    #Update local revision number

    echo “$(revision)” > rev.md5

    #Kill existing process of fbi

    pkill -f “fbi”

    #Delete existing poster images

    rm *.jpg

    rm *.png

    #Download new images

    first=true

    while IFS= read -r line; do

        #If this is the first line, skip, as the first line has the hash

        if [ “$first” = true ]; then

            #Set first to false so subsequent lines will be processed

            first=false

        else

            #Download the image file on this line

            wget “$line”

        fi

        done <<< “$current”

    #Restart fbi, showing any jpg or png files in the working directory

    exec fbi -a –noverbose -t 5 -T 1 -d /dev/fb0 *.(jpg,png) &

fi

The Strand is an all volunteer organization.   Upgrades such as this make it possible to engage and retain volunteers.    We did some math and this upgrade saves approximately 38 volunteer hours per year!    Thank you to Cody Veerkamp for donating his talent and expertise to accomplish this task.