Giter Site home page Giter Site logo

pyslac's Introduction

SLAC

Python Implementation of the SLAC Protocol as specified by ISO15118-3 1

How to test it and fire it up 🔥

The project depends on an installation of slac as a module in the user environment. Dependencies management is handled by Poetry.

Dependencies:

  • Poetry 2
  • Python >= 3.9

The project presents examples of how to spin up the SLAC session, for one or multiple EVSEs which are associated with a specific network interface. The SlacSession class defined in slac/session.py expects the evse id and the network interface as arguments, this because SLAC requires to bind to a network interface. To ease the passing of these arguments, a json file named cs_configuration.json includes a configuration example containing the EVSE id and the network interface for two EVSEs:

{
  "number_of_evses": 2,
  "parameters": [
	{"evse_id": "DE*SWT*E123456789",
	  "network_interface": "eth0"
	},
	{"evse_id": "DE*SWT*E5131456589",
	  "network_interface": "eth1"
	}
  ]
}

There are two ways of running the examples:

  1. Building and running the docker file will run the single_slac_session.py:

    $ make build
    $ make dev
  2. Installing the module using poetry and running one of the examples, which steps are compiled with the help of the Makefile:

    $ make install-local
    $ make run-local-single

Both the single and multiple session examples have the same structure:

class SlacHandler(SlacSessionController):
    def __init__(self, slac_config: Config):
        SlacSessionController.__init__(self)
        self.slac_config = slac_config
        self.running_sessions: List["SlacEvseSession"] = []

    async def start(self, cs_config: dict):
        while not self.running_sessions:
            if cs_config["number_of_evses"] < 1 or (
                len(cs_config["parameters"]) != cs_config["number_of_evses"]
            ):
                raise AttributeError("Number of evses provided is invalid.")

            evse_params: dict = cs_config["parameters"][0]
            evse_id: str = evse_params["evse_id"]
            network_interface: str = evse_params["network_interface"]
            try:
                slac_session = SlacEvseSession(
                    evse_id, network_interface, self.slac_config
                )
                await slac_session.evse_set_key()
                self.running_sessions.append(slac_session)
            except (OSError, TimeoutError, ValueError) as e:
                logger.error(
                    f"PLC chip initialization failed for "
                    f"EVSE {evse_id}, interface "
                    f"{network_interface}: {e}. \n"
                    f"Please check your settings."
                )
                return
        await self.process_cp_state(self.running_sessions[0], "B")
        await asyncio.sleep(2)
        await self.process_cp_state(self.running_sessions[0], "C")
        await asyncio.sleep(20)
        await self.process_cp_state(self.running_sessions[0], "A")

Both start by attempting to create a SlacEvseSession for each evse, which network interface is defined in the cs_config dictionary. If, for example, the network interface defined does not exist, the system will raise an error and exit.

Both define a class named SlacHandler, which inherits from SlacSessionController. The SlacSessionController has two main methods process_cp_state and start_matching. The process_cp_state is a handler for the state change of the Control Pilot circuit and based on a state transition from "A, E or F" to "B, C or D", the start_matching is spawned as an asyncio task. Is that task that handles the SLAC matching process and that ultimately succeeds or fails the attempt.

That task includes calls to two stub methods notify_matching_ongoing and notify_matching_failed, which can be used by the end user to notify other services of the current SLAC matching state ("ongoing" or "failed"). This can be useful for the use case defined in ISO 15118-3, section 7, where different strategies need to be carried on, depending on if SLAC matching has started after or before EIM authentication was completed.

The example is a very raw way to trigger the matching process and does not represent a real production scenario. In a more realistic scenario, the user may use any way to communicate the Control Pilot state to SLAC, e.g., using MQTT or RabbitMQ as message brokers.

In that case, the user would have some external service monitoring the Control Pilot state, which would send the state to the SLAC application. The Slac Handler would then await, listening for the Control Pilot state notification and upon its reception, would call the process_cp_state, which in its turn would spawn a matching process task.

Environmental Settings

The project also includes a few general configuration variables, whose default values can be modified by setting them as environmental variables.

The following table provides a few of the available variables:

