-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
68 lines (47 loc) · 1.47 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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.