--- title: "Connect and read capabilities" description: "Find a Sony, Canon or Nikon camera attached to your computer, open it, read what it can do right now, set any setting by id, and recover it." url: https://darkgrade.com/docs/functionality/connection last_updated: 2026-12-04 docs_index: https://darkgrade.com/docs/llms.txt --- # Connect and read capabilities > Find a Sony, Canon or Nikon camera attached to your computer, open it, read what it can do right now, set any setting by id, and recover it. > ## Documentation Index > Fetch the complete documentation index at: https://darkgrade.com/docs/llms.txt > Use this file to discover all available pages before exploring further. Remote control starts here: find the Sony, Canon or Nikon camera attached to your computer, open it, and ask what it offers. What a camera can do depends on its model, its mode and its lens, so read [What the camera can do](#what-the-camera-can-do) before changing anything. | What | Does | | - | - | | [Find cameras](#find-cameras) | List the cameras plugged in. | | [Connect](#connect) | Open the camera. | | [Camera info](#camera-info) | Make, model, firmware and connection. | | [What the camera can do](#what-the-camera-can-do) | Every setting, its choices, and what works right now. | | [Set any setting](#set-any-setting) | Change a setting by its id. | | [Recover a stuck camera](#recover-a-stuck-camera) | Bring back a camera that stopped answering. | | [Disconnect](#disconnect) | Close the camera and put it back as it was. | | [Events](#events) | Hear when a setting changes or a file lands. | Each example has a tab per product. Pick yours once and every example follows. In Studio, the microphone that starts [voice](https://darkgrade.com/docs/studio/voice.md) is under the picture. MCP tabs show the tool Claude calls on Studio; on [your own server](https://darkgrade.com/docs/ai/server.md#what-differs-from-studio) the tools also take `camera`. Each CLI command opens the camera, does one thing and closes it. ## Find cameras Lists the cameras plugged in over USB, without opening any of them. ```text Studio The camera pill above the picture names the camera Studio found. Studio holds one camera at a time. ``` ```text MCP Studio holds the camera itself, so its server has no tool for this. On your own server: → camera_discover {} ``` ```bash CLI npx darkgrade cameras ``` ```typescript Slate import { Camera } from '@darkgrade/slate' const cameras = await Camera.discover() // [{ vendorId, productId, model, … }] ``` ### What you get back Slate returns a list of [`DiscoveredCamera`](https://darkgrade.com/docs/slate/reference/types-results.md#discoveredcamera), and `camera_discover` the same fields. - **`vendorId`** · `number` The USB vendor id. - **`productId`** · `number` The USB product id. - **`serialNumber`** · `string` · optional The USB serial number, when the device reports one. - **`manufacturer`** · `string` · optional The make, as the device reports it over USB. - **`model`** · `string` · optional The model, as the device reports it over USB. `npx darkgrade cameras --json` prints `{ "cameras": [...] }`. Each entry adds `usbId`, `vendor` and `state` (`ready`, or `other-mode` for a camera in card-reader mode), and leaves out `manufacturer`. Also called *list cameras*, *scan for cameras*, *detect cameras*, *enumerate devices*. Slate reference: [`Camera.discover`](https://darkgrade.com/docs/slate/getting_started/camera.md#cameradiscover) ## Connect Opens the camera so you can control it. Everything else on these pages needs an open camera. ```text Studio Plug the camera in over USB. Studio connects on its own. To connect by hand, click the camera pill above the picture, then Connect. ``` ```text MCP Studio holds the camera itself, so its server has no tool for this. On your own server: → camera_connect {"camera": "main"} ``` ```bash CLI # Every command opens the camera and closes it when done, # so you never need to run this yourself. npx darkgrade camera connect ``` ```typescript Slate import { Camera } from '@darkgrade/slate' const camera = new Camera() await camera.connect() ``` ### Inputs - **`observeOnly`** · true or false · CLI `--[no-]observe-only` Default false. True reads everything but changes no setting on the camera. - **`device`** · `DeviceDescriptor` · Slate only Which camera to open, when several are attached. See [`connect`](https://darkgrade.com/docs/slate/getting_started/camera.md#connect). * If no camera is found, check the camera first: it must be on, connected with a USB cable that carries data, and set for remote control (Sony: PC Remote). See [Set up the camera](https://darkgrade.com/docs/slate/getting_started/camera-compatibility.md#set-up-the-camera). * On a Mac, if connecting fails with an access or busy error, the system has claimed the camera first. Studio handles this for you; for the CLI see [If a ready camera will not open](https://darkgrade.com/docs/cli/install.md#if-a-ready-camera-will-not-open), and for Slate [Prepare your computer](https://darkgrade.com/docs/slate/getting_started/installation.md#prepare-your-computer). * Over Wi-Fi or Ethernet, only Slate opens a camera: see [Wi-Fi with PTP/IP](https://darkgrade.com/docs/slate/getting_started/ptp-ip.md). Also called *open camera*, *start session*, *attach camera*. Slate reference: [`connect`](https://darkgrade.com/docs/slate/getting_started/camera.md#connect) ## Camera info Reads the camera's make, model and firmware version, and how it is connected. ```text Studio The camera pill above the picture names the camera. Click it for its details. Or click the microphone and ask “Which camera is this?” ``` ```text MCP Ask Claude: “Which camera is this?” → camera_get_info {} ``` ```bash CLI npx darkgrade camera get-info ``` ```typescript Slate const info = await camera.getInfo() // { manufacturer, model, firmware, connection, … } ``` ### What you get back Slate returns a [`CameraInfo`](https://darkgrade.com/docs/slate/reference/types-results.md#camerainfo). [MCP](https://darkgrade.com/docs/ai/results.md#what-a-tool-returns) and the [CLI](https://darkgrade.com/docs/cli/output.md#json-results) return the same fields as JSON. - **`manufacturer`** · `string` The make, such as `Sony`. - **`model`** · `string` As the camera names itself, such as `ILCE-7M5`. - **`firmware`** · `string` The firmware version, as the camera reports it. - **`serialNumber`** · `string` · optional The body's serial number, when it reports one. - **`lensMount`** · `string` · optional The lens mount (E, A, Z, F, RF), for model families whose name gives it. - **`connection`** · `"usb"` `"wifi"` `"ip"` `ip` is a network connection over Wi-Fi or Ethernet; `wifi` is a camera maker’s own Wi-Fi link. Also called *device info*, *identify*, *model name*, *firmware version*. Slate reference: [`getInfo`](https://darkgrade.com/docs/slate/getting_started/camera.md#getinfo) ## What the camera can do Reads every setting's current value and the values it accepts, which operations the camera can do right now (with the reason when it can't), and the lens. Read it before you change anything: a camera only accepts the values it lists here. ```text Studio The sidebar shows the settings your camera reports, each with its current value. Open one to see the values it takes right now. A greyed-out setting cannot change in the current mode. Or click the microphone and ask “What are my settings?” ``` ```text MCP Ask Claude: “What can my camera do right now?” → camera_get_capabilities {} ``` ```bash CLI npx darkgrade camera get-capabilities --json ``` ```typescript Slate const capabilities = await camera.getCapabilities() console.log(capabilities.controls.iso?.allowedValues) console.log(capabilities.operations?.takePhoto?.supported) ``` ### What you get back Slate returns a [`CameraCapabilities`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracapabilities). [MCP](https://darkgrade.com/docs/ai/results.md#what-a-tool-returns) and the [CLI](https://darkgrade.com/docs/cli/output.md#json-results) return the same fields as JSON. - **`observedAt`** · `number` When this was read, in milliseconds since 1970. - **`controls`** · object, by setting id Each setting the camera reports now, by id: its value, the values it accepts and whether it can be changed. - **`advertisedOperations`** · `number[]` `null` The raw operation codes the camera lists, for diagnostics; null when it lists none. - **`lens`** · `CameraLens` · optional The lens on the camera; left out when the camera reports nothing about it. - **`operations`** · object, by operation name · optional Each operation, whether it can run right now, and the reason when it cannot. The fields of `lens`: - **`name`** · `string` `null` The lens's name; null when the camera does not report it. - **`focalLengthMillimetres`** · `number` `null` The focal length now, in millimetres; null when the camera does not report it. Each entry of `controls` has the fields listed under [Set any setting](#set-any-setting). Each entry of `operations` is `{ supported, reason?, options? }`: `reason` says why not, in words you can act on, and `options` covers optional parts such as a live-view overlay. Also called *get settings*, *list settings*, *get controls*, *list controls*, *list properties*, *supported operations*, *controls*. Slate reference: [`getCapabilities`](https://darkgrade.com/docs/slate/getting_started/camera.md#getcapabilities) ## Set any setting Changes any setting by its id and answers with what the camera reports afterwards. It is for scripts and code that pick the setting as they run. Every setting also has a section of its own, linked under Setting ids below. ```text Studio Click the microphone and say “Set drive mode to single”. Any setting works by name, including those that are not in the sidebar. ``` ```text MCP Ask Claude: “Set ISO to 800.” → camera_set_control {"id": "iso", "value": "ISO 800"} ``` ```bash CLI npx darkgrade camera set-control iso 'ISO 800' ``` ```typescript Slate const state = await camera.setControl('iso', 'ISO 800') console.log(state.value) // 'ISO 800' ``` ### Inputs - **`id`** · a setting id · required A setting id, such as `iso`: see Setting ids, below. - **`value`** · text or a number · required One of the setting's allowed values: text, or a number for colour temperature and audio level. - **`framesPerSecond`** · a number · CLI `--frames-per-second` Only for shutter speed, and only to convert between a shutter angle and a duration. ### Setting ids | Id | Setting | | - | - | | `exposureMode` | [Exposure mode](https://darkgrade.com/docs/functionality/exposure.md#exposure-mode) | | `shutterSpeed` | [Shutter speed](https://darkgrade.com/docs/functionality/exposure.md#shutter-speed) | | `aperture` | [Aperture](https://darkgrade.com/docs/functionality/exposure.md#aperture) | | `iso` | [ISO](https://darkgrade.com/docs/functionality/exposure.md#iso) | | `exposureCompensation` | [Exposure compensation](https://darkgrade.com/docs/functionality/exposure.md#exposure-compensation) | | `meteringMode` | [Metering](https://darkgrade.com/docs/functionality/exposure.md#metering) | | `focusMode` | [Focus mode](https://darkgrade.com/docs/functionality/focus.md#focus-mode) | | `focusArea` | [Focus area](https://darkgrade.com/docs/functionality/focus.md#focus-area) | | `subjectDetection` | [Subject detection](https://darkgrade.com/docs/functionality/focus.md#subject-detection) | | `detectionSubject` | [Detection subject](https://darkgrade.com/docs/functionality/focus.md#detection-subject) | | `eyeSelection` | [Eye selection](https://darkgrade.com/docs/functionality/focus.md#eye-selection) | | `continuousAutofocus` | [Continuous AF](https://darkgrade.com/docs/functionality/focus.md#continuous-af) | | `digitalZoom` | [Digital zoom](https://darkgrade.com/docs/functionality/zoom.md#digital-zoom) | | `imageStabilization` | [Image stabilisation](https://darkgrade.com/docs/functionality/zoom.md#image-stabilisation) | | `driveMode` | [Drive mode](https://darkgrade.com/docs/functionality/photos.md#drive-mode) | | `shutterType` | [Shutter type](https://darkgrade.com/docs/functionality/photos.md#shutter-type) | | `flashMode` | [Flash](https://darkgrade.com/docs/functionality/photos.md#flash) | | `photoFormat` | [Photo format](https://darkgrade.com/docs/functionality/photos.md#photo-format) | | `photoSize` | [Photo size](https://darkgrade.com/docs/functionality/photos.md#photo-size) | | `aspectRatio` | [Aspect ratio](https://darkgrade.com/docs/functionality/photos.md#aspect-ratio) | | `jpegQuality` | [JPEG quality](https://darkgrade.com/docs/functionality/photos.md#jpeg-quality) | | `rawCompression` | [RAW compression](https://darkgrade.com/docs/functionality/photos.md#raw-compression) | | `liveViewQuality` | [Live-view quality](https://darkgrade.com/docs/functionality/live-view.md#live-view-quality) | | `photoVideoMode` | [Photo / video](https://darkgrade.com/docs/functionality/video.md#photo--video) | | `videoFormat` | [Video format](https://darkgrade.com/docs/functionality/video.md#video-format) | | `videoQuality` | [Video quality](https://darkgrade.com/docs/functionality/video.md#video-quality) | | `frameRate` | [Frame rate](https://darkgrade.com/docs/functionality/video.md#frame-rate) | | `audioRecording` | [Audio recording](https://darkgrade.com/docs/functionality/video.md#audio-recording) | | `audioLevel` | [Audio level](https://darkgrade.com/docs/functionality/video.md#audio-level) | | `whiteBalance` | [White balance](https://darkgrade.com/docs/functionality/color.md#white-balance) | | `colorTemperature` | [Colour temperature](https://darkgrade.com/docs/functionality/color.md#colour-temperature) | | `pictureStyle` | [Look](https://darkgrade.com/docs/functionality/color.md#look) | | `pictureProfile` | [Picture profile](https://darkgrade.com/docs/functionality/color.md#picture-profile) | ### What you get back Slate returns a [`CameraControlState`](https://darkgrade.com/docs/slate/reference/types-capabilities.md#cameracontrolstate). [MCP](https://darkgrade.com/docs/ai/results.md#what-a-tool-returns) and the [CLI](https://darkgrade.com/docs/cli/output.md#json-results) return the same fields as JSON. - **`id`** · `CameraControlId` The setting's id, such as `iso`. - **`label`** · `string` The setting's name for people, such as `ISO`. - **`aliases`** · `readonly string[]` Other words for the setting, for search. - **`source`** · `{ name, code, protocol }` The camera property behind the setting, for diagnostics. - **`value`** · `string` · optional The current value. Left out when the setting does not apply right now, such as colour temperature under a white balance preset. - **`allowedValues`** · `string[]` · optional The values the camera accepts right now. - **`writable`** · `boolean` False when the camera reports the setting as read-only. - **`enabled`** · `boolean` False when the setting does not apply in the current mode. - **`range`** · `{ minimum, maximum, step }` · optional For numeric settings: the minimum, maximum and step. - **`exposureTime`** · `ExposureTime` · optional For shutter speed: the value as a duration or an angle, in numbers. - **`unrecognized`** · `{ value?, choices? }` · optional Values the camera reported that have no name yet. They are never writable. * In Slate, shutter speed also takes an exposure-time object: see [`setControl`](https://darkgrade.com/docs/slate/getting_started/camera.md#setcontrol). Also called *set setting*, *set property*, *set value*. Slate reference: [`setControl`](https://darkgrade.com/docs/slate/getting_started/camera.md#setcontrol) ## Recover a stuck camera Brings back a camera that stopped answering, in software: it tries a fresh connection, then a camera reset, then a USB port reset, and stops at the first that works. Nothing is unplugged or power-cycled. ```text Studio Studio reconnects on its own when the camera stops answering. Meanwhile the camera pill reads Reconnecting… ``` ```text MCP Studio holds the camera itself, so its server has no tool for this. On your own server: → camera_recover {"camera": "main"} ``` ```bash CLI npx darkgrade camera recover ``` ```typescript Slate const report = await camera.recover() // recover closes the connection, so open it again if (report.recovered) await camera.connect() ``` ### Inputs - **`stepTimeoutMilliseconds`** · a number · CLI `--step-timeout-milliseconds` The longest each step may take. Default 8 seconds. - **`waitForDeviceMilliseconds`** · a number · CLI `--wait-for-device-milliseconds` How long to wait for the camera to show up on USB. Default 20 seconds. - **`allowPortReset`** · true or false · CLI `--[no-]allow-port-reset` Default true. Turn it off when other software on this computer must keep its connection to the USB port. ### What you get back Slate returns a [`CameraRecoveryReport`](https://darkgrade.com/docs/slate/reference/types-results.md#camerarecoveryreport). [MCP](https://darkgrade.com/docs/ai/results.md#what-a-tool-returns) and the [CLI](https://darkgrade.com/docs/cli/output.md#json-results) return the same fields as JSON. - **`recovered`** · `boolean` True when the camera answered again after one of the steps. - **`needsPhysicalAction`** · `boolean` True when software could not bring the camera back: unplug it, or turn it off and on. - **`steps`** · `CameraRecoveryStep[]` Each recovery step tried, in order, and whether it worked. - **`durationMilliseconds`** · `number` How long recovery took. - **`identity`** · `{ manufacturer, model, firmware }` · optional The camera that answered, when one did: its make, model and firmware. Each entry of `steps`: - **`step`** · `"enumerate"` `"session"` `"device-reset"` `"port-reset"` `enumerate`: waiting for the camera on USB. `session`: a fresh connection. `device-reset`: a camera reset. `port-reset`: a USB port reset. - **`ok`** · `boolean` Whether the camera answered after this step. - **`durationMilliseconds`** · `number` How long the step took. - **`detail`** · `string` · optional Why the step failed, when it did. * The connection is closed afterwards. Connect again to use the camera. * When `needsPhysicalAction` is true, software could not bring the camera back: unplug it, or turn it off and on. Also called *reset camera*, *unstick*, *reconnect*, *repair connection*. Slate reference: [`recover`](https://darkgrade.com/docs/slate/getting_started/camera.md#recover) ## Disconnect Closes the camera and puts it back the way it was. ```text Studio Click the camera pill above the picture, then Disconnect. Quitting Studio or unplugging the camera closes it too. ``` ```text MCP Studio holds the camera itself, so its server has no tool for this. On your own server: → camera_disconnect {"camera": "main"} ``` ```bash CLI # Every command closes the camera when it is done, # so you never need to run this yourself. npx darkgrade camera disconnect ``` ```typescript Slate await camera.disconnect() ``` Also called *close camera*, *end session*. Slate reference: [`disconnect`](https://darkgrade.com/docs/slate/getting_started/camera.md#disconnect) ## Events The camera says when a setting changes on it, for example when someone turns a dial, and when a new photo or clip lands on the card. An event says that something changed, not what: read the settings or the file list again to find out. ```text Studio Studio updates by itself when a setting changes on the camera, and lists new photos and clips as they land. ``` ```text MCP There is no tool for events. Read the camera again: → camera_get_capabilities {} → camera_list_media {} ``` ```bash CLI # Prints a line per event until Ctrl-C or --duration. npx darkgrade camera watch --json ``` ```typescript Slate const onMedia = () => console.log('a new photo or clip') camera.on('mediaAdded', onMedia) camera.on('settingsChanged', () => console.log('a setting changed')) camera.off('mediaAdded', onMedia) ``` | Event | Means | | - | - | | `settingsChanged` | A setting changed on the camera. | | `mediaAdded` | A new photo or clip is on the card. | Slate reference: [`on`](https://darkgrade.com/docs/slate/getting_started/camera.md#on) · [`off`](https://darkgrade.com/docs/slate/getting_started/camera.md#off) · [Events guide](https://darkgrade.com/docs/slate/guides/events.md) · [`watch` on the CLI](https://darkgrade.com/docs/cli/output.md#watch-for-events)