ENV Default Value Description
SLAC_INIT_TIMEOUT 50 Timeout[s] for the reception of the first slac message after state B detection
ATTEN_RESULTS_TIMEOUT None Timeout[ms] for the reception of all the MNBC sounds. When not set, the system uses the timeout defined by the EV
LOG_LEVEL INFO Level of the Python log service

These env variables, can be modified using .env files, which this project includes, in the root directory, for different purposes:

  • .env.dev.docker - ENV file with development settings, tailored to be used with docker
  • .env.dev.local - ENV file with development settings, tailored to be used with the local host

If the user runs the project locally, e.g. using $ make install-local && make run-local-single, the system will look for a .env file, containing the required settings.

This means, if development settings are desired, one can simply copy the contents of .env.dev.local to .env.

If Docker is used, the command make run will try to get the .env file; The command make dev will fetch the contents of .env.dev.docker - thus, in this case, the user does not need to create a .env file, as Docker will automatically fetch the .env.dev.docker one.

The key-value pairs defined in the .env file directly affect the settings present in slac/environment.py.

Any of those variables can also be set by exporting their value in the env:

$ export LOG_LEVEL=DEBUG

Known Issues and Limitation

  1. make run-local-single may not work in your system

    SLAC requires the use of Level 2 frames, as so, the app requires low level access to the socket interface. Such level of access is only attained with root privileges, so if the user group that your system is using does not have root privileges, the app will fail to run.

    In order to run the app with root privileges, try the following command, instead: $ make run-local-sudo-single

Integration Test with an EV SLAC Simulator

The EVSE SLAC code can be tested against the EV counterpart. For convenience, a simple EV SLAC version was programmed using scapy. The code is located under the folder examples/ev_slac_scapy.py and contains all the necessary SLAC messages as well the right and expected sequence of messages that must be sent to the EVSE to complete SLAC. This code doesn't perform any check on the payloads received, thus is not a complete bullet-proof test system.

To start the test, you may need root privileges and to start in the following order:

$ sudo $(shell which python) pyslac/examples/single_slac_session.py
$ sudo $(shell which python) pyslac/examples/ev_slac_scapy.py

This integration test was tested under:

  • Linux - Ubuntu and Debian distros

License

Copyright 2022 Switch

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Footnotes

  1. https://www.iso.org/standard/59675.html

  2. https://python-poetry.org/docs/#installation

pyslac's People

Contributors

mdwcrft avatar santiagosalamandri avatar tropxy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyslac's Issues

pyslac ModuleNotFoundError

root@ubuntu-linux-20-04-desktop:~/pyslac# make run-local-single
python pyslac/examples/single_slac_session.py
Traceback (most recent call last):
File "/root/pyslac/pyslac/examples/single_slac_session.py", line 1, in
from pyslac.utils import is_distro_linux
ModuleNotFoundError: No module named 'pyslac'
make: *** [Makefile:65: run-local-single] Error 1

Check if we are compliant

In a cable plug-out and plug-in event, where no new SLAC process was started, section A.9.7 of 15118-3 mentions the following about Leaving the logical network:
[V2G3-A09-121]: the low-layer communication module shall leave the logical network, reset the NMK and switch to matching state 'Unmatched'.
By resetting the NMK, the next cable plug-in will likely result in a new SLAC process as this will make sure the EV properly detects no existing logical network anymore.

`make build` fails with flake8 related errors.

make build fails.

