MrChristo
Posts: 4
Joined: Fri Sep 12, 2014 7:45 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 12, 2014 6:29 pm

Oh I havent seen that. Thanks so much !

MrChristo
Posts: 4
Joined: Fri Sep 12, 2014 7:45 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 12, 2014 6:46 pm

I tried it but actually, fullscreen is already set to True and I still have the problem.
You are speaking about the camera.preview.fullscreen right ?

Could you tell me juste witch resolutions you use for the camera and for the capture ?

Thanks

Edit : In case you didn't understand my problem, the preview seems cropped compare to the capture display.

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 12, 2014 8:01 pm

I don't actually use the fullscreen, i just set the resolution and start the preview

the resolution is the same as my raspbian resolution btw

Code: Select all

        camera = picamera.PiCamera()
        camera.resolution = (1280,720)
        camera.start_preview()

kylerichards89
Posts: 98
Joined: Sun Aug 31, 2014 12:42 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 26, 2014 12:18 am

Did you ever get around to setting up your button to restart CUPs service? I've played around a little and added a callback event when a button was pressed and it ran

Code: Select all

 os.system('service cups restart')
That worked, but it closed out the script. So I added

Code: Select all

os.system('sudo python led4.py')
under it. This did work, when it runs the second os.system command, it reopens the script. But I think it runs the script twice(or more depending on how many times you press the button). There must be an easier, more efficient way to do this, right?

mattius
Posts: 87
Joined: Thu Jun 14, 2012 9:55 am

Re: Thought id share: Wedding Photo Booth

Sun Oct 26, 2014 5:08 pm

You don't need to restart cups, you can just re enable the printer I do an os call to "cups enable canon_cp910i"

Just make sure you call it as background task

kylerichards89
Posts: 98
Joined: Sun Aug 31, 2014 12:42 am

Re: Thought id share: Wedding Photo Booth

Thu Oct 30, 2014 6:58 pm

Not sure if this is only my Printer's PPD file, but i did find an option to restart the current job in case of an error(paper out, ink, ect.) You can set it in the Set Printer Options> Policies Page in the CUPS Admin. The default is set to Stop Printer, which is why I think you needed to program a button to re-enable it. Changing to Retry-Current-Job works perfect for me. I've tested it several times and once the error is cleared with the printer, it prints the last job that wasn't successful. Please note: I am using CUPS 1.7.5. I hope this helps someone!

kbw3
Posts: 1
Joined: Wed Dec 10, 2014 10:52 pm

Re: Thought id share: Wedding Photo Booth

Wed Dec 10, 2014 11:00 pm

johnboy wrote:Finally got the gutenprint 5.2.10 working with cups. But even selecting the SELPHY CP900 drivers it refuses to print.

I switched to USB rather than over the wireless network and the images now print :)

It is however quite slow from the point at which python tells cups to print and the time that the printer actually starts printing out the image. Not sure if this is CUPS or the printer itself, but in the OP's video the delay was a lot lot shorter (mine is taking maybe 3 or 4 minutes)
Could you post a guide about how to upgrate gutenprint and make it work with cups?, I'm having problems solving that. Thank you.

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Mon Apr 27, 2015 7:27 pm

Hopefully this will become visible for anyone having the same issues, so forgive the tonne of keywords for google to find this and save others some pain.

After spending 4.5 full days battling with the Canon Selphy CP910 printer with CUPS I'll account for some of the things I tried and end with the final solution.

USB with current (as of writing - Gutenprint 5.2.10) packaged gutenprint/cups off the shelf configuration with a CP900 driver - worked perfectly for the first print (I was so excited), subsequent prints resulted in the printer becoming locked saying 'busy' (sad face).
Network with CP900 shows error about not being able to read the memory card on the printer - no prints at all.

I then painfully compiled the Gutenprint drivers from cvs (5.2.11-CVS) since the support was apparently added.
USB: success I could print! and subsequent prints worked too!!!
But you couldn't queue another job while one was still running, so I hacked around with tea4cups to introduce a delay after a job finished which worked for a while. HOWEVER after about 5 or so the printer stopped responding and I couldn't even see it with lpinfo -v which scans for available printers (more sad faces). You have to fully powercycle the printer for it to come back, unplugging and rebooting the pi didn't bring it back to life.
Network: same error same as before.

