Thank you for checking the profile.
input_test.py was useful and showed no problems.
I edited it slightly to just check GPIO24 (see below) and there was no delay in response.
Now when I try my profile with Threshold set to 1 or 2 on P1-18, there is no problem and I cannot reproduce my earlier problem. Hmm. Probably a bad contact. At least I know how to check inputs and know that the profile is fine now.
I also discovered that a version of the video that was 1920 x 1080 would, after a few plays, fail to load. I went back to an earlier 1280 x760 version and it was fine again, so maybe my problem is related to our friend the omxplayer and I shouldn't expect it to handle very large files.
I am using pipresents-next with a version of omxplayer 39e6352 dated 22nd March.
This latest exhibit will make our 6th pipresents exhibit in the galleries.
Thanks Again.
Cheers
Robert

Thank you so much for creating this great open-source software, it really is fun to work with! So I am a first time Raspberry Pi user (just recently got my Model B+) and I am trying to make a digital media frame with a PIR sensor. I should mention that I am a computer programmer and my knowledge of python is at the beginning/intermediate stage. Pi Presents seems to be almost exactly what I am looking for, so I downloaded pipresents-next and started playing around with that. I was able to play around with the code and get some functionality working that I wanted, which was subtitles for video using omxplayer. So I have been familiarizing myself with the code.

However, now I would like to use the PIR sensor to control the media frame. I have played around with the sensor and written some test programs to make sure I can detect the GPIO signals. I have also finished a version of the media frame where Pi Presents plays continuously and a separate process monitors the PIR sensor and turns the monitor off after a certain amount of inactivity. What I would like to do is to use the PIR sensor to turn off the monitor AND pause Pi Presents after inactivity. And then when the sensor triggers again, turn on the monitor and unpause Pi Presents.

I am having trouble figuring this out. I can't even figure out how to make the sensor start the media show through Pi Presents. And once I do that, is it possible to make the inactivity/activity sensor thing I want happen easily, or would I need to write some custom code. And if I do need to write custom code, where in the code base should I start?

If you use a oneshot mediashow with a 'start trigger' of input then the medaishow will wait until the PIR triggers before playing a track. pp_exhibit is an example profile that does this.

I haven't designed in a way to stop the video however if you bind the pp-stop symbolic name to the same gpio input but triggered with the opposite edge that might work provided the mediashow is on auto and has a single track. I'm going to add an INPUT end trigger one day in pp_mediashow.py.

What you might need some extra code to detect abscence from the PIR. I reckon some time delay after the last presence trigger will be required. Probably best to put it in pp_gpio.py. Also I don't know how to turn off the monitor however the screen fan be made to go black while waiting for the PIR.

sandman_artlover wrote:Hi Ken,

Thank you so much for creating this great open-source software, it really is fun to work with! So I am a first time Raspberry Pi user (just recently got my Model B+) and I am trying to make a digital media frame with a PIR sensor. I should mention that I am a computer programmer and my knowledge of python is at the beginning/intermediate stage. Pi Presents seems to be almost exactly what I am looking for, so I downloaded pipresents-next and started playing around with that. I was able to play around with the code and get some functionality working that I wanted, which was subtitles for video using omxplayer. So I have been familiarizing myself with the code.

However, now I would like to use the PIR sensor to control the media frame. I have played around with the sensor and written some test programs to make sure I can detect the GPIO signals. I have also finished a version of the media frame where Pi Presents plays continuously and a separate process monitors the PIR sensor and turns the monitor off after a certain amount of inactivity. What I would like to do is to use the PIR sensor to turn off the monitor AND pause Pi Presents after inactivity. And then when the sensor triggers again, turn on the monitor and unpause Pi Presents.

I am having trouble figuring this out. I can't even figure out how to make the sensor start the media show through Pi Presents. And once I do that, is it possible to make the inactivity/activity sensor thing I want happen easily, or would I need to write some custom code. And if I do need to write custom code, where in the code base should I start?

Any help you can give me is highly appreciated. Thanks!

- Nik.

Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

