diff --git a/docker/everest-playground/.devcontainer.json b/docker/everest-playground/.devcontainer.json index 249cb566..0a6be5b3 100644 --- a/docker/everest-playground/.devcontainer.json +++ b/docker/everest-playground/.devcontainer.json @@ -4,7 +4,7 @@ "dockerfile": "Dockerfile" }, "containerEnv": { - "MQTT_SERVER_ADDRESS": "mqtt-server", + "MQTT_SERVER_ADDRESS": "localhost", "MQTT_SERVER_PORT": "1883" }, "extensions": [ @@ -28,5 +28,8 @@ }, "terminal.integrated.defaultProfile.linux": "bash", "python.pythonPath": "/usr/bin/python3" - } + }, + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + } } diff --git a/docker/everest-playground/Dockerfile b/docker/everest-playground/Dockerfile index 92ba2e79..b4c69753 100644 --- a/docker/everest-playground/Dockerfile +++ b/docker/everest-playground/Dockerfile @@ -44,6 +44,7 @@ RUN apt-get update \ libcurl4-openssl-dev \ pkg-config \ libpcap-dev \ + libcap-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/docker/mqtt-devcontainer.sh b/docker/mqtt-devcontainer.sh new file mode 100755 index 00000000..c0fdb5e7 --- /dev/null +++ b/docker/mqtt-devcontainer.sh @@ -0,0 +1,2 @@ +#!/bin/sh +docker run -d --name mqtt-server -p 1883:1883 -p 9001:9001 -v ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto:2.0.10 diff --git a/everest-cpp/init.sh b/everest-cpp/init.sh index 2247158b..63c0eeaf 100755 --- a/everest-cpp/init.sh +++ b/everest-cpp/init.sh @@ -33,4 +33,4 @@ cd everest-core/build echo "" echo "You can now build everest-core with the following commands:" echo "" -echo "cmake .. && make install -j$(nproc)" +echo "cmake .. -DBUILD_SHARED_LIBS=on && make install -j$(nproc)" diff --git a/mac-setup.md b/mac-setup.md new file mode 100644 index 00000000..c6d4c8e7 --- /dev/null +++ b/mac-setup.md @@ -0,0 +1,41 @@ +# How To: Develop on a Mac + +## Preparation + +1. Clone the repository `git clone git@github.com:EVerest/everest-utils.git` +1. From inside VSCode, type `Cmd+Shift+P` +1. Select the directory `everest-utils/docker/everest-playground` to start a +DevContainer - all the following commands must be executed in VSCode terminals + inside the DevContainer. +1. Run `. init.sh` to initialize the dependencies. +1. Compile and install + +```bash +cmake .. -DBUILD_SHARED_LIBS=on && make install +``` + +## MQTT +Open a terminal tab to start the MQTT server + +```bash +cd /workspace/docker ; ./mqtt-devcontainer.sh +``` + +## Nodered / Simulator UI +Open a terminal tab to start the Nodered server + +```bash +cd /workspace/everest-cpp/everest-core/build ; ./run-scripts/nodered-sil.sh +``` + +## Software-in-the-loop Simulator +Open a terminal tab to start the simulation + +```bash +export LD_LIBRARY_PATH=$(find / -name "*.so*" 2>/dev/null | + xargs -I {} dirname {} | sort -u | tr '\n' ':' | sed 's/:$//') + +cd /workspace/everest-cpp/everest-core/build ; ./run-scripts/run-sil.sh +``` + +Open http://localhost:1880/ui and test the Charging Station and EV simulators.