I was about to give up, thinking the hardware was just crap (which in reality - it is), then I tested it with my mac and was able to run 20 prints off in a row with no issues over WIFI. Something is different so I decided to compare the PPD that my mac used against the one from Gutenprint. The mac one appeared super simple, apart from references to where the icon for it is, everything looked like it might just work, osx uses cups after all and it wasn't referring to any binary rasterizers like some of the more commercial photo printer ppds do.

So for a laugh more than anything before I threw the printer and all the paper I'd bought for my wedding at the wall/ebay, I tried adding it as the driver for wifi printing in CUPS on my pi, boom it worked, I almost fell off my seat when the first print came out. I quickly queued 30 more, every single one came out spot on, borderless - if anything it was bleeding the image too much, but that's fine, I can correct that on the pi in the image processing.

Attached is the PPD from my Mac unless you don't have a mac handy.

For anyone interested in the rest of the process, for my wedding the company we've got running it do a staffed booth, so not automated like the other ones listed here, someone simply has a camera - they had planned to use a polaroid camera which is what they normally do, but we wanted to keep a copy of the photos for after, and ideally enjoy reviewing them in our hazed states the morning after.
So I got a Toshiba Flashair SD card and put it inside a digital camera (its a Sony RX100, but thats not important) and then used https://github.com/cyborg-x1/PyFlashAero to grab the files off the SD card as and when the camera came in to wifi range of the raspberry pi (which is acting as an access point) and pump them through imagemagick to put a PNG over the top then on to CUPS. it also tries to upload them to Facebook via a second wifi adapter on the PI - which will work if our venue has given me the correct wifi details and its got coverage where the thing is all setup.

It's been one hell of a journey getting it to where it is now, I just hope it works on the day and pays off else my Mrs-to-be will have her first opportunity to say "I told you that was a waste of time" - which she did after I'd spent the first night up till 4am on it.

Happy to share configs + code if anyone wants it?
Attachments
Canon_CP910.ppd.zip
(1.66 KiB) Downloaded 775 times

benjamin7785
Posts: 26
Joined: Tue May 20, 2014 6:27 am

Re: Thought id share: Wedding Photo Booth

Tue Apr 28, 2015 9:14 am

Brilliant Investigation!
I just recently encountered exactly the same problem with my Selphy910. Even though I'd worked and printed with it for about 7month now using the pi, the problem occured just 3days ago for the first time. But, since then it is as you have mentioned. I didn't even assumed it was a driver issue because I supposed my selfmade powersupply to cause this issue. So, you saved me from having massive headaches and potential give-ups on this project. THANK YOU

Now I can't wait to get back home and try your ppd file. But before I start fiddling around like a noob (actually I'm a noob :-) ) I have a couple of questions:
Did you just choose a different ppd file while installing a new printer via cups browser interface? Can I change the ppd-file for an existing printer?
You mentioned wifi drivers. Do you still connect the Selphy910 using usb-cable or is it truly wifi then?

I'm working on a similar project but I want my booth to be automated. Indeed everything works fine apart from the printer now....
My beta test for the booth is on Saturday this week. I'll post some results whether positive or negative.

By the way: In the beginning I used the Pi Model B rev2. But since the Pi2 is out I'm using this one now. Since then I haven't really printed a lot. Any thoughts on the Pi2 is causing this issue?

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Wed Apr 29, 2015 9:05 pm

Hey @benjamin7785
Totally wifi, I didn't even bother with the usb - I wanted to test it all working while I had the selphy's USB crashed - and non-responsive.
Once I had it working apart from waking my sleeping fiancee with my rather noisy yelps of delight I just left it the f*ck alone!
I think you can change the ppd - its at the point where you can pick a different driver, theres a 'or use a ppd' thing where you can upload the file, but adding a
I upgraded to a PI2 and I've enjoyed around an 8x speed improvement on the time it takes cups to process the image.
I had all the issues with the selphy on pi Brev2, pi2 and on a desktop linux box.

Good luck for your beta :)

rondhi
Posts: 6
Joined: Fri Dec 19, 2014 2:53 pm

Re: Thought id share: Wedding Photo Booth

Wed Apr 29, 2015 9:11 pm

Very interesting stuff! That's funny that it's a Mac PPD that got the printer working. I just ordered a Selphy CP910 and it should be arriving tomorrow.

So it's my understanding that you don't really need to compile the Gutenprint 5.2.11 CVS and we can just use the PPD you provided to get the CP910 working?

