Configuration
Configure your unit to make it work for you!
Most aspects of POCS are controlled via a configuration file that is stored in $HOME/conf_files/pocs.yaml
. Most of this file will work for your system by default, but there are a few changes that need to be made manually first.
Configuration
Initial setup command
Most of the basic configuration items can be changed with the pocs config setup
command. You will be prompted to continue before proceeding so you don't accidentaly change any items. The current item in the config will apepar as the default (e.g. [/home/panoptes/pocs]
and you can hit Enter to accept the default).
Getting and setting config entries
You can use pocs config get <key>
and pocs config get <key> <value>
to get and set items in the configuration.
The <key>
corresponds to the entries in the YAML configuration file (see below for manually editing and viewing the file).
One note is that YAML can be "nested", so a value for a given key could be another key. For instance, if you look at the location
config item you will see something like:
Here the latitude
, longitude
, elevation
, and other items are all nested underneath the main location
keyword. To access these individual keys you use a "dot-notation" for each nested level. This is especially useful when you want to set
a new entry For instance:
In the above example the location.latitude
has some units and so it returns what is called a Quantity
(from astropy
- don't worry about it).
To set a new value with a quantity you can use the abbreviated unit name, e.g. deg
for degree or m
for meter.
Note that we recommend using the pocs config setup
command for the basic details as it will do some intelligent checking of the values.
The nested entries can be as deep as needed. For instance, the mount appears as follows:
Manual editing
All configuration changes are made to the $HOME/conf_files/pocs_local.yaml
file, which can be edited in a number of ways.
Via Jupyter
You can open the configuration file in the Jupyter environment simply by clicking on it in the file browser. After making the changes make sure to restart the config server with pocs config restart
.
Via shell
The configuration file can be editing via a text editor. If you are using the command line (the default), a good option is nano
. At the command line prompt, type:
You can type Ctrl-X
to save and exit nano
You should see a file with a lot of keywords and values, each separated by a colon (:
).
After making any changes be sure to restart the config server with pocs config restart
, and check with pocs config get
that the changes have been applied.
Troubleshooting: what if the changes are not applied ?
Check $HOME/logs/config-server.log for warning or error message:
tail $HOME/logs/config-server.log
If you see warning that another instance was already running, find its PID, kill it and try again. Use
sudo lsof -i -P -n | grep 6563
to check if any process is using port number 6563 that pocs config server is usingIf a process is using port 6563, kill it with the
kill
commandThen run
pocs config restart
and check again that the changes have been applied
Last updated