6

Using gphoto2/gtkam, I have managed to obtain a live view of my camera on my laptop. However, gtkam (or digiKam, for that matter) stops showing the live view once I have taken a picture. Further attempts at capturing an image just don't show a live view. If I toggle the camera on and off (while still connected to the laptop), the next attempt will show a live view, and then the cycle will continue. Toggling the camera is cumbersome; what options do I have from the laptop?

When I toggle the camera, I hear the sound of the shutter closing. I guess that indicates the camera is still active somehow - perhaps if I could stop it, I wouldn't need to turn it off. Removing and re-adding the camera from gtkam just errors out. The error is similar to the could not lock error mentioned in the gphoto2 documentation, but:

  • AFAICT nothing other than gtkam is using the camera;
  • the camera is sometimes listed in gvfs-mount -l output, but gvfs-umount -s gphoto2 has no effect.

I'm using Arch Linux, kernel 4.2.5-1.

  • 3
    I wonder if I should have posted this in Unix & Linux instead. – muru Dec 16 '15 at 21:15
  • You could both post it to Unix or to StackOverflow. Either way I recommend asking developers about that. – Euri Pinhollow Dec 5 '16 at 10:49
  • See askubuntu.com/q/645/8903 , although this may already be fixed. Patches for gphoto2 have been floating around for years. – Peter Taylor Oct 2 '17 at 9:54
  • It's not a programming question so don't ask at StackOverflow. Unix/Linux and Superuser would be possible. – Andreas Hartmann Jun 24 '18 at 18:04
1

You could try toggling the USB connection off and on. Maybe you also have to programmatically restart the program. Maybe this can help you pull it off: https://www.linux.com/blog/disable-enable-usb-terminal

First time, our modem must be plugged into our usb. After that, we trying to connect with wvdial command. Ups, I cannot got carrier.The first solution for a long time is I pull out the modem from usb and wait a few second than I plug again into usb. it's very make me feel bored and angry. So, to fix the problem without do the really bad clue. First time, You must open the terminal and make access as super user : "sudo lsusb -t|less", this command will be give you list the active usb. And in the result is :

 /:  Bus 05.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
 /:  Bus 04.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
 /:  Bus 03.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
 |__ Port 1: Dev 2, If 0, class="HID", Driver=usbhid, 1.5M
 /:  Bus 02.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
 |__ Port 1: Dev 6, If 0, class="vend"., Driver=usbserial_generic, 12M
 |__ Port 1: Dev 6, If 1, class="vend"., Driver=usbserial_generic, 12M
 |__ Port 1: Dev 6, If 2, class="vend"., Driver=usbserial_generic, 12M
 |__ Port 1: Dev 6, If 3, class="stor"., Driver=usb-storage, 12M
 |__ Port 2: Dev 3, If 0, class="HID", Driver=usbhid, 1.5M
 |__ Port 2: Dev 3, If 1, class="HID", Driver=usbhid, 1.5M
 /:  Bus 01.Port 1: Dev 1, class="root_hub", Driver=ehci_hcd/8p, 480M
 |__ Port 6: Dev 5, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
 |__ Port 6: Dev 5, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M

After we know the actived usb that connect with our modem. Do this command

echo '2-1' |sudo tee /sys/bus/usb/drivers/usb/unbind # <- to make usb disable/turn off

NB : 2-1 is the process that we will be kill. after you do that command, the usb will be disable. Trying to dial again with wvdial. So we have the result:

eject: unable to find or open device for: `/dev/sr0'
--> WvDial: Internet dialer version 1.60
--> Cannot open /dev/ttyUSB0: No such file or directory
--> Cannot open /dev/ttyUSB0: No such file or directory
--> Cannot open /dev/ttyUSB0: No such file or directory

*This is good information.That's have mean, the usb succesfully set as disable. We do again the command such as step number 5 but with different input at the end. So ,like this:

echo '2-1' |sudo tee /sys/bus/usb/drivers/usb/bind # <- to make usb active again // the different command just in the end of syntax. NB :

2-1 is process that will be make enable. Try again with the wvdial command like as before. And.... i no need to pull out and plug in again modem in usb. So, the mainly command is in step 5 and 7.

One more possibility would be to use darktable. It uses the same backend, but perhaps has some better trickery regarding the commands that are sent to the camera: https://www.linux.com/learn/how-remote-control-your-camera-darktable-linux

  • +1, hopefully this helps someone else, but my D5300 long since completely stopped responding to the USB cable (on both Linux and Windows). I just use a card reader now. :/ – muru Jun 24 '18 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.