I have a cgi script to control my dslr camera

On my server the app that sends commands to the camera is gphoto2

Running under Debian on a Linksys NSLU2.

I'm using tthtp and pearl.

My problem is that I'm not able to get the cgi to send the command to the server.

I'm no expert on cgi.

What I need to know is what cgi command can pass the server command.

Here is a more detail explanation:

When login using putty under ssh to server as root

This command works fine

gphoto2 --set-config capture=on --set-config capturetarget=1 --set-config capture=on --set-config eos-shutterspeed=35 --set-config eos-iso=0 --set-config capture=off --capture-image

But when I attempt it from within a cgi script using this command

system("gphoto2 --set-config capture=on --set-config capturetarget=1 --set-config capture=on --set-config eos-shutterspeed=35 --set-config eos-iso=0 --set-config capture=off --capture-image");

I get this error back

*** Error *** An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device. *** Error *** An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device. *** Error *** An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device. *** Error *** An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device. *** Error *** An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device. *** Error *** An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device. *** Error *** An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device. ERROR: Could not capture. *** Error (-53: 'Could not claim the USB device') *** For debugging messages, please use the --debug option. Debugging messages may help finding a solution to your problem. If you intend to send any error or debug messages to the gphoto developer mailing list , please run gphoto2 as follows: env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --set-config capture=on --set-config capturetarget=1 --set-config capture=on --set-config eos-shutterspeed=35 --set-config eos-iso=0 --set-config capture=off --capture-image Please make sure there is sufficient quoting around the arguments.

The <o:p></o:p>

has nothing to do with my script for some reason WORD adds that. The server for this is local only so security is not an issue so long as I can get script to work. Any words of advise on how to use suid as I have never heard of it? Thank you

In reply to How to send server / shell command via cgi? by DrStrangeLv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.