Skip to content
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

Fix grammar and markdown format #931

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
138 changes: 93 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# everest-core

This is the main part of EVerest containing the actual charge controller logic included in a large set of modules.
This is the main part of EVerest containing the actual charge controller logic
included in a large set of modules.

All documentation and the issue tracking can be found in our main repository here: https://github.com/EVerest/everest
All documentation and the issue tracking can be found in our main repository
here: <https://github.com/EVerest/everest>

### Prerequisites:
## Prerequisites

#### Hardware recommendations
### Hardware recommendations

It is recommended to have at least 4GB of RAM available to build EVerest.
More CPU cores will optionally boost the build process, while requiring more RAM accordingly.
It is recommended to have at least 4GB of RAM available to build EVerest. More
CPU cores will optionally boost the build process while requiring more RAM
accordingly.

.. note::

EVerest can also run on much lower hardware specifications, if needed.
The reason for this is that the module configuration is very much defining
the RAM requirements. About 128 MB flash / RAM should be seen as an absolute
minimum requirement.
> [!NOTE]
> EVerest can also run on much lower hardware specifications if needed. The
> reason for this is that the module configuration is very much defining the RAM
> requirements. About 128 MB flash / RAM should be seen as an absolute minimum
> requirement.

Besides these recommendations, a typical EVerest should meet the following
minimum requirements:
Expand All @@ -34,60 +36,87 @@ minimum requirements:
* PLC GreenPhy
* RFID

#### Ubuntu 22.04
### Ubuntu 22.04

> :warning: Ubuntu 20.04 is not supported anymore. Please use Ubuntu 22.04 or newer.
> [!WARNING]
> Ubuntu 20.04 is not supported anymore. Please use Ubuntu 22.04 or newer.

```bash
sudo apt update
sudo apt install -y python3-pip python3-venv git rsync wget cmake doxygen graphviz build-essential clang-tidy cppcheck openjdk-17-jdk npm docker docker-compose libboost-all-dev nodejs libssl-dev libsqlite3-dev clang-format curl rfkill libpcap-dev libevent-dev pkg-config libcap-dev
sudo apt install -y python3-pip python3-venv git rsync wget cmake doxygen \
graphviz build-essential clang-tidy cppcheck openjdk-17-jdk npm docker \
docker-compose libboost-all-dev nodejs libssl-dev libsqlite3-dev \
clang-format curl rfkill libpcap-dev libevent-dev pkg-config libcap-dev
```