make build                                                                                                                                                                                                      master ✱
/bin/sh: 1: pip: not found
/bin/sh: 1: pip: not found
docker-compose build
[+] Building 1.4s (16/20)                                                                                                                                                                                               docker:default
 => [slac internal] load .dockerignore                                                                                                                                                                                            0.0s
 => => transferring context: 2B                                                                                                                                                                                                   0.0s
 => [slac internal] load build definition from Dockerfile                                                                                                                                                                         0.0s
 => => transferring dockerfile: 2.00kB                                                                                                                                                                                            0.0s
 => [slac internal] load metadata for docker.io/library/python:3.10.0-buster                                                                                                                                                      0.7s
 => [slac build  1/12] FROM docker.io/library/python:3.10.0-buster@sha256:bb76a025d1ba1820c33197637d21484e439347cb18c59d1858f06425d0a3b403                                                                                        0.0s
 => [slac internal] load build context                                                                                                                                                                                            0.1s
 => => transferring context: 297.27kB                                                                                                                                                                                             0.1s
 => CACHED [slac build  2/12] WORKDIR /usr/src/app                                                                                                                                                                                0.0s
 => CACHED [slac stage-1 3/6] RUN python -m venv /venv                                                                                                                                                                            0.0s
 => CACHED [slac build  3/12] RUN pip install "poetry==1.6"                                                                                                                                                                       0.0s
 => CACHED [slac build  4/12] RUN poetry config virtualenvs.create false                                                                                                                                                          0.0s
 => CACHED [slac build  5/12] COPY .coveragerc pyproject.toml poetry.lock ./                                                                                                                                                      0.0s
 => CACHED [slac build  6/12] RUN poetry update -vvvvv                                                                                                                                                                            0.0s
 => CACHED [slac build  7/12] COPY . ./                                                                                                                                                                                           0.0s
 => CACHED [slac build  8/12] RUN mv .env.dev.docker .env                                                                                                                                                                         0.0s
 => CACHED [slac build  9/12] RUN poetry install --no-interaction --no-ansi                                                                                                                                                       0.0s
 => CACHED [slac build 10/12] RUN pytest -vv --cov-config .coveragerc --cov-report term-missing  --durations=3 --cov=.                                                                                                            0.0s
 => ERROR [slac build 11/12] RUN flake8 --config .flake8 pyslac tests 
 => ERROR [slac build 11/12] RUN flake8 --config .flake8 pyslac tests                                                                                                                                                             0.6s
------
 > [slac build 11/12] RUN flake8 --config .flake8 pyslac tests:
0.540 pyslac/session.py:925:89: E501 line too long (105 > 88 characters)
0.540 pyslac/session.py:939:89: E501 line too long (136 > 88 characters)
------
failed to solve: process "/bin/sh -c flake8 --config .flake8 pyslac tests" did not complete successfully: exit code: 1

`make dev` fails with `SetKey Timeout`.

Running make dev fails with a SetKey Timeout.

pyslac-slac-1  | DEBUG:asyncio:Using selector: EpollSelector
pyslac-slac-1  | INFO:slac_session:
pyslac-slac-1  |
pyslac-slac-1  | #################################################
pyslac-slac-1  |  ###### Starting PySlac version: 0.8.3 #######
pyslac-slac-1  | #################################################
pyslac-slac-1  |
pyslac-slac-1  |
pyslac-slac-1  | DEBUG:slac_session:Session created for evse_id DE*SWT*E123456789 on interface eth0
pyslac-slac-1  | INFO:slac_session:CM_SET_KEY: Started...
pyslac-slac-1  | DEBUG:slac_session:New NMK: b'3cac08b812cab1e1d71cf8c8056539bc'
pyslac-slac-1  | DEBUG:slac_session:New NID: b'db55c016546d05'
pyslac-slac-1  | ERROR:/venv/lib/python3.10/site-packages/pyslac/examples/single_slac_session.py:PLC chip initialization failed for EVSE DE*SWT*E123456789, interface eth0: SetKey Timeout raised.
pyslac-slac-1  | Please check your settings.

The SlacSessionController operators on the network interfaces as defined in pyslac/examples/cs_configuration.json. The defaults are eth0 and eth1.

The issue issue two fold:

  1. Interface eth0 doesn't exists in my Docker container. Instead, the interface name follows the format eth0@<number>. For example eth0@127. The <number> is not predictable.
  2. The Docker container doesn't have an eth1 interface.

I suggest to change the defaults from eth0 and eth1 to lo, that's the loop back interface. Now make dev is executed without any issues.

MyPy type errors

Running MyPy through poetry gives the following output:

