Open travnick opened 8 years ago
The pentax can not capture in PTP mode, but in the other (mass storage mode).
However ... We have some support for other Pentax cameras, but so far not the K50 :(
I'm following up on this as I'd also like to see the K-50 supported by Gphoto. In my case for use with Indilib/Ekos for astronomy. I'd like to suggest comparing and integrating code from the more active and up to date PKtriggercord. While also based on Pkremote, PKtriggercord has been actively updating and is currently functional on the k50 for capture,iso and exposure. Perusing the newer routines might reduce the work needed to bring that library up to speed with the newer cameras.
I'd also put myself and "Pentax the Red!"(magic tavern reference) up as testers for this purpose. I would take a naive stab at hacking the two together myself [--and have now gotten the thing to compile.]
I notice that the issue has been picked up, and know just how busy you folks are from the email digest (lurking). I've been busy working on other problems myself but have every intention of being available when the time comes. When you get time to look it over just let me know if there's anything I can do to help.
(currently not working on this due to lack of time and lack of testhardware to verify ... mostly due to lack of time :( )
I understand Marcus, it's no problem. I'll be around if you get into it. I worked out a way to cut power to the Pentax instantly if it decides to go unstable as has happened a few times in the past. Is there any easy way to enable the k-50 for testing? If I could get it recognized I might be able to debug a bit on my own. I poked around in the source a bit and tried replacing the k30 references with k50 as I had read they were similar but failed to get it to register.
I've been watching the action by way of the email list and there are lots of things going on already, so I figured I'd have to be patient. This project would help a ton of Pentaxians get tethered too.
Would you be able to build and test libgphoto2 git?
i tried a port integrating pktriggercord and it was not so bad as I feared. But it will probably need some test turnarounds.
I'll get right on it!
Just to be sure, I made a fresh directory clone of current git and compiled from that but I don't see any new work at git master. Has master been updated, or am I showing my newbness in pulling from the wrong place? (so excited! and off work today too) edit: [found updates in libary.c from today]
Here's the debug file I missed in previous post.
Starting without a settings file in msc mode:
Error
Could not detect any camera
Error (-105: 'Unknown model')
k50test1.txt
i was not yet readsy there. ;)
can you checkout the pentax branch and check that out?
ig you have a checkout, just do "git checkout pentax" and then make
What USB ID does it have in MSC mode, this probably the first thing to add
I had no notebook today as I forgot it this morning. Home now, and will check it out.
(DST sucks)
Git still throws me for a loop sometimes but I got it eventually. - Just for anyone following along, I did $ git checkout -b pentax to get on the branch then $ git pull https://github.com/gphoto/libgphoto2 pentax ...to update it. seemed to do the trick, lots of new code. :)
Still no joy on the camera ID in msc. Here's the usb info on the camera trimmed from lsusb -v. Bus 001 Device 099: ID 25fb:0160 idVendor 0x25fb idProduct 0x0160 The rest is here if needed: k50info.txt
And another debug just in case: k50debug.txt
can you git pull again, remake, reinstall.
grep K50D camlibs/pentax/library.c should now show it.
see if that helped?
Got it, built on my notebook at work and tested during a break. It found the camera, and even worked the shutter with --captture-image-and-download but only after declaring an error. lots of err. info is going to screen but for some reason isn't picked up by bash/xterminal to grab from scrollback. I'll get some files up and corral that info when I get home. I noticed --config worked some too. which should be in the capture/debug I'll get in a while. good progress! note this is on my acer notebook running 16.04 xubuntu k50d-test1.txt debug.output to file.txt
edit: I think the screen output stuff is pktriggercord --debug info via dprint. I've also been working with that code trying to figure out the bug in the bulb mode and recognized it after getting an explanation of dprint outputting to error, then realized it wasn't gphoto debug! confusing. :-P
i need to hook up the bulk support i think, its not there yet.
I changed the dbeugging in git to log to the gphoto2 logfile (my hookin code was incorrect)
it would be nice to see what fails with capture-image :)
Much quieter to screen now. Still gives an error but went ahead and worked the shutter. No capture file is apparent on the drive or sdcard. I got this to screen when I did the test.
0x0000 | 00 00 00 02 00 00 00 00 01 00 02 10 00 00 00 00
0x0010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0020 | 00 00 00 0f 00 00 00 02 00 00 00 00 00 00 00 00
0x0030 | 00 00 01 00 00 00 00 03 00 00 00 0a 00 00 00 50
0x0040 | 00 00 00 0a 00 00 00 00 00 00 00 0a 00 00 00 00
0x0050 | 00 00 00 03 00 00 00 0a 00 00 00 00 00 00 00 03
0x0060 | 00 00 00 00 00 00 00 00 00 00 03 20 00 00 00 64
0x0070 | 00 00 0c 80 00 00 00 00 00 00 00 07 00 00 00 07
0x0080 | 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 01
0x0090 | 00 00 00 00 00 00 00 04 00 00 00 04 00 00 00 04
0x00a0 | 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01
0x00b0 | 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 02
0x00c0 | 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 02
0x00d0 | 00 00 00 00 00 00 00 03 00 00 00 07 00 00 00 01
0x00e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
0x00f0 | 00 00 00 01 00 00 00 00 00 00 13 88 00 00 00 04
0x0100 | 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 03
0x0110 | 00 00 00 0a 00 00 00 50 00 00 00 0a 00 00 00 00
0x0120 | 00 00 00 0a 00 00 00 00 00 00 00 0a 00 00 00 00
0x0130 | 00 00 00 00 00 00 03 20 00 00 00 00 00 00 00 01
0x0140 | 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 00 00
0x0150 | 00 00 00 0a 00 00 00 02 00 00 00 00 00 00 00 50
0x0160 | 00 00 00 0a 00 00 00 00 00 00 00 00 00 00 02 50
0x0170 | 00 00 03 77 00 00 02 fd 00 00 00 00 00 00 00 00
0x0180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0190 | 00 00 00 87 00 00 00 00 00 00 00 00 00 00 00 ca
0x01a0 | 00 00 0b f7 00 00 00 64 00 00 00 3c ff ff ff d8
0x01b0 | 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 3f
0x01c0 | 00 00 00 00 00 00 00 00
ERROR: Could not capture image.
ERROR: Could not capture.
I got a couple of segfaults but then was able to get this on the third try: Here's a config.txt of --list-all-config > config.txt
Here's the debug file from the second try. First try appended an old file and I realized it was getting big.
k50debug1.txt
I added some more debugging to git. if you can rebuild and rerun the test? I think the image type is not correctly detected, but it was not debug priunted.
I also added "bulb" as config option, so --bulb seconds should produce some form of result, but it will probably encounter a failure similar to capture-image still.
I think you are right about image type. I changed it to .jpg only and it captured a file on camera. I often use raw+ which makes one of each, or just raw for post processing. --bulb=45 appears to have set the camera exposure to 30 seconds, but also had the effect of never finishing. I also saw similar with pktriggercord in the past however so that may be "next tier" problem.
Rebuilt and tested with capture-image: k50d-test2.txt
Tested with --capture-image --bulb=10 ...no shutter , waited then ctrl-c out. k50d-bulbtest1.txt
so, the format your camera is set to RAW_PLUS. I added code similar to handling RAW (DNG?)
I also add a shutter release in bulb support. Can you check both again?
Yes. It saves RAW format as .DNG and the + setting makes it go ahead and develop a .JPG file of the same name. I usually shoot raw or raw+ for astronomy. The bulb test was similar to before with the process stopping just after showing the bulb value and the hex dump. I let it run a bit before breaking out. The camera engaged the shutter when I did and it dropped out when I turned the camera power off. I suspect this may be the problem I was working on in pktriggercord last week. I had the idea that it might procedural problem and started learning the code but haven't isolated it. I was reading both Gphoto and Pktriggercord code when it occurred to me that this project might be a thing worth trying(still excited!). The k-50 has a menu item that sets bulb type to hold button or push on/off that may be offsetting the command from protocol somehow - just a hunch. I'd really like to get that working though as it's the number one thing we use in long exposure astrophotography(AP). It might also be worth noting that PKtriggercord usage was different and would dump photo code to terminal if you didn't give it a file name. Might be some weirdness involved there to check out.
I switched the dial to bulb mode for this with no change. k50d-bulb2.txt
The capture-image test still reported capture error, worked the shutter, and no file report. I made sure it was in raw+ and dialed to user mode with M(manual) k50d-test3.txt
Ok , I forgot some break; statements. that should cure the --capture-image cases now.
will check bulb later
Failed to finish. Looks like it got stuck at the file type parsing again for some reason as log shows. did not report capture error to screen this time though. k50d-test4.txt
Appreciate all the attention. :) I've had my k50 at the workbench with me all day while I work on PLC's in a windows vm so I could just bang out tests.
i am trying to move this a bit forward ;)
I now added a commit handling RAW_PLUS to the save function. (the single image capture modes should work already, RAW_PLUS needs a bit work)
Oh rats. I found a problem on my end. The dirty bit got set on the card at some point. I'll get that cleaned up and retest. I have it set to not mount but probably failed to eject it after checking at some point then repowered the camera.
Cleared card formatted with camera(easiest solution) and retested. Switched to .JPG to test. It still reports ERROR: Could not capture image. ERROR: Could not capture. New file is in location /capt0001.dng on the camera But it isn't to be found. I tried --capture-image-and-download and it worked okay, then deleted the photo from camera. The file reads okay, shows a pic of junk on my desk.
ERROR: Could not capture image. ERROR: Could not capture. New file is in location /capt0001.jpg on the camera File capt0001.jpg exists. Overwrite? [y|n] n Specify new filename? [y|n] y Enter new filename: capt0002 Saving file as capt0002 Deleting file /capt0001.jpg on the camera
Last couple tests. sorry about the size/stacking in it. I'll do more when I get home.
First file to pc viewer! woot!
yeah, capture-image-and-download is needed, as the file is only in temporary memory on the camera and in libgphoto2. I changed capture-image hopefully to also return an image already, so hopefully this error goes away.
Ah, that explains the missing file.
Guess who left the only working pentax cable sitting on the workbench at work. :1st_place_medal:
I saw some updates so blundering forward with another test this morning.
Got a jpg on the first try:
k50d-test6-jpg.txt
Raw+ test downloaded a .DNG file but raw readers would not open it. No jpg was found.
and looked like this:
hawk@hawk-Aspire-R3-131T:~/libgphoto2$ gphoto2 --debug --debug-logfile=k50d-test6-rawpl.txt --capture-image-and-download
0x0000 | 00 00 00 02 00 00 00 00 01 00 02 10 00 00 00 00
0x0010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0020 | 00 00 00 0f 00 00 00 02 00 00 00 00 00 00 00 00
0x0030 | 00 00 01 00 00 00 00 01 00 00 00 0d 00 00 00 32
0x0040 | 00 00 00 0a 00 00 00 00 00 00 00 0a 00 00 00 00
0x0050 | 00 00 00 03 00 00 00 0a 00 00 00 00 00 00 00 03
0x0060 | 00 00 00 00 00 00 00 00 00 00 03 20 00 00 00 64
0x0070 | 00 00 0c 80 00 00 00 00 00 00 00 07 00 00 00 07
0x0080 | 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 01
0x0090 | 00 00 00 00 00 00 00 04 00 00 00 04 00 00 00 04
0x00a0 | 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01
0x00b0 | 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 02
0x00c0 | 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 02
0x00d0 | 00 00 00 00 00 00 00 03 00 00 00 07 00 00 00 01
0x00e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01
0x00f0 | 00 00 00 01 00 00 00 00 00 00 13 88 00 00 00 04
0x0100 | 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01
0x0110 | 00 00 00 0d 00 00 00 32 00 00 00 0a 00 00 00 00
0x0120 | 00 00 00 0a 00 00 00 00 00 00 00 0a 00 00 00 00
0x0130 | 00 00 00 00 00 00 03 20 00 00 00 00 00 00 00 00
0x0140 | 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 00 00
0x0150 | 00 00 00 0a 00 00 00 02 00 00 00 00 00 00 00 50
0x0160 | 00 00 00 0a 00 00 00 00 00 00 00 00 00 00 02 50
0x0170 | 00 00 03 37 00 00 02 f0 00 00 00 00 00 00 00 00
0x0180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0190 | 00 00 00 87 00 00 00 00 00 00 00 00 00 00 00 ca
0x01a0 | 00 00 0d ac 00 00 00 64 ff ff ff f6 ff ff ff d8
0x01b0 | 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 3f
0x01c0 | 00 00 00 00 00 00 00 00
ERROR: Could not capture image.
ERROR: Could not capture.
New file is in location /capt0001.dng on the camera
Saving file as capt0001.dng
Deleting file /capt0001.dng on the camera
The raw only test resulted in a 0 length .DNG file. after I said Y to overwrite. also after deleting the file and retrying. k50d-test6-raw.txt
k50d-test6-rawpl.txt
shows a JPEG file being downloaded, so capt0001.dng there might be .jpg instead... can you chek with "file capt0001.dng" ?
In the dual mode capture I need to detect the types better :/
k50d-test6-raw.txt only has a 0 byte files as you saw.
I added the status display code to --summary What you can try for instance:
gphoto2 --capture-image-and-download --summary
perhaps we can see something interesting there too
I thought that might be the case too, because geeqie(which uses jpg/raw grouping for thumbnails) loaded it when rawtherapee and ufraw would not. Sure enough, renaming to .jpg loads in viewers right away. this may be related somehow to the dual(DNG+JPG) file output of raw+ mode. Heres the output of summary: Camera summary: Pentax K DSLR capture driver. Using code from pktriggercord by Andras Salamon. Collected Statatus Information: current iso : 800 current shutter speed : 1/13 camera max shutter speed : 1/6000 current aperture : 5.6 lens max aperture : 40.0 lens min aperture : 5.6 set shutter speed : 1/13 set aperture : 5.6 fixed iso : 800 auto iso : 100-3200 jpeg quality : 4 jpeg resolution : 16M jpeg image tone : Natural jpeg saturation : 4 jpeg contrast : 4 jpeg sharpness : 4 jpeg hue : 4 zoom : 47.50 mm focus : 0 color space : sRGB image format : RAW+ raw format : DNG light meter flags : 32 ec : 0.00 custom ev steps : 1/3 custom sensitivity steps : 0 exposure mode : 6 (NONE) user mode flag : 2 ae metering mode : Spot af mode : AF.S af point select : Auto-5 selected af point : 0 focused af point : 0 drive mode : SelfTimer-2 auto bracket mode : off auto bracket picture count : 0 auto bracket picture counter : 0 auto bracket ev : 0.30 shake reduction : off white balance mode : Auto white balance adjust : 0 flash mode : Manual flash exposure compensation : 0.00 manual mode ev : 1.30 lens : smc PENTAX-DA L 18-55mm F3.5-5.6 AL WR battery : 7.95V 7.23V 0.00V 0.00V
Here's the debug from that, file got pretty big. k50d-test7-rawpl.txt
I also ran raw only again: summary.txt k50d-test7-raw.txt
the raw only was empty, as the code did not handle raw downloads yet (only jpeg downloads).
I fixed that in GIT I hope.
I have some ideas for the dual-mode download.
(thats why the second trace for raw downlooad is so short... its 0 bytes, as there is no JPEG)
I see. Okay I'll repeat the raw tests then. The raw+ did the same thing as previous, as expected? Never hurts to have a fresh debug: k50d-RAWpl.txt
The RAW only (DNG) shuttered okay, but failed to download a file. k50d-RAW.txt
I added some dual mode (rawplus) capture code now. you should be seeing both images being downloaded.
I need to add some waiting after delete I think, it currently returns some images twice
I grabbed my camera soon as I noticed the message. :)
Here's a summary from the first test to show where I had things set: summary.txt
I had a little trouble and found that while it wasn't mounted, the msc drive being recognized seemed to be an issue. mounting then ejecting it in pcmanfm seemed to solve it and returned to expected operation. From console: " ERROR: Could not capture image. ERROR: Could not capture. New file is in location /capt0000.jpg on the camera ERROR: Could not get image. ERROR: Buggy libcanon.so? "
The raw+ test gave me 4 files as you mentioned, the raw is now actually a raw image and loaded right up in darktable, accepting a raw only command to filter noise(as a test). The jpg is okay as well. I did notice a slight exposure difference between the two but it was not reported in exif. I thought I heard a double shutter as if in bracket mode as well(which gives 3 images, I.e.+1,-1,0) but isn't when I tested it locally. May be related to the timing/delay issue you mentioned. More testing shows the shutter gets erratic in its timing, sometimes firing or working once before going ahead and doing the actual 2sec/remote delay shutter I usually use on the mount. It had been working okay with it but to be more sure I switched the camera to regular single mode and retested. k50-dngp.txt
This is output to console with the console hex dump omitted for clarity - repeating the command. hawk@hawk-Aspire-X1420:~/libgphoto2$ gphoto2 --capture-image-and-download --debug --debug-logfile=k50-dngp.txt ERROR: Could not capture image. ERROR: Could not capture. New file is in location /capt0000.jpg on the camera ERROR: Could not get image. ERROR: Buggy libcanon.so? hawk@hawk-Aspire-X1420:~/libgphoto2$ gphoto2 --capture-image-and-download --debug --debug-logfile=k50-dngp.txt New file is in location /capt0000.dng on the camera Saving file as capt0000.dng Deleting file /capt0000.dng on the camera New file is in location /capt0000.jpg on the camera Saving file as capt0000.jpg Deleting file /capt0000.jpg on the camera New file is in location /capt0001.dng on the camera Saving file as capt0001.dng Deleting file /capt0001.dng on the camera New file is in location /capt0001.jpg on the camera Saving file as capt0001.jpg Deleting file /capt0001.jpg on the camera
Debug of RAW only: k50-dng.txt I changed the debug level to "error" to help keep file size manageable, let me know if you need the really big (reporting 100+meg for some reason) version, though it may take a while to upload at home. probably wait till i'm at work to try, and zipping may help.
I managed to get the camera stuck twice breaking out of commands, and also managed to set the dirty bit again. Formatted with camera before the last couple tries.
Off to go Jupiter hunting with the new asi178 I just got! :)
I added some more waits to the capture function, so the errors should be gone now.
Like a good bike saddle, nothing much to report when it works. I got the right files and right amounts of files this time in all tests jpg, raw, and raw+. :dancing_women: k50jpg.txt k50d-RAW.txt k50d-RAWpl.txt Might be time to look at some of the other config stuff?
I've been switching modes locally raw/etc. because the config takes the command but no change is made. Also that pesky bulb problem still eludes me - I stopped digging in the pktriggercord code once you started this since it seemed it might become redundant and your wisdom on this is going to be miles ahead of my meager efforts. the library called bulb correctly but it responded incorrectly as when I tried it with pktriggercord-cli. Before I stopped looking I thought the bulb setup might have been offset by a version change but I found a guy with a k30 who also reports having bulb press type 1-2 in the extra menus. I had noticed that the bulb setting I usually keep on 2 for press open-press closed changed to 1 after calling --bulb in pktirggercord. It seems to recognise the mode as bulb, and your code did get a shutter if I remember right, but never timed out or locked up. not sure which. I'll redo that test when I get home. Would a todo list help? I could do a more complete checkout of --config as well if needed.
Running some tests at home, confirmed the proper downloads again on another computer. Nice! Also noted the internal 2 second shutter delay works correctly and does not interfere. I pulled something from my notes on pktriggercord that I thought might be of interest: " I think the return from status call may not be passing the string to status, but instead a number, presumably from the camera? ..so I did some more tests and ran through the dial collecting data." (note the gui mode [user1/2 dial position changes on screen in software] switch to also does not work) dialed exposure modes (read from status) 7 (none) = B Bulb 6 (none) = M Manual 5 (none) = Tav 4 (none) = Av 3 (none) = Tv 2 (none) = Sv 0 (none) = P 1 (STANDARD) = movie (movie camera icon) - odd,fired shutter during status 0 (MACRO) = green colored "auto" () shows submode 1 (LANDSCAPE) = "SCN" scene mode.() shows what scene is picked." when I put the number into the bulb function parse it acted more correctly, but I still hadn't gotten it to shutter. I think this may be related to several problems with mode changes.
Bulb test with bulb mode1 and user1 set to bulb manually in camera
gphoto2 --capture-image-and-download --bulb 5 --debug-loglevel=debug --debug-logfile=k50bulbjpg.txt
Bulb mode enabled (exposure time: 5s).
[omitted hex code console output]
pentax/pslr.c:869:get_status(p->fd) failed: 129
New file is in location /capt0000.jpg on the camera
Saving file as capt0000.jpg
Deleting file /capt0000.jpg on the camera
pentax/pslr.c:869:get_status(p->fd) failed: 129
camera shuttered but photo has 1/25 second exposure. (press and hold probably not the method to use)
Next I changed to mode 2, dial user1 and gui set bulb Camera opened shutter, errors came at time 5=seconds but had to break out and restart camera to close shutter. pentax/pslr.c:869:get_status(p->fd) failed: 129 pentax/pslr.c:869:get_status(p->fd) failed: 129 ^C Cancelling... ^C k50bulb2.txt
if you have other stuff i'll be glad to go in whatever order you like and as time allows of course. I figured it never hurts to send more data. :)
The shootingmode values should now match what is on the camera, I was using the wrong enum.
so switch the camera mode dial to "B", plug it in, then run:
gphoto2 --set-config bulb=1 --wait-event=5s --set-config bulb=0 --wait-event-and-download=5s
I now merged the pentax branch back into GIT "master" branch for further work and the next release. "git checkout master" and then "git pull" as usual...
Good morning! This looks like a great thing to wake up to. :fireworks: Well it almost worked. The shutter opened but never closed. After waiting long enough, I manually pushed the shutter button and the routine then downloaded files but kept on going and the camera became unresponsive. After pulling power to reset it, I tried setting the extras menu item to bulb=1 (press and hold) and it worked the shutter/released the first time but not the second which seems right. looks to me like the camera didn't like bulb=0 command. Because I had to break out the debug may be incomplete. I can try some more ways if needed. k50bulb.txt
EDIT DOH! I did git pull and forgot to compile! ..morning indeed. ignore all that. Trying again!
(head clearing) ..sorry bout that. When I did the command you sent I got a quick shutter open/close and then it waited, then downloaded the (very dark) picture. I checked and it was set to bulb mode 2 press/press so I changed it to mode 1 and tried again. It did similar to before with open shutter and time down but not close it. *** I tried something else which may be a clue. I set to mode 2 and changed the command to have the bulb 0 be another bulb 1 like this: libgphoto2$ gphoto2 --debug --debug-logfile=k50bulb.txt --debug-loglevel=debug --set-config bulb=1 --wait-event=5s --set-config bulb=1 --wait-event-and-download=5s And it triggered the shutter both times! I'm thinking maybe it toggled back on its own? Hope this helps.
Both commands landed in the one file. k50bulb.txt
In other tinkering, I got my first photo from the k50 in indilib/ekos last night! The exposure change doesn't work and the mode set causes issues as expected considering my previous report on it but it was neat to see it connect and give me results.
You need to send --set-config bulb=0 at the end of bulb capture.
It seems not be doing bulb capture though, as the bulb=0 reports some error back from the camera.
It seems to access the filesystem at least.
gphoto2 --debug --debug-logfile=k50bulb.txt --debug-loglevel=debug --set-config bulb=1 --wait-event-and-download=5s --set-config bulb=0 --wait-event-and-download=5s
I suspect it takes a regular non-bulb image for some reason :/
hmm. Did my second try overwrite the first in the debug? I did it correctly the first time but did not change the file name on the second (experimental) try. I'll redo that test asap.
The camera did take a very short exposure image with the proper command. The bulb=1 may be changing back to 0 by itself in camera
My improper use version was a troubleshooting experiment. It shows that the command will toggle shutter each time bulb=1 is called. I noticed in the pktriggercord code that there is a shutter call if the bulb mode is not found, which leads me to believe that routine is not parsing bulb because it's getting a number instead of the name.
Just to try to be clear I did it again and split things up better. :)
gphoto2 --debug --debug-logfile=k50bulb.txt --debug-loglevel=debug --set-config bulb=1 --wait-event-and-download=5s --set-config bulb=0 --wait-event-and-download=5s
Image exif shows 1/25s This one produced the file: k50bulb - 1 press and hold.txt
This one opens shutter and hangs. k50bulb-2 press start press stop.txt
Thanks... I looked at it and the bulb command gets a status of 0x81 ...
Good status would be 0x00 (ok) or 0x01 (busy, wait a bit) , but 0x81 seems to indicate something went wrong or was unexpected.
So it just executed the psl_shutter command, which then took a short picture.
The same thing works for my K10D, so the K50D seems to have a different thing going on.
Does bulb mode work on the camera itself?
Bulb mode works. I use an IR remote to fire bulb on the telescope in press press mode. Does the k10D have the two different bulb modes in the menu?
Also, does the --summary for the k10D show numbers in exposure mode or command names?
I dont see any mention of bulb in the cameras menus. I can turn the dial to "B" but there seems no other modification possibility. Pressing the shutter button starts bulb, releasing it ends bulb capture.
Ideas, theory and hypothesis:
Idea: Since the first command set config bulb=1 also locks the shutter open okay, maybe doing something like calling shutter directly I.E. shutter/time/shutter while menu bulb mode=2 (+dial set to bulb) would make it close and finish up..
Since the K10D is using the press and hold method (bulb=1/wait/bulb=0) then bulb=1 is shutter open in that model. My suspicion is that the later models bulb=1 sets the menu bulb input type. I'm pretty sure I saw bulb change from 2 to 1 in one of my early tests which made me suspect this. I saw it because I usually use mode 2 in normal(nighttime) use and found it had changed to 1 in the menu.
Hypothesis: Is bulb=1 acting on the menu instead of a set shuttering routine as in the earlier models? I'm out of time tonight but i'll try to verify that as soon as I get a chance.
If so, enabling the routine to --set-config bulb=2(which currently errors) for later models might prove useful in the long term, perhaps by being able to set the control mode at run time.
On another note, this article shows the K-30 also has the menu items. I think that model may be when things changed, The trick is going to be finding out just how they differ. [recently {9/17} discovered others, k-5 and k-7 also have bulb type in menus)
I'm not able shot photo with Pentax K-50:
from gphoto --shell --debug:
I'm familiar with C++ programming so maybe I'm able to help you with bringing support of this camera to libgphoto2