Skip to content

Updated docs #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions docs-hardware/bill-of-materials.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@
sidebar_position: 2
---

# Bill of materials
# 📝 Bill of materials

## Note:
## Note:

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

## Enclosure and wiring

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

## Electronics

| Item| # |
| :---: | :---: |
| ETIMat6 C10 | 1 |
| ETIMat6 B6 | 1 |
| Raspberry Pi 4 2GB | 1 |
| 4-Relay module 230V 10A | 1 |
| Huawei LTE modem | 1 |
| CS5460 power meter | 4x (for each outlet) |
| PN532 NFC/RFID reader | 1 |
| WS281x LED strip | a few meters |
| Item | # |
|:-----------------------:|:--------------------:|
| ETIMat6 C10 | 1 |
| ETIMat6 B6 | 1 |
| Raspberry Pi 4 2GB | 1 |
| 4-Relay module 230V 10A | 1 |
| Huawei LTE modem | 1 |
| CS5460 power meter | 4x (for each outlet) |
| PN532 NFC/RFID reader | 1 |
| WS281x LED strip | a few meters |

## Misc

| Item| # |
| :---: | :---: |
| M2,5 20mm screws | 4 |
| M2 or M2,5 6mm screws | 2 |
| __optionally__ 3D printed DIN mounts | 2 |
| Item | # |
|:------------------------------------:|:---:|
| M2,5 20mm screws | 4 |
| M2 or M2,5 6mm screws | 2 |
| __optionally__ 3D printed DIN mounts | 2 |
4 changes: 4 additions & 0 deletions docs-services/logging/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Logging",
"position":5
}
30 changes: 15 additions & 15 deletions docs-services/graylog.md → docs-services/logging/graylog.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
---
sidebar_position: 1
sidebar_position: 2
---

# Graylog logging server
# 📜 Graylog logging server

## Prerequisites

You should have a publicly accessible Linux or Windows server with Docker and docker-compose installed. Check
out [Docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/)
You should have a publicly accessible Linux or Windows server with Docker and docker-compose installed.

See [Docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/)
for installation guides.

## Running Graylog server with docker-compose
## 🏃 Deploying Graylog server with docker-compose

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

```yaml
version: '3'
Expand Down Expand Up @@ -53,11 +53,11 @@ services:
- mongo
- elasticsearch
ports:
- 8081:9000
- 1514:1514
- 1514:1514/udp
- 12201:12201
- 12201:12201/udp
- "8081:9000"
- "1514:1514"
- "1514:1514/udp"
- "12201:12201"
- "12201:12201/udp"
networks:
graylog:
driver: bridge
Expand All @@ -70,7 +70,7 @@ volumes:
driver: local
```

2. Change the `GRAYLOG_ROOT_PASSWORD_SHA2` as well as the external `GRAYLOG_HTTP_EXTERNAL_URI` environment variable.
2. Change the password hint and SHA256 as well as the external `GRAYLOG_HTTP_EXTERNAL_URI` environment variable.

3. Run using:

Expand Down
44 changes: 44 additions & 0 deletions docs-services/logging/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
sidebar_position: 1
---

# 📜 Logging

Logging is configured in the `settings` file. There are multiple ways of logging:

1. Remote logging
- Using Graylog and GELF
- Using Syslog

2. File logging
- Log to the `/var/logs` in a JSON format
- Read the logs from the file and send them to a remote Loki instance using Promtail (or any other client)

3. Console logging
- Only output the logs in the console.

## 🛠️ Logging configuration

| Attribute | Valid values | Default | Description |
|:---------:|:---------------------------:|:---------:|:----------------------------------------------------:|
| `type` | `remote`, `file`, `console` | `console` | Where to output the logs. Can have multiple outputs. |
| `format` | `json`, `syslog`, `gelf` | `json` | The format the logs are in. |
| `host` | Any valid IP/hostname | / | Only needed when the type is `remote`. |
| `port` | / | / | Only needed when the type is `remote`. |

Example logging settings:

```json
{
// ... other settings
"logging": {
"type": [
"remote",
"file"
],
"format": "gelf",
"host": "logging.example.com",
"port": 12201
}
}
```
23 changes: 13 additions & 10 deletions docs/go-client/adding-support-for-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 4
---

# Adding support for hardware
# ➡️Adding support for hardware

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

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

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

## 💳 Reader hardware

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

The settings of the reader are read from the `settings` file, which is stored in the cache and are available in the
The settings of the reader are read from the `settings.json` file, which is stored in the cache and are available in the
NewTagReader method.

```go
```golang
package reader

const (
Expand Down Expand Up @@ -57,14 +61,14 @@ func NewTagReader() Reader {
}
```

## Display hardware
## 🖥️ Display hardware

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

```go
```golang
package display

const (
Expand Down Expand Up @@ -113,7 +117,7 @@ func NewDisplay() LCD {

The process is the same as the previous description.

```go
```golang
package indicator

const (
Expand Down Expand Up @@ -146,11 +150,11 @@ func NewIndicator(stripLength int) Indicator {
}
```

## Power meters
## Power meters

The process is the same as the previous description.

```go
```golang
package power_meter

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

Loading