Skip to content

Commit 15cdfd6

Browse files
authored
Merge pull request #37 from chargebyte/everest/charge_som-add-logging-and-debugging
Charge SOM: Add logging and debugging section
2 parents 546a263 + e8c3625 commit 15cdfd6

5 files changed

+130
-8
lines changed

docs/source/development.rst

+2
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,5 @@ how to checkout a dedicated EVerest release.
109109
110110
#. Follow the steps under the section :ref:`firmware_customization` to install your PKI certificate, pack
111111
the modified root filesystem image again into the firmware update image, and test the new firmware image.
112+
113+
.. include:: ../../includes/development_debugging_and_logging.inc

docs/source/getting_started.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ changes. Just type "systemctl restart everest" to restart the EVerest charging s
178178
start. Therefore, it is recommended to back up the original configuration file before making
179179
changes.
180180

181+
.. _start_charging_and_monitoring:
181182

182183
Starting and Monitoring the Charging Process
183184
--------------------------------------------
@@ -186,7 +187,8 @@ Before we start the first charging session, we shall open the EVerest log to mon
186187
process. The EVerest log is stored in the systemd journal and can be accessed via the journalctl
187188
command. The journalctl command provides a lot of options to filter the log messages.
188189
Now just type "journalctl -f -u everest -n 50" to see the last 50 log messages of the EVerest
189-
charging stack and to follow the charging process in real time.
190+
charging stack and to follow the charging process in real time. For more information about the
191+
EVerest log, see the :ref:`logging_and_debugging` chapter.
190192

191193
The EVerest log should look like this:
192194

docs/source/troubleshooting.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Frequently Asked Questions
1313
Is it possible to use the Charge SOM as an EV simulator?
1414
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515

16-
No, the Control Pilot interface on Charge SOM is not able to operate as an EV. Please look at
17-
our `website <https://www.chargebyte.com/>`_ for more suitable products.
16+
The Charge SOM hardware is not designed to be used as an EV simulator. Please refer to our
17+
`website <https://www.chargebyte.com/>`_ for more suitable products.
1818

1919

2020
I want to control EVerest via CAN, how can I achieve this?
2121
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222

23-
Currently there is no such EVerest module available, you will need to implement it on your own. But
23+
Currently, there is no such EVerest module available, you will need to implement it on your own. But
2424
at least there is a `module <https://github.com/EVerest/everest-core/tree/main/modules/DPM1000>`_
2525
and a `library <https://github.com/EVerest/everest-core/tree/main/lib/staging/can_dpm1000>`_,
2626
which uses the CAN interface.
@@ -29,15 +29,15 @@ which uses the CAN interface.
2929
How can I access the EVerest admin panel on Charge SOM?
3030
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131

32-
The Charge SOM doesn't have an `EVerest admin panel <https://github.com/EVerest/everest-admin-panel>`_
33-
because of its limited resources. Please use your development environment to set up your configuration
34-
file or just use a plain text editor.
32+
Currently, the Charge SOM does not have integrated the `EVerest admin panel <https://github.com/EVerest/everest-admin-panel>`_
33+
Please use your development environment to set up your configuration file. Alternatively, you can use a plain text
34+
editor.
3535

3636

3737
Does EVerest on Charge SOM support ISO 15118-20 yet?
3838
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3939

40-
The required module for ISO 15118-20 has been included in the image since the chargebyte EVerest 0.2.0 release.
40+
The required module for ISO 15118-20 has been included in the image since the Charge SOM EVerest release 0.2.0.
4141
Please note that the implementation is still under development.
4242

