del
Posts: 5
Joined: Sun Sep 16, 2012 11:05 am

RPi 3 as digital notice board

Tue Jul 19, 2016 1:56 pm

Or more accurately, as an automatic powerpoint presentation player....

EDIT: if troubleshooting is not a good forum for this, please feel free to move. Just wasn't sure what it would fall under.

This is what I would like to do.
Have a script that starts automatically on boot.
Opens the most recently modified presentation (in presentation mode with libreoffice impress - possibly needs to be read only mode also so the file can continue to be updated from another machine) in a CIFS mounted smb location.
Scans the same folder every x minutes for updates to files.
If a newer file is found, close (either gracefully or kill) libreoffice impress process and reopen with newer file.
Rinse and repeat.

This is what I have so far;
watch.sh

Code: Select all

#This script scans '/mnt/presentations' every two mins for a more newer file. If it finds one, it will run restartPresentation.sh (at least I hope it does. It seems to work but sometimes it launches the script twice or more times)
while true
do
   touch  ./lastwatch
   sleep 120
   find /mnt/presentations -cnewer ./lastwatch -exec ~/restartPresentation.sh \;
done
restartPresentation.sh

Code: Select all

#Kill libreoffice processes
killall oosplash
killall soffice.bin
#remove lockfiles (not needed if I can get read only & presentation mode working)
rm -r /mnt/presentations/.~lock.*
#open LibreOffice. --show for presentation mode. --view for readonly. But these commands don't work together.
libreoffice --show --view `ls -tr /mnt/presentations/*.pptx | tail -1`
* Cannot use inotify with CIFS / SMB locations
* Can't get the presentation to open in presentation mode AND read only (causes problems with recovery of docs on restart when opened in edit mode)
* Lots more problems, like the application not ending gracefully. Application not ending at all sometimes. Bash windows never ending, cause new scripts to stall until intervened with.

I've also done more testing with other stuff but my brain is melted right this moment and I can't for the life of me think what else I have done.

My scripting leaves a lot to be desired. But if someone could help me out with this, I would really appreciate it. Feel free to merge the scripts. There is no reason for them to be seperate, that's just where my rabbit hole lead me.

Thanks in advance!

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: RPi 3 as digital notice board

Tue Jul 19, 2016 2:20 pm

Some other presentation projects for comparison or source of ideas: viewtopic.php?f=38&t=150277

del
Posts: 5
Joined: Sun Sep 16, 2012 11:05 am

Re: RPi 3 as digital notice board

Wed Jul 20, 2016 10:54 am

Thanks, I'll definitely check that out.

Return to “Troubleshooting”