Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Camera dual triggering

Everything camera related. Includes triggers, batteries, power supplies, flatbeds and sheet-feeding scanners, too.
User avatar
daniel_reetz
Posts: 2797
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: Camera dual triggering

Post by daniel_reetz » 28 Mar 2014, 00:08

If you're only using the hub to trigger the cameras, then the current will not be an issue. Any USB port supplies enough current to trigger your cameras via CHDK.

EsquireTech
Posts: 2
Joined: 27 Mar 2014, 06:51
Number of books owned: 0
Country: USA

Re: Camera dual triggering

Post by EsquireTech » 02 Apr 2014, 21:54

Thanks Daniel. I now have both cameras triggering with the usb switch using steve1066d's script above. Now I just need to fashion a spacer to accomodate the power plug coming into the bottom of the A2200's and I should be ready to start scanning. It's been a long time getting to this point for me and still so much to learn.

~ET

barth
Posts: 28
Joined: 28 Sep 2014, 09:42
Number of books owned: 0
Country: Belgium

Re: Camera dual triggering

Post by barth » 23 Nov 2014, 18:42

Hello,
I've been experiencing 'double takes' by the cameras when triggered with the keypedal ever since I started using the pedal in combination with Spreads. There is appr. 7 sec. between the first, intended capture and the second unwanted capture on each camera. Unfortunately that's not enough to prepare the next pages. So I end up with 50% useless files, i.e. pictures of my hands manipulating the original. Recently I've had 3 captures in one command. The problem doesn't occur when I use the touch pad on the laptop.
Another, very recent problem is that the flash of both cameras is activated when they capture their images, although the flash is deactivated before the SD-cards with CHDK are inserted. It first appeared after I had set the capture mode to shoot in monochrome mode. But it has persisted after I changed the mode back to colour, started a new workflow, restarted the cameras etc.

Sorry to barge in like this btw. I have introduced neither myself or my build so far, because I wasn't fully satisfied with its performance. However, it's been stable for some time now, until moments ago. The build is a New Standard 2 with Raspberry Pi Model B, Pihub and a Scythe single pedal to replace the faulty one that came wit the kit. I've tested the Scythe on other appliances and it gives a perfect, single 'b' there. The scanner is controlled by the Spreads GUI webinterface via Google Chrome on a 2013 Toshiba Sattelite running Windows 8. The cameras are Canon Powershot A810's running CHDK version 1.2.0 (according to Exif from the DNG-files). The cameras are connected to the Pi via the Pihub. The pedal is plugged into the Pi directly. The cameras are powered by AC adapters converting 220 V into 3,15V and 1,5 A. The Pihub is powered with an AC adapter too and the Pi takes its power from the hub.

If there is a tried and true solution to both the 'stutter' in the dual capture and the random flash activation, and a way to prevent this from reoccurring, I 'd love to read about them. If they are right under my nose above or under this message, I apologise for 'dual capturing' the problem. And if this post is out of place here, I apologise for that too and will gladly move it to a more appropriate thread.

Thanks a lot,
Regards,
Bart H

ps 'project design and production' is just a pompous way of saying 'having the idea of building and modifying a book scanner especially fitted for scanning special collections of precious and vulnerable originals'
Attachments
Untitled-1.jpg

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Camera dual triggering

Post by jbaiter » 24 Nov 2014, 13:33

Bart, your problem can bedue to you running spreads with the 'hidtrigger' plugin on a machine with another HID device attached in addition to the keypedal.
The plugin indiscriminately triggers a capture for any action on any USB HID device, i.e. if you have your keypedal and a USB mouse attached, it will trigger a capture when you push the pedal, but also when your mouse registers the tiniest movement.
The hidtrigger plugin is *only* intended for usage on a SpreadPi-like scenario, where there is only one keyboard-like input device that is used solely to trigger captures. The docs should probably be clearer on that subject....

Another possibility would be that you are hitting either 'b' or the spacebar in the browser accessing the web interface, this will trigger a capture, too.
Can you confirm that the dual triggers also happen when you run spreads via its CLI interface controlled via SSH on the Pi?
If this is the case and the pedal is the only input device, can you confirm that the 'intervaltrigger' plugin is not active at the same time?
If that is not the case, could you be so kind and post the output of this command:

Code: Select all

# hexdump /dev/input/<footpedal-device>
... hit Ctrl+C after you've pressed and released the pedal once ....
You'll have to find out the name of your device on your own, try out the various devices listed in /dev/input and choose the one that reacts to actions on the pedal.
spreads: Command-line workflow assistant

barth
Posts: 28
Joined: 28 Sep 2014, 09:42
Number of books owned: 0
Country: Belgium

Re: Camera dual triggering

Post by barth » 25 Nov 2014, 05:54

Thank you for your swift and helpful reply.
I'll try to answer some of the questions you raised.

The Scythe pedal is the only input device directly connected to the Pi.
The laptop is connected by wifi to the hub of my local network which is in turn connected to the Pi by FTP cable.
Apart from the occasional check up on image quality, the touchpad-operated laptop is left alone while scanning.
I use the pedal to capture images, and both hands to manipulate the cradle lift and the original. So I'm only touching the laptop when I'm not actually scanning.
The time interval between the commanded and the unwanted captures is always the same 7 seconds.
The unwanted captures occur after nearly every command for a wanted capture.

