porkbuns / shmile

The DIY photobooth, at your service.
75 stars 39 forks source link

Fails to take all 4 pictures on raspberry pi linux (raspbian/debian) #21

Closed danrue closed 9 years ago

danrue commented 9 years ago

Hi! I know you don't want to deal with Linux, but I'm wondering if you can point me in the right direction. shmile works great on my macbook, but I thought it would be really neat to get it going on a raspberry pi.

Symptom: It will hang and stop taking pictures some time before the 4th picture. Sometimes it won't take any, sometimes it will take one or two or even three - but three is rare. Always, what will happen is it will hang after one of the "camera_begin_snap" events.

Let me know if you have any ideas I can pursue. Sample output below:

pi@raspberrypi ~/shmile $ coffee app.coffee 
printer is: false
CameraControl is: function CameraControl(filename, cwd, web_root_path) {
      this.filename = filename != null ? filename : "%m-%y-%d_%H:%M:%S.jpg";
      this.cwd = cwd != null ? cwd : "public/photos";
      this.web_root_path = web_root_path != null ? web_root_path : "/photos";
    }
   info  - socket.io started
   debug - served static content /socket.io.js
   debug - client authorized
   info  - handshake authorized wXcnot4OtRdFaRxx-91P
   debug - setting request GET /socket.io/1/websocket/wXcnot4OtRdFaRxx-91P
   debug - set heartbeat interval for client wXcnot4OtRdFaRxx-91P
   debug - client authorized for 
   debug - websocket writing 1::
Web browser connected
   debug - websocket writing 5:::{"name":"camera_begin_snap"}
   debug - websocket writing 5:::{"name":"camera_snapped"}
   debug - websocket writing 5:::{"name":"photo_saved","args":[{"filename":"10-14-19_19:36:47.jpg","path":"public/photos/10-14-19_19:36:47.jpg","web_url":"/photos/10-14-19_19:36:47.jpg"}]}
   debug - websocket writing 5:::{"name":"camera_begin_snap"}
   debug - emitting heartbeat for client wXcnot4OtRdFaRxx-91P
   debug - websocket writing 2::
   debug - set heartbeat timeout for client wXcnot4OtRdFaRxx-91P
   debug - got heartbeat packet
   debug - cleared heartbeat timeout for client wXcnot4OtRdFaRxx-91P
   debug - set heartbeat interval for client wXcnot4OtRdFaRxx-91P
   debug - emitting heartbeat for client wXcnot4OtRdFaRxx-91P
   debug - websocket writing 2::
   debug - set heartbeat timeout for client wXcnot4OtRdFaRxx-91P
   debug - got heartbeat packet
   debug - cleared heartbeat timeout for client wXcnot4OtRdFaRxx-91P
   debug - set heartbeat interval for client wXcnot4OtRdFaRxx-91P
andrewhao commented 9 years ago

Hey @danrue, what is the result of running:

$ gphoto2 --capture-image-and-download

repeatedly from the command line with your camera plugged in? Can you reliably get the camera to take photos?

danrue commented 9 years ago

Hi @andrewhao - I'll try to do that this weekend. I'll have to re-image my pi to get it set up again.

You may be interested in an article I wrote about my experience with shmile at http://therub.org/2014/10/29/diy-digital-photo-booth/

Dan

andrewhao commented 9 years ago

@danrue, what a great writeup. I'm glad it worked out for you guys!

I fully agree that reliability is a top concern. I just ran the booth at a Halloween community event last night and it still crashes once or twice a night.

I will caution against rebooting the app in a while true; do; .. loop -- you need to pick the right time to reboot the server and the client simultaneously.

Anything by way of documentation or help that I could make more clear?

techyteach-s commented 9 years ago

@danrue, @andrewhao I've recently had a play with the porkbuns/shmile photobooth app. I noticed the issue that you talk about here and had a bit of a play and managed to get it working in a more stable manner on my raspberry pi.

The issue is in gphoto2. In the version that downloads automatically via apt-get install there is an error which causes gphoto2 not to work with the raspberry pi and take the photos.

I had a hunt and was able to update gphoto2 via this shell script:

https://raw.githubusercontent.com/gonzalo/gphoto2-updater/master/gphoto2-updater.sh

after updating (and with a charged battery, whoops!) shmile worked well. I still have some more extended testing to do with iPad / WiFi and using and iPad's adhoc portable hotspot, but it looks good for it too work on a Raspberry Pi. I also plan to give it a try with the latest Raspberry Pi 2 with the hope that it will run a little smoother on the iPad screen etc. I think it'll work great for a Wedding photobooth!

