Skip to content

Commit 82c94b1

Browse files
authored
Add tutorial for quickstart
Working on #3
1 parent 3af1918 commit 82c94b1

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,43 @@ When sending to the RESTful API is not possible (e.g. in case of no network conn
2323

2424
For accessing DHT22 sensors we are using [Adafruit_Python_DHT](https://github.com/adafruit/Adafruit_Python_DHT).
2525

26-
### RESTful API (nodejs)
26+
### RESTful API
2727

28-
@todo
29-
30-
Built with [expressjs](https://github.com/expressjs/express)
28+
Built with [nodejs](https://github.com/nodejs/node) and [expressjs](https://github.com/expressjs/express)
3129

3230
### Frontend (HTML + javascript)
3331

34-
@todo
35-
3632
Built with [jquery](https://github.com/jquery/jquery/) and [plotly.js](https://github.com/plotly/plotly.js/)
3733

3834

3935

4036
## Get it running
4137

38+
### On the server (where the RESTful API and frontend should be running)
39+
4240
1. checkout this repository
4341
`git clone https://github.com/myxor/sensorlog.git`
44-
2. copy folder *api* to the machine the RESTful API should be running on
45-
3. @todo configure API (rename example config first)
46-
4. @todo install nodejs, ...
47-
5. @todo run API
48-
5. copy folder *logger* to the machine(s) where the 1wire temperature sensors are connected to (for example your Raspberry Pi(s))
49-
6. @todo configure logger (rename example config first)
50-
7. @todo install python3 + modules...
51-
9. @todo
52-
53-
54-
## API as systemd service
42+
2. configure api (in the `api` folder):
43+
- copy `config.example.json` file to `config.json`
44+
- open the file and adjust the values in the sensors section to your wishes
45+
- you need the sensor_ids from your 1wire sensors
46+
- remove or add sensors here as you need
47+
- give them names :)
48+
3. install node.js
49+
4. run `npm install`
50+
5. start api by running `node api.js`
51+
52+
### On the client (where the sensors are attached and the logger should be running)
53+
54+
1. configure logger (in the `logger` folder):
55+
- copy `config.example.ini` file to `config.ini`
56+
- open the file and replace the HOST and PORT values with the one from the machine your RESTful API is running on
57+
2. Install python3.6+
58+
3. (optional) if you want to use DHT22 sensors you need to install the Adafruit_Python_DHT module. See: [Adafruit_Python_DHT#install-with-pip](https://github.com/adafruit/Adafruit_Python_DHT#install-with-pip)
59+
4. Run the logger by executing `python3 log.py sqlite` or `python3 log.py restful`
60+
61+
62+
## Run the RESTful API as systemd service
5563

5664
If you want the RESTful API run as a systemd service you can do the following:
5765

0 commit comments

Comments
 (0)