I am running Spreadpi via the webinterface in a graphic user interface, I don't use command lines.
I'm going to have to look up if and how I can use the CLI via SSH. I hope I'll manage that and be able to answer the rest of your questions.

The excessive captures are inconvenient but don't interfere with image quality and can for now be avoided by temporarily discarding the pedal in favour of the laptop's touchpad while we look for a solution.
The flash firing is more of a nuisance because it ruins every image. So there's a bit more of a 'sense of urgency' there. I'll check again tonight if this problem persists.

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Camera dual triggering

Post by jbaiter » 25 Nov 2014, 06:52

Ok, if the time between those shots is always the same, then I'm almost certain that you accidentally have enabled the `intervaltrigger` plugin. Just remove that from the configuration and you should be good.
About the flash, make sure that your cameras are set to 'manual' shooting mode (there's usually a wheel on the camera itself, the mode is marked "P" on my A2200s).
spreads: Command-line workflow assistant

barth
Posts: 28
Joined: 28 Sep 2014, 09:42
Number of books owned: 0
Country: Belgium

Re: Camera dual triggering

Post by barth » 25 Nov 2014, 07:41

Thank you!
On the flash "turning itself on":
I have manually changed the cameras' mode from 'auto', which seems to be the default setting, to 'P'.
Then I have tried to trigger the cameras using the graphic interface via the webinterface of Spreadpi, by using the mousepad on the laptop to click on the blue circle with the white camera icon.
This resulted in the error message 'capture command failed' and no images made. Like the user commenting before me, I noticed that the cameras seemed to prepare for capture and then just stopped in their tracks.

I may add that the cameras started taking images with flash when I set the parameters in the workflow to shoot in monochrome mode. I hadn't deliberately touched the cameras controls at that time other than to turn them on or of (although there, I may have accidently pushed any of several buttons). In fact I've only now noticed that you can see and maybe change the CHDK settings via the camera's menu.
Until now I thought those were carved in stone and you could only perform minimal modifications in the scanner's behaviour through the 'edit workflow' menu in Spreadpi.
But being able to modify CHDK settings directly would be nice. One of the first things I would like to change there if I get round to it, is disabling the digital zoom and enhancing the optical zoom instead, if possible. That way we can have higher quality image and less useless margins (now the pictures include half of the base of the scanner, the wall behind it, the desk it's sitting on and the operator's knees). I hope that is possible without breaking the software.
But that's for another time and a different thread.
For the flash, I guess I'll try 'live view' instead of 'auto' and 'p' and see what comes out of that.
Thanks again for your help.

On the pedal problem: I'm not sure where to look for the interval plugin. I guess it can be either the chdk sd-card or the spreadpi one. Will figure that out too in due time.

barth
Posts: 28
Joined: 28 Sep 2014, 09:42
Number of books owned: 0
Country: Belgium

Re: Camera dual triggering

Post by barth » 25 Nov 2014, 17:52

When the camera settings are in P, command to capture is given, the lenses zoom out, i can hear the bleep and the click, but no 'shutter' noise. the cameras do this once each with no flash, but instead of thumbnails and picture counts I get 'capture failure' messages. The cameras seem to take a picture, fail to do anything else with it, and then call it a day. This also happens in 'Live' settings. I haven't found a way to disable the interval plugin in chdk via the camera menu. Apparently I enabled it by selecting it. So I have reset the interval time in chdk to 0 so even with the interval plugin enabled there will be no double take even with the plugin enabled.
Unfortunately, I have also accidentally disabled overrides on one camera. I'm still looking up how I can restore that.
Bottom line is that changing the function mode from auto to anything else doesn't agree with my cameras and the spreadpi on my pi very well.
And using the spreadpi interface to change capture mode to monochrome during a workflow apparently activates the flash permanently on my camera. That's how it is for me, for now. I hope I can get out of this before I make it any worse.

User avatar
jbaiter
Posts: 98
Joined: 17 Jun 2013, 16:42
E-book readers owned: 2
Number of books owned: 0
Country: Germany
Location: Munich, Germany
Contact:

Re: Camera dual triggering

Post by jbaiter » 25 Nov 2014, 19:30

1. Try to reset the configuration on your cameras and set them both to the settings described here: https://github.com/markvdb/diybookscann ... ettings.md Do not configure anything in the CHDK menus. Make sure you run CHDK 1.30 (unstable).
2. Does remote capturing ('remoteshoot' command) with chdkptp work from the command-line?
3. The 'intervaltrigger' has to be deactivated by removing it from the 'plugins' entry in the spreads configuration file on the Raspberry Pi ('/home/spreads/.config/spreads/config.yaml')

I will look into the monochrome-mode/flash issue and see if I can reproduce it. Just go with color images for the time being, apart from taking a few KiB more on your disk nothing should change much.
spreads: Command-line workflow assistant

nafraf
Posts: 25
Joined: 29 Oct 2013, 09:33
Number of books owned: 0
Country: Brazil

Re: Camera dual triggering

Post by nafraf » 25 Nov 2014, 22:08

jbaiter wrote:1. Try to reset the configuration on your cameras and set them both to the settings described here: https://github.com/markvdb/diybookscann ... ettings.md Do not configure anything in the CHDK menus. Make sure you run CHDK 1.30 (unstable).
Additionally, I think it worth to reset CHDK settings to default. CHDK Menu -> CHDK Settings -> Reset Options to Default.

Post Reply