Lightmeter ========== This is a set of scripts to read out an SQM lightmeter, store it in a Postgres database table, and send it to the verlustdernacht.aip.de webservice. Setup on CentOS7 ---------------- Install Postgres: ``` yum install postgresql postgresql-devel postgresql-server postgresql-contrib postgresql-setup initdb createuser ``` as postgres user: ``` createuser lightmeter # or a different user createdb lightmeter -O lightmeter ``` Install more prerequisites: ``` yum install pytz python-requests python-psycopg2 ``` Create `settings.py` file including: ``` SQM_IP = '' # IP address of the lightmeter SQM_PORT = 10001 # TCP port of the lightmeter INTERVALL = 2 # read-out intevall in seconds DB_CONNECTION = 'dbname=lightmeter' # connection to the local database DB_TABLE = 'sqm_babelsberg' # local database table API_URL= '' # url of the webservice (ending on /api/measurements/) API_USER = '' # authentication username API_PASS = '' # authentication password API_LOCATION = '' # location slug of this lightmeter in the web service ``` Create the database table: ``` ./create_sqm_table.py ``` Edit and copy systemd config: ``` cp lightmeter.service /usr/lib/systemd/system/lightmeter.service ``` Enable and start service: ``` systemctl enable lightmeter.service systemctl start lightmeter.service ``` The database table should now filled with measurements.