I've been trying to figure out a way to test a presentation without actually having a pi handy (my test pi got reappropriated to another room). I have PiPresents working in a Linux Mint virtual box... except for videos. I was not successful with trying to build omxplayer for x86. I don't do much gnu style building, but building ffmpeg, which was the first step, was piece of cake.

Perhaps there's a better way? From the PiPresents source code, it looks like PP does some kind of custom frame handling or something (via pexpect?), so simply changing the command line to point to a different player/options would not work so well. I tried symlinking /usr/bin/omxplayer to vlc and totem just to see what would happen. PP outputs some errors and goes to the next track. VLC works ok in the virtual box from a command line, while Totem seems to confuse the vbox video driver and starts doing weird things to my screen.

I actually did post the blog article a few months ago about how to run a different PP show on different days of the week, which I had mentioned doing in this forum a while ago. Basically, it uses a cron one-liner to call the appropriate show. The longer script deals with killing any running shows and turning the screen on and off. Details at: http://www.drewkeller.com/content/how-r ... -days-week

Cool, thanks for the info. CubieBoard is arm7, but I see that the git fork you linked uses the MPV player... which has a package in Mint's repositories. I'll have to try it later, but it looks promising.

Thank you for your response. I think I may have figured it out! I added code to pp_gpio.py in the do_buttons function. Since that gets polled frequently, I put the time delay shutoff code in there. On every cycle of the the poll, it checks if the frame is "on" (i.e. monitor is on and pi presents is playing) and if the current time is past the last time motion was detected plus the time delay. If so, it turns off the monitor (using tvservice) and pauses pi presents using the callback. When a PIR rising edge is detected, it updates the last motion time and if the frame is "off", it turns on the monitor and unpauses pi presents. This seems to work really well. Anyways, just thought I'd let you know and thank you!

- Nik.

KenT wrote:Hi

If you use a oneshot mediashow with a 'start trigger' of input then the medaishow will wait until the PIR triggers before playing a track. pp_exhibit is an example profile that does this.

I haven't designed in a way to stop the video however if you bind the pp-stop symbolic name to the same gpio input but triggered with the opposite edge that might work provided the mediashow is on auto and has a single track. I'm going to add an INPUT end trigger one day in pp_mediashow.py.

What you might need some extra code to detect abscence from the PIR. I reckon some time delay after the last presence trigger will be required. Probably best to put it in pp_gpio.py. Also I don't know how to turn off the monitor however the screen fan be made to go black while waiting for the PIR.

The cubieboard fork doesn't quite work out of the box, but I got it working and then got the mpv player working in a Virtualbox Linux Mint by figuring the correct command line options. So now I can test a show on my Windows 8 machine with no actual Pi around. Awesome. I'll have to write up how I did this and merge the various source code fixes into my fork of PiPresents.

drewkeller wrote:The cubieboard fork doesn't quite work out of the box, but I got it working and then got the mpv player working in a Virtualbox Linux Mint by figuring the correct command line options. So now I can test a show on my Windows 8 machine with no actual Pi around. Awesome. I'll have to write up how I did this and merge the various source code fixes into my fork of PiPresents.

That's great. Give me a heads up when you have done the code fixes and write up and I'll put it on the blog. It will be useful to many people for production environments currently using some other linux box as well as for testing.

Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

Hi Ken
Thanks for this great package. Have been working on getting it to run 4 selected videos for a display at the Lady Denman Maritime Museum Jervis Bay Australia where I work as a volunteer.
Have got it working from keyboard input, can I select 1 of 4 videos to play using separate buttons to GPIO pins.
I'm using a B+ Pi
Using it to replace a $700 media player that just failed.
Also how can I play mpg format videos as this is the format we are currently using without needing to change format?
New to R Pi but have a computer and electronics background.
Thanks
Terrance

TerranceF wrote:Hi Ken
Thanks for this great package. Have been working on getting it to run 4 selected videos for a display at the Lady Denman Maritime Museum Jervis Bay Australia where I work as a volunteer.
Have got it working from keyboard input, can I select 1 of 4 videos to play using separate buttons to GPIO pins.
I'm using a B+ Pi
Using it to replace a $700 media player that just failed.
Thanks
Terrance

Quite a lot of interest from Australia. Questacon in Sydney apparently has 9 Pi Presents in use which is great.