#### OpenSuse
```bash
### OpenSuse

```shell
zypper update && zypper install -y sudo shadow
zypper install -y --type pattern devel_basis
zypper install -y git rsync wget cmake doxygen graphviz clang-tools cppcheck boost-devel libboost_filesystem-devel libboost_log-devel libboost_program_options-devel libboost_system-devel libboost_thread-devel java-17-openjdk java-17-openjdk-devel nodejs nodejs-devel npm python3-pip gcc-c++ libopenssl-devel sqlite3-devel libpcap-devel libevent-devel libcap-devel
zypper install -y git rsync wget cmake doxygen graphviz clang-tools cppcheck \
boost-devel libboost_filesystem-devel libboost_log-devel \
libboost_program_options-devel libboost_system-devel libboost_thread-devel \
java-17-openjdk java-17-openjdk-devel nodejs nodejs-devel npm python3-pip \
gcc-c++ libopenssl-devel sqlite3-devel libpcap-devel libevent-devel \
libcap-devel
```

#### Fedora 38, 39 & 40
### Fedora 38, 39 & 40

```bash
sudo dnf update
sudo dnf install make automake gcc gcc-c++ kernel-devel python3-pip python3-devel git rsync wget cmake doxygen graphviz clang-tools-extra cppcheck java-17-openjdk java-17-openjdk-devel boost-devel nodejs nodejs-devel npm openssl openssl-devel libsqlite3x-devel curl rfkill libpcap-devel libevent-devel libcap-devel
sudo dnf install make automake gcc gcc-c++ kernel-devel python3-pip \
python3-devel git rsync wget cmake doxygen graphviz clang-tools-extra \
cppcheck java-17-openjdk java-17-openjdk-devel boost-devel nodejs \
nodejs-devel npm openssl openssl-devel libsqlite3x-devel curl rfkill \
libpcap-devel libevent-devel libcap-devel
```

### Build & Install:
## Build & Install

It is required that you have uploaded your public [ssh key](https://www.atlassian.com/git/tutorials/git-ssh) to [github](https://github.com/settings/keys).
It is required that you have uploaded your public [ssh key](https://www.atlassian.com/git/tutorials/git-ssh)
to [github](https://github.com/settings/keys).

To install the [Everest Dependency Manager](https://github.com/EVerest/everest-dev-environment/blob/main/dependency_manager/README.md), follow these steps:
To install the [Everest Dependency Manager](https://github.com/EVerest/everest-dev-environment/blob/main/dependency_manager/README.md),
follow these steps:

Install required python packages:

```bash
python3 -m pip install --upgrade pip setuptools wheel jstyleson jsonschema
```
Get EDM source files and change into the directory:

Get EDM source files and change to the directory:

```bash
git clone git@github.com:EVerest/everest-dev-environment.git
cd everest-dev-environment/dependency_manager
```

Install EDM:

```bash
python3 -m pip install .
```

We need to add */home/USER/.local/bin* and *CPM_SOURCE_CACHE* to *$PATH*:

```bash
export PATH=$PATH:/home/$(whoami)/.local/bin
export CPM_SOURCE_CACHE=$HOME/.cache/CPM
```

Now setup EVerest workspace:
Now setup EVerest workspace:

```bash
cd everest-dev-environment/dependency_manager
edm init --workspace ~/checkout/everest-workspace
```

This sets up a workspace based on the most recent EVerest release. If you want to check out the most recent main you can use the following command:
This sets up a workspace based on the most recent EVerest release. If you want
to check out the most recent main you can use the following command:

```bash
cd everest-dev-environment/dependency_manager
edm init main --workspace ~/checkout/everest-workspace
Expand All @@ -96,6 +125,7 @@ edm init main --workspace ~/checkout/everest-workspace
Install [ev-cli](https://github.com/EVerest/everest-utils/tree/main/ev-dev-tools):

Change the directory and install ev-cli:

```bash
cd ~/checkout/everest-workspace/everest-utils/ev-dev-tools
python3 -m pip install .
Expand All @@ -108,7 +138,12 @@ cd ~/checkout/everest-workspace/Josev
python3 -m pip install -r requirements.txt
```

For ISO15118 communication including Plug&Charge you need to install the required CA certificates inside [config/certs/ca](config/certs/ca) and client certificates, private keys and password files inside [config/certs/client](config/certs/client/). For an more seamless development experience, these are automatically generated for you, but you can set the ISO15118_2_GENERATE_AND_INSTALL_CERTIFICATES cmake option to OFF to disable this auto-generation for production use.
For ISO15118 communication including Plug&Charge you need to install the
required CA certificates inside [config/certs/ca](config/certs/ca) and client
certificates, private keys and password files inside [config/certs/client](config/certs/client/).
For a more seamless development experience, these are automatically generated
for you, but you can set the ISO15118_2_GENERATE_AND_INSTALL_CERTIFICATES cmake
option to OFF to disable this auto-generation for production use.

Now we can build EVerest!

Expand All @@ -119,57 +154,70 @@ cmake ..
make install
```

(Optional) In case you have more than one CPU core and more RAM availble you can use the following command to significantly speed up the build process:
> [!TIP]
> In case you have more than one CPU core and more RAM available you can use the
> following command to significantly speed up the build process:

```bash
make -j$(nproc) install
```
*$(nproc)* puts out the core count of your machine, so it is using all available CPU cores!
You can also specify any number of CPU cores you like.


*$(nproc)* puts out the core count of your machine, so it uses all available CPU
cores! You can also specify any number of CPU cores you like.

Done!

<!--- WIP: [everest-cpp - Init Script](https://github.com/EVerest/everest-utils/tree/main/everest-cpp) -->

### Simulation

In order to test your build of Everest you can simulate the code on your local machine! Check out the different configuration files to run EVerest and the corresponding nodered flows in the [config folder](config/).
## Simulation

Check out this [guide for using EVerest SIL](https://everest.github.io/nightly/tutorials/run_sil/index.html)
In order to test your build of Everest you can simulate the code on your local
machine! Check out the different configuration files to run EVerest and the
corresponding nodered flows in the [config folder](config/).

Check out this [guide for using EVerest SIL](https://everest.github.io/nightly/tutorials/run_sil/index.html)

### Troubleshoot
## Troubleshoot

**1. Problem:** "make install" fails with complaining about missing header files.

**Cause:** Most probably your *clang-format* version is older than 11 and *ev-cli* is not able to generate the header files during the build process.
**Cause:** Most probably your *clang-format* version is older than 11 and
*ev-cli* is not able to generate the header files during the build process.

**Solution:** Install a newer clang-format version and make Ubuntu using the new
version e.g.:

**Solution:** Install newer clang-format version and make Ubuntu using the new version e.g.:
```bash
sudo apt install clang-format-12
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-12 100
```

Verify clang-format version:

```bash
clang-format --version
Ubuntu clang-format version 12.0.0-3ubuntu1~20.04.4
```
To retry building EVerest delete the entire everest-core/**build** folder and recreate it.
Start building EVerest using *cmake ..* and *make install* again.

To retry building EVerest delete the entire everest-core/**build** folder and
recreate it. Start building EVerest using *cmake ..* and *make install* again.

**2. Problem:** Build speed is very slow.

**Cause:** *cmake* and *make* are only utilizing one CPU core.

**Solution:** use
**Solution:** use

```bash
cmake -j$(nproc) ..
```
and

and

```bash
make -j$(nproc) install
```
to use all available CPU cores.
Be aware that this will need roughly an additional 1-2GB of RAM per core.
Alternatively you can also use any number between 2 and your maximum core count instead of *$(nproc)*.

to use all available CPU cores. Be aware that this will need roughly an
additional 1-2GB of RAM per core. Alternatively, you can also use any number
between 2 and your maximum core count instead of *$(nproc)*.