Scroll to navigation



pktriggercord-cli - command-line Pentax DSLR tethering software


pktriggercord-cli [--model CAMERA_MODEL] [--device DEVICE] [--timeout SECONDS] [--exposure_mode MODE] [--exposure_compensation VALUE] [--drive_mode DRIVE_MODE] [--flash_mode FLASH_MODE] [--flash_exposure_compensation VALUE] [--iso ISO] [--aperture APERTURE] [--shutter_speed SHUTTER_SPEED] [--af_mode AF_MODE] [--select_af_point AF_SELECT_MODE] [--ae_metering AE_METERING] [--resolution RESOLUTION] [--quality QUALITY] [--jpeg_image_tone IMAGE_TONE] [--white_balance_mode WB_MODE] [--white_balance_adjustment WB_ADJ] [--auto_focus] [--reconnect] [--green] [--warnings | --nowarnings ] [--version | --help | --dust_removal | --status | --status_hex | --settings | --settings_hex | --read_datetime | --read_firmware_version | --dump_memory SIZE | --frames NUMBER [ --delay SECONDS ] | --noshutter | --servermode [ --servermode_timeout SECONDS] | --pentax_debug_mode VALUE] [ --file_format FORMAT ] [ --output_file FILENAME ] [--file_num_start NUMBER] [--debug]

Syntax shows only long option names.


pkTriggerCord is a cross-platform Pentax DSLR tethering software, and pktriggercord-cli is a command-line client for it.


By default the software connects to the first available Pentax camera.


Specify the camera model. Useful if more than one camera is connected. Valid ( case-insensitive ) values are: K20d, K10d, GX10, GX20, K-x, K200D, K-7, K-r, K-5, K-2000, K-m, K-30, K100D, K110D, K-01, K-5II, K-5IIs, K-3, K-3II, K-500.

--device DEVICE

Specify the device. Useful if more than one camera is connected. Valid ( case-sensitive ) values are depend on the operating system. Valid values for Linux: sg0, sg1, ..., for Windows: C, D, E, ....

--timeout SECONDS

Specify the timeout in seconds for camera connection. 0 means no timeout, the program will wait forever. By default there is no timeout.

Work mode

Without specifying work mode the program prints out the status info.

-F, --frames NUMBER

Specify the number of shots. Maximum number of pictures is 10000.

-d, --delay SECONDS

Specify the delay between the shots (if number of frames is greater than 1). The minimum delay is based on several factors, approximately 3 seconds. If auto bracketing is set there is only delay after bracketing groups.

-f, --auto_focus

Autofocus before first shot.


Reconnect between shots. Might solve image artifact problems.

-g, --green

Green button before first shot.

-s, --status

Print human readable status info and do not take pictures.


Print raw (hexadecimal) and human readable status info and do not take pictures.

-S, --settings

Print human readable settings info and do not take pictures.


Print raw (hexadecimal) settings info and do not take pictures. Since the size of the settings buffers is unknown it prints out only the first 1024 bytes.


Print the date and time set in the camera and do not take pictures.


Print the firmware version of the camera and do not take pictures.

--dump_memory SIZE

Dump the memory of the camera to pentax_dump.dat file. Size should be specified by bytes, but K, M, and G modifiers can be used. For instance: 2K, 10M, 3G. Maximum size of the dump memory is 4GB.


Do not send shutter command just wait for new images. Shutter should be released by using a cable release or by pressing the shutter button of the camera. The latter does not work for all camera models.


Initiate dust removal process.


The program waits for commands using port number 8888. The program ends if no client connects for 30 seconds. Different timeout value can be specified by --servermode_timeout.

--servermode_timeout SECONDS

Specify timeout for servermode. Default value: 30 seconds

--pentax_debug_mode VALUE

Enable (VALUE=1) or disable (VALUE=0) the camera debug mode. This is DANGEROUS, use it only if you know camera debug mode..

Setting exposure parameters

-w, --warnings

Specify warning mode. The program prints out warning messages if the settings are invalid. It will not stop since the camera can fix most of the invalid settings. For instance specifying -iso 796 will change the iso to 800.


Turns off warning mode.

-m, --exposure_mode EXPOSURE_MODE

Specify exposure mode. Only works if the camera is set to user mode (and in manual mode for some models).

-i, --iso ISO

Specify ISO settings. Single value (400) or interval (200-800) can be used.

-a, --aperture APERTURE

Specify aperture. Sample valid valus: 2.8, 5.6, 11 (depends on the lens).

-t, --shutter_speed SHUTTER_SPEED