If you are using [pipresents-next] then the example pp_radiobuttonshow_1p2 is already set up to play four tracks from four gpio inputs. You will need to do sudo python..... and use the -g option. Look at gpio.cfg if you want to change the pin assignments or add more pins.

A photo of your system in use and a few words about what it is used for would be great to put on the PP blog. Contact me via the blog for an email address

Ken

Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

Hi Ken
Thanks for your reply.
Have just downloaded the latest version of pipresents-next, noticed that it has this function.
Have printed out the manual and reading through now.
Will send you pictures and info about the installation when it is up and running.
Thanks again
Terrance

Our latest application uses a button connected to pin18 to interupt a slide show and run a short video. Now we need the button to flash when running the slide show. I've managed to turn the LED connected to pin 11 on using the first track of slide show and turn it off using the video sub show track as per the pp_animate_1p2 example. If I try to turn it on with each track in the slide show, it won't turn off for the video, so currently when the video finished, we need to wait for the first slide to appear again to turn the LED back on. Ideally we would like the LED to flash when the video is not running to draw attention to the button. I tried using the on and off delay in animate panel but nothing seemed to happen. An example or any hints would be much appreciated.
Regards
Robert Parker
Questacon IN CANBERRA - Sydney is a nice place to visit but I wouldn't want to live there
P.S. We haven't quite got to 9 Raspberry Pis yet but we do have 8, 6 of which are running PiPresents. Only failures so far have been two cheap SD cards. Stick with good brands.
P.S.S. I must visit the Lady Denman Maritime Museum in Jervis Bay Australia now that I know we share technology.

Hi Robert
Would be nice to have you visit our museum at Huskisson,
Have just got our first Pi B+ running for a video display.
It plays a short repeating video which has the button menu.
There you can select 1 of 4 videos using momentary push buttons connected to GPIO pins.
Has the advantage over the original media that you can interrupt the video being played to select another video to watch.
Will be sending Ken pictures and info on our setup.
You can contact me at terranceattezwebdesignsdotcom.
Terrance Fullerton

Our latest application uses a button connected to pin18 to interupt a slide show and run a short video. Now we need the button to flash when running the slide show. I've managed to turn the LED connected to pin 11 on using the first track of slide show and turn it off using the video sub show track as per the pp_animate_1p2 example. If I try to turn it on with each track in the slide show, it won't turn off for the video, so currently when the video finished, we need to wait for the first slide to appear again to turn the LED back on. Ideally we would like the LED to flash when the video is not running to draw attention to the button. I tried using the on and off delay in animate panel but nothing seemed to happen. An example or any hints would be much appreciated.
Regards
Robert Parker

Hi Robert
I think you need to use a concurrent show. The concurrent show (flasher) would flash the LED. it would be a repeating mediashow consisting of two tracks one turns the LED on and the other turns it off using animate commands. The two tracks will be audio tracks with the location blank and with a duration of 1 second. flasher need not be started in the start show.

having done this you can stop and start flasher by using show control commands at the appropriate places in your video and slideshow shows. e.g. flasher start. Section 6.4.2 of the manual refers.

I haven't tried it but it should work. I'll check the animate delay to see if I've introduced a bug somewhere.

Ken

Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

So I posted a little while ago on this thread about using a PIR which you helped me with and it works just great. Now I am trying to do something a little more involved. My project is a digital media frame which shows both pictures and video. I am using the mediashow module in pipresents-next to display the pics and vids. I have also connected three buttons to the Pi which control going forward, going backward, and pausing. What I am trying to do is be able to pause the show and then use the forward and backward buttons to go through the media list whilst being paused. I.e., I want to stop the show at any time and then use the forward/back buttons to go back and forth between the different pics and vids, all the while still being paused until I unpause it by pressing the pause button again. I've gotten it to work for images, but I am having trouble getting it to work for video. Basically, inside pp_mediashow.py I am saving the pause state of the show and if it is paused, then I send a "pause" signal to the next player after it is playing (inside the what_next function). This works just fine for images. However, omxplayer does not seem to accept the "pause" signal it is sent. I thought that maybe it was a race condition of some kind, so I put in some code to send the pause after I was sure that the player was running (inside play_state_machine in pp_videoplayer.py). This still didn't work.... omxplayer is running and sending the pause signal does nothing. The pause signal obviously does work since pressing the pause button while the video is playing definitely pauses the video. I also tried using the "prepare" function in pp_omxdriver.py, which supposedly processes the video until it is about to play and then pauses it, but that function does not seem to work. Anyways, I hope this makes some sense and you can give me some pointers on how to proceed. Any help is highly appreciated! Thanks!