poetry run mypy --config-file pyproject.toml pyslac tests
pyslac/messages.py:159: error: Module "ctypes" is not valid as a type
pyslac/messages.py:175: error: Value of type ctypes? is not indexable
pyslac/messages.py:176: error: Value of type ctypes? is not indexable
pyslac/messages.py:177: error: Value of type ctypes? is not indexable
pyslac/messages.py:178: error: Value of type ctypes? is not indexable
pyslac/messages.py:179: error: Value of type ctypes? is not indexable
pyslac/messages.py:180: error: Value of type ctypes? is not indexable
pyslac/messages.py:181: error: Value of type ctypes? is not indexable
pyslac/messages.py:237: error: Module "ctypes" is not valid as a type
pyslac/messages.py:239: error: Value of type ctypes? is not indexable
pyslac/messages.py:240: error: Value of type ctypes? is not indexable
pyslac/messages.py:241: error: Value of type ctypes? is not indexable
pyslac/messages.py:338: error: Module "ctypes" is not valid as a type
pyslac/messages.py:341: error: Value of type ctypes? is not indexable
pyslac/messages.py:342: error: Value of type ctypes? is not indexable
pyslac/messages.py:343: error: Value of type ctypes? is not indexable
pyslac/messages.py:344: error: Value of type ctypes? is not indexable
pyslac/messages.py:345: error: Value of type ctypes? is not indexable
pyslac/messages.py:346: error: Value of type ctypes? is not indexable
pyslac/messages.py:347: error: Value of type ctypes? is not indexable
pyslac/messages.py:348: error: Value of type ctypes? is not indexable
pyslac/messages.py:423: error: Module "ctypes" is not valid as a type
pyslac/messages.py:425: error: Value of type ctypes? is not indexable
pyslac/messages.py:426: error: Value of type ctypes? is not indexable
pyslac/messages.py:427: error: Value of type ctypes? is not indexable
pyslac/messages.py:428: error: Value of type ctypes? is not indexable
pyslac/messages.py:429: error: Value of type ctypes? is not indexable
pyslac/messages.py:430: error: Value of type ctypes? is not indexable
pyslac/messages.py:431: error: Value of type ctypes? is not indexable
pyslac/messages.py:508: error: Module "ctypes" is not valid as a type
pyslac/messages.py:510: error: Value of type ctypes? is not indexable
pyslac/messages.py:511: error: Value of type ctypes? is not indexable
pyslac/messages.py:512: error: Value of type ctypes? is not indexable
pyslac/messages.py:513: error: Value of type ctypes? is not indexable
pyslac/messages.py:514: error: Value of type ctypes? is not indexable
pyslac/messages.py:515: error: Value of type ctypes? is not indexable
pyslac/messages.py:516: error: Value of type ctypes? is not indexable
pyslac/messages.py:578: error: Module "ctypes" is not valid as a type
pyslac/messages.py:579: error: Value of type ctypes? is not indexable
pyslac/messages.py:581: error: Value of type ctypes? is not indexable
pyslac/messages.py:583: error: Value of type ctypes? is not indexable
pyslac/messages.py:584: error: Value of type ctypes? is not indexable
pyslac/messages.py:671: error: Module "ctypes" is not valid as a type
pyslac/messages.py:672: error: Value of type ctypes? is not indexable
pyslac/messages.py:674: error: Value of type ctypes? is not indexable
pyslac/messages.py:675: error: Value of type ctypes? is not indexable
pyslac/messages.py:676: error: Value of type ctypes? is not indexable
pyslac/messages.py:677: error: Value of type ctypes? is not indexable
pyslac/messages.py:678: error: Value of type ctypes? is not indexable
pyslac/messages.py:679: error: Value of type ctypes? is not indexable
pyslac/messages.py:680: error: Value of type ctypes? is not indexable
pyslac/messages.py:682: error: Value of type ctypes? is not indexable
pyslac/messages.py:760: error: Module "ctypes" is not valid as a type
pyslac/messages.py:762: error: Value of type ctypes? is not indexable
pyslac/messages.py:763: error: Value of type ctypes? is not indexable
pyslac/messages.py:764: error: Value of type ctypes? is not indexable
pyslac/messages.py:765: error: Value of type ctypes? is not indexable
pyslac/messages.py:766: error: Value of type ctypes? is not indexable
pyslac/messages.py:767: error: Value of type ctypes? is not indexable
pyslac/messages.py:768: error: Value of type ctypes? is not indexable
pyslac/messages.py:846: error: Module "ctypes" is not valid as a type
pyslac/messages.py:848: error: Value of type ctypes? is not indexable
pyslac/messages.py:849: error: Value of type ctypes? is not indexable
pyslac/messages.py:850: error: Value of type ctypes? is not indexable
pyslac/messages.py:851: error: Value of type ctypes? is not indexable
pyslac/messages.py:852: error: Value of type ctypes? is not indexable
pyslac/messages.py:853: error: Value of type ctypes? is not indexable
pyslac/messages.py:854: error: Value of type ctypes? is not indexable
pyslac/messages.py:855: error: Value of type ctypes? is not indexable
pyslac/messages.py:856: error: Value of type ctypes? is not indexable
pyslac/messages.py:951: error: Module "ctypes" is not valid as a type
pyslac/messages.py:953: error: Value of type ctypes? is not indexable
pyslac/messages.py:954: error: Value of type ctypes? is not indexable
pyslac/messages.py:955: error: Value of type ctypes? is not indexable
pyslac/messages.py:956: error: Value of type ctypes? is not indexable
pyslac/messages.py:957: error: Value of type ctypes? is not indexable
pyslac/messages.py:958: error: Value of type ctypes? is not indexable
pyslac/messages.py:959: error: Value of type ctypes? is not indexable
pyslac/messages.py:960: error: Value of type ctypes? is not indexable
pyslac/messages.py:961: error: Value of type ctypes? is not indexable
pyslac/messages.py:962: error: Value of type ctypes? is not indexable
pyslac/messages.py:963: error: Value of type ctypes? is not indexable
pyslac/messages.py:964: error: Value of type ctypes? is not indexable
pyslac/utils.py:204: error: Incompatible types in assignment (expression has type "Task[Any]", variable has type "Coroutine[Any, Any, Any]")
pyslac/utils.py:209: error: Incompatible types in assignment (expression has type "Task[Any]", variable has type "Coroutine[Any, Any, Any]")
pyslac/utils.py:212: error: Incompatible types in assignment (expression has type "Task[Any]", variable has type "Coroutine[Any, Any, Any]")
pyslac/utils.py:214: error: "Coroutine[Any, Any, Any]" has no attribute "result"
pyslac/sockets/async_linux_socket.py:6: error: Module "socket" has no attribute "AF_PACKET"
pyslac/session.py:164: error: Bracketed expression "[...]" is not valid as a type
pyslac/session.py:164: note: Did you mean "List[...]"?
pyslac/session.py:182: error: Incompatible types in assignment (expression has type "float", variable has type "int")
pyslac/session.py:475: error: Missing return statement
pyslac/session.py:496: error: On Python 3 formatting "b'abc'" with "{}" produces "b'abc'", not "abc"; use "{!r}" if this is desired behavior
pyslac/session.py:677: error: Assignment to variable "e" outside except: block
pyslac/session.py:686: error: Assignment to variable "e" outside except: block
pyslac/session.py:729: error: On Python 3 formatting "b'abc'" with "{}" produces "b'abc'", not "abc"; use "{!r}" if this is desired behavior
pyslac/session.py:815: error: Value of type "Coroutine[Any, Any, Any]" is not indexable
Found 96 errors in 4 files (checked 18 source files)

