Skip to content

Commit 44b7cc1

Browse files
authored
Updated docs (#5)
1 parent 4ab0820 commit 44b7cc1

File tree

13 files changed

+276
-186
lines changed

13 files changed

+276
-186
lines changed

docs-hardware/bill-of-materials.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@
22
sidebar_position: 2
33
---
44

5-
# Bill of materials
5+
# 📝 Bill of materials
66

7-
## Note:
7+
## Note:
88

99
The bill of materials can vary, depending on your preferences, part availability and price. The aim of the project is to
1010
make a charging point out of off-the-shelf hardware that is widely available. Also, the list is not in any way perfect.
1111

1212
## Enclosure and wiring
1313

14-
| Item| # |
15-
| :---: | :---: |
16-
| Schneider Electric Kaedra with 4 openings (or more) | 1x |
17-
| Schneider Electric Schuko outlet for Kaedra | 4x (depends on the electrical box)|
18-
| Terminal/crimp connectors | a lot |
19-
| 1,5 mm2 or any 10A rated wire | around 20m |
20-
| Schuko plug | 1 |
14+
| Item | # |
15+
|:---------------------------------------------------:|:----------------------------------:|
16+
| Schneider Electric Kaedra with 4 openings (or more) | 1x |
17+
| Schneider Electric Schuko outlet for Kaedra | 4x (depends on the electrical box) |
18+
| Terminal/crimp connectors | a lot |
19+
| 1,5 mm2 or any 10A rated wire | around 20m |
20+
| Schuko plug | 1 |
2121

2222
## Electronics
2323

24-
| Item| # |
25-
| :---: | :---: |
26-
| ETIMat6 C10 | 1 |
27-
| ETIMat6 B6 | 1 |
28-
| Raspberry Pi 4 2GB | 1 |
29-
| 4-Relay module 230V 10A | 1 |
30-
| Huawei LTE modem | 1 |
31-
| CS5460 power meter | 4x (for each outlet) |
32-
| PN532 NFC/RFID reader | 1 |
33-
| WS281x LED strip | a few meters |
24+
| Item | # |
25+
|:-----------------------:|:--------------------:|
26+
| ETIMat6 C10 | 1 |
27+
| ETIMat6 B6 | 1 |
28+
| Raspberry Pi 4 2GB | 1 |
29+
| 4-Relay module 230V 10A | 1 |
30+
| Huawei LTE modem | 1 |
31+
| CS5460 power meter | 4x (for each outlet) |
32+
| PN532 NFC/RFID reader | 1 |
33+
| WS281x LED strip | a few meters |
3434

3535
## Misc
3636

37-
| Item| # |
38-
| :---: | :---: |
39-
| M2,5 20mm screws | 4 |
40-
| M2 or M2,5 6mm screws | 2 |
41-
| __optionally__ 3D printed DIN mounts | 2 |
37+
| Item | # |
38+
|:------------------------------------:|:---:|
39+
| M2,5 20mm screws | 4 |
40+
| M2 or M2,5 6mm screws | 2 |
41+
| __optionally__ 3D printed DIN mounts | 2 |

docs-services/logging/_category_.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Logging",
3+
"position":5
4+
}

docs-services/graylog.md renamed to docs-services/logging/graylog.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 2
33
---
44

5-
# Graylog logging server
5+
# 📜 Graylog logging server
66

77
## Prerequisites
88

9-
You should have a publicly accessible Linux or Windows server with Docker and docker-compose installed. Check
10-
out [Docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/)
9+
You should have a publicly accessible Linux or Windows server with Docker and docker-compose installed.
10+
11+
See [Docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/)
1112
for installation guides.
1213

13-
## Running Graylog server with docker-compose
14+
## 🏃 Deploying Graylog server with docker-compose
1415