4343

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
.. _logging_and_debugging:
2+
3+
Logging and Debugging
4+
=====================
5+
6+
There are different ways to analyze the EVerest charging software. In the following, different
7+
ways are described. In preparation for starting this chapter, it is necessary to be connected to the board
8+
via Ethernet. This is also necessary to copy logs and traces from the board to the local PC via a SFTP
9+
tool like `WinSCP <https://winscp.net/eng/download.php>`_ or `FileZilla <https://filezilla-project.org/>`_.
10+
11+
journalctl logs
12+
---------------
13+
As already described in the :ref:`start_charging_and_monitoring` section, the EVerest framework uses
14+
journalctl for logging. journalctl is a system service that collects and stores logging data.
15+
To view the logs, connect to the charge controller via SSH and run the following command:
16+
17+
.. code-block:: console
18+
19+
journalctl -f -n 100 -u everest
20+
21+
The -f flag is used to follow the logs live, and the -n flag is used to view the last 100 lines.
22+
The -u flag is used to filter the logs for the everest service. To stop following the logs, press :code:`Ctrl + C`.
23+
24+
The logs are stored by the systemd journal service in a binary format in
25+
"/var/log/journal". To open the binary in a human-readable format, use the following command:
26+
27+
.. code-block:: console
28+
29+
journalctl -u everest --file /path/to/your/file.journal
30+
31+
As shown in the :ref:`start_charging_and_monitoring` section, a log line consists, among other things,
32+
of a timestamp, a log level, a module id, a module name, and a message. The log level can be one of the following:
33+
34+
- "VERB" (Verbose)
35+
- "DEBG" (Debug)
36+
- "INFO" (Information)
37+
- "WARN" (Warning)
38+
- "ERRO" (Error)
39+
- "CRIT" (Critical)
40+
41+
The log level can be configured for each EVerest module separately in the logging configuration file.
42+
The logging configuration file is located at "/etc/everest/default_logging.cfg". The filter can be configured
43+
using the log level and the module identifier as defined in the EVerest configuration.
44+
Here is an example to configure the message filter to change the log level of the EvseManager module
45+
to DEBUG:
46+
47+
.. code-block:: console
48+
49+
# The filter expression consists of two parts:
50+
# 1. Logs with severity level INFO or higher (affects all EVerest modules).
51+
# 2. Logs from the EvseManager with module id "connector" with severity level DEBUG or higher.
52+
Filter="(%Severity% >= INFO) or (%Process% contains connector and %Severity% >= DEBG)"
53+
54+
pcap traces
55+
-----------
56+
pcap traces can be used to debug and analyze the high-level communication (HLC) between SECC and EVCC.
57+
In general, there are two ways to capture pcap traces:
58+
59+
#. Capture via tcpdump command
60+
61+
.. code-block:: console
62+
63+
tcpdump -i eth1 -w /srv/charge_com_01.pcap
64+
65+
This command captures all packets on the eth1 (PLC) interface and writes them to
66+
a pcap file. Stop the capture by pressing :code:`Ctrl + C`.
67+
68+
.. note::
69+
Please stop the trace before copying the file to a local machine. The file may be incomplete if
70+
copied while the tcpdump is still running.
71+
72+
#. Using the EVerest "PacketSniffer" module
73+
74+
The `PacketSniffer <https://github.com/EVerest/everest-core/tree/main/modules/PacketSniffer>`_ module
75+
is part of everest-core and can be used to capture pcap traces automatically. Please look into
76+
the module manifest to see how to configure the PacketSniffer module.
77+
78+
pcap traces with V2G communication can be analyzed using Wireshark with a V2G plugin like from `dSPACE <https://www.dspace.com/en/pub/home/news/wireshark-charging-plug-in.cfm>`_.
79+
80+
.. note::
81+
TLS encrypted communication cannot be analyzed with Wireshark without the TLS session key. Please
82+
look in the module manifest which is responsible for the TLS handshake and check if there is an option
83+
to export the TLS session key. E.g. the `IsoMux module <https://github.com/EVerest/everest-core/blob/main/modules/IsoMux/manifest.yaml>`_
84+
is able to export the TLS session key.
85+
86+
Session logging of the EVSEManager
87+
----------------------------------
88+
The EVerest "EVSEManager" can generate session log files with information about the current session state,
89+
configured CP state and duty cycle. It can also decode and log the content of the V2G messages.
90+
Please look into the module manifest to see how to configure the EVSEManager module to activate session logging.
91+
92+
.. note::
93+
The session logging is pretty performance intensive and should only be used for debugging purposes.
94+
95+
MQTT logs
96+
---------
97+
It is also possible to observe the internal MQTT communication between the EVerest modules.
98+
When developing new modules, this can be helpful to better understand the internal processes regarding
99+
the use of the interfaces.
100+
We recommend using the `MQTT Explorer <https://mqtt-explorer.com/>`_ tool to monitor and analyze the MQTT communication.
101+
It is also possible to use the following command to monitor the MQTT communication, but this is not so easy to read:
102+
103+
.. code-block:: console
104+
105+
mosquitto_sub -F "[@H:@M:@S.@N] %t %p" -t 'everest/#' -t 'everest_api/#' > /srv/charge_com_mqtt_01.log
106+
107+
Summary
108+
-------
109+
There are several ways to debug and analyze the EVerest framework. Which way to choose depends on the
110+
specific use case and the information needed. The most common way is using journalctl logs. If it is
111+
necessary to analyze the high-level communication between SECC and EVCC, pcap traces are the best choice.
112+
If it is not clear how the internal communication between the EVerest modules works, the MQTT logs can
113+
be helpful.

includes/troubleshooting_contact.inc

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Do you have general questions about EVerest, please use the EVerest community's
1414
Do you have questions about the chargebyte BSP (incl. Yocto), please use
1515
`our support desk <https://chargebyte.atlassian.net/servicedesk/customer/portal/13>`_.
1616

17+
.. note::
18+
Before submitting a support request, make sure that all relevant log files have been captured.
19+
The chapter :ref:`logging_and_debugging` describes the debugging options EVerest offers and shows
20+
which logs are relevant for the respective case.
21+
1722
Address
1823
^^^^^^^
1924

0 commit comments

Comments
 (0)