Any ideas on the difference of using ImageMagick or Python Imaging Library to modify images? Is one more efficient than the other, or are they just two different things that can accomplish the same goal (arranging multiple photos into a 4x6 strip)?

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Wed Apr 29, 2015 9:32 pm

Hey @rondhi
Pretty sure I didn't need to compile Gutenprint, but I haven't dared/bothered to wipe it down and remake from scratch to know for sure - feel free to post your results :)
ImageMagick vs PIL as far as I'm aware not much outperforms ImageMagick http://randomfoo.net/2010/07/09/perform ... -libraries apart from maybe http://www.graphicsmagick.org/benchmarks.html

rondhi
Posts: 6
Joined: Fri Dec 19, 2014 2:53 pm

Re: Thought id share: Wedding Photo Booth

Fri May 01, 2015 9:05 pm

Just a quick update: I got my Selphy CP910 in the mail today. Plug power and install ink and paper cartridges. Configured it to connect via wifi. Added it to CUPS on the Raspberry Pi 2 using @chrisns' supplied PPD file. Set it as the server default printer. Sent the following to the Pi over SSH: lp /home/pi/PB_archive/photo.jpg
Photo printed no problem. Everything's coming up Milhouse.

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Fri May 01, 2015 9:10 pm

rondhi wrote:Just a quick update: I got my Selphy CP910 in the mail today. Plug power and install ink and paper cartridges. Configured it to connect via wifi. Added it to CUPS on the Raspberry Pi 2 using @chrisns' supplied PPD file. Set it as the server default printer. Sent the following to the Pi over SSH: lp /home/pi/PB_archive/photo.jpg
Photo printed no problem. Everything's coming up Milhouse.
Woot!
more importantly, have you tested sending a bunch of images at once - that was the issue I had with the other drivers that the osx PPD solved.
Did you do anything else to make it work or was stock CUPS and gutenprint install from apt-get (or other package manager?)?

rondhi
Posts: 6
Joined: Fri Dec 19, 2014 2:53 pm

Re: Thought id share: Wedding Photo Booth

Sat May 02, 2015 9:00 am

chrisns wrote:Woot!
more importantly, have you tested sending a bunch of images at once - that was the issue I had with the other drivers that the osx PPD solved.
Did you do anything else to make it work or was stock CUPS and gutenprint install from apt-get (or other package manager?)?
I haven't tested a large queue of images yet, but yes, I'm using stock CUPS and Gutenprint installed via apt-get.

benjamin7785
Posts: 26
Joined: Tue May 20, 2014 6:27 am

Re: Thought id share: Wedding Photo Booth

Mon May 04, 2015 11:59 am

Here is an update as I have now successfully betatested my automated photobooth with the Selphy printer.

Everything worked like a charme, apart from the printer thing. What I noticed was that with every print command it takes longer for the printer to actually start. The first print came out just about 1:30min after the command was sent (lp -d selphy /home/pi/picture.jpg). the second print took already about 3:30min. Thrid print 7min...... I've eventually ended up waiting about 30min or so when suddenly the printer started working again.
However, I don't feel like this is actually about the printer here, but something with the printer queue? Because, the time from actually seeing the printer is busy (on the Selphy display) until the print comes out is more or less the same every time. What is strange is that once the print job shows up on the cups web interface (job-id: "sending data to printer") it feels like nothing is happening in between until eventually the printer shows the "busy" display.
Any idea if it is possible that "bullshit" data is piling up with each print job?

The only solution I found, so far, to get it back to reasonable printing times was to fully powercycle the printer. It then started immediately printing all those jobs that were still queued.

Today I will try to work out if restarting the CUPS Service will solve this issue too. Because, even if this would be a horrible workaround it would work for my application.

Any idea on how this could be solved elegantly is very much appreciated :D

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Tue May 05, 2015 7:53 am

what PPD are you using, and is it a CP910?
I'd wager that its not CUPS - you could prove that easily by making a pdf/postscript dummy printer device and see if the same delay occurs in writing to that.
In theory /etc/init.d/cups reload would gracefully reload and you could do that after inserting a job - if it behaves correctly it won't restart until its not doing anything.
Are you connecting over usb, if you can resolve the issue by unplugging/plugging back the usb cable you could write something to reinitalize the usb device between each job - use something like tea4cups maybe.

benjamin7785 wrote:Here is an update as I have now successfully betatested my automated photobooth with the Selphy printer.