15-
1. Copy the following code into a docker-compose.yaml or use the
16-
provided [docker-compose](https://github.com/xBlaz3kx/ChargePi-go/blob/main/docs/services/docker-compose.yaml). There
17-
are two docker-compose files - the first one is the base and the second one uses [Traefik](https://traefik.io/) as a
18-
reverse proxy for routing.
16+
1. Copy the following code into a docker-compose.yaml or use the provided [docker-compose](../../docker-compose.yaml). There
17+
are two docker-compose files - the first one is the base and the second one uses Traefik as a reverse proxy for
18+
routing.
1919

2020
```yaml
2121
version: '3'
@@ -53,11 +53,11 @@ services:
5353
- mongo
5454
- elasticsearch
5555
ports:
56-
- 8081:9000
57-
- 1514:1514
58-
- 1514:1514/udp
59-
- 12201:12201
60-
- 12201:12201/udp
56+
- "8081:9000"
57+
- "1514:1514"
58+
- "1514:1514/udp"
59+
- "12201:12201"
60+
- "12201:12201/udp"
6161
networks:
6262
graylog:
6363
driver: bridge
@@ -70,7 +70,7 @@ volumes:
7070
driver: local
7171
```
7272
73-
2. Change the `GRAYLOG_ROOT_PASSWORD_SHA2` as well as the external `GRAYLOG_HTTP_EXTERNAL_URI` environment variable.
73+
2. Change the password hint and SHA256 as well as the external `GRAYLOG_HTTP_EXTERNAL_URI` environment variable.
7474

7575
3. Run using:
7676

docs-services/logging/logging.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# 📜 Logging
6+
7+
Logging is configured in the `settings` file. There are multiple ways of logging:
8+
9+
1. Remote logging
10+
- Using Graylog and GELF
11+
- Using Syslog
12+
13+
2. File logging
14+
- Log to the `/var/logs` in a JSON format
15+
- Read the logs from the file and send them to a remote Loki instance using Promtail (or any other client)
16+
17+
3. Console logging
18+
- Only output the logs in the console.
19+
20+
## 🛠️ Logging configuration
21+
22+
| Attribute | Valid values | Default | Description |
23+
|:---------:|:---------------------------:|:---------:|:----------------------------------------------------:|
24+
| `type` | `remote`, `file`, `console` | `console` | Where to output the logs. Can have multiple outputs. |
25+
| `format` | `json`, `syslog`, `gelf` | `json` | The format the logs are in. |
26+
| `host` | Any valid IP/hostname | / | Only needed when the type is `remote`. |
27+
| `port` | / | / | Only needed when the type is `remote`. |
28+
29+
Example logging settings:
30+
31+
```json
32+
{
33+
// ... other settings
34+
"logging": {
35+
"type": [
36+
"remote",
37+
"file"
38+
],
39+
"format": "gelf",
40+
"host": "logging.example.com",
41+
"port": 12201
42+
}
43+
}
44+
```

docs/go-client/adding-support-for-hardware.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sidebar_position: 4
33
---
44

5-
# Adding support for hardware
5+
# ➡️Adding support for hardware
66

77
There are four hardware component groups that are included in the project:
88

@@ -14,17 +14,21 @@ There are four hardware component groups that are included in the project:
1414
These hardware components have corresponding interfaces that are included in the `ChargePointHandler` struct. This
1515
allows adding support for other models of hardware with similar functionalities.
1616

17-
## Reader hardware
17+
You're welcome to submit a Pull Request with any additional hardware model implementations! Be sure to test and document
18+
your changes, update the [supported hardware](../hardware/hardware.md) table(s) with the new hardware model(s). It would
19+
be nice to have a wiring sketch or a connection table included for the new model(s).
20+
21+
## 💳 Reader hardware
1822

1923
All readers must implement the `Reader` interface. It is recommended that you implement the interface in a new file
2024
named after the model of the reader in the `hardware/reader` package. Then you should add a **constant** named after
2125
the **model** of the reader in the `reader` file in the package and add a switch case with the implementation and the
2226
necessary logic that returns a pointer to the struct.
2327

24-
The settings of the reader are read from the `settings` file, which is stored in the cache and are available in the
28+
The settings of the reader are read from the `settings.json` file, which is stored in the cache and are available in the
2529
NewTagReader method.
2630

27-
```go
31+
```golang
2832
package reader
2933

3034
const (
@@ -57,14 +61,14 @@ func NewTagReader() Reader {
5761
}
5862
```
5963

60-
## Display hardware
64+
## 🖥️ Display hardware
6165

6266
All displays must implement the `LCD` interface. It is recommended that you implement the interface in a new file named
6367
after the model of the display/LCD in the `hardware/display` package. Then you should add a **constant** named after
6468
the **model** of the display in the `display` file in the package and add a switch case with the implementation and the
6569
necessary logic that returns a pointer to the struct.
6670

67-
```go
71+
```golang
6872
package display
6973

7074
const (
@@ -113,7 +117,7 @@ func NewDisplay() LCD {
113117

114118
The process is the same as the previous description.
115119

116-
```go
120+
```golang
117121
package indicator
118122

119123
const (
@@ -146,11 +150,11 @@ func NewIndicator(stripLength int) Indicator {
146150
}
147151
```
148152

149-
## Power meters
153+
## Power meters
150154

151155
The process is the same as the previous description.
152156

153-
```go
157+
```golang
154158
package power_meter
155159

156160
const (
@@ -187,4 +191,3 @@ func NewPowerMeter(connector *settings.Connector) (PowerMeter, error) {
187191
return nil, fmt.Errorf("power meter not enabled")
188192
}
189193
```
190-

0 commit comments

Comments
 (0)