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. awb

Syntax: awb mode [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

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 fluorescent 192.168.0.1
cpi> awb sunlight 192.168.0.1-192.168.0.10

6.3. 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.4. 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.5. 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.6. 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.7. 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.8. exposure

Syntax: exposure mode [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 one of the following:

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

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 night 192.168.0.1
cpi> exposure backlight 192.168.0.1-192.168.0.10

6.9. 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.10. 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.11. 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.12. 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.13. 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.14. 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.15. levels

Syntax: levels brightness contrast saturation [addresses]

The levels command is used to simultaneously set the brightness, contrast, and saturation levels on all or some of the defined servers. Each level is specified as an integer number between 0 and 100. The default for each level is 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: status.

cpi> levels 50 50 50
cpi> levels 70 50 50 192.168.0.1
cpi> levels 40 60 70 192.168.0.1-192.168.0.10

6.16. 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.17. 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.18. 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.19. 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.20. 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.21. 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.22. shutter

Syntax: shutter speed [addresses]

The shutter command is used to set the shutter speed of the camera on all or some of the defined servers. The speed can be specified as a floating-point number (in milli-seconds), or auto which leaves the camera to determine the shutter speed. The framerate of the camera limits the shutter speed that can be set. For example, if framerate is 30fps, then shutter speed cannot be slower than 33.333ms.

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, framerate.

cpi> shutter auto
cpi> shutter 33.333 192.168.0.1
cpi> shutter 100 192.168.0.1-192.168.0.10

6.23. 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