diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 6af21ae..cafca54 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -11,9 +11,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: Checkout repository with submodules + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Initialize and update submodules + run: git submodule update --init --recursive # This external action cares about all the sphinx stuff - - uses: ammaraskar/sphinx-action@4.3.2 + - name: Build project + uses: ammaraskar/sphinx-action@4.3.2 with: build-command: "sphinx-build -b linkcheck source/ build/" docs-folder: "docs/" diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..011bc4e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "includes"] + path = includes + url = https://github.com/chargebyte/chargebyte-docs.git + branch = shared-docs diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9138a7f..ba8f698 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,3 +11,6 @@ python: sphinx: configuration: docs/source/conf.py + +submodules: + include: all #includes all git-submodules diff --git a/README.rst b/README.rst index e8ff51a..e2af492 100644 --- a/README.rst +++ b/README.rst @@ -12,6 +12,13 @@ Contents: - Charge Control C User Guide +Repo initialization: +------------------- +This repository is using git submodules to share documents between the user guides. +After cloning of the project please execute the following command: + +git submodule update --init --force --remote + Building the documentation locally: ----------------------------------- diff --git a/includes b/includes new file mode 160000 index 0000000..770a838 --- /dev/null +++ b/includes @@ -0,0 +1 @@ +Subproject commit 770a8386ec0aeae33285329582e6ee0242105266 diff --git a/includes/_static/files/toolchain.cmake b/includes/_static/files/toolchain.cmake deleted file mode 100644 index ed736af..0000000 --- a/includes/_static/files/toolchain.cmake +++ /dev/null @@ -1,52 +0,0 @@ -set(CMAKE_SYSTEM_NAME Linux) - -if(EXISTS ${CMAKE_SYSROOT} AND IS_DIRECTORY ${CMAKE_SYSROOT}) - execute_process(COMMAND file ${CMAKE_SYSROOT}/bin/bash.bash - OUTPUT_VARIABLE TARGET_BASH_OUTPUT) - if(TARGET_BASH_OUTPUT MATCHES aarch64) - message(STATUS "Setting architecture to aarch64") - set(CMAKE_SYSTEM_PROCESSOR aarch64) - set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc) - set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} " CACHE STRING "" FORCE ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " CACHE STRING "" FORCE ) - else() - message(STATUS "Setting architecture to arm") - set(CMAKE_SYSTEM_PROCESSOR arm) - set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc) - set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-psabi" CACHE STRING "" FORCE ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi" CACHE STRING "" FORCE ) - endif() -else() - message(FATAL_ERROR "ERROR: SYSROOT '${CMAKE_SYSROOT}' not found!!!") -endif() - - if(CMAKE_BUILD_TYPE MATCHES Debug) - # Debug flags - message("Enabling Debug build") - set(CMAKE_CXX_FLAGS_DEBUG "-g") -else() - # Enable compiler optimization flags - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os") - - # Strip debug symbols - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s") -endif() - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -L${CMAKE_SYSROOT}/usr/lib") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SYSROOT}/usr/lib") - -set(ENV{PKG_CONFIG_PATH} "${CMAKE_SYSROOT}/usr/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") - -set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_SYSROOT}/usr/lib/libstdc++.so") - -set(NODEJS_INCLUDE_DIR /usr/include/node) # make sure that nodejs is installed. If not, sudo apt-get install nodejs-dev - -set(PYTHON_INCLUDE_DIRS "${CMAKE_SYSROOT}/usr/include/python3.10") -set(PYTHON_LIBRARIES "${CMAKE_SYSROOT}/usr/lib/libpython3.10.so") - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/includes/_static/images/cbenergy/discover.png b/includes/_static/images/cbenergy/discover.png deleted file mode 100644 index 1ebbdb3..0000000 Binary files a/includes/_static/images/cbenergy/discover.png and /dev/null differ diff --git a/includes/_static/images/cbenergy/home.png b/includes/_static/images/cbenergy/home.png deleted file mode 100644 index 8d7f2b2..0000000 Binary files a/includes/_static/images/cbenergy/home.png and /dev/null differ diff --git a/includes/_static/images/cbenergy/manual.png b/includes/_static/images/cbenergy/manual.png deleted file mode 100644 index 176591c..0000000 Binary files a/includes/_static/images/cbenergy/manual.png and /dev/null differ diff --git a/includes/_static/images/cbenergy/setup-final.png b/includes/_static/images/cbenergy/setup-final.png deleted file mode 100644 index dd868e1..0000000 Binary files a/includes/_static/images/cbenergy/setup-final.png and /dev/null differ diff --git a/includes/_static/images/cbenergy/setup-skip.png b/includes/_static/images/cbenergy/setup-skip.png deleted file mode 100644 index cdb054a..0000000 Binary files a/includes/_static/images/cbenergy/setup-skip.png and /dev/null differ diff --git a/includes/_static/images/cbenergy/setup.png b/includes/_static/images/cbenergy/setup.png deleted file mode 100644 index 8b76ed0..0000000 Binary files a/includes/_static/images/cbenergy/setup.png and /dev/null differ diff --git a/includes/_static/images/cbenergy/user.png b/includes/_static/images/cbenergy/user.png deleted file mode 100644 index 54f7746..0000000 Binary files a/includes/_static/images/cbenergy/user.png and /dev/null differ diff --git a/includes/_static/images/mountpoints.svg b/includes/_static/images/mountpoints.svg deleted file mode 100644 index 205df02..0000000 --- a/includes/_static/images/mountpoints.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
System A
System B
Mountpoints
/
srv
var
...
log
...
/dev/mmcblk0p7
/dev/mmcblk0p5
/dev/mmcblk0p2
/dev/mmcblk0p6
/dev/mmcblk0p5
/dev/mmcblk0p1
\ No newline at end of file diff --git a/includes/cb_energy.inc b/includes/cb_energy.inc deleted file mode 100644 index 4e05366..0000000 --- a/includes/cb_energy.inc +++ /dev/null @@ -1,171 +0,0 @@ -.. _introduction_nymea: - -Introduction CB energy -====================== -CB energy is a (home) energy management system. -A CB energy installation consists of two parts: - -The first part is the nymea:core (nymead) which is a server application running on the wallbox. -The main application of the nymea:core is to connect the wallbox with 3rd party local energy assets (PV, meters, home storage, ...) and enables features like: - -* load balancing -* overload protection -* surplus charging -* energy management -* spot market charging -* remote access -* providing charging reports -* target time charging -* and more - -The second part is the CB energy app running on end user platforms like iOS and Android. The app is used to control -nymea:core. -The nymea:core and the different integration plugins for wallbox, meters and inverters are open source -and can be found on `Github `_. -Features like generating charging session report and the energy management are closed source and require a license -from chargebyte GmbH. For more information have a look `on our website `_. - - -Both parts have to be in the same network. In order to monitor and control the wallboxes, the EVerest charging stack is needed. The EVerest stack provides an API module, that is used by CB Energy either on localhost (on the same hardware) or to access other instances in the same local network. - -Note: This documentation is a quick start to get the nymea ecosystem running as fast as possible with EVerest charging stack. If you are testing CB Energy on one of chargebyte's Linux controllers, both EVerest and CB Energy are preinstalled in the latest firmware images. A more detailed documentation can be found `on the nymea website `_. - -.. important:: - The `API module `_ must be installed and active in the EVerest configuration. - - -.. _cb_energy_app: - -CB energy app -============= - -The CB energy app can be installed from the official stores. - -.. raw:: html - - - - - - -
-