andrewhao commented 9 years ago

Fantastic, @techyteach-s. Would you be willing to create a wiki page for us documenting how to set this up on Raspberry Pi?

techyteach-s commented 9 years ago

Absolutely, I've never made one, and I'm sure there is still some more things to iron out, but as I have time I'll do a write up and edit it as I find issues or enhancements.

On Tuesday, 10 February 2015, Andrew Hao notifications@github.com wrote:

Fantastic, @techyteach-s https://github.com/techyteach-s. Would you be willing to create a wiki page for us documenting how to set this up on Raspberry Pi?

— Reply to this email directly or view it on GitHub https://github.com/porkbuns/shmile/issues/21#issuecomment-73621724.

techyteach-s commented 9 years ago

I have written a step by step wiki on how to setup the photobooth on the raspberry pi. It's in the wiki pages for shmile. I still need to figure out an auto boot to the app/auto restart if it crashes, but it seems to be working quite well from my tests. Let me know what you think @andrewhao, hopefully some people will get some joy out of using it this way!

danrue commented 9 years ago

Found your write-up at https://github.com/porkbuns/shmile/wiki/Shmile-on-the-Raspberry-Pi. I will give it a shot in a few weeks when I have to do my next photo booth. Hopefully I'll have my Pi 2 by then. Thanks for contributing!

I'm going to go ahead and close this issue out.

stowel commented 8 years ago

Hey,

i've been searching since january for a possible photobooth solution for my wedding this august. Now I followed @techyteach-s instructions on github and installed shimle on my raspberry pi model B+, my setup: Canon 1000D, gphoto2 2.5.8, npm 2.13.1, node v0.12.6

Unfortunately, I still getting an error and hope that you can help me.

If you click Start on the frontend ui the countdown begins, shmile takes a photo and download it to the correct path. After this no further action continues, except of sending heartbeats, the server gives me the following messages:

printer is: false info - socket.io started debug - served static content /socket.io.js debug - client authorized info - handshake authorized M_L_0bVz7ZlJ_r2_ljQp debug - setting request GET /socket.io/1/websocket/M_L_0bVz7ZlJ_r2_ljQp debug - set heartbeat interval for client M_L_0bVz7ZlJ_r2_ljQp debug - client authorized for debug - websocket writing 1:: util.puts: Use console.log instead Web browser connected debug - websocket writing 5:::{"name":"camera_begin_snap"} debug - emitting heartbeat for client M_L_0bVz7ZlJ_r2_ljQp debug - websocket writing 2:: debug - set heartbeat timeout for client M_L_0bVz7ZlJ_r2_ljQp debug - got heartbeat packet debug - cleared heartbeat timeout for client M_L_0bVz7ZlJ_r2_ljQp debug - set heartbeat interval for client M_L_0bVz7ZlJ_r2_ljQp "name":"camera_begin_snap" debug - emitting heartbeat for client M_L_0bVz7ZlJ_r2_ljQp debug - websocket writing 2:: debug - set heartbeat timeout for client M_L_0bVz7ZlJ_r2_ljQp debug - got heartbeat packet debug - cleared heartbeat timeout for client M_L_0bVz7ZlJ_r2_ljQp debug - set heartbeat interval for client M_L_0bVz7ZlJ_r2_ljQp debug - emitting heartbeat for client M_L_0bVz7ZlJ_r2_ljQp debug - websocket writing 2:: debug - set heartbeat timeout for client M_L_0bVz7ZlJ_r2_ljQp ....

If I run the gulp test, i am getting the error that mocha cant get an instance of ImageCompositor. Imagemagick is installed.

Does somebody have any ideas, pls?

Thx Stowel

andrewhao commented 8 years ago

@stowel: do you have another camera you can use to try out a different approach?

Additionally, can you try running this on a different system (one other than a Raspberry)?

techyteach-s commented 8 years ago

@stowel: It's been a while since I've been on, as I'm about to use the photobooth at a friends wedding I thought I'd have a look at whats going on here again. One issue I had when I first got it going was that when the camera was set to raw images it would not take the photo's properly, also, I found an error in code when using it on the raspberry pi, a solution is posted here: https://github.com/porkbuns/shmile/issues/33

techyteach-s commented 8 years ago

@stowel: here's a link to the edited file that should sort out the issue, simply download and swap for the original in the 'lib' folder of shmile