Specify shutter speed. Value should be specified in the following format: 1/50, 1/500, 0.5, 5, ... Values greater than 30 sec only allowed if Bulb mode is already set.

--af_mode AF_MODE

Specify the autofocus mode. Valid values are: AF.S, AF.C, AF.A.

--select_af_point AF_SELECT_MODE

Specify the autofocus point selection mode. Valid values are: Auto-5, Auto-11, Select, Spot. It is also possible to specify the raw numerical value.

--ae_metering AE_METERING

Specify the autoexposure metering mode. Valid values are: Multi, Center, Spot.

--exposure_correction VALUE

Specify exposure compensation value.

--drive_mode DRIVE_MODE

Specify the drive mode. Valid values are: Single, Continuous-HI, SelfTimer-12, SelfTimer-2, Remote, Remote-3, Continuous-LO.

--flash_mode FLASH_MODE

Specify the flash mode. Valid values are: Manual, Manual-RedEye, Slow, Slow-RedEye, TrailingCurtain, Auto, Auto-RedEye, Wireless.

--flash_exposure_correction VALUE

Specify flash exposure compensation value.

Output file specification

-o,--output_file FILENAME

Specify the name of the output file prefix. Frame number and extension will be automatically added. Use '-' to output to stdout.

--file_num_start NUMBER

Specify what number to start at when adding the frame number to a file. Valid values are 0-9999.

--file_format FORMAT

Specify the output file format. Valid values are: PEF, DNG, JPEG. It also changes the default file format in the camera.

--color_space COLOR_SPACE

Specify the color space. Valid values are: sRGB, AdobeRGB.

-q,--quality QUALITY

Specify jpeg quality using the 'star' rating of the camera. 1, 2, 3 can be used for all the cameras, for some cameras 4 is also allowed. It also changes the jpeg quality in the camera.

-r,--resolution RESOLUTION

Specify jpeg resolution. While this changes the jpeg resolution setting in the camera, it will not affect the resolution of the downloaded jpeg file. (it's a bug).

--jpeg_image_tone IMAGE_TONE

Specify the jpeg image tone. Valid values are: Natural, Bright, Portrait, Landscape, Vibrant, Monochrome, Muted, ReversalFilm, BleachBypass, Radiant, Auto. Currently this setting is temporary, picture taking restores it back to the original, so it's quite useless.

--white_balance_mode WB_MODE

Specify the white balance mode. Valid values are: Auto, Daylight, Shade, Cloudy, Fluorescent_D, Fluorescent_N, Fluorescent_W, Fluorescent_L, Tungsten, Flash, Manual, Manual2, Manual3, Kelvin1, Kelvin2, Kelvin3, CTE, MultiAuto.

--white_balance_adjustment WB_ADJ

Specify the white balance adjustment. Valid values like: G5B2, G3A5, B5, A3, G5, M4.


-v, --version

Display version and exit.

-h, --help

Display a short usage message.


Debug info.


The program accepts the following commands in servermode:


Connect to the camera.


Focus (half pressing the shutter).


Shutter (full pressing).

delete_buffer BUFFER_INDEX

Delete a buffer image.


Read camera status info.


Get camera name.


Get lens name.


Get current shutter speed.


Get current aperture.


Get current ISO.


Get buffer mask.


Get auto bracket mode.


Get Auto bracket picture count.

get_preview_buffer BUFFER_INDEX

Get the preview buffer.

get_buffer BUFFER_INDEX

Get the image buffer.


Get the current buffer type for images downloaded from the camera (DNG or PEF).

set_buffer_type BUFFER_TYPE

Set the buffer type for images downloaded from the camera (defaults to DNG, valid values are "DNG" or "PEF").

set_shutter_speed SHUTTER_SPEED

Set shutter speed.

set_aperture APERTURE

Set aperture.

set_iso ISO

Set ISO.


Disconnects the client. The server keeps running (for a while) and waits for a new client to connect.


Stops the server.


Test command.


Sleep some number of microseconds.


The website[1],


pktriggercord-cli --status

Connects to the camera and prints out status info.

pktriggercord-cli --status_hex

Connects to the camera and prints out hexadecimal and human-readable status info.

pktriggercord-cli --file_format dng -o test.dng

Takes a single image and saves it as test.dng.

pktriggercord-cli --file_format dng -F 5 -d 20 -o test

Takes five images using 20 seconds delay and saves them test-0000.dng, test-0001.dng ... .

To track down errors, you can add the --debug parameter to the pktriggercord-cli command line.


The website