Everything worked like a charme, apart from the printer thing. What I noticed was that with every print command it takes longer for the printer to actually start. The first print came out just about 1:30min after the command was sent (lp -d selphy /home/pi/picture.jpg). the second print took already about 3:30min. Thrid print 7min...... I've eventually ended up waiting about 30min or so when suddenly the printer started working again.
However, I don't feel like this is actually about the printer here, but something with the printer queue? Because, the time from actually seeing the printer is busy (on the Selphy display) until the print comes out is more or less the same every time. What is strange is that once the print job shows up on the cups web interface (job-id: "sending data to printer") it feels like nothing is happening in between until eventually the printer shows the "busy" display.
Any idea if it is possible that "bullshit" data is piling up with each print job?

The only solution I found, so far, to get it back to reasonable printing times was to fully powercycle the printer. It then started immediately printing all those jobs that were still queued.

Today I will try to work out if restarting the CUPS Service will solve this issue too. Because, even if this would be a horrible workaround it would work for my application.

Any idea on how this could be solved elegantly is very much appreciated :D

benjamin7785
Posts: 26
Joined: Tue May 20, 2014 6:27 am

Re: Thought id share: Wedding Photo Booth

Tue May 05, 2015 9:03 am

Hi chrisns,
the ppd I use is the one you supplied here :-)
For me the ppd didn't work when I tried using the printer over usb. So I connected both Pi and printer to the same wifi network and modified the printer in the cups interface.
Unfortunately, I didn't had the chance to try and test reloading cups everytime yesterday. Partly because I got stuck trying (and failing!!!!) to upgrade to debian/jessie, and partly because I was watching the world championchip snooker final :lol:
I'll give it another shot today.

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Tue May 05, 2015 9:59 am

Not something I experienced, worst case if you needed to powercycle the printer, you can do it via the web interface via saving the settings, so you could curl that in between print jobs to force it to work :)
benjamin7785 wrote:Hi chrisns,
the ppd I use is the one you supplied here :-)
For me the ppd didn't work when I tried using the printer over usb. So I connected both Pi and printer to the same wifi network and modified the printer in the cups interface.
Unfortunately, I didn't had the chance to try and test reloading cups everytime yesterday. Partly because I got stuck trying (and failing!!!!) to upgrade to debian/jessie, and partly because I was watching the world championchip snooker final :lol:
I'll give it another shot today.

benjamin7785
Posts: 26
Joined: Tue May 20, 2014 6:27 am

Re: Thought id share: Wedding Photo Booth

Wed May 06, 2015 8:14 am

Quick update on the Selphy cp910 printing issue.
Restarting cups in order to reset the printer doesn't really work. Luckly it doesn't need to work because I think I pin-pointed the problem I'm experiencing. It has to do with an unstable wifi routing. In fact I'm using my Iphone5s as a network access point. Both the pi and the cp910 are connecting to the mobile phone, which surprisingly worked quite well. But after a while (I guess when the phone or anything else starts to sleep) the connection to the printer seems to abort and re-establishing the connection through cups takes some time. I realised this when I was sending a print command and then constantly asking cups what the job status is about. (lpstat -r Selphy)
I then set up a whole new wifi access point without the Iphone and "boom" no delays anymore. Sometimes it is as easy as that..... :lol:
My approch now is to use two wifi dongles with the pi. One wifi dongle will still be used to connect to the iphone for mobile internet connection reasons. The other one will be used to connect to the printer only, by using the cp910 itself as an access point. Luckely the printer supports this.
I think this solution, using two wifi dongles, wouldn't actually be necessary if cups were able to ping the printer and asks for a status. Because this would keep up the connection alive. But I couldn't find anything about it in the documentation about it. In fact it seems to not be possible at all since ipp doesn't support this.


What is still a little bit annyoing is that with the ppd supplied by chrisns you don't have the option setting available to tell the printer to shrink the picture onto the paper. That means that if you have pictures with a ratio other than useful for 100x148mm paper the prints will lose some areas of your photo.
Any idea of how to manipulate the ppd file?
Because currently I create a separate image just for the print that comes with some 600pxX100px whithe border to actually produce the result on the printout that I want it to be.

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Wed May 06, 2015 8:26 am

Hey, thats awesome @benjamin7785
2 wifi dongles is pretty much the same configuration as I ended up with.
I do recommend putting one on the end of a USB extension cable and making sure they're on two different channels as I found they got interference when they were next to each other in the pi.
In theory some usb dongles can handle bridging and maintaining multiple SSIDs so you may be able to go back to just one - but your milage may vary.
Theres some stuff in the wlan settings that stops it powering down, (iwconfig wlan0 power off - will do it as a one off) you could also just have a process running that pings the printer - and perhaps sends you a notification to prowl/boxcar/other push service if the printer drops offline I'm considering doing similar, and trying to find a way to inspect it when it runs out of paper/ink.

