Discussion:
[Gphoto-user] Problems with DEVICE_BUSY( 0x2019)
Ryan Neve
2013-03-06 16:40:22 UTC
Permalink
I was taking pictures automatically every 15 minutes for several hours
when gphoto2 began to hang (block). It has been busy for over an hour.

Any ideas on how to recover and prevent this would be a big help!

It's a USB tethered Nikon D40 on Debian Squeeze. The SD card is very
small, but I never save any pictures to it.
The command I'm using:
/usr/bin/gphoto2 --debug --debug-logfile 'tmp.log' --camera 'Nikon DSC
D40 (PTP mode)' --port usb: --capture-image-and-download --filename
20130306_110957.f.jpeg

I can still do--list-config, --get-config, and --set-config without a
problem. If I dogphoto2 -L I get
There is no file in folder '/'.
There is 1 file in folder '/special'.
#1 curve.ntc
There is no file in folder '/store_00010001'.
There is no file in folder '/store_00010001/DCIM'.

Here is some of the log file:

STARTUP

0.000448 main(2): gphoto2 2.4.5
0.000505 main(2): gphoto2 has been compiled with the following options:
0.000546 main(2): + gcc (C compiler used)
0.000583 main(2): + popt (mandatory, for handling command-line parameters)
0.000631 main(2): + exif (for displaying EXIF information)
0.000669 main(2): + cdk (for accessing configuration options)
0.000705 main(2): + aa (for displaying live previews)
0.000742 main(2): + jpeg (for displaying live previews in JPEG format)
0.000778 main(2): + readline (for easy navigation in the shell)
0.000830 main(2): libgphoto2 2.4.6
0.000887 main(2): libgphoto2 has been compiled with the following options:
0.000928 main(2): + gcc (C compiler used)
0.000971 main(2): + ltdl (for portable loading of camlibs)
0.001008 main(2): + EXIF (for special handling of EXIF files)
0.001050 main(2): libgphoto2_port 0.8.0
0.001100 main(2): libgphoto2_port has been compiled with the following
options:
0.001140 main(2): + gcc (C compiler used)
0.001180 main(2): + ltdl (for portable loading of camlibs)
0.001227 main(2): + USB (libusb, for USB cameras)
0.001264 main(2): + serial (for serial cameras)
0.001300 main(2): + no resmgr (serial port access and locking)
0.001369 main(2): + no baudboy (serial port locking)
0.001423 main(2): + no ttylock (serial port locking)
0.001476 main(2): + no lockdev (serial port locking)
0.001535 main(2): CAMLIBS env var not set, using compile-time default
instead
0.001593 main(2): IOLIBS env var not set, using compile-time default instead
0.001810 main(2): Processing 'model' option ('Nikon DSC D40 (PTP mode)')...

LATER THIS

0.120883 PTP2/ptp2/library.c(2): 0xd1c1
0.120937 PTP2/ptp2/library.c(2): 0xd1e0
0.120994 PTP2/ptp2/library.c(2): 0xd1e1
0.121289 gphoto2-port(2): Writing 24=0x18 byte(s) to port...
0.121359 gphoto2-port(3): Hexdump of 24 = 0x18 bytes follows:
0000 18 00 00 00 01 00 07 10-03 00 00 00 ff ff ff ff ................
0010 00 00 00 00 00 00 00 00- ........

0.121510 ptp2/ptp_usb_getdata(2): reading data
0.121553 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.121721 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.216732 gphoto2-port(2): Could only read 20 out of 512 byte(s)
0.216825 gphoto2-port(3): Hexdump of 20 = 0x14 bytes follows:
0000 14 00 00 00 02 00 07 10-03 00 00 00 01 00 00 00 ................
0010 00 40 00 24 - ***@.$

0.216894 ptp2/ptp_usb_getresp(2): reading response
0.216934 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.216982 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.217256 gphoto2-port(2): Could only read 12 out of 512 byte(s)
0.217316 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000 0c 00 00 00 03 00 01 20-03 00 00 00 ....... ....

0.217968 gphoto2-port(2): Writing 16=0x10 byte(s) to port... \ 10.0%
0.218030 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
0000 10 00 00 00 01 00 08 10-04 00 00 00 00 40 00 24 ***@.$

