# Config Server

## Overview

The `pocs config` command offers some basic ways to interact with the mount, mostly to be used while testing or as a backup if something goes wrong.

## Commands

### `get`

Get a value from the configration. The values are separate by dot syntax, as explained in [#getting-and-setting-config-entries](https://www.projectpanoptes.org/build/configuration#getting-and-setting-config-entries "mention").

```
(conda-pocs)  panoptes@panoptes  pocs config get mount

{'brand': 'ioptron',
 'commands_file': 'ioptron/v310',
 'driver': 'panoptes.pocs.mount.ioptron.cem40',
 'model': 'cem40',
 'serial': {'baudrate': 115200, 'port': '/dev/ttyUSB0', 'timeout': 0.0},
 'settings': {'max_tracking_threshold': 99999,
              'min_tracking_threshold': 100,
              'non_sidereal_available': True,
              'park': {'dec_direction': 'north',
                       'dec_seconds': 15,
                       'ra_direction': 'west',
                       'ra_seconds': 15},
              'update_tracking': False}}


(conda-pocs)  panoptes@panoptes  pocs config get mount.serial.port

'/dev/ttyUSB0'
```

### `set`

Used for setting values. If successfully set, the key and value are returned.

```
(conda-pocs)  panoptes@panoptes  pocs config set mount.serial.port "/dev/ttyUSB0"

{'mount.serial.port': '/dev/ttyUSB0'}
```

### `setup`

Runs the setup wizard.

```
(conda-pocs)  panoptes@panoptes  pocs config setup

Setting up configuration for your PANOPTES unit.
This will overwrite any existing configuration. Proceed? [y/N]: y
Enter the base directory for POCS [/home/panoptes/pocs]: 
Enter the user-friendly name for this unit [Generic PANOPTES Unit]: Alcyone
Enter the PANOPTES ID for this unit. If you don't have one yet just use the default. [PAN000]: PAN021
Enter the latitude for this unit, e.g. "19.5 deg" [19.54 deg]: 
Enter the longitude for this unit, e.g. "-154.12 deg" [-155.58 deg]: 
Enter the elevation for this unit. Use " ft" or " m" for units, e.g. "3400 m" or "12000 ft" [3400.0 m]: 
Enter the timezone for this unit [Pacific/Honolulu]: 
Enter the GMT offset for this unit [-600]: 
```

### `restart`

Restart the config (`supervisorctrl`) service. Use if values in config file have changed or if getting errors with the other commands.

```
(conda-pocs)  panoptes@panoptes  pocs config restart
```

## Configuration

The config server is the config. :smirk: See [configuration](https://www.projectpanoptes.org/build/software/configuration "mention") for details on setting up the configuration the first time.
