5. Command Line Reference¶
The picroscopy application launches a live view of the Raspberry Pi’s camera and serves a web application providing control of the camera. Various options can be used to configure which network clients can access the web application, and the paths which the camera will use when writing images.
picroscopy [-h] [--version] [-c CONFIG] [-q] [-v] [-l FILE] [-P] [-d] [-L HOST[:PORT]] [-C NETWORK[/LEN]] [--images-dir DIR] [--thumbs-dir DIR] [--thumbs-size WIDTHxHEIGHT] [--email-from USER[@HOST]] [--sendmail EXEC | --smtp-server HOST[:PORT]]
Show the application’s help page, giving a brief description of each command line option, and exit.
Show the program’s version number and exit.
Specify the configuration file that the application should load. See the Configuration section for more information on the configuration file format.
Produce less console output. When this is specified, only error messages will be visible at the console. By default, warnings and error messages are displayed.
Produce more console output. When this is specified, information, warning, and error messages will be visible at the console. By default, warnings and error messages are displayed.
Log displayed messages to the specified FILE. The log file will be appended to if it already exists. Its format will include the timestamp that the message was displayed, and the severity of the message.
Run under PuDB (if available) or PDB. This launches Picroscopy within a Python debugger for development purposes.
The address and port of the interface that Picroscopy will listen on. Defaults to
0.0.0.0:80(when running as root) or
0.0.0.0:8000(when running as a non-root user). The
0.0.0.0address means “listen on all available network interfaces”.
The network that clients must belong to. Clients that do not belong to the specified network will be denied access to Picroscopy. Defaults to
0.0.0.0/0(all valid addresses).
The directory in which Picroscopy will store images captured by the camera. If not specified, defaults to a temporary directory which is destroyed upon exit. If the specified directory does not exist, it will be created.
The directory in which Picroscopy will store thumbnails generated from the images taken by the camera. If not specified, defaults to a temporary directory which is destroyed upon exit. If the specified directory does not exist, it will be created. The thumbnails directory must be different to the images directory.
The maximum size for generated thumbnails (the actual size may be smaller due to aspect ratio preservation). Defaults to 320x320.
The address which Picroscopy will use as a From: address when sending e-mail. If HOST is not specified, the configuration of the sending SMTP server will determine the host associated with the USER.
Use the specified sendmail binary to send e-mail. This is the preferred option for sending e-mail as it (usually) gracefully handles the case where the target SMTP server is unavailable. Defaults to
Use the specified SMTP smarthost to send e-mail. This should only be used if you do not wish to configure a local sendmail binary. If this option is specified, it will always override any
Run Picroscopy, with the default configuration and verbose logging:
$ picroscopy -v
Run Picroscopy, listening for clients on port 8080 of the interface with the
192.168.0.5, and only accepting requests from the machine with
$ picroscopy -L 192.168.0.5:8080 -C 192.168.0.6
Run Picroscopy, only accepting requests from the
$ picroscopy -C 192.168.0.0/16
Run Picroscopy, ensuring that e-mail is sent via the SMTP server running on
localhost, and that e-mail appears to come from
$ picroscopy --smtp-server localhost --email-from email@example.com
Run Picroscopy, explicitly specifying the images directory and the thumbnails directory (which ensures both persist across runs; the default is to use ephemeral temporary directories):
$ mkdir -p picroscopy/images picroscopy/thumbs $ picroscopy --images-dir picroscopy/images --thumbs-dir picroscopy/thumbs