6. Client Commands

Each section below documents one of the commands available in the Compound Pi command line client. Many commands accept an address or list of addresses. Addresses must be specified in dotted-decimal format (no hostnames). Inclusive ranges of addresses are specified by two dash-separated addresses. Lists of addresses, or ranges of addresses are specified by comma-separating each list item.

The following table demonstrates various examples of this syntax:

Syntax Expands To
192.168.0.1 192.168.0.1
192.168.0.1-192.168.0.5 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 192.168.0.5
192.168.0.1,192.168.0.3 192.168.0.1 192.168.0.3
192.168.0.1,192.168.0.3-192.168.0.5 192.168.0.1 192.168.0.3 192.168.0.4 192.168.0.5
192.168.0.1-192.168.0.3,192.168.0.5 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.5

It is also worth noting that if readline is installed (which it is on almost any modern Unix platform), the command line supports Tab-completion for commands and most parameters, including defined server addresses.

6.1. add

Syntax: add addresses

The add command is used to manually define the set of Pi servers to communicate with. Addresses can be specified individually, as a dash-separated range, or a comma-separated list of ranges and addresses.

See also: find, remove, servers.

cpi> add 192.168.0.1
cpi> add 192.168.0.1-192.168.0.10
cpi> add 192.168.0.1,192.168.0.5-192.168.0.10

6.2. agc

Syntax: agc mode [addresses]

The agc command is used to set the AGC mode of the camera on all or some of the defined servers. The mode can be one of the following:

  • antishake
  • auto
  • backlight
  • beach
  • fireworks
  • fixedfps
  • night
  • nightpreview
  • off
  • snow
  • sports
  • spotlight
  • verylong

If ‘off’ is specified, the current sensor gains of the camera will be fixed at their present values (unfortunately there is no way at the moment to manually specify the gain values).

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status, awb, exposure, metering.

cpi> agc auto
cpi> agc backlight 192.168.0.1
cpi> agc antishake 192.168.0.1-192.168.0.10
cpi> agc off
cpi> agc off 192.168.0.1

6.3. awb

Syntax: awb (mode | red_gain blue_gain) [addresses]

The awb command is used to set the AWB mode of the camera on all or some of the defined servers. The mode can be one of the following:

  • auto
  • cloudy
  • flash
  • fluorescent
  • horizon
  • incandescent
  • shade
  • sunlight
  • tungsten

Alternatively you can specify the red and blue gains of the camera manually as two floating point values. Valid gains for each channel are between 0.0 and 8.0. Typical values are between 1.0 and 2.0 (for most scenes, red gain slightly exceeds blue gain, e.g. 1.6 and 1.2 respectively).

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status, exposure, metering.

cpi> awb auto
cpi> awb 1.5 1.3
cpi> awb fluorescent 192.168.0.1
cpi> awb 1.7 1.0 192.168.0.10
cpi> awb sunlight 192.168.0.1-192.168.0.10

6.4. brightness

Syntax: brightness value [addresses]

The brightness command is used to adjust the brightness level on all or some of the defined servers. Brightness is specified as an integer number between 0 and 100 (default 50).

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: contrast, saturation, ev.

cpi> brightness 50
cpi> brightness 75 192.168.0.1

6.5. capture

Syntax: capture [addresses]

The capture command causes the servers to capture an image. Note that this does not cause the captured images to be sent to the client. See the download command for more information.

If no addresses are specified, a broadcast message to all defined servers will be used in which case the timestamp of the captured images are likely to be extremely close together. If addresses are specified, unicast messages will be sent to each server in turn. While this is still reasonably quick there will be a measurable difference between the timestamps of the last and first captures.

See also: download, clear.

cpi> capture
cpi> capture 192.168.0.1
cpi> capture 192.168.0.50-192.168.0.53

6.6. clear

Syntax: clear [addresses]

The clear command can be used to clear the in-memory image store on the specified Pi servers (or all Pi servers if no address is given). The download command automatically clears the image store after successful transfers so this command is only useful in the case that the operator wants to discard images without first downloading them.

See also: download, capture.

cpi> clear
cpi> clear 192.168.0.1-192.168.0.10

6.7. config

Syntax: config

The config command is used to display the current client configuration. Use the related set command to alter the configuration.

See also: set.

cpi> config

6.8. contrast

Syntax: contrast value [addresses]

The contrast command is used to adjust the contrast level on all or some of the defined servers. Contrast is specified as an integer number between -100 and 100 (default 0).

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: brightness, saturation, ev.

cpi> contrast 0
cpi> contrast -50 192.168.0.1

6.9. denoise

Syntax: denoise value [addresses]

The denoise command is used to set whether the camera’s software denoise algorithm is active when capturing. The follow values can be specified:

  • on
  • off

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status.

cpi> denoise off
cpi> denoise on 192.168.0.3

6.10. download

Syntax: download [addresses]

The download command causes each server to send its captured images to the client. Servers are contacted consecutively to avoid saturating the network bandwidth. Once images are successfully downloaded from a server, they are wiped from the server.

See also: capture, clear.

cpi> download
cpi> download 192.168.0.1

6.11. ev

Syntax: ev value [addresses]