Modifying the PPD, maybe compare the one from Gutenprint and the one that Apple/Canon supply in the os x ppd and see if there's some magic you can copy paste over that'll give you the added settings?
I do image processing in python/imagemagick before I send to the printer so its not an issue for my specific application, you could do similar automagically with tea4cups if you can't figure a way to do it in the PPD

Unrelated note, last night for fun I connected cups to google cloud print so now I can send print jobs to it from anywhere.

benjamin7785
Posts: 26
Joined: Tue May 20, 2014 6:27 am

Re: Thought id share: Wedding Photo Booth

Thu May 07, 2015 6:13 am

I now got my second wifi dongle. Hooked it up and changed the settings necessary to make sure wlan0 connects to "Network1" (router that is connected to the internet) automatically and wlan1 connects to "Network2" (CP910 that works as access point) automatically.
It works.....more or less. At least, using iwconfig I can see that each wifi adaptor gets an independent ip-address. Using ifconfig it seems that data is being received and sent successfully on both wifi adaptors. Trying to print actually works fine.
BUT!!!!!!!!!, for whatever reason I cannot connect to the internet on wlan0. Even though I have successfully acquired an IP address from my home network router it wont sent data out. It seems like every internet data tries to use the wlan1 adaptor to connect.
How do I tell the pi to use wlan0 connection for everything that is dealing with internet connection data. Or vice versa, use wlan0 for everything that is not printer data. Because wlan1 should be associated with the printer only. I want the wlan1 to be as independent as possible from any other connection, other than the printer.
I even tried to make wlan0 the printer adaptor and wlan1 the internet connection adaptor. But no success anyway. Same results there. If I have one adaptor stopped, e.g. the wlan1 printer adaptor, there is no problem with sending out data nor with receiving data from (google, dropbox, or whatever) the outside.
I'm stuck in the network setting jungle here and kindly request your help: How to route my data correctly????

Here is my /etc/network/interfaces

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wpa-ssid Home Inet
wpa-psk XxXxXxXx

auto wlan1
iface wlan1 inet dhcp
wpa-ssid CP910-A6D1F2
wpa-psk xXxXxXxX
and my /etc/wpa_supplicant/wpa_supplicant.conf

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
  ssid="Home Inet"
  psk="XxXxXxXx"
  proto=RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP
  auth_alg=OPEN
}

network={
  ssid="CP910-A6D1F2"
  psk="xXxXxXxX"
  proto=RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP
  auth_alg=OPEN
}

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Thu May 07, 2015 7:58 am

the printer is setting you up a route, so you need to tell your machine to route out the wlan that has an internet connection.
you may also run into issues if both networks are in the same subnet range e.g. 192.168.n.n
my setup has the pi being an access point - which is easy and also for me gave the added benefit that if the printer says its connected to the network I know the (headless) pi has booted and things are working :)

benjamin7785
Posts: 26
Joined: Tue May 20, 2014 6:27 am

Re: Thought id share: Wedding Photo Booth

Thu May 07, 2015 8:37 am

I know it is so noobish but ho wdo I actually change the routing? Trying to google it gives me another headache because I see a million different solutions mostly related to the pi being access point.
Maybe I have to make one of the wifi adaptors of the pi an access point. Do you think this is a helpful guide to do? http://www.maketecheasier.com/set-up-ra ... ess-point/
But isn#t there any easy way to do the routing with the pi not being an access point? Not being in the same subnet I think i can realise, because I can set up the address of the printer easily.
Do you know where I can see what the current route for internet connection? I would assume that there the wlan1 connection is mentioend, right? :?

chrisns
Posts: 15
Joined: Mon Apr 27, 2015 6:45 pm

Re: Thought id share: Wedding Photo Booth

Thu May 07, 2015 8:49 am

looks as good as any other guide and not dissimilar to my config

if you don't want to do that, first check that they're not both in the same subnet range so things are easy. and then look
also, you may be able to do it by just swapping the order in the /etc/network/interfaces file so your broadband connection is last
if not
route add default gw 192.168.1.254 wlan0
(where 192.168.1.254 is your router)

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 11 guests