This isn't currently run within the GitHub actions. The issues should be fixed and then MyPy added to the PR GHA flow.

EV simulator support

I'm going to design an EV simulator.
iso155118 looks support both EV and SECC sides, pyslac looks tailored for SECC (based on available docs).

Is it possible to use pyslac for implement EV simulator?

Workflow 'code-quality-check' fails during set up.

The workflow 'code-quality-check' fails while configuring the runner:

Run actions/setup-python@v2
Version 3.10.0 was not found in the local cache
Error: Version 3.10.0 with arch x64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

See https://github.com/SwitchEV/pyslac/actions/runs/6096941630/job/16543788145

This job uses runner ubuntu-latest which refers to Ubuntu 22.04. This runner has Python 3.10.12 installed by default, not Python 3.10.0.

`make dev` fails `EnvValidationError`

Executing make dev runs pyslac/examples/single_slac_session.py. Starting this script fails with:

pyslac-slac-1  | DEBUG:asyncio:Using selector: EpollSelector
pyslac-slac-1  | Traceback (most recent call last):
pyslac-slac-1  |   File "/venv/lib/python3.10/site-packages/pyslac/examples/single_slac_session.py", line 92, in <module>
pyslac-slac-1  |     run()
pyslac-slac-1  |   File "/venv/lib/python3.10/site-packages/pyslac/examples/single_slac_session.py", line 88, in run
pyslac-slac-1  |     asyncio.run(main())
pyslac-slac-1  |   File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
pyslac-slac-1  |     return loop.run_until_complete(main)
pyslac-slac-1  |   File "/usr/local/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
pyslac-slac-1  |     return future.result()
pyslac-slac-1  |   File "/venv/lib/python3.10/site-packages/pyslac/examples/single_slac_session.py", line 77, in main
pyslac-slac-1  |     slac_config.load_envs(env_path)
pyslac-slac-1  |   File "/venv/lib/python3.10/site-packages/pyslac/environment.py", line 47, in load_envs
pyslac-slac-1  |     env.seal()  # raise all errors at once, if any
pyslac-slac-1  |   File "/venv/lib/python3.10/site-packages/environs/__init__.py", line 447, in seal
pyslac-slac-1  |     raise EnvValidationError(f"Environment variables invalid: {error_messages}", error_messages)
pyslac-slac-1  | environs.EnvValidationError: Environment variables invalid: {'ATTEN_RESULTS_TIMEOUT': ['Must be less than or equal to 1050.']}