The ev command is used to adjust the exposure compensation (EV) level on all or some of the defined servers. Exposure compensation is specified as an integer number between -24 and 24 where each increment represents 1/6th of a stop. Hence, 12 indicates that camera should overexpose by 2 stops. The default EV is 0.

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: brightness, contrast, saturation.

cpi> ev 0
cpi> ev 6 192.168.0.1

6.12. exit

Syntax: exit|quit

The exit command is used to terminate the application. You can also use the standard UNIX Ctrl+D end of file sequence to quit.

6.13. exposure

Syntax: exposure (auto | speed) [addresses]

The exposure command is used to set the exposure mode of the camera on all or some of the defined servers. The mode can be ‘auto’ or a speed measured in ms. Please note that exposure speed is limited by framerate.

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status, awb, metering.

cpi> exposure auto
cpi> exposure 30 192.168.0.1
cpi> exposure auto 192.168.0.1-192.168.0.10

6.14. find

Syntax: find [count]

The find command is typically the first command used in a client session to locate all Pis on the configured subnet. If a count is specified, the command will display an error if the expected number of Pis is not located.

See also: add, remove, servers, identify.

cpi> find
cpi> find 20

6.15. flip

Syntax: flip value [addresses]

The flip command is used to set the picture orientation on all or some of the defined servers. The following values can be specified:

  • none
  • horizontal
  • vertical
  • both

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status.

cpi> flip none
cpi> flip vertical 192.168.0.1
cpi> flip both 192.168.0.1-192.168.0.10

6.16. framerate

Syntax: framerate rate [addresses]

The framerate command is used to set the capture framerate of the camera on all or some of the defined servers. The rate can be specified as an integer, a floating-point number, or as a fractional value. The framerate of the camera influences the capture mode that the camera uses. See the camera hardware chapter of the picamera documentation for more information.

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status, resolution.

cpi> framerate 30
cpi> framerate 90 192.168.0.1
cpi> framerate 15 192.168.0.1-192.168.0.10

6.17. help

Syntax: help [command]

The ‘help’ command is used to display the help text for a command or, if no command is specified, it presents a list of all available commands along with a brief description of each.

6.18. identify

Syntax: identify [addresses]

The identify command can be used to locate a specific Pi server (or servers) by their address. It sends a command causing the camera’s LED to blink on and off for 5 seconds. If no addresses are specified, the command will be sent to all defined servers (this can be useful after the find command to determine whether any Pi’s failed to respond due to network issues).

See also: find.

cpi> identify
cpi> identify 192.168.0.1
cpi> identify 192.168.0.3-192.168.0.5

6.19. iso

Syntax: iso value [addresses]

The iso command is used to set the emulated ISO value of the camera on all or some of the defined servers. The value can be specified as an integer number between 0 and 1600, or auto which leaves the camera to determine the optimal ISO value.

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status, exposure.

cpi> iso auto
cpi> iso 100 192.168.0.1
cpi> iso 800 192.168.0.1-192.168.0.10

6.20. metering

Syntax: metering mode [addresses]

The metering command is used to set the metering mode of the camera on all or some of the defined servers. The mode can be one of the following:

  • average
  • backlit
  • matrix
  • spot

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status, awb, exposure.

cpi> metering average
cpi> metering spot 192.168.0.1
cpi> metering backlit 192.168.0.1-192.168.0.10

6.21. quit

Syntax: exit|quit

The exit command is used to terminate the application. You can also use the standard UNIX Ctrl+D end of file sequence to quit.

6.22. remove

Syntax: remove addresses

The remove command is used to remove addresses from the set of Pi servers to communicate with. Addresses can be specified individually, as a dash-separated range, or a comma-separated list of ranges and addresses.

See also: add, find, servers.

cpi> remove 192.168.0.1
cpi> remove 192.168.0.1-192.168.0.10
cpi> remove 192.168.0.1,192.168.0.5-192.168.0.10

6.23. resolution

Syntax: resolution width x height [addresses]

The resolution command is used to set the capture resolution of the camera on all or some of the defined servers. The resolution of the camera influences the capture mode that the camera uses. See the camera hardware chapter of the picamera documentation for more information.

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: status, framerate.

cpi> resolution 640x480
cpi> resolution 1280x720 192.168.0.54
cpi> resolution 1280x720 192.168.0.1,192.168.0.3

6.24. saturation

Syntax: saturation value [addresses]

The saturation command is used to adjust the saturation level on all or some of the defined servers. Saturation is specified as an integer number between -100 and 100 (default 0).

If no address is specified then all currently defined servers will be targetted. Multiple addresses can be specified with dash-separated ranges, comma-separated lists, or any combination of the two.

See also: brightness, contrast, ev.

cpi> saturation 0
cpi> saturation -50 192.168.0.1

6.25. servers

Syntax: servers

The servers command is used to list the set of servers that the client expects to communicate with. The content of the list can be manipulated with the find, add, and remove commands.

See also: find, add, remove.

cpi> servers

6.26. set

Syntax: set name value

The set command is used to alter the value of a client configuration variable. Use the related config command to view the current configuration.

See also: config.

cpi> set timeout 10
cpi> set output ~/Pictures/
cpi> set capture_count 5

6.27. status

Syntax: status [addresses]

The status command is used to retrieve configuration information from servers. If no addresses are specified, then all defined servers will be queried.

See also: resolution, framerate.

cpi> status