- - iOS Badge -

-
-

- - Android Badge -

-
- -.. _setup_and_configuration: - -Setup and configuration -======================= - -On a chargebyte controller, the nymea daemon will start automatically, together with the EVerest stack while the system is booting up. -Once the services are running the app will be able to detect the instance automatically on localhost or in the local network. - - -.. _client_discovery: - -Client discovery -================ - -The CB energy app (client) automatically discovers available instances (servers) in your local network. Please make sure to allow the smartphone app to have access to your local network devices after installing it. - -.. figure:: ../../includes/_static/images/cbenergy/discover.png - :height: 600px - -If the discovery has not found any wallbox in the local network you can try to set up a manual connection as described in :ref:`connection_option`. - - -.. _user_setup: - -User setup -================ - -Once you are connected to the nymea:core, you can start to set up your system. - -.. figure:: ../../includes/_static/images/cbenergy/user.png - :height: 600px - -It is time to create login credentials to keep the CB energy setup protected. When connecting to the system for the first time, it will prompt for a username and a password. Optionally, you can also provide your name and e-mail address. -This information is stored locally. - - - -.. _setup: - -Setup of ecosystem -========================= - -In the next step, nymea:core starts a discovery for EV chargers. This might be the same machine (localhost) or any other supported charger in the local network. - -.. figure:: ../../includes/_static/images/cbenergy/setup.png - -If you are trying CB energy on a chargebyte controller an EVerest connector will be discovered. - - -After discovering and setting up the wallbox, CB Energy tries to discover other assets like solar inverters and meters. If there aren't any of these devices around, you can skip this step. - -.. figure:: ../../includes/_static/images/cbenergy/setup-skip.png - :height: 600px - -Basically, you don't need solar inverters or meters for controlling the wallbox. If you want to make use of the ``Eco mode``, you need to add at least one meter measuring the overall consumption of the house. - - -The final steps of the wizard are - -* to set a grid limit for overload protection -* add your initial EV parameters with name, netto battery capacity and minimum charging current as well as phase count of the on-board-charger - -.. figure:: ../../includes/_static/images/cbenergy/setup-final.png - -You can change this option later in the settings as well. - - - -.. _home: - -Home screen -=========== - -Well done! At this point you are ready to explore the Home Screen, the charging modes (``Eco`` and ``Quick``) and all the other capabilities of CB energy. -As mentioned in `setup`_, ``Eco mode`` is only available if at least one root meter is registered in the system. With ``Quick mode`` however, you should be able to control basic charging features like starting and stopping a charging session as well as adjusting the charging power. Give it a try! - -.. figure:: ../../includes/_static/images/cbenergy/home.png - - - -.. _supported_devices: - -Supported devices -================= - -Here you find a list of `supported devices `_. -CB energy comes with license, maintenance, support and service level agreement. So for the number of integrations you want to use in your final product (e.g. smart EV charger with embedded HEMS), we make sure all integrations are maintained and work as intended. - -Since the fundamental IoT middleware of CB energy - nymea - is open source, you can add your own integration to the stack. The developer guide can be found `here `_. - - - -.. _connection_option: - -Manual connection option -======================== - -If discovery between CB energy app (client) and nymea:core (server) fails for some reason (e.g. blocked UPnP/ZeroConf in company network), you can still enter the endpoints manually. -There are three options for the connection protocol: - -#. TCP -#. Websocket -#. RemoteProxy - -For simply hooking up client and server locally, choose TCP and enter the IP address of your nymea:core instance. For the first -time you can keep the port at 2222. - -.. figure:: ../../includes/_static/images/cbenergy/manual.png - :height: 600px diff --git a/includes/connecting.inc b/includes/connecting.inc deleted file mode 100644 index dc68824..0000000 --- a/includes/connecting.inc +++ /dev/null @@ -1,71 +0,0 @@ -.. _connecting-via-ssh-or-serial-interface: - -Connecting via SSH or Serial Interface --------------------------------------- - -For debugging, there are two ways to connect the developer computer to the Charge controller: via SSH -or via serial interface. The following sections explain how to connect to the Charge controller using -PuTTY. You can also use other terminal programs (like e.g. MobaXTerm) to connect to the -Charge controller. - - -SSH Connection with PuTTY -^^^^^^^^^^^^^^^^^^^^^^^^^ - -Here are the steps to connect to the Charge controller via SSH using PuTTY: - -#. Install PuTTY on your computer. You can download PuTTY from the following link: - `PuTTY Download `_. -#. Connect the Charge controller over Ethernet to your computer. -#. Start PuTTY and enter the IPv4 fallback address "169.254.12.53" of the Charge controller in - the "Host Name (or IP address)" field (See figure :ref:`PuTTY SSH Configuration `). -#. Click on "Save" to save the configuration and then click on "Open" to start the connection. -#. A PuTTY Security Alert window will appear. Click on "Accept" to continue. -#. Enter the username "root" and the password "zebematado" to log in to the Charge controller. - -.. note:: - The username can also be stored under "Connection -> Data -> Auto-login username" in the - PuTTY configuration. - -.. note:: - It is also possible to install an SSH key on the Charge controller to log in without a - password. Please look online for instructions on how to do this on a Linux system. - -.. figure:: _static/images/putty_config_ssh_fallback_ip.png - :width: 300pt - - Figure: PuTTY SSH Configuration - - -Serial Connection with PuTTY -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Here are the steps to connect to the Charge controller via serial interface using PuTTY: - -#. Install PuTTY on your computer. You can download PuTTY from the following link: - `PuTTY Download `_. -#. Connect the Charge controller to your computer via USB to serial adapter. -#. Start PuTTY and configure the COM port of the USB to serial adapter (e.g. "COM1") in the - "Serial line" field. - Note: You can find the COM port of the USB to serial adapter in the Windows Device Manager - under "Ports (COM & LPT)". -#. Switch to Connection -> Serial configuration and set the "Speed" to 115200, "Data bits" to 8, - "Stop bits" to 1, "Parity" to "None" and "Flow control" to "None" (See figure - :ref:`PuTTY Serial Configuration `). -#. Switch back to the "Session" and click on "Save" to save the configuration - (See figure :ref:`PuTTY Save Serial Connection `). -#. Click on "Open" to start the connection. -#. Now a black window will appear. Press enter to get the login prompt. -#. Enter the username "root" and the password "zebematado" to log in to the Charge controller. - -.. figure:: _static/images/putty_config_serial_1.png - :width: 300pt - :name: PuTTY_Serial_Configuration_1 - - Figure: PuTTY Serial Configuration - -.. figure:: _static/images/putty_config_serial_2.png - :width: 300pt - :name: PuTTY_Serial_Configuration_2 - - Figure: PuTTY Save Serial Connection diff --git a/includes/development.inc b/includes/development.inc deleted file mode 100644 index 5c43bd8..0000000 --- a/includes/development.inc +++ /dev/null @@ -1,116 +0,0 @@ -*********** -Development -*********** - -As mentioned in the section ":ref:`programming`", customers can create their own applications and -integrate them into a custom firmware image. This section will guide you through the process of creating a custom -EVerest module and integrating it into an image. This is done by either using the Yocto build system or -cross-compiling the application for the chargebyte hardware platform. - - -Setting up Yocto Build Environment -================================== - -#. Install the `required packages `_ - for Yocto on a Linux machine / virtual machine. (**Note**: We normally set up the Yocto build environment - on an Ubuntu 20.04 or later Linux distribution.) -#. Install :code:`repo` to help getting your Yocto environment ready. The :code:`repo` utility makes it - easy to reference several Git repositories within a top-level project, which you can then clone to your - local machine all at once. - - .. code-block:: console - - mkdir ~/bin - curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo - chmod a+x ~/bin/repo - - You need to also make sure that :code:`~/bin` is added to your :code:`PATH` variable - (Usually the directory is added automatically in Ubuntu). - - .. code-block:: console - - echo 'export PATH="$PATH":~/bin' >> ~/.bashrc - -#. The :code:`repo` tool should be used to checkout the Yocto layers needed to build the firmware image. - This requires a manifest file containing information about the repositories for the necessary Yocto - layers and the specific branches to be checked out. The manifest file can be found in a repository - called "`chargebyte-bsp `_". - (**Note**: chargebyte's Yocto build environment is currently based on 'Kirkstone' - a LTS release of the Yocto Project). - - .. code-block:: console - - mkdir yocto - cd yocto - repo init -u https://github.com/chargebyte/chargebyte-bsp -b kirkstone-everest - repo sync - - It should take a couple of minutes to download all the repositories using the command :code:`repo sync`. - After the command is executed, you should be able to find three folders in the created yocto directory: - - #. :code:`source`: Where all the repositories representing the layers are cloned. - #. :code:`chargebyte-bsp`: A clone of the 'chargebyte-bsp' repository containing the manifest file and configurations folder. - #. :code:`build`: Initially holds a link to the :code:`conf` folder in :code:`chargebyte-bsp`. - -Follow the `documentation `_ in the -'chargebyte-bsp' repository to build a firmware image based on the hardware platform specific board support package (BSP). -Currently supported are the hardware platforms Tarragon (Charge Control C) and Charge SOM. - -This will include EVerest and chargebyte's hardware abstraction layer (HAL). - -The next step in this chapter is to write a new EVerest module and build a custom image that incorporates -this new module. - -.. _adding-a-custom-everest-module: - -Adding a Custom EVerest Module -============================== - -The EVerest documentation explains the `modules in detail `_ -and their `configurations `_, -and includes a guide on `how to develop an new EVerest module `_. - -This section will focus on integrating the module into the Yocto build system. - -#. In order to integrate custom EVerest modules into the Yocto build system, you can either - `create a new Yocto layer `_ - or extend an existing one. This section will assume that a new layer has been created and added - to the :code:`BBLAYERS` variable in the :code:`build/conf/bblayers.conf` file. -#. A recipe file is needed to build the module. A recipe is a file with the extension :code:`.bb` and - contains information about the module, such as the source code location, dependencies, and how to build it. - The Yocto documentation provides a `guide on how to write a recipe file `_. - Let's assume that the new recipe is called :code:`my-module.bb`. It should look something like this: - - .. code-block:: console - - SUMMARY = "My Module" - DESCRIPTION = "A new EVerest module" - - LICENSE = "APACHE-2.0" - LIC_FILES_CHKSUM = "file://LICENSE;md5=1234567890" - - SRC_URI = "git://github.com/my_org/my-module.git;branch=main" - S = "${WORKDIR}/git" - - inherit cmake - - DEPENDS = "lib1 lib2" - - do_install() { - install -d ${D}${bindir} - install -m 0755 ${B}/my-module ${D}${bindir} - } - -#. Add the name of the recipe :code:`my-module` to the :code:`IMAGE_INSTALL` variable in the - :code:`build/conf/local.conf` file so that the module is included in the image. - -The module is now integrated into the Yocto build system. The next step is to build the custom image. - -Creating a Development Image -============================ - -In order to build the custom image, follow the section "`Building an image `_" -found in the "chargebyte-bsp" repository which produces a Linux root filesystem. This can be either -`flashed `_ -directly, or used to `create a firmware image using RAUC `_. - -The custom image should now include the new EVerest module. diff --git a/includes/development_debugging_and_logging.inc b/includes/development_debugging_and_logging.inc deleted file mode 100644 index edf6143..0000000 --- a/includes/development_debugging_and_logging.inc +++ /dev/null @@ -1,113 +0,0 @@ -.. _logging_and_debugging: - -Logging and Debugging -===================== - -There are different ways to analyze the EVerest charging software. In the following, different -ways are described. In preparation for starting this chapter, it is necessary to be connected to the board -via Ethernet. This is also necessary to copy logs and traces from the board to the local PC via a SFTP -tool like `WinSCP `_ or `FileZilla `_. - -journalctl logs ---------------- -As already described in the :ref:`start_charging_and_monitoring` section, the EVerest framework uses -journalctl for logging. journalctl is a system service that collects and stores logging data. -To view the logs, connect to the charge controller via SSH and run the following command: - -.. code-block:: console - - journalctl -f -n 100 -u everest - -The -f flag is used to follow the logs live, and the -n flag is used to view the last 100 lines. -The -u flag is used to filter the logs for the everest service. To stop following the logs, press :code:`Ctrl + C`. - -The logs are stored by the systemd journal service in a binary format in -"/var/log/journal". To open the binary in a human-readable format, use the following command: - -.. code-block:: console - - journalctl -u everest --file /path/to/your/file.journal - -As shown in the :ref:`start_charging_and_monitoring` section, a log line consists, among other things, -of a timestamp, a log level, a module id, a module name, and a message. The log level can be one of the following: - - - "VERB" (Verbose) - - "DEBG" (Debug) - - "INFO" (Information) - - "WARN" (Warning) - - "ERRO" (Error) - - "CRIT" (Critical) - -The log level can be configured for each EVerest module separately in the logging configuration file. -The logging configuration file is located at "/etc/everest/default_logging.cfg". The filter can be configured -using the log level and the module identifier as defined in the EVerest configuration. -Here is an example to configure the message filter to change the log level of the EvseManager module -to DEBUG: - -.. code-block:: console - - # The filter expression consists of two parts: - # 1. Logs with severity level INFO or higher (affects all EVerest modules). - # 2. Logs from the EvseManager with module id "connector" with severity level DEBUG or higher. - Filter="(%Severity% >= INFO) or (%Process% contains connector and %Severity% >= DEBG)" - -pcap traces ------------ -pcap traces can be used to debug and analyze the high-level communication (HLC) between SECC and EVCC. -In general, there are two ways to capture pcap traces: - -#. Capture via tcpdump command - - .. code-block:: console - - tcpdump -i eth1 -w /srv/charge_com_01.pcap - - This command captures all packets on the eth1 (PLC) interface and writes them to - a pcap file. Stop the capture by pressing :code:`Ctrl + C`. - - .. note:: - Please stop the trace before copying the file to a local machine. The file may be incomplete if - copied while the tcpdump is still running. - -#. Using the EVerest "PacketSniffer" module - - The `PacketSniffer `_ module - is part of everest-core and can be used to capture pcap traces automatically. Please look into - the module manifest to see how to configure the PacketSniffer module. - -pcap traces with V2G communication can be analyzed using Wireshark with a V2G plugin like from `dSPACE `_. - -.. note:: - TLS encrypted communication cannot be analyzed with Wireshark without the TLS session key. Please - look in the module manifest which is responsible for the TLS handshake and check if there is an option - to export the TLS session key. E.g. the `IsoMux module `_ - is able to export the TLS session key. - -Session logging of the EVSEManager ----------------------------------- -The EVerest "EVSEManager" can generate session log files with information about the current session state, -configured CP state and duty cycle. It can also decode and log the content of the V2G messages. -Please look into the module manifest to see how to configure the EVSEManager module to activate session logging. - -.. note:: - The session logging is pretty performance intensive and should only be used for debugging purposes. - -MQTT logs ---------- -It is also possible to observe the internal MQTT communication between the EVerest modules. -When developing new modules, this can be helpful to better understand the internal processes regarding -the use of the interfaces. -We recommend using the `MQTT Explorer `_ tool to monitor and analyze the MQTT communication. -It is also possible to use the following command to monitor the MQTT communication, but this is not so easy to read: - -.. code-block:: console - - mosquitto_sub -F "[@H:@M:@S.@N] %t %p" -t 'everest/#' -t 'everest_api/#' > /srv/charge_com_mqtt_01.log - -Summary -------- -There are several ways to debug and analyze the EVerest framework. Which way to choose depends on the -specific use case and the information needed. The most common way is using journalctl logs. If it is -necessary to analyze the high-level communication between SECC and EVCC, pcap traces are the best choice. -If it is not clear how the internal communication between the EVerest modules works, the MQTT logs can -be helpful. diff --git a/includes/everest_basic_configuration.inc b/includes/everest_basic_configuration.inc deleted file mode 100644 index a54f52f..0000000 --- a/includes/everest_basic_configuration.inc +++ /dev/null @@ -1,17 +0,0 @@ -Basic configuration -=================== - -In order to test EVerest, you need to build it either natively on host Linux machine or integrate it into a -firmware suitable for a specific target platform using Yocto. To build it natively, follow the instructions -found in the main EVerest repository "`everest-core `_". -Additionally, there is a `quickstart guide `_ -to EVerest, which presents the different EVerest tools, build instructions, and a dive into simulating EVerest. - -For Yocto, EVerest offers "`meta-everest `_"; a Yocto meta layer -that can be used to integrate the EVerest charging stack into a platform-specific firmware image. -chargebyte utilizes this layer to produce firmware images suitable for chargebyte hardware platforms. Detailed instructions on -how to integrate EVerest into a chargebyte firmware image can be found on `GitHub `_. - -For setting up a use case with EVerest, such as basic setups for AC or DC charging, a YAML configuration file is needed. -Various example configurations, including those for software-in-the-loop tests, can be found in -the "`config `_" folder of the everest-core repository. diff --git a/includes/everest_further_reading.inc b/includes/everest_further_reading.inc deleted file mode 100644 index 23b99a4..0000000 --- a/includes/everest_further_reading.inc +++ /dev/null @@ -1,20 +0,0 @@ -Further reading -=============== - -For more information on getting started with EVerest, including an overview of the necessary tools and -instructions on writing your own modules, please refer to the official -`EVerest documentation `_. - -EVerest consists of multiple repositories, such as "`everest-core `_" -and "`libocpp `_". Each repository has its own documentation detailing its -specific role within EVerest. It should be noted that Pionix GmbH and the EVerest community maintain -all repositories that are a part of the EVerest GitHub organization. Only the EVerest modules that chargebyte -implemented and that are located in "`everest-chargebyte `_" -are maintained by chargebyte. - -For interesting discussions and solutions to common problems, visit the EVerest community's -`Zulip `_ channels. - -For support and issues related to the EVerest modules developed by chargebyte, please check the -:ref:`troubleshooting.rst` section of the documentation first. If you can't find the answer, please don't -hesitate to contact chargebyte's support team (:ref:`contact`). diff --git a/includes/everest_introduction_to_everest.inc b/includes/everest_introduction_to_everest.inc deleted file mode 100644 index ff14cc5..0000000 --- a/includes/everest_introduction_to_everest.inc +++ /dev/null @@ -1,14 +0,0 @@ -Introduction to EVerest -======================= - -EVerest is an open-source modular framework designed to create a comprehensive software stack for -electric vehicle (EV) charging. - -The modular software architecture promotes flexibility and customization, allowing users to configure specific charging -scenarios using interchangeable modules. This architecture is integrated and coordinated using MQTT (Message Queuing -Telemetry Transport). EVerest aims to standardize and simplify the development of EV charging -infrastructure, making it easier for developers and companies to implement robust and scalable charging solutions. -The project includes support for various protocols like ISO 15118, OCPP, and IEC 61851, ensuring broad -compatibility and future-proofing of the charging systems. - -For more information, visit the `EVerest GitHub repository `_. diff --git a/includes/everest_overview_of_everest_modules.inc b/includes/everest_overview_of_everest_modules.inc deleted file mode 100644 index 2ca47cb..0000000 --- a/includes/everest_overview_of_everest_modules.inc +++ /dev/null @@ -1,60 +0,0 @@ -Overview of EVerest modules -============================ - -As seen from the previous configuration file, some modules are required in order to use EVerest. -Which modules are required is highly dependent on the use case you want to release. The following -is a list of modules that are part of the chargebyte EVerest charging software: - -**EvseManager** (`view on GitHub `_) - -The main module in a charging infrastructure EVerest setup. It manages a single EVSE (i.e., one connector for -charging a car) and may control multiple connectors under some circumstances. It handles charging -logic (basic charging and HLC), gathers all relevant data for the charging session, such as energy -delivered during the session, and provides control over the charging port/session. For more information about -its capabilities, refer to the `module documentation `_. - -**EnergyManager** (`view on GitHub `__) - -This module is the global Energy Manager for all EVSE/Charging stations in a building. - -**API** (`view on GitHub `__) - -This module is not mandatory for an EVSE setup in EVerest. However, the module -:code:`API` is responsible for providing a simple MQTT based API to EVerest internals. - -**ErrorHistory** (`view on GitHub `__) - -This module is not mandatory for an EVSE setup in EVerest. This module is responsible -for storing EVerest error events in a database file. The location of the database file can be defined -via a configuration parameter. - -**DummyTokenProvider** (`view on GitHub `__) - -This module is used for automatically providing an authorization token, instead of requiring e.g. an -actual RFID reader. It listens to the AuthRequired event from evse_manager module and then publishes one token. - -**DummyTokenValidator** (`view on GitHub `__) - -This module always returns the same configured token validation result for every token. The -validation result is a configuration key in the manifest of the module. - -**CbSystem** (`view on GitHub `__) - -This module is an adaptation of the "`System `_" -module in EVerest. It implements the "`system `__" -interface and, like the :code:`System` module, is responsible for performing system-wide operations but -tailored for chargebyte's hardware platforms. The use of this module depends on the specific use case, -such as if OCPP is required. In such cases, the :code:`CbSystem` module is responsible for executing -commands from OCPP e.g. :code:`UpdateFirmware`. - -**OCPP** (`view on GitHub `__) - -This module implements and integrates OCPP 1.6 support within EVerest. - -**OCPP201** (`view on GitHub `__) - -This module implements and integrates OCPP 2.0.1 support within EVerest. - -**AuthListValidator** - -This module validates if an incoming token exists in a predefined list of authorized tokens. diff --git a/includes/firmware_programming.inc b/includes/firmware_programming.inc deleted file mode 100644 index 586b2f9..0000000 --- a/includes/firmware_programming.inc +++ /dev/null @@ -1,342 +0,0 @@ -.. _release_vs_development_images: - -Release Images vs Development Images -------------------------------------- - -There are two types of firmware images available for chargebyte devices: - -- Release images: These images are tested and verified by chargebyte and are recommended for - production use. The image size is optimized for production use and contains only the necessary - components. -- Development images: These images are used for development purposes and are not tested or verified - by chargebyte. They are intended for developers who want to implement and test new features or - applications before they are released. The image size is larger than the release image and - contains additional development tools and libraries that are not necessary for production use. - -.. note:: - Before installation of a chargebyte EVerest image, please check whether you are installing a - developer or release image. In order to update the firmware with a chargebyte EVerest developer - image, the developer key must be set in the :code:`"/etc/rauc"` directory to pass the internal - validation process of the RAUC firmware update mechanism. The image type can be identified by the - file name. - - Depending on the image type, the key must be adapted as follows: - - Change to developer key: - - .. code-block:: bash - - cd /etc/rauc - ln -sf i2se-devel.crt keyring.pem - - Change to release key: - - .. code-block:: bash - - cd /etc/rauc - ln -sf i2se-release.crt keyring.pem - -.. _firmware_update_considerations: - -Firmware Update Considerations ------------------------------- - -During a firmware update, several configuration files and runtime data files are copied over from -the current/active system partition to the partition with the newer/updated system. - -To migrate single configuration keys of a YAML-based EVerest configuration file, chargebyte has -introduced a migration mechanism. This mechanism allows migrating single configuration keys from one -release to another. The migration mechanism is based on Bourne shell scripts (ending in ".sh") which -are placed in the directory :code:`"/usr/libexec/everest/migration.d/"`. These scripts are executed before -the launch of the EVerest stack. Please see the initial scripts in that location for how to ensure -that they only get executed once. - -Since the EVerest configuration allows to configure paths to many configuration files freely, customers -should keep in mind that only the following files and directories are handled automatically during a -firmware update: - -.. list-table:: List of files/directories copied during a firmware update - :header-rows: 1 - - * - File/Directory - - Description - * - file: :code:`/etc/everest/config.yaml` - - EVerest configuration file - * - file: :code:`/etc/everest/ocpp-config.json` - - OCPP 1.6 configuration file - * - directory: :code:`/etc/everest/user-config` - - User specific configuration files. The config file must have the same name as in the parent - directory ("config.yaml"). - * - directory: :code:`/etc/everest/certs` - - Certificates directory, mainly for TLS and Plug&Charge - * - directory: :code:`/var/lib/everest` - - OCPP databases - * - directory: :code:`/etc/systemd/network` - - Network configuration - * - file: :code:`/etc/hostapd/hostapd.conf` - - Hostapd configuration - * - file: :code:`/etc/shadow` - - Copies only the root password - -A complete list of copied files and directories during a firmware update can be found in the -"meta-chargebyte-everest" github repository in the `bundles/core-bundle/post-install.d -`_ -directory. - -.. note:: - Please take special care of the following EVerest module configuration keys, ensuring that they - point to file system locations which are saved as listed above. - - .. list-table:: List of configuration keys pointing to configuration files and directories - :header-rows: 1 - - * - EVerest Module - - Configuration Key - - Recommended Content - * - OCPP - - ChargePointConfigPath - - :code:`/etc/everest/ocpp-config.json` - * - OCPP - - UserConfigPath - - :code:`/var/lib/everest/ocpp16/user-config.json` - * - OCPP - - DatabasePath - - :code:`/var/lib/everest/ocpp16` - * - OCPP201 - - CertsPath - - :code:`/etc/everest/certs` - * - OCPP201 - - CoreDatabasePath - - :code:`/var/lib/everest/ocpp201` - * - OCPP201 - - DeviceModelDatabasePath - - :code:`/var/lib/everest/ocpp201/device_model_storage.db` - -.. note:: - It is assumed that only either OCPP or OCPP201 module is operational at the same time. - -.. note:: - Please note, that in case :code:`/etc/everest/config.yaml` is a symlink, after a firmware update - it is resolved and created as plain file on the updated system. - -.. _rollback_mechanism: - -Rollback Mechanism ------------------- - -The internal storage of chargebyte devices is subdivided into several partitions. This forms a redundant setup with systems A and B, where one system is active and running while the other is inactive. This allows the inactive system to be updated in the background without interrupting the main operation. After a firmware update is performed and the system boots into the new firmware, the previously active system still exists, but is now inactive. It will be used for future firmware updates, and immediately after an update, it serves as a fallback option. This is possible because it can be safely assumed that the previously active system is still in a recent state or at least not in a worse condition than before the firmware update. - -The process of using the previous system as a fallback after a firmware update is called the rollback mechanism. Several software components must work together to provide this feature. The main purpose is to ensure that after a firmware update is installed, all software components run smoothly, even with the restored/retained configuration files of the previous system. - -How it works -^^^^^^^^^^^^ - -As mentioned, the filesystem architecture of chargebyte devices consists of several partitions. During the manufacturing process, two of these partitions are flashed with the same firmware version of the charging software, and both would be bootable per se. After initially starting the board, only the first partition (rootfs A) is activated and used by the bootloader to complete the boot process. When this boot process reaches the point at which it considers itself to be in a known-to-be-good state, it disables the other partition (rootfs B). - -The rollback mechanism is activated only while performing a firmware update on chargebyte devices. After starting the update process, the update image file will be installed to the other, currently deactivated partition. The currently booted rootfs filesystem remains unaffected during the update. As soon as the update is successfully installed, the currently booted partition is deactivated. Depending on the update method used, a reboot may occur immediately, such as during an update from a USB pen drive. The bootloader is then responsible for booting the partition with the new firmware image. After successfully starting the charging software, the rollback mechanism is deactivated, and the charging software is fully operational. - -But in case something went wrong during the update, the boot process will not be marked as successful. In this case, the bootloader will switch back to boot the previous system again. - -As noted, a successfully booted new firmware will disable the rollback mechanism. On the other hand, if the previous system is booted again - and it can be assumed that this system also boots successfully - the previous system will disable the rollback mechanism. Ultimately, the rollback mechanism is automatically disabled after a firmware update is installed or a rollback is performed. In either case, the device operates with functional firmware, providing a stable base for normal operation and future firmware updates. - -However, it is worth mentioning that the partitions are not synchronized. Thus, if one rootfs is customized, such as by integrating custom software applications, the other partition remains unaffected. Only the configuration and certificate files stored in :code:`/etc/everest`, database files stored in :code:`/var/lib/everest` as well as custom network device configurations are migrated during the installation of an update. This point must be especially considered before performing a standard firmware update from chargebyte. In the case of customized file system contents, it is recommended to create a customized firmware image update based on the standard update image. For more information regarding the creation of own firmware image updates please refer to section :ref:`firmware_customization` or contact the chargebyte support. - -Performing the Rollback Mechanism Manually -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -In some situations, e.g., rescuing data of the other partition after a firmware update, it might be necessary to perform a manual rollback to the other partition. - -The chargebyte device uses the RAUC update framework for updating the device with a new firmware version and managing the boot partitions. Before using RAUC command line tool, it is necessary to establish a connection via SSH or Debug UART. After the connection is established, the status of the RAUC managed partitions can be retrieved by using the :code:`rauc status` console command. The following figure shows the console output of the RAUC status command. Here the board was booted from the first partition “rootfs.0” (A). - -.. image:: _static/images/rauc_status.png - :alt: RAUC status - :align: center - -.. raw:: html - -
- Console output of the "rauc status" command -
- -The rollback to the other partition can now be performed by using the command :code:`rauc status mark-active other`. The console output should now look like the following figure. - -.. image:: _static/images/rauc_status_mark_other.png - :alt: RAUC status mark-active - :align: center - -.. raw:: html - -
- Console output of the "rauc status mark-active other" command -
- -After rebooting of the board with command reboot the board should be successfully booted on the other partition. To revert to the initial partition, just repeat this process. - -Development Tools -^^^^^^^^^^^^^^^^^ - -During development it may be useful to access/mount the inactive partition. Then it is required to first determine the inactive partition using rauc command line tool. To simplify things, a helper shell script is included in the firmware which is called :code:`mount-other-rootfs`. It takes one command line argument as parameter, that is, a target directory used as mountpoint for the inactive root filesystem. - -.. code-block:: console - - mount-other-rootfs /mnt - -Note, that this helper script does not modify any RAUC status information regarding this slot. - -.. _programming: - -Programming -=========== - -It is possible for customers to add new programs and software and/or modify configuration files. Customers can then integrate their custom-developed software components using the Yocto Project to create new Linux firmware images. Please refer to our Board Support Package documentation in our public GitHub repository at: https://github.com/chargebyte/chargebyte-bsp for detailed instructions. - -Some general notes and recommendation for custom software development: - -* Develop your customer software on your local PC Linux environment, where you can use a compiler, debugger etc. you are familiar with. If the software you developed does not depend on specific hardware components, you can use the `Software-in-the-Loop `_ (SiL) environment provided by EVerest to test your software. If everything works as expected in this setup, you can then switch to cross-compiling for the target system. -* Using tools like autotools, cmake and pkg-config in your own projects makes the integration and cross-compiling process much easier. Yocto itself has rich support for these widely used tools and provides many examples on how to use them. -* If you start your project from scratch, have a look at libraries which are already required by EVerest Stack and/or Linux distribution. Re-use these libraries to keep the overall firmware footprint small. The benefit is when updating the boards, it will take less time when transferring the firmware update image and flashing it to internal storage. -* You need to determine how your software components will interact with the EVerest stack. You can develop your software as an EVerest module and use one of the EVerest interfaces for interaction. Alternatively, you can utilize the simple MQTT-based API provided by the EVerest '`API `_' module, which gives you access to the EVerest stack internals. Check section :ref:`adding-a-custom-everest-module` to figure out how to create an EVerest module. - -.. _firmware_customization: - -Firmware Update Customization and Signing ------------------------------------------ - -After making sure that the customized software is working on the board, there might be the requirement to pack this with our pre-flashed firmware to create your own firmware update file which should be signed. This facilitates the production process. The following steps illustrate how to create your own signed firmware update image. For this you would need a native Linux machine or a Linux virtual machine which includes the tool "`RAUC `_". RAUC is the framework we use for performing our firmware update. During the steps, the tool will be used to extract our firmware image, re-pack it including your customized software and sign the new firmware update image. Note that you need your own Public Key Infrastructure (PKI) to sign firmware update images later. - -**Steps:** - -#. Download chargebyte's digital certificate found on `our website `_ which is used to validate distributed firmware update images. -#. Use the latest firmware image. How to download the firmware image is described in the section :ref:`download_firmware_images`. -#. Download and install RAUC tool for the host environment; follow the guide here: https://github.com/rauc/rauc/#user-content-prerequisites . It is also possible, that your Linux distribution already ships with pre-compiled packages which just need to be installed with your package management system. In this case, you can skip this step. - - .. code-block:: console - - sudo apt-get install build-essential automake libtool libdbus-1-dev libglib2.0-dev libcurl3-dev libssl-dev libjson-glib-dev - git clone https://github.com/rauc/rauc - cd rauc - ./autogen.sh - ./configure --prefix=/usr - make - sudo make install - cd .. - -#. Create your own PKI if you do not have one already (see https://rauc.readthedocs.io/en/latest/advanced.html#security). -#. Extract the root filesystem image shipped by chargebyte from the firmware update image file. Note that the directory "bundle-staging" will be created, and the content of the firmware update image file will be extracted into it. - - .. code-block:: console - - rauc extract --keyring=.crt .image bundle-staging - - .. note:: - Alternatively, if the above command does not work, you can use the following command: - .. code-block:: console - - unsquashfs -d bundle-staging .image - - But this will not verify the signature of the firmware image. - -#. Mount the ext4 root filesystem image as a loop device. - - .. code-block:: console - - sudo mkdir -p /tmp/rootfs - sudo mount bundle-staging/core-image-minimal-tarragon.ext4 /tmp/rootfs -o loop - -#. Modify and extend the root file system image with your customized software by changing the files/directories below the mountpoint. - - * Install your PKI certificate which is used later during firmware updates to verify your firmware update file. For this step you need to copy your PKI certificate, created in step 4, and place it under :code:`/tmp/rootfs/etc/rauc/`. Then, replace the :code:`/tmp/rootfs/etc/rauc/keyring.pem` symlink with your PKI certificate. - - .. code-block:: console - - cp .crt /tmp/rootfs/etc/rauc/ - cd /tmp/rootfs/etc/rauc/ - ln -sf .crt /tmp/rootfs/etc/rauc/keyring.pem - - * Copy your additional files, software components etc. from your developer board into this corresponding directory below :code:`/tmp/rootfs`. - -#. Unmount the loop device with - - .. code-block:: console - - sudo umount /tmp/rootfs - - -#. Make sure that the customized filesystem is in a clean state. This is important since otherwise, the installation process and/or the production process would fail. - - .. code-block:: console - - fsck.ext4 -f bundle-staging/core-image-minimal-.ext4 - -#. This step only needs to be done, if you want chargebyte to initially flash your own firmware during the manufacturing process of the chargebyte boards. - - Create MD5 hashsum of the file with the following command. This hash is used during production process to ensure that the image file is not altered but installed correctly into flash. Please send us this hash. - - .. code-block:: console - - md5sum bundle-staging/core-image-minimal-.ext4 - -#. Pack your modified root filesystem image into a firmware update file. The firmware update file must be signed with your PKI using the RAUC tool. - - .. code-block:: console - - rauc bundle --keyring=.crt --key=.key --cert=.crt bundle-staging .image - -#. Test the firmware update image file. On the test board, transfer your PKI to the board via SFTP to :code:`/etc/rauc` folder so that the board accepts your firmware updates. The symbolic link refers originally to our chargebyte certificates, so you probably would need to change this. Once finished, the system should be rebooted. - - .. code-block:: console - - cd /etc/rauc - ln -sf .crt /etc/rauc/keyring.pem - reboot - -#. Transfer your newly created firmware update image :code:`.image` via SFTP to :code:`/srv` folder on your test board. -#. Install the image via SSH or debug UART with the command :code:`rauc install /srv/.image`. Wait until the update is installed and reboot the test board. - -Board Customization with USB ----------------------------- - -For easier customization of the boards, such as modifying configuration files or updating to new customized firmware, a USB flash drive can be used. This is a two-step process. In the first step, chargebyte's :code:`/etc/rauc/keyring.pem` is replaced with the customer's CA certificate. This step is also done automatically when you insert a USB flash drive into the board's USB port. In the second step, a script that you need to write is triggered automatically to perform the desired customization on the board. Below is a description of how this feature behaves and the requirements that must be fulfilled for a successful process. - -Replacement of :code:`/etc/rauc/keyring.pem` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -#. Send us your public CA certificate so that we can sign i.e. cross-sign it for you with our certificates. -#. On a USB flash drive, place your cross-signed CA certificate together with the corresponding signature file. The pair has to be named as follows: :code:`fwupdate-keyring.pem` & :code:`fwupdate-keyring.pem.p7s`. You would get this pair from us as a result of step 1. -#. Insert the USB flash drive in the USB port of the board. The following behavior will be triggered automatically: - - #. The onboard yellow diagnostics LED is turned on to indicate the detected USB flash drive. - #. It is checked whether the pair :code:`fwupdate-keyring.pem` and :code:`fwupdate-keyring.pem.p7s` exist on the USB flash drive. - #. It is checked whether :code:`fwupdate-keyring.pem` contains at least one X.509 certificate. - #. It is checked whether the signature of :code:`fwupdate-keyring.pem` is valid against the current certificate found in :code:`/etc/rauc/keyring.pem`. This is originally a symbolic link referring to our CA certificates. Therefore, step 1 is needed. - #. If the verification has succeeded, the current :code:`/etc/rauc/keyring.pem` will be deleted, and the content of :code:`fwupdate-keyring.pem` is saved as new :code:`/etc/rauc/keyring.pem`. From this point in time, this new certificate is active for all later uses, i.e. further customizations but also regular firmware updates. - -Performing Customization through :code:`autorun.sh` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This assumes that the first step has successfully ended, and the file :code:`/etc/rauc/keyring.pem` now contains your CA certificate. However, this will also work later at any time, as long as the CA certificate matches to the script signature. - -#. Write a script that contains the customization you want to do. This has to be named :code:`autorun.sh`. -#. Sign it by your key and certificate. The resulting signature file must be named :code:`autorun.sh.p7s`. -#. Place the key and certificate pair on a USB flash drive and insert it in the USB port of the board. The following behavior will be triggered automatically: - - #. It is checked whether the pair :code:`autorun.sh` and :code:`autorun.sh.p7s` exist on the USB flash drive. - #. It is checked whether the signature of :code:`autorun.sh` is valid against the current certificate found in :code:`/etc/rauc/keyring.pem`. Remember, this now usually contains your CA certificate. - #. If the verification has succeeded, the current working directory is changed to the mount point where the USB flash drive was mounted, and the :code:`autorun.sh` script is executed by means of :code:`/bin/sh`. The changed working directory should make it easier to reference files you want to install from the USB flash drive. - -**Notes** - -* If a :code:`reboot` is called within the :code:`autorun.sh` script, this will not end the execution of the script immediately, but the upcoming lines of the script will continue to be executed until the reboot command is propagated through the system. -* Every time the USB flash drive is inserted or a reboot is performed, a re-execution of the customized :code:`autorun.sh`script will be prevented if it has not been changed. This does not depend on the success of the script, i.e. the return value of the script. This is done by saving the MD5 checksum of :code:`autorun.sh` found on the USB flash drive in the file :code:`/var/cache/usb-autorun/executed.list`. This behavior can be controlled in :code:`autorun.sh` by e.g., removing the :code:`executed.list` file completely or just deleting single MD5 checksums from it. -* Please keep in mind, that certificate verifications are done without time checking since it cannot be ensured that the device has a valid date/time at the moment when you want to use this feature. -* To sign :code:`autorun.sh` and get :code:`autorun.sh.p7s` as a signature file, the following commands can be used - typically on a Linux developer host system: - - .. code-block:: console - - openssl smime -sign -outform DER -binary -inkey .key -signer .crt -in autorun.sh -out autorun.sh.p7s - -* To verify :code:`autorun.sh` against your CA certificate, the following command can be used: - - .. code-block:: console - - openssl smime -verify -no_check_time -inform DER -CAfile .crt -content autorun.sh -in autorun.sh.p7s diff --git a/includes/firmware_upgrade.inc b/includes/firmware_upgrade.inc deleted file mode 100644 index e9b8e0e..0000000 --- a/includes/firmware_upgrade.inc +++ /dev/null @@ -1,99 +0,0 @@ -******** -Firmware -******** - -Introduction to Yocto -===================== - -chargebyte hardware platforms are shipped with pre-flashed firmware including one of the following charging stacks: - -* EVerest charging stack along with platform specific EVerest modules e.g. CbSystem. -* chargebyte's proprietary charging stack (only available for Charge Control C) - -The shipped firmware was created using the Yocto project; an open-source collaboration initiative that provides templates, tools, and methods to help developers create custom Linux-based systems for embedded devices. It supports a wide range of hardware architectures and provides a consistent, reproducible environment for developing, building, and maintaining embedded systems. To get familiar with the Yocto project, you can find all the required information on the project's `website `_. - -.. _firmware_update: - -Firmware Upgrade -================ - -The following sections describe different ways to install a firmware upgrade on your chargebyte product. Please ensure that the power supply is stable during a firmware upgrade. In case of an unsuccessful update or of power loss during the installation of the update, the chargebyte device performs a rollback to the previous stable version of the charging firmware. For more information about the rollback mechanism, see the section :ref:`rollback_mechanism`. The update is finished when the board is rebooted. - -The currently installed firmware version can be checked by reading the content of the file :code:`VERSION` found under :code:`/usr/share/secc`. - -.. _download_firmware_images: - -Download EVerest Firmware Images --------------------------------- - -EVerest firmware images are released by chargebyte on our meta-chargebyte-everest repository, which is the Yocto layer to build the firmware images. -The image files can be found in the `"Release" section `_ of the -repository. Here you can find the latest firmware images and also older released versions. - -.. note:: - - Please read the release notes of the firmware image before downloading and installing it. In the - release notes you can find information about the changes and new features of the firmware image and - also the version information which "everest-core" tag the firmware image is based on. This information - is especially important if you build up your cross-compile environment in section :ref:`cross_compiling`. - Please check that your cross-compile environment is using the same "everest-core" tag as the firmware - image you want to install. - -Device Access -------------- - -There are different possibilities to access the device for configuration or update purposes. Please look at section :ref:`connecting-via-ssh-or-serial-interface` for further details. - -Update via USB --------------- - -**Preparation of the USB update** - -#. Download the firmware update image file onto your workstation. -#. Plug a USB flash drive into your workstation. -#. Format the USB flash drive as EXT2/3/4, FAT16/32, exFAT or NTFS. -#. Copy the firmware update image file (:code:`*.image`) onto the USB flash drive's root directory. - -Please note that you should not place multiple :code:`*.image` files onto the root folder of the USB flash drive, since it is not guaranteed in which order the files are tried and applied. - -**Updating the Firmware** - -#. Connect the board to the power supply. -#. Wait until the board is booted. -#. Connect to the board via SSH or Debug UART to backup all your own implementation, configuration and databases files. -#. Plug in the USB flash drive with the Firmware Update Image file in the USB port of the board. -#. Observe the LED update indications and wait until the whole firmware update and reboot process is finished - it takes up to 5 minutes. -#. When the firmware update process is finished and the USB flash drive can be unplugged. - -Update via SSH and SFTP ------------------------ - -#. Connect to the board via SSH (e.g. PuTTY). -#. Backup all your own implementation, configuration and databases files if necessary. -#. Transfer the update image file via SFTP to the board and store it in the directory :code:`/srv` with e.g. filename my-update.image. On Windows systems you can use e.g. WinSCP or Filezilla. -#. Run the following command via SSH console: :code:`rauc install /srv/my-update.image`. -#. The update process should start and report progress and success via console messages. -#. Reboot into the new system by running the following command via SSH console: :code:`reboot`. -#. Re-login into the new system and delete the file :code:`/srv/my-update.image`. - -Update via SSH or Serial Console and HTTP or FTP ------------------------------------------------- - -#. Connect to the board via SSH (e.g. PuTTY) or serial terminal. -#. Backup all your own implementation, configuration and databases files if necessary. -#. Place the update image file on a HTTP or FTP server which is reachable via network by your chargebyte device. -#. Note the URL of the download. In case authentication is required, you must provide the credentials in the URL, e.g. :code:`http://username:passwd@my-site.com/update.image`. -#. Run the following command via SSH console: :code:`rauc install `, where you replace the URL with your actual URL. -#. The update process should start and report progress and success via console messages. -#. After success, reboot into the new system by running the following command via SSH console: :code:`reboot`. - -Update via OCPP ---------------- - -The firmware update via OCPP commands :code:`UpdateFirmware` and :code:`FirmwareStatusNotification` is implemented. Such an update via OCPP automatically triggers a reboot of the charge point after successfully installing the new firmware. The central system is notified about the successful installation before the reboot of the charge point. - -Support for casync based Firmware Updates ------------------------------------------ -As mentioned in the previous sections, the firmware update mechanism uses `RAUC `_ as update framework. The traditional method of updating a device is that a big firmware update image file is transferred to the device and then installed. However, this approach is sometimes not ideal, for example when during different firmware releases only few parts changed. To address such scenarios, RAUC itself supports casync based bundles. For more details, please refer to RAUC's own documentation: https://rauc.readthedocs.io/en/latest/advanced.html#rauc-casync-support. It is obvious that such kind of firmware updates require an established Internet connection (or a locally available HTTP/FTP server which can be reached by the charging station) - but the concept does not work for USB pen drive firmware updates. - -On casync-enabled chargebyte firmware versions, it is possible to pass a URL referring to a casync firmware update image directly to the RAUC framework via :code:`rauc install `. Please remember that RAUC will use the passed URL to construct a base URL for accessing the smaller chunks. For example the URL :code:`http://example.com/update.raucb` would lead to the assumption that all chunks can be accessed via the base URL :code:`http://example.com/update.castr/`. Note, that the chunk store is a whole directory with many small files inside, not a simple file - the file extension like directory naming might suggest this. diff --git a/includes/troubleshooting_contact.inc b/includes/troubleshooting_contact.inc deleted file mode 100644 index 6ef3911..0000000 --- a/includes/troubleshooting_contact.inc +++ /dev/null @@ -1,33 +0,0 @@ -Contact -------- - -Support -^^^^^^^ - -EVerest is an open-source project with a lot of modules, which is supported by a big community. -chargebyte is an active part of this community. However chargebyte is not able to provide support -for every aspect of EVerest. In order to get quick answers, here are some suggestions: - -Do you have general questions about EVerest, please use the EVerest community's -`Zulip `_. - -Do you have questions about the chargebyte BSP (incl. Yocto), please use -`our support desk `_. - -.. note:: - Before submitting a support request, make sure that all relevant log files have been captured. - The chapter :ref:`logging_and_debugging` describes the debugging options EVerest offers and shows - which logs are relevant for the respective case. - -Address -^^^^^^^ - -chargebyte GmbH - -Bitterfelder Straße 1-5 - -04129 Leipzig - -Germany - -Website: ``_