Hi Nik
Sounds like you are on the right track with what you are doing.

Are you trying to pause as soon as the track starts playing. If so have a look at [pipresents-gapless]. In this version I implement gapless playback by pre-loading a track and then pausing it immeadiately it starts. I had to modify omxdriver.py so that the pause was not tried until the first timestamp is received.

'prepare' is a leftover from the original pyomxplayer code, it may not work.

Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

Thanks for the tip. I took a look at pipresents-gapless and I moved the pause event for video into _get_position in pp_omxdriver.py. This does pause the video before playing, but it doesn't do exactly what I want. It actually pauses the video before the first frame, which means that nothing is displayed to the screen. What I want is the first frame to be displayed and then paused. I added code to delay the pause until video_position > 1. This does work, however, about 1/10th of a second of the video gets played before pausing. This isn't terrible or anything, but it would be nice to have it pause on the first frame. Can you think of something I could do to make that happen? Perhaps I just need to wait until pipresents-gapless is ready for prime time. Anyways, any help you can give me is, as always, highly appreciated. Thanks!

I am using the PI Presents software for a few prototypes of my products.
At this point I am looking for a dutch speaking specialist in RPi and PI Presents.
This person should have knowledge of the hardware as well as the software of the RPi and PiP.

If you think you can help me, for the right compensation of course, I hope to hear from you!

I really like your software! I use it to show pictures at a party and give people the possibility to upload their photo's to my website. The uploaded photo's will sync via FTP with the pi and will show up in the liveshow.

I have 2 questions:
- I would like to shuffle the liveshow. I saw this:

KenT wrote:
SHUFFLE
Tracks in mediashow and liveshow can now be shuffled

But I can't find it anywhere in the software or manual. Is this possible? And maybe the 'just-added' photo's will show up first?

- I would like to add the feature that people can add a short text that will appear on the screen. Is there a way to show dynamic text (from a database or something like that) on the screen? And then again, show the recent texts first, and then shuffle trough the rest

Yvad wrote:I really like your software! I use it to show pictures at a party and give people the possibility to upload their photo's to my website. The uploaded photo's will sync via FTP with the pi and will show up in the liveshow.

I have 2 questions:
- I would like to shuffle the liveshow. I saw this:

KenT wrote:
SHUFFLE
Tracks in mediashow and liveshow can now be shuffled

But I can't find it anywhere in the software or manual. Is this possible? And maybe the 'just-added' photo's will show up first?

- I would like to add the feature that people can add a short text that will appear on the screen. Is there a way to show dynamic text (from a database or something like that) on the screen? And then again, show the recent texts first, and then shuffle trough the rest

Thanks in advance!

Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

So I've made myself a media frame using pipresents-next and I have hooked up a PIR to the Pi to detect motion and turn off the monitor and pause pipresents when no motion is detected and turn it back on and unpause pipresents when motion is detected. I have added some custom code to be able to do this. I am using the rising edge of the PIR signal to detect the motion. This works okay, but I am having trouble distinguishing signal from noise. I seem to getting a number of spurious signals when I know that there is no motion going on. I am trying to use the debounce threshold value to help with this, but I am having to set the threshold at 100 in order to not get spurious signals. I have also played around with changing the sensitivity knob on the PIR but I can't quite figure out how best to get the correct settings. Am I doing something wrong? Is a threshold of 100 too high? Should I be looking for the falling edge of the signal?.... I've tried this and it makes the turning on of the monitor lag quite a bit. Also, with the threshold set so high, sometimes it doesn't register actual movement and I still get some spurious signals. Does anyone have any suggestions on how I might best calibrate the PIR and its settings?