Unable to process unexpected `CM_SLAC_PARM` message

According to the spec, at any point in time, if a CM_SLAC_PARM.REQ is received, the application must interpret it as a reset of the Slac process and process the Slac parameter message (this means a reset of the state machine).

The issue is that with the current code, the application is unable to jump to a state where processes the slac parm request and continues with the rest of the flow. This is a design flaw and requires refactoring.

A state design pattern may be the best fit for the job:

Autocharge MAC EVSE ID extraction (plcstat)

AB#1525 AB#1526

For Autocharge it is possible to extract the PLC unique MAC Address from the EV, which is useful for Autocharge use case

Menno's answer:

Hi @André Duarte as mentioned during the meeting, below is the info I added to our ticket to retrieve the EV PLC node MAC address. I will also add a Wireshark trace.
Quote from ticket:
Even though the EV PLC node MAC address is not present in the high-level communication, there is a method to retrieve it. This is only possible though after SLAC matching has succeeded, because it uses specific messages defined in the HomePlug standard to retrieve the network configuration.
In open-plc-utils (the QCA reference implementation) there are two commands:

$ plcstat -t -i vensb1
 P/L NET TEI ------ MAC ------ ------ BDA ------  TX  RX CHIPSET FIRMWARE
 LOC CCO 001 00:01:87:10:A1:C0 DE:8F:A8:F8:30:76 n/a n/a QCA7000 MAC-QCA7000-1.2.5.3207-00-20180927-CS
 REM STA 002 02:26:00:00:00:22 FF:FF:FF:FF:FF:FF 009 009 QCA7000 MAC-QCA7005-1.2.5.3207-00-20180927-CS
and
plctool -m -i vensb1
vensb1 00:B0:52:00:00:01 Fetch Network Information
vensb1 00:01:87:10:A1:C0 Found 1 Network(s)
source address = 00:01:87:10:A1:C0
network->NID = 76:DE:7D:2E:84:D4:00
network->SNID = 13
network->TEI = 1
network->ROLE = 0x02 (CCO)
network->CCO_DA = 00:01:87:10:A1:C0
network->CCO_TEI = 1
network->STATIONS = 1
	station->MAC = 02:26:00:00:00:22
	station->TEI = 2
	station->BDA = FF:FF:FF:FF:FF:FF
	station->AvgPHYDR_TX = 009 mbps Primary
	station->AvgPHYDR_RX = 009 mbps Primary