0.218248 ptp2/ptp_usb_getdata(2): reading data
0.218292 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.218342 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.219633 gphoto2-port(2): Could only read 142 out of 512 byte(s)
0.219705 gphoto2-port(3): Hexdump of 142 = 0x8e bytes follows:
0000 8e 00 00 00 02 00 08 10-04 00 00 00 01 00 01 00 ................
0010 01 30 00 00 00 00 00 00-00 00 00 00 00 00 00 00 .0..............
0020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
0030 00 00 00 00 00 00 01 00-00 00 00 00 00 00 00 00 ................
0040 05 44 00 43 00 49 00 4d-00 00 00 10 32 00 30 00 .D.C.I.M....2.0.
0050 31 00 33 00 30 00 32 00-30 00 34 00 54 00 31 00 1.3.0.2.0.4.T.1.
0060 32 00 30 00 34 00 35 00-38 00 00 00 10 32 00 30 2.0.4.5.8....2.0
0070 00 31 00 33 00 30 00 32-00 30 00 34 00 54 00 31 .1.3.0.2.0.4.T.1
0080 00 32 00 30 00 34 00 35-00 38 00 00 00 00 .2.0.4.5.8....

0.219809 ptp2/ptp_usb_getresp(2): reading response
0.219848 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.219895 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.220132 gphoto2-port(2): Could only read 12 out of 512 byte(s)
0.220219 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000 0c 00 00 00 03 00 01 20-04 00 00 00 ....... ....

0.220557 PTP2/ptp2/library.c(2): ObjectInfo for 'DCIM':
0.220605 PTP2/ptp2/library.c(2): Object ID: 0x24004000
0.220643 PTP2/ptp2/library.c(2): StorageID: 0x00010001
0.220682 PTP2/ptp2/library.c(2): ObjectFormat: 0x3001
0.220719 PTP2/ptp2/library.c(2): ProtectionStatus: 0x0000
0.220757 PTP2/ptp2/library.c(2): ObjectCompressedSize: 0
0.220794 PTP2/ptp2/library.c(2): ThumbFormat: 0x0000
0.220831 PTP2/ptp2/library.c(2): ThumbCompressedSize: 0
0.220868 PTP2/ptp2/library.c(2): ThumbPixWidth: 0
0.220905 PTP2/ptp2/library.c(2): ThumbPixHeight: 0
0.220941 PTP2/ptp2/library.c(2): ImagePixWidth: 0
0.220977 PTP2/ptp2/library.c(2): ImagePixHeight: 0
0.221013 PTP2/ptp2/library.c(2): ImageBitDepth: 0
0.221049 PTP2/ptp2/library.c(2): ParentObject: 0x00000000
0.221087 PTP2/ptp2/library.c(2): AssociationType: 0x0001
0.221124 PTP2/ptp2/library.c(2): AssociationDesc: 0x00000000
0.221191 PTP2/ptp2/library.c(2): SequenceNumber: 0x00000000
0.221231 PTP2/ptp2/library.c(2): ModificationDate: 0x510fea3a
0.221269 PTP2/ptp2/library.c(2): CaptureDate: 0x510fea3a
0.222914 gphoto2-port(2): Writing 16=0x10 byte(s) to port...
0.222990 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
0000 10 00 00 00 01 00 14 10-05 00 00 00 13 50 00 00 .............P..

0.223251 ptp2/ptp_usb_getdata(2): reading data
0.223295 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.223346 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.225009 gphoto2-port(2): Could only read 34 out of 512 byte(s)
0.225071 gphoto2-port(3): Hexdump of 34 = 0x22 bytes follows:
0000 22 00 00 00 02 00 14 10-05 00 00 00 13 50 04 00 "............P..
0010 01 01 00 02 00 02 05 00-01 00 02 00 11 80 13 80 ................
0020 14 80 - ..

0.225140 ptp2/ptp_usb_getresp(2): reading response
0.225204 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.225254 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.225505 gphoto2-port(2): Could only read 12 out of 512 byte(s)
0.225564 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000 0c 00 00 00 03 00 01 20-05 00 00 00 ....... ....

0.225732 gphoto2-port(2): Writing 16=0x10 byte(s) to port...
0.225818 gphoto2-port(3): Hexdump of 16 = 0x10 bytes follows:
0000 10 00 00 00 01 00 14 10-06 00 00 00 18 50 00 00 .............P..

