Showing posts with label public announcement system. Show all posts
Showing posts with label public announcement system. Show all posts

Friday, October 13, 2017

Making an embedded Audio PA System with a web based UI

In my post how to make digital signage and PA system using a google chrome box it worked well for a while but then we had issues with the audio announcements double playing, skipping or not playing at all.  It was very odd, so to rectify this issue I built a new PA system using an old Foxconn AMD E-350 AT-3350 with 4GB of RAM and loaded with Windows 7 Embedded.

The PA System run WAV files at a specified time using task scheduler.  This just opens the default player (windows media player in this case) and runs the file.  This means that the user must be logged into the system to run so if you setup RDP you will have to just disconnect (do not logout).  I also created a Web Based UI using XAMPP for Windows as the base Apache 2 install with minimal settings.  I've also used a 3rd party plugin called nircmd.  This allowed me to make a php file to run a mute/unmute command.  This machine has no access to the internet and is only accessible from the intranet due to security concerns.


Task Scheduler with the wave file schedule
I changed the root directory to a folder we will call PA.  In there I have a file called sound status which tracks if the sound is enabled or disabled.  This is loaded into the index.php file on load which uses a if else statement for displaying the status and the button.


Web Directory
The code for the php files that are executed using nircmd are setup like so


nircmd.exe mutesysvolume 0 - Sound is Enabled


nircmd.exe mutesysvolume 1 - Sound is Muted

The PHP files for enabling and disabling the sound are seperated out from the index.php file because it would run the mute/unmute commands when loading the page.  Lets go over the index file first.  We have the index file loading a txt file with a true or false value.  The sound is either on or off.  The we use a simple if statement to display if we are displaying the sound is on or off.
Code for the index.php file
The buttons for enabling and disabling the sound are php files which run the bat script for muting and unmuting the sound writes the new value to the soundstatus.txt file and then sends you back to the index.php page.


PHP Files for enabling and disabling sound
The PHP code is fairly simple.

system('cmd /c $YOURPATHTONIRCMD.EXE mutesysvolume 1');

as I described above this is the command for muting the sound, using the NIRCMD utility.

Then I built used a responsive web based UI for enabling and disabling the sound.


PA System Desktop Showing Sound Enabled


PA System Desktop Showing Sound Disabled


PA System on Mobile
UPDATE!

To reset the PA System Audio to enabled I setup a task scheduler event to run a bat file that runs nircmd.exe mutesysvolume 0 at 6:00 am.  With this in mind you also need to update the soundstatus.txt file so when the GUI load it registers that the sound has been re-enabled.  To do that I decided to use powershell, specifically the Out-File utility.
"on" | Out-File $PATHTO\TEXTFILE.txt

Now by doing this if I want to run it as a .ps1 file I need to allow powershell scripts to run the powershell scripts you run powershell as an administrator and 

Set-ExecutionPolicy Unrestricted

Now this IS a security risk and I will be looking to make something that is more secure in the future, in the mean time it is a stopgap measure that his acceptable since the access to the device is intranet on port 80 and RDP only.  The script above leaves some forward character garbage so I also changed the lookup logic of the PHP file to look and see if the sound is off.  This way be default it assumes the sound is on, and only checks to see if the sound has been disabled.

Friday, September 22, 2017

Using a ChromeBox for digital signage and PA System

I was tasked to look into a replacement for a digital signage/public announcement (PA) System.  The old signage/PA system was running a single core 2.0 Ghz AMD barton running windows xp.  The System is about 15 years old not really maintained and extremely dated.  After looking at some third party vendors and the costs associated with them, we looked at using the new Google Sign Builder since the organization is on Google Apps anyway and it wouldn't hurt to look into a low cost, easy way to update and manage the digital signage/PA System.


The chrome devices are administered through the sign builder app and the Google Admin.

Chrome Management

Devices can be given different permissions, and settings by use of subdomains in the google admin area.  For example, there are 11 kiosk stations and 1 signage station and 1 general use chrome device for meetings.

As you can see you can assign devices to different sub domains which also allows you to give them different permissions and lets you also assign different chrome apps.

The chrome signage settings are found under chrome management in the picture above under device settings.  In the picture below I have chrome sign builder assigned to the signage sub domain and no other sub domain.


Chrome Device Settings

Chrome Sign Builder Kiosk Settings

With chrome sign builder you can assign all day schedules and you have a variety of settings you can use.  What was required for this project was the ability to do an all day running sign can can get updates, and run the closing announcements.  I found that it can do both.  However when you set this up make sure if there are others that need access you use a universal account; currently chrome sign builder can only work under one account.

I also found that the most important part of the URL for using chrome sign builder is 

pub?start=false&loop=false&delayms=3000

start is set to true otherwise the slides will not play.  Start should always be set to true.

loop, if you want to have the presentation loop or not.  

delay, how long you want the slides to be on for before moving on to the next slide. (default is 3 seconds)


Signage Running (All Day Schedule)

The signage I've setup to run in presentation mode, with auto start and to loop with a delay of 7 seconds before switching slides.

https://docs.google.com/presentation/embed?id=1yourgoogledocumentULR&start=true&loop=true&rm=minimal&delayms=7000

As you can see in the image below I've also set the URL to reload every 10 minutes so that if any changes are made to the document it gets shown on the signage. (This is the setting for the all day schedule)



PA System.

The chome sign builder can work double duty much like the signage system before.  What I've done here is setup 3 separate google slides.  Since Google sides doesn't play audio I've converted the audio files that are used into movies using handbrake.

Some interesting things that came up while I was working with this.  The media I was working with is only about 30 seconds long (max) but if I set the content time to 1 minute it does not play also setting the zone size to 1px by 1px also caused a problem. 


NOTE:

The URL looks like this https://docs.google.com/presentation/embed?id=1yourgoogledocumentULR/embed?start=true&loop=false&rm=minimal&delayms=60000&slide=id.p

These must have &slide=id.p to the url of the slide otherwise it will not play 

The content time I required was only 1 minute but it would should be set to 3 minutes.

zone is set to lower right and a size of the to 10px by 10px.  The Slides I need to play play but do not show up in front of the other signage.



Chrome Signbuilder Schedule

Example of PA System Notification Settings




Fix a windows network printer that is offline

How to fix a network printer that get's installed and shows offline. By default SNMP is set to public, so when you are installing a netw...