# Cameras

Camera is a basic building block of Robopipe. It represent a single Luxonis device that can be manipulated through our API. Each camera corresponds to a real camera device and is independent of other devices. Camera can be connected via USB or Ethernet interface, the API doesn't make any distinctions regarding this matter. Camera is always addressed by its unique [MXID](https://docs.luxonis.com/software/depthai/examples/device_information/).

{% hint style="warning" %}
If you're using PoE devices, make sure that they are connected to a network with running DHCP server. While this step can be ommited, the autodiscovery might be unreliable. If you run into any troubles connecting to PoE cameras, visit our [troubleshooting guide](/doc/other/troubleshooting.md), or refer to  [Luxonis PoE docs](https://docs.luxonis.com/hardware/platform/deploy/poe-deployment-guide/#PoE%20deployment%20guide-Initial%20Connection-Debugging).
{% endhint %}

## API Reference

## GET /cameras/

> List Cameras

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/":{"get":{"tags":["cameras"],"summary":"List Cameras","operationId":"list_cameras_cameras__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DeviceInfo"},"type":"array","title":"Response List Cameras Cameras  Get"}}}}}}}},"components":{"schemas":{"DeviceInfo":{"properties":{"mxid":{"type":"string","title":"Mxid"},"name":{"type":"string","title":"Name"},"camera_name":{"type":"string","title":"Camera Name"},"platform":{"$ref":"#/components/schemas/DevicePlatform"},"protocol":{"$ref":"#/components/schemas/DeviceProtocol"},"state":{"$ref":"#/components/schemas/DeviceState"},"status":{"type":"string","title":"Status"}},"type":"object","required":["mxid","name","camera_name","platform","protocol","state","status"],"title":"DeviceInfo"},"DevicePlatform":{"type":"string","enum":["X_LINK_ANY_PLATFORM","X_LINK_MYRIAD_X","X_LINK_MYRIAD_2"],"title":"DevicePlatform"},"DeviceProtocol":{"type":"string","enum":["X_LINK_ANY_PROTOCOL","X_LINK_IPC","X_LINK_PCIE","X_LINK_TCP_IP","X_LINK_USB_CDC","X_LINK_USB_VSC"],"title":"DeviceProtocol"},"DeviceState":{"type":"string","enum":["X_LINK_ANY_STATE","X_LINK_BOOTED","X_LINK_BOOTLOADER","X_LINK_FLASH_BOOTED","X_LINK_UNBOOTED"],"title":"DeviceState"}}}}
```

## GET /cameras/{mxid}/

> Get Camera

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/":{"get":{"tags":["cameras","cameras"],"summary":"Get Camera","operationId":"get_camera_cameras__mxid___get","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceInfo"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DeviceInfo":{"properties":{"mxid":{"type":"string","title":"Mxid"},"name":{"type":"string","title":"Name"},"camera_name":{"type":"string","title":"Camera Name"},"platform":{"$ref":"#/components/schemas/DevicePlatform"},"protocol":{"$ref":"#/components/schemas/DeviceProtocol"},"state":{"$ref":"#/components/schemas/DeviceState"},"status":{"type":"string","title":"Status"}},"type":"object","required":["mxid","name","camera_name","platform","protocol","state","status"],"title":"DeviceInfo"},"DevicePlatform":{"type":"string","enum":["X_LINK_ANY_PLATFORM","X_LINK_MYRIAD_X","X_LINK_MYRIAD_2"],"title":"DevicePlatform"},"DeviceProtocol":{"type":"string","enum":["X_LINK_ANY_PROTOCOL","X_LINK_IPC","X_LINK_PCIE","X_LINK_TCP_IP","X_LINK_USB_CDC","X_LINK_USB_VSC"],"title":"DeviceProtocol"},"DeviceState":{"type":"string","enum":["X_LINK_ANY_STATE","X_LINK_BOOTED","X_LINK_BOOTLOADER","X_LINK_FLASH_BOOTED","X_LINK_UNBOOTED"],"title":"DeviceState"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## POST /cameras/{mxid}/

> Create Camera

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/":{"post":{"tags":["cameras","cameras"],"summary":"Create Camera","operationId":"create_camera_cameras__mxid___post","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceInfo"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DeviceInfo":{"properties":{"mxid":{"type":"string","title":"Mxid"},"name":{"type":"string","title":"Name"},"camera_name":{"type":"string","title":"Camera Name"},"platform":{"$ref":"#/components/schemas/DevicePlatform"},"protocol":{"$ref":"#/components/schemas/DeviceProtocol"},"state":{"$ref":"#/components/schemas/DeviceState"},"status":{"type":"string","title":"Status"}},"type":"object","required":["mxid","name","camera_name","platform","protocol","state","status"],"title":"DeviceInfo"},"DevicePlatform":{"type":"string","enum":["X_LINK_ANY_PLATFORM","X_LINK_MYRIAD_X","X_LINK_MYRIAD_2"],"title":"DevicePlatform"},"DeviceProtocol":{"type":"string","enum":["X_LINK_ANY_PROTOCOL","X_LINK_IPC","X_LINK_PCIE","X_LINK_TCP_IP","X_LINK_USB_CDC","X_LINK_USB_VSC"],"title":"DeviceProtocol"},"DeviceState":{"type":"string","enum":["X_LINK_ANY_STATE","X_LINK_BOOTED","X_LINK_BOOTLOADER","X_LINK_FLASH_BOOTED","X_LINK_UNBOOTED"],"title":"DeviceState"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## DELETE /cameras/{mxid}/

> Delete Camera

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/":{"delete":{"tags":["cameras","cameras"],"summary":"Delete Camera","operationId":"delete_camera_cameras__mxid___delete","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceInfo"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DeviceInfo":{"properties":{"mxid":{"type":"string","title":"Mxid"},"name":{"type":"string","title":"Name"},"camera_name":{"type":"string","title":"Camera Name"},"platform":{"$ref":"#/components/schemas/DevicePlatform"},"protocol":{"$ref":"#/components/schemas/DeviceProtocol"},"state":{"$ref":"#/components/schemas/DeviceState"},"status":{"type":"string","title":"Status"}},"type":"object","required":["mxid","name","camera_name","platform","protocol","state","status"],"title":"DeviceInfo"},"DevicePlatform":{"type":"string","enum":["X_LINK_ANY_PLATFORM","X_LINK_MYRIAD_X","X_LINK_MYRIAD_2"],"title":"DevicePlatform"},"DeviceProtocol":{"type":"string","enum":["X_LINK_ANY_PROTOCOL","X_LINK_IPC","X_LINK_PCIE","X_LINK_TCP_IP","X_LINK_USB_CDC","X_LINK_USB_VSC"],"title":"DeviceProtocol"},"DeviceState":{"type":"string","enum":["X_LINK_ANY_STATE","X_LINK_BOOTED","X_LINK_BOOTLOADER","X_LINK_FLASH_BOOTED","X_LINK_UNBOOTED"],"title":"DeviceState"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## GET /cameras/{mxid}/stats

> Get Camera Stats

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/stats":{"get":{"tags":["cameras","cameras"],"summary":"Get Camera Stats","operationId":"get_camera_stats_cameras__mxid__stats_get","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CameraStats"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CameraStats":{"properties":{"chip_temperature":{"$ref":"#/components/schemas/ChipTemperature"},"cmx_memory_usage":{"$ref":"#/components/schemas/MemoryInfo"},"ddr_memory_usage":{"$ref":"#/components/schemas/MemoryInfo"}},"type":"object","required":["chip_temperature","cmx_memory_usage","ddr_memory_usage"],"title":"CameraStats"},"ChipTemperature":{"properties":{"average":{"type":"number","title":"Average"},"css":{"type":"number","title":"Css"},"dss":{"type":"number","title":"Dss"},"mss":{"type":"number","title":"Mss"},"upa":{"type":"number","title":"Upa"}},"type":"object","required":["average","css","dss","mss","upa"],"title":"ChipTemperature"},"MemoryInfo":{"properties":{"total":{"type":"integer","title":"Total"},"used":{"type":"integer","title":"Used"},"remaining":{"type":"integer","title":"Remaining"}},"type":"object","required":["total","used","remaining"],"title":"MemoryInfo"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## GET /cameras/{mxid}/ir

> Get Infrared Config

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/ir":{"get":{"tags":["cameras","cameras"],"summary":"Get Infrared Config","operationId":"get_infrared_config_cameras__mxid__ir_get","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IRConfig"},{"type":"null"}],"title":"Response Get Infrared Config Cameras  Mxid  Ir Get"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"IRConfig":{"properties":{"flood_light":{"type":"number","maximum":1,"minimum":0,"title":"Flood Light","description":"IR LED intensity. Value must be between 0.0 and 1.0","default":0},"dot_projector":{"type":"number","maximum":1,"minimum":0,"title":"Dot Projector","description":"Dot projector intensity. Value must be between 0.0 and 1.0","default":0}},"type":"object","title":"IRConfig"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## POST /cameras/{mxid}/ir

> Set Infrared Config

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/ir":{"post":{"tags":["cameras","cameras"],"summary":"Set Infrared Config","operationId":"set_infrared_config_cameras__mxid__ir_post","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IRConfig"},{"type":"null"}],"title":"Response Set Infrared Config Cameras  Mxid  Ir Post"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"IRConfig":{"properties":{"flood_light":{"type":"number","maximum":1,"minimum":0,"title":"Flood Light","description":"IR LED intensity. Value must be between 0.0 and 1.0","default":0},"dot_projector":{"type":"number","maximum":1,"minimum":0,"title":"Dot Projector","description":"Dot projector intensity. Value must be between 0.0 and 1.0","default":0}},"type":"object","title":"IRConfig"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## IR Perception

The PRO line-up of Luxonis devices has notch IR filters at 940nm on the stereo camera pair, which allows both visible light and IR light from illumination LED/laser dot projector to be perceived by the camera.

{% hint style="warning" %}
This product is classified as a **Class 1 Laser Product** under the **EN/IEC 60825-1, Edition 3 (2014)** internationally. You should take safety precautions when working with this product.
{% endhint %}

{% hint style="info" %}
RGB cameras do not perceive IR light, only monochromatic sensors have IR perception.
{% endhint %}

### Dot Projector

A laser dot projector emits numerous tiny dots in front of the device, aiding in disparity matching, particularly on surfaces with low visual features or texture, such as walls or floors. This method, known as ASV (Active Stereo Vision), functions similarly to passive stereo vision but incorporates active depth enhancement.

### Flood IR (Led)

LED lighting enables visibility in environments with minimal or no light. It allows you to execute AI or computer vision (CV) tasks on frames illuminated by the infrared (IR) LED.

## GET /cameras/{mxid}/ir

> Get Infrared Config

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/ir":{"get":{"tags":["cameras","cameras"],"summary":"Get Infrared Config","operationId":"get_infrared_config_cameras__mxid__ir_get","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IRConfig"},{"type":"null"}],"title":"Response Get Infrared Config Cameras  Mxid  Ir Get"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"IRConfig":{"properties":{"flood_light":{"type":"number","maximum":1,"minimum":0,"title":"Flood Light","description":"IR LED intensity. Value must be between 0.0 and 1.0","default":0},"dot_projector":{"type":"number","maximum":1,"minimum":0,"title":"Dot Projector","description":"Dot projector intensity. Value must be between 0.0 and 1.0","default":0}},"type":"object","title":"IRConfig"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## POST /cameras/{mxid}/ir

> Set Infrared Config

```json
{"openapi":"3.1.0","info":{"title":"Robopipe API","version":"0.2.1.dev12"},"servers":[{"url":"http://localhost:8080","description":"Locally running server"}],"paths":{"/cameras/{mxid}/ir":{"post":{"tags":["cameras","cameras"],"summary":"Set Infrared Config","operationId":"set_infrared_config_cameras__mxid__ir_post","parameters":[{"name":"mxid","in":"path","required":true,"schema":{"type":"string","pattern":"[A-Z0-9]+","title":"Mxid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IRConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/IRConfig"},{"type":"null"}],"title":"Response Set Infrared Config Cameras  Mxid  Ir Post"}}}},"404":{"description":"Camera not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"IRConfig":{"properties":{"flood_light":{"type":"number","maximum":1,"minimum":0,"title":"Flood Light","description":"IR LED intensity. Value must be between 0.0 and 1.0","default":0},"dot_projector":{"type":"number","maximum":1,"minimum":0,"title":"Dot Projector","description":"Dot projector intensity. Value must be between 0.0 and 1.0","default":0}},"type":"object","title":"IRConfig"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://robopipe.gitbook.io/doc/api/rest-api-reference/cameras.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