0.225997 ptp2/ptp_usb_getdata(2): reading data
0.226043 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.226094 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.226384 gphoto2-port(2): Could only read 28 out of 512 byte(s)
0.226445 gphoto2-port(3): Hexdump of 28 = 0x1c bytes follows:
0000 1c 00 00 00 02 00 14 10-06 00 00 00 18 50 04 00 .............P..
0010 01 01 00 01 00 01 01 00-3c 00 01 00 ........<...

0.226506 ptp2/ptp_usb_getresp(2): reading response
0.226544 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.226592 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.226757 gphoto2-port(2): Could only read 12 out of 512 byte(s)
0.226816 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000 0c 00 00 00 03 00 01 20-06 00 00 00 ....... ....

0.226872 ptp2(2): burstnumber 1
0.226926 gphoto2-port(2): Writing 12=0xc byte(s) to port...
0.226981 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000 0c 00 00 00 01 00 cb 90-07 00 00 00 ............

FINALLY THIS OVER AND OVER....

0.227117 ptp2/ptp_usb_getresp(2): reading response
0.227187 ptp2/ptp_usb_getpacket(2): getting next ptp packet
0.227240 gphoto2-port(2): Reading 512=0x200 bytes from port...
0.416301 gphoto2-port(2): Could only read 12 out of 512 byte(s)
0.416386 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000 0c 00 00 00 03 00 19 20-07 00 00 00 ....... ....

0.416443 ptp2/usb_getresp(0): request code 0x90cb getting resp error 0x2019
0.416500 gphoto2-port(2): Writing 12=0xc byte(s) to port...
0.416555 gphoto2-port(3): Hexdump of 12 = 0xc bytes follows:
0000 0c 00 00 00 01 00 cb 90-08 00 00 00 ............

Thank You!
--
*Ryan Neve*
University of North Carolina
Institute of Marine Sciences
3431 Arendell St
Morehead City, NC 28557
(252) 726-6841 x179
(252) 726.2426 Fax
Ryan Neve
2013-03-06 19:43:18 UTC
Permalink
I little more info. I saw Marcus suggest to someone else with a similar
problem to try:

gphoto2 --set-config capturetarget=0

Unexpectedly, mine was already at 0, so I changed it to 1.

Now when I try to take a picture, I get:

*** Error ***
PTP Device Busy
ERROR: Could not capture.
*** Error (-110: 'I/O in progress') ***

This is better than blocking, but seems to indicate the same problem. So:

If capturetarget=1 Returns above error and if capturetarget=0 it hangs,
but the debug log indicates it it receiving the same 0x2019 message.

I suppose it could be some internal setting keeping if from taking a
picture. I'm going through all the settings to see what might be amiss.

-Ryan
Post by Ryan Neve
I was taking pictures automatically every 15 minutes for several hours
when gphoto2 began to hang (block). It has been busy for over an hour.
Any ideas on how to recover and prevent this would be a big help!
It's a USB tethered Nikon D40 on Debian Squeeze. The SD card is very
small, but I never save any pictures to it.
/usr/bin/gphoto2 --debug --debug-logfile 'tmp.log' --camera 'Nikon DSC
D40 (PTP mode)' --port usb: --capture-image-and-download --filename
20130306_110957.f.jpeg
--
*Ryan Neve*
University of North Carolina
Institute of Marine Sciences
3431 Arendell St
Morehead City, NC 28557
(252) 726-6841 x179
(252) 726.2426 Fax
Marcus Meissner
2013-03-09 19:23:13 UTC
Permalink
Post by Ryan Neve
I little more info. I saw Marcus suggest to someone else with a
gphoto2 --set-config capturetarget=0
Unexpectedly, mine was already at 0, so I changed it to 1.
It won't help for cases where capture worked for an hour and stops.

capturetarget basically changes the capture method from either using
the SD Card inbetween or just the RAM of the camera.
Post by Ryan Neve
*** Error ***
PTP Device Busy
ERROR: Could not capture.
*** Error (-110: 'I/O in progress') ***
If capturetarget=1 Returns above error and if capturetarget=0 it
hangs, but the debug log indicates it it receiving the same 0x2019
message.
I suppose it could be some internal setting keeping if from taking a
picture. I'm going through all the settings to see what might be amiss.
As it happens only after a long while of working capture something else
has happened probably, some internal state of the camera run full or similar.

It is hard to say what or why though :(
And also hard to guess how to unblock it, without powercycling the camera.

I am letting my D7000 take some pictures ...

Ciao, Marcus

Continue reading on narkive:
Loading...