Chapter 6. Configuration

Table of Contents
nightviewd
http server
Testing of installation

nightviewd

The main nightview server is the nightviewd. I recommends start this server at a boot time from any rc.d file. Many systems have directory /etc/init.d/ or /etc/rc.d/ where the start scripts appears. The debian users can use the prepackaged start script. If you can start nightviewd at boot time, edit some start script (/etc/init.d/local for example) and put this line to the file:


/usr/sbin/nightviewd

Command line parameters for nightviewd:


 -device 0x378 (default) | 0x3bc |  0x278
         lp0             | lp1   | lp2    ... IO address of the parallel port
 -filter1 x  -filter2 x ... filter5 x
         define filter specification up to 5 filters
 -site Site Name
 -longitude Longitude of the site
 -latitude  Latitude of the site
 -altitude  Altitude of the site
 -telescope Telescope designation

All above parameters are specified in the /etc/nightview.conf file. It's generated by nightview-conf script. This file is read first time. The command line parameters replaces the config file values.

Note. The nightviewd is not a well-matured daemon for now. It can crash every time. I highly recommends (if you have a users without root access) use some from utilities to daemon monitoring and restart it during observation. The daemon create file (socket) /tmp/.night_shock.

The nightview package contains a script nightview-conf to create the configuration file for the nightview server. The debian installation packages will be created automatically, but you can run it by the hand. The generated file has defaults used by the daemon when no configure and no command options appears. The created file /etc/nightviewd.conf follows:


# Config file for Nightview daemon, server part. 
# 
#

# ---------------------------------------------------------------------------
# HW address port specification
#
# Select one from this:
#
#   port      device      address
#    1        /dev/lp0    0x378      (default)
#    2        /dev/lp1    0x3bc
#    3        /dev/lp2    0x278

Device HW address = 0x378

#
#----------------------------------------------------------------------------

#---------------------------------------------------------------------------
# Debug options
#
# Select level:
#
#   level      means
#    0         no debug informations, only status codes
#    1         print errors to standard error
#    2 - 5     from 2 to 5 increase print of debug informations
#
#    Use 0 for normal operation, increase when you have a problem.

Device HW debug level = 0

#
#---------------------------------------------------------------------------
# Site options
#
# Specify your site coordinates. This values will be used without any 
# changes in header of the created FITS file. 
#

# Name of site 
Site = "Monte Boo"

# longitude (+east, -west) in degrees
Longitude = 16.58395

# latitude (+north, -south) in degrees
Latitude = 49.204128

# altitude (+over sea, -under sea) in meters
Altitude = 304.0

# telescope
Telescope = "0.62 m, 1:1.44 refl."

#
#--------------------------------------------------------------------------
# Filters definition
#
#  Specify string(s) for your filter(s)
#

# position in carousel = filter
Filter 1 = "B"
Filter 2 = "V"
Filter 3 = "R"
Filter 4 = "I"
Filter 5 = "clear"

#
#--------------------------------------------------------------------------
#

There is a possibility to change address of the connected parallel port. The switch Device HW address = 0x378 for a first port (default) or Device HW address = 0x3bc for a second port in the /etc/nightview.conf file. This file provide the run-time debug level configuration also. Run nightview-conf script to create it. See these file for more description.

Generally, If you have the camera connected to the first parallel port, the HW address will be correct, eg. no changes are need for first tests. The new computers have two parallel ports on board, but extremely rarely are both connected to hardware connectors on a case.

The other parameters are used for fine tuning. The debug option is for hackers only (see description of debug option in sbig library). The site parameters identify your observation station. The values are no directly used by the nightview package. They're copied to the FITS header without any change.

The filter options defines your filters. The values are any strings enclosed to the apostrophes ("). The night_filter -list command will be print this definition in clients programs.

The running kernel needs to contain the parallel port support. Modules are preferred. Set these variables:


CONFIG_PARPORT=m
CONFIG_PARPORT_PC=m
CONFIG_PARPORT_PC_CML1=m

(this function didn't fully tested)

The server has changed logging facility from the 0.3.0 version. The syslog is used now. Any critical events (server launch, client connect, errors) will be included in syslog file. All others list from daemon are debug messages to stderr. They are enables the define the DEBUG macro in ccd.h. This logging will be disabled per default in future (in stable version).

Tip. If you have a server's computer on the net I recommends use ntpdate and ntpd to synchronise time with some time server. Include to your /etc/crontab this line:


58 * * * * root ntpdate -u 999.999.999.999 >& /dev/null &&  hwclock --systohc

The ntpdate will be synchronise your computer once per hour with the specified time server. The list of time servers can be found at page Public NTP Time Servers.

Nightview server can save information about telescope's position to header of FITS file. It uses telescope utility to this (see mount server description). The nightview server lunch the command telescope get -ra -dec" to get the position and suppose as the output two real numbers. If the command is not found, output is not in fashion of two numbers or another error is appeared than the positional information is not included in the FITS header. This means that you can supply some 'telescope' utility to get info as you need. If nightviewd server run on another machine than telescoped server (and telescope utility require -host option) than use MOUNT_HOST environment variable to specify the address of the host running telescoped server.