which both reveal that 02:26:00:00:00:22 is the EV PLC node MAC address.
The underlying HomePlug message that can be used to retrieve the logical network information is NW_INFO.REQ. If the EVSECC sends that request to the generic HomePlug destination MAC 00:b0:52:00:00:01, the EVSE PLC node will return the network information with connected stations, including the MAC address.
Clearly, this only works after the logical network is formed, so SLAC must complete first.

Verisco_network_info.pcapng.txt

evse_id value

Hello and thank you for you work.
I am testing the iso15118 repo using this QCA7000 board (evse mode - model 2) with RaspberryPi 4b
https://www.aliexpress.com/item/1005003956180603.html?gatewayAdapt=Msite2Pc

I am trying to setup your software in SECC mode.
I have been able to get the ISO15118 module run up and now i am trying the pyslac module run up.

I get this message when i try to start a SLAC session (with out a car connected and without the 5% duty cycle running).
This is just the first run up to test if i implemented the software properly on the Rasp. Pi.

"
mark@raspberrypi:~/myprogs/iso15118/pyslac $ python pyslac/examples/single_slac_session.py
DEBUG:asyncio:Using selector: EpollSelector
INFO:slac_session:

#################################################

Starting PySlac version: 0.8.3

#################################################

DEBUG:slac_session:Session created for evse_id DESWTE5131456589 on interface eth1
ERROR:/home/mark/myprogs/iso15118/pyslac/pyslac/examples/single_slac_session.py:PLC chip initialization failed for EVSE DESWTE5131456589, interface eth1: [Errno 1] Operation not permitted.
Please check your settings.
"

The setting "evse_id": "DESWTE5131456589" in cs_configuration.json is wrong for me.
I have one ethernet port (eth1) used for the QCA7000 communications and so i deleted the second port (eth0) in the cs_configuration file.
Given the above message, i am not sure how to find what the evse_id should be for my hardware.
I was able to connect this same hardware using a different Repo to this one and it worked fine through the SLAC phase.
I didn't have to specify an evse_id for that other approach and i am wondering if you are able to help me determine what it should be for my hardware in this case.

Endianness of MVF Length in CM_SLAC_MATCH.CNF

Hi everyone,

In the MatchCnf class, it is stated that:

MVF is sent in little endian

I checked the Din SPEC 70121 and ISO 15118-3 documents, and I could not find such a thing. Have I missed something? Is there any
other document you can refer me to for that?

Pause Communication

The EV can request a Pause of the communication by sending and PowerDeliveryReq to Stop charging and a StopSession Req with ChargingSession = "Pause".

According to this requirement:

7.6.1 Entering the sleep mode
[V2G3-M07-20] - With receiving D-LINK_Pause.request, the EVSE shall switch to state X1 and may switch the low-layer communication module into low-power mode. The logical network parameter set shall be stored for continuing the data link after the sleeping phase.

[V2G3-M07-22] -  If the EVSE or EV is in “Matched state” and has been woken up from the counter-part station, the low-layer communication module shall be configured to the last known logical network parameter set

iso15118 shall send a message to the application that controls the CP requesting the PWM to be turned off (state X1)
The last NMK and NID shall be saved, so that once the EV/EVSE wakes up the network parameter set can be set directly into the PLC chip without the need of performing the matching process again.

iso15118 shall send a message to the application that controls the CP requesting the PWM to be turned off (state X1)

This also means that the iso15118 needs to have a new method in its interface to do this request (e.g. pause_dlink_session)

SLAC_SETTLE_TIME

Can someone explain where the SLAC_SETTLE_TIME value is coming from and why it is required?

`make build` hangs, possible because of old version of Poetry

The README.md instructs users to run make build. In turn, docker-compse build which builds the Dockerfile.

Building the Dockerfile never finishes. The flow hangs at Dockerfile:27.
https://github.com/SwitchEV/pyslac/blob/e047321ae437ac6fd38a6fd619096ea3131e6da7/Dockerfile#L27

While debugging this issue, I noticed that the Dockerfile is using Poetry 1.1.11. This is a very old version of Poetry.
The latest version is 1.6.x.

Updating to Poetry 1.6 prevents the hanging.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.