robertatquestacon
Posts: 8
Joined: Fri Feb 14, 2014 5:26 am

Re: Pi Presents: A display package for museums & visitor cen

Thu Aug 07, 2014 5:06 am

Hi Ken,

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

Code: Select all

import RPi.GPIO as GPIO
from time import sleep



# pins 3 and 5 have permanent 1.8k pull ups to 3.3 volts and will therefore be 1 even if PULL_UP=GPIO.PUD_DOWN
# comment out all but the internal pullup value you want
PULL=GPIO.PUD_UP            # internal pullup resistor to 3.3 volts
#PULL=GPIO.PUD_DOWN   #internal pullup resistor to 0 volts
#PULL=GPIO.PUD_OFF        # internal pullup resistor disconnected

GPIO.setwarnings(False)
GPIO.cleanup()
GPIO.setmode(GPIO.BOARD)
GPIO.setup(18,GPIO.IN,pull_up_down=PULL)
lv = -10
while True:
    v = GPIO.input(18)
    if (v != lv):
      print v
      lv = v

sandman_artlover
Posts: 8
Joined: Mon Aug 25, 2014 7:51 am

Re: Pi Presents: A display package for museums & visitor cen

Mon Aug 25, 2014 8:07 am

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.

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Pi Presents: A display package for museums & visitor cen

Tue Aug 26, 2014 1:49 pm

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.
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

drewkeller
Posts: 8
Joined: Thu May 01, 2014 7:01 am

Re: Pi Presents: A display package for museums & visitor cen

Fri Aug 29, 2014 4:28 am

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

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Pi Presents: A display package for museums & visitor cen

Fri Aug 29, 2014 5:08 pm

Hi Drew

I think to use omxplayer you will need openmax o the other machine.

To run PP on another machine have a look at this fork for cubieboard. I seems to substitute omxplayer for mpv player and also changes the GPIO

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

drewkeller
Posts: 8
Joined: Thu May 01, 2014 7:01 am

Re: Pi Presents: A display package for museums & visitor cen

Fri Aug 29, 2014 6:10 pm

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.

sandman_artlover
Posts: 8
Joined: Mon Aug 25, 2014 7:51 am

Re: Pi Presents: A display package for museums & visitor cen

Sat Aug 30, 2014 12:16 am

Hi Ken,

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.

drewkeller
Posts: 8
Joined: Thu May 01, 2014 7:01 am

Re: Pi Presents: A display package for museums & visitor cen

Sat Aug 30, 2014 7:03 am

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.

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Pi Presents: A display package for museums & visitor cen

Sat Aug 30, 2014 7:57 am

Hi Drew
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

drewkeller
Posts: 8
Joined: Thu May 01, 2014 7:01 am

Re: Pi Presents: A display package for museums & visitor cen

Sat Aug 30, 2014 9:34 pm

Here is the writeup:
http://www.drewkeller.com/blog/how-run- ... spberry-pi

And my edits are in the 'cubieboard branch' at:
http://github.com/drewkeller/pipresents-next

...which if you have git, you can get with
git clone -b cubieboard http://github.com/drewkeller/pipresents-next

TerranceF
Posts: 3
Joined: Tue Sep 02, 2014 8:22 am

Re: Pi Presents: A display package for museums & visitor cen

Tue Sep 02, 2014 8:41 am

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


KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Pi Presents: A display package for museums & visitor cen

Tue Sep 02, 2014 6:35 pm

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

TerranceF
Posts: 3
Joined: Tue Sep 02, 2014 8:22 am

Re: Pi Presents: A display package for museums & visitor cen

Thu Sep 04, 2014 5:21 am

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

robertatquestacon
Posts: 8
Joined: Fri Feb 14, 2014 5:26 am

Re: Pi Presents: A display package for museums & visitor cen

Wed Sep 24, 2014 6:09 am

Hi Ken,

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.

TerranceF
Posts: 3
Joined: Tue Sep 02, 2014 8:22 am

Re: Pi Presents: A display package for museums & visitor cen

Wed Sep 24, 2014 9:36 am

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

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Pi Presents: A display package for museums & visitor cen

Thu Sep 25, 2014 8:06 am

robertatquestacon wrote:Hi Ken,

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

robertatquestacon
Posts: 8
Joined: Fri Feb 14, 2014 5:26 am

Re: Pi Presents: A display package for museums & visitor cen

Thu Sep 25, 2014 11:45 pm

Thanks Ken. That worked fine. I needed to add an output off in the subshow for the occassions when the concurrent show had the led on.
Regards
Robert Parker

sandman_artlover
Posts: 8
Joined: Mon Aug 25, 2014 7:51 am

Re: Pi Presents: A display package for museums & visitor cen

Wed Oct 08, 2014 11:46 am

Hi Ken,

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!

- Nik.

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Pi Presents: A display package for museums & visitor cen

Thu Oct 09, 2014 11:11 am

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

sandman_artlover
Posts: 8
Joined: Mon Aug 25, 2014 7:51 am

Re: Pi Presents: A display package for museums & visitor cen

Sat Oct 11, 2014 12:17 pm

Hi Ken,

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!

- Nik.

cedexis
Posts: 1
Joined: Sat Oct 18, 2014 9:02 pm

Re: Pi Presents: A display package for museums & visitor cen

Sat Oct 18, 2014 9:13 pm

Hi everyone!

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!

Please contact me on: [email protected]

Thank you in advance,

Yvad
Posts: 2
Joined: Wed Nov 12, 2014 11:36 am

Re: Pi Presents: A display package for museums & visitor cen

Wed Nov 12, 2014 11:45 am

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!

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Pi Presents: A display package for museums & visitor cen

Thu Nov 13, 2014 8:14 am

Answered duplicate her as it needs [pipresents-next]

http://www.raspberrypi.org/forums/viewt ... 36#p639836


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

sandman_artlover
Posts: 8
Joined: Mon Aug 25, 2014 7:51 am

PIR motion sensor calibration

Sun Jan 11, 2015 8:28 am

Hi all,

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?

- Nik.

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 7 guests