Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Latest commit

 

History

History
 
 

someip2val

SOME/IP integration in Docker containers

Example vsomeip dockerisation is described in details here

SOME/IP to Kuksa.VAL Feeder

Overview

SOME/IP feeder is vsomeip app, that subscribes for specific SOME/IP Events, parses its payload and feeds some of the data to KUKSA.VAL Databroker.

Setup Development environment

Prerequisites

  1. Install cmake and build requirements
    sudo apt-get install -y cmake g++ build-essential g++-aarch64-linux-gnu binutils-aarch64-linux-gnu jq
  2. Install and configure conan (if needed)
    sudo apt-get install -y python3 python3-pip
    pip3 install conan
  3. Install VS Code. To setup proper conan environment in vs code, launch vscode using:
    ./vscode-conan.sh
  4. Install and start KUKSA Databroker
    # if running on x86_64 host:
    wget https://github.com/eclipse/kuksa.val/releases/download/databroker-v0.17.0/databroker_x86_64.tar.gz
    # if running on arm 64 host (rpi)
    wget https://github.com/eclipse/kuksa.val/releases/download/databroker-v0.17.0/databroker_aarch64.tar.gz
    # extract needed binaries
    tar xzvf databroker_x86_64.tar.gz --strip-components 3
    # start databroker
    ./databroker

Building someip2val

There are scripts for building release and debug versions of someip2val feeder, supporting x86_64, aarch64 or rpi architectures:

cd someip2val
./build-release.sh <arch>

NOTE: Use rpi when building on a Raspberry Pi.

Scripts generate someip2val-<debug|release>-<arch>.tar archives

Configuration

vsomeip requires a combination of json config file + environment variables

vsomeip specific Configuration

Environment variables:

  • VSOMEIP_CONFIGURATION : path to vsomeip config json file
  • VSOMEIP_APPLICATION_NAME: vsomeip application name, must be consistent with json config file .applications[].name

Wiper configuration files:

NOTE: Proxy config should be used if Wiper Service is running on the same host with someip2val feeder. It has wiper service app as router, and client is proxy to local wiper service.

Config file modifications:

In order to use non-proxy mode on 2 network hosts, you have to modify the .unicast address in vsomeip config file, unfortunately it does not support hostnames, so there are some helper scripts for setting up the environment and replacing hostnames with jq

Runing someip example and someip2val feeder

Setup scripts in ./bin are meant to run from install directory, e.g. after executing ./build-debug.sh it is: target/x86_64/debug/install/bin.

If running from another location, make sure your LD_LIBRARY_PATH includes vsomeip3 binaries.

Local mode (single host)

In this mode only Unix sockets are used, wiper service is acting as a someip router app and someip2val feeder is a proxy.

  • Launch wiper service from install directory:
. ./setup-wiper-service.sh
./wiper_service --cycle 300
  • Launch someip2val feeder in proxy mode:
. ./setup-someip2val-proxy.sh
./someip_feeder

UDP mode (2 hosts)

In this mode you need another host in your network to run the service.

  • Launch wiper service from install directory on Host2:
. ./setup-wiper-service.sh
./wiper_service --cycle 300
  • Launch someip2val feeder in default mode:
. ./setup-someip2val.sh
./someip_feeder

Make sure you have jq installed as it is rewriting config files to update unicast address.

Extending someip2val feeder

Provided wiper example needs to be adjusted for another someip service events.

  • SomeIPClient class provides generic event subscription and passes someip payload to a custom callback:
typedef std::function <
  int (vsomeip::service_t service, vsomeip::instance_t instance, vsomeip::method_t event,
      const uint8_t *payload, size_t size)
> message_callback_t;
  • SomeIPConfig vsomeip service/instance/event_group/event values also have to be changed (e.g. via environment variables, or in code)
  • SomeipFeederAdapter::on_someip_message() : Example for someip payload callback, deserializing payload and feeding to Databroker