Browse Source

[doc] updated README with installation instructions

Maxime Alves LIRMM@home 4 years ago
parent
commit
27c329e4f5
1 changed files with 59 additions and 0 deletions
  1. 59
    0
      README.md

+ 59
- 0
README.md View File

@@ -10,3 +10,62 @@ starlette
10 10
 uvicorn
11 11
 pytest
12 12
 requests
13
+
14
+# Install
15
+
16
+Initialize a database in the home directory of your system user.
17
+
18
+`sqlite3 -init ./db/pyheatpump.sql /var/run/pyheatpump/pyheatpump.sqlite3`
19
+
20
+Create a configuration file in `/etc/pyheatpump.ini` .
21
+
22
+```
23
+[heatpump]
24
+mac_address = 00:00:00:00:00:00
25
+database = /var/run/pyheatpump/pyheatpump.sqlite3
26
+
27
+[supervisor]
28
+scheme = https
29
+host = supervision-test.gteo.fr:8081
30
+get_path = /Symfony/web/app_dev.php/boardws/insert
31
+post_path = /Symfony/web/app_dev.php/boardws/orders
32
+interval = 10000
33
+heatpump_id = 42
34
+
35
+[api]
36
+host = 0.0.0.0
37
+port = 80
38
+```
39
+
40
+Fetch manually to initialize the data.
41
+
42
+```
43
+pyheatpump fetch
44
+```
45
+
46
+Insert the init files into the right locations.
47
+
48
+```
49
+cp -t /etc/init.d conf/pyheatpump
50
+chmod +x /etc/init.d/pyheatpump
51
+rc-update add default pyheatpump
52
+rc-service pyheatpump start
53
+```
54
+
55
+```
56
+cp ./conf/pyheatpump.systemd.socket /etc/systemd/system/pyheatpump.socket
57
+cp ./conf/pyheatpump.systemd.service /etc/systemd/system/pyheatpump.service
58
+systemctl daemon-reload
59
+systemctl enable pyheatpump
60
+systemctl start pyheatpump
61
+```
62
+
63
+Enable the *cron task / systemd timer* for the automatic fetch and supervise tasks.
64
+
65
+```
66
+cat conf/pyheatpump.cron >> /etc/crontab
67
+```
68
+
69
+```
70
+cp ./conf/pyheatpump.systemd.timer /etc/systemd/system/pyheatpump.timer
71
+```

Loading…
Cancel
Save