kuksa-dbc-feeder-sllin: add recipe 14/27714/1
authorScott Murray <scott.murray@konsulko.com>
Tue, 7 Jun 2022 00:02:33 +0000 (20:02 -0400)
committerScott Murray <scott.murray@konsulko.com>
Wed, 6 Jul 2022 18:00:05 +0000 (14:00 -0400)
Add kuksa-dbc-feeder-sllin recipe to install systemd unit and
configuration file to run a second copy of the KUKSA.val DBC
feeder against the demo setup's sllin0 interface.  The systemd
unit will bring up the sllin0 interface by a call to the
can-dev-helper.sh script if run on hardware that lacks the
LIN adapter.  Additionally, the DBC feeder mapping configuration
has been updated with the mappings for the steering wheel LIN
events, and kuksa-dbc-feeder-sllin has been added to the
agl-demo-preload packagegroup for the full AGL demo setup.

Bug-AGL: SPEC-4405

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ief38c4dcccda899cdef24881b292928e607dda14

recipes-connectivity/kuksa-val/can-dev-helper/can-dev-helper.sh
recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin.bb [new file with mode: 0644]
recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/config-sllin.ini [new file with mode: 0644]
recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/kuksa-dbc-feeder-sllin.service [new file with mode: 0644]
recipes-connectivity/kuksa-val/kuksa-dbc-feeder/mapping.yml
recipes-platform/packagegroups/packagegroup-agl-demo-preload.bb

index de9894d..69dc628 100644 (file)
@@ -15,6 +15,9 @@ vcan_up() {
 }
 
 CONF=/etc/kuksa-dbc-feeder/config.ini
+if [ $# -gt 0 ]; then
+    CONF=$1
+fi
 
 if [ ! -f $CONF ]; then
     exit 0
diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin.bb b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin.bb
new file mode 100644 (file)
index 0000000..0a86cbb
--- /dev/null
@@ -0,0 +1,34 @@
+SUMMARY = "Demo LIN configuration for DBC feeder for KUKSA.val"
+HOMEPAGE = "https://github.com/eclipse/kuksa.val"
+BUGTRACKER = "https://github.com/eclipse/kuksa.val/issues"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI += "file://config-sllin.ini \
+            file://kuksa-dbc-feeder-sllin.service \
+"
+
+inherit allarch systemd
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+do_install() {
+    # NOTE: Installing into same /etc directory as the main configuration for now,
+    #       this may be worth re-evaluating at some point (e.g. splitting the DBC
+    #       files, having a dedicated token, etc.).
+    install -d ${D}${sysconfdir}/kuksa-dbc-feeder
+    install -m 0644 ${WORKDIR}/config-sllin.ini ${D}${sysconfdir}/kuksa-dbc-feeder/
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+        install -d ${D}${systemd_system_unitdir}
+        install -m 0644 ${WORKDIR}/kuksa-dbc-feeder-sllin.service ${D}${systemd_system_unitdir}
+    fi
+}
+
+FILES:${PN} += "${systemd_system_unitdir}"
+
+RDEPENDS:${PN} += " \
+    kuksa-dbc-feeder \
+    can-dev-helper \
+    sllin-demo \
+"
diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/config-sllin.ini b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/config-sllin.ini
new file mode 100644 (file)
index 0000000..66980cb
--- /dev/null
@@ -0,0 +1,15 @@
+[kuksa_val]
+# kuksa VSS server address
+server=wss://localhost:8090
+# JWT security token file
+token=/etc/kuksa-dbc-feeder/dbc_feeder.json.token
+# VSS mapping file
+mapping=/etc/kuksa-dbc-feeder/mapping.yml
+
+[can]
+# CAN port
+port=sllin0
+#Enable SAE-J1939 Mode. False: ignore
+j1939=False
+# DBC file used to parse CAN messages
+dbcfile=/etc/kuksa-dbc-feeder/agl-vcar.dbc
diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/kuksa-dbc-feeder-sllin.service b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder-sllin/kuksa-dbc-feeder-sllin.service
new file mode 100644 (file)
index 0000000..8f830de
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Eclipse KUKSA.val DBC feeder (sllin0)
+Requires=kuksa-val.service sllin-demo.service
+After=kuksa-val.service sllin-demo.service
+
+[Service]
+ExecStartPre=/usr/sbin/can-dev-helper.sh /etc/kuksa-dbc-feeder/config-sllin.ini
+ExecStart=/usr/bin/dbcfeeder.py --config /etc/kuksa-dbc-feeder/config-sllin.ini
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
index a493168..f8a561d 100644 (file)
@@ -10,3 +10,86 @@ PT_EngineSpeed:
     Vehicle.Powertrain.CombustionEngine.Engine.Speed:
       transform:
         math: "floor(x+0.5)"
+
+SW_Next:
+  minupdatedelay: 500
+  targets:
+    Vehicle.Cabin.Infotainment.Media.Action:
+      transform:
+        fullmapping:
+          1: "SkipForward"
+
+SW_Previous:
+  minupdatedelay: 500
+  targets:
+    Vehicle.Cabin.Infotainment.Media.Action:
+      transform:
+        fullmapping:
+          1: "SkipBackward"
+
+# NOTE: Dependent on AGL-specific VSS overlay adding the extra action
+SW_Mode:
+  minupdatedelay: 500
+  targets:
+    Vehicle.Cabin.Infotainment.Media.Action:
+      transform:
+        fullmapping:
+          1: "NextSource"
+
+# NOTE: Dependent on AGL-specific VSS overlay adding the signal
+SW_Info:
+  minupdatedelay: 500
+  targets:
+    Vehicle.Cabin.Infotainment.Cluster.Mode:
+      transform:
+        fullmapping:
+          1: "true"
+
+#
+# The following is a little hackish, due to relying on the
+# application to treat IsActive and IsSet = "true" as toggles, and
+# being dependent on the AGL-specific VSS overlay to add IsSet.
+# A standalone LIN feeder with some state knowledge would maybe
+# be cleaner.  Another possible option would be the addition of
+# another type of transform that has state to the DBC feeder.
+#
+
+SW_CruiseEnable:
+  minupdatedelay: 500
+  targets:
+    Vehicle.ADAS.CruiseControl.IsActive:
+      transform:
+        fullmapping:
+          1: "true"
+
+SW_CruiseSet:
+  minupdatedelay: 500
+  targets:
+    Vehicle.ADAS.CruiseControl.IsSet:
+      transform:
+        fullmapping:
+          1: "true"
+
+SW_CruiseResume:
+  minupdatedelay: 500
+  targets:
+    Vehicle.ADAS.CruiseControl.IsSet:
+      transform:
+        fullmapping:
+          1: "true"
+
+SW_CruiseCancel:
+  minupdatedelay: 500
+  targets:
+    Vehicle.ADAS.CruiseControl.IsSet:
+      transform:
+        fullmapping:
+          1: "false"
+
+SW_LaneDepartureWarning:
+  minupdatedelay: 500
+  targets:
+    Vehicle.ADAS.LaneDepartureDetection.IsActive:
+      transform:
+        fullmapping:
+          1: "true"
index 5a9178a..25a3795 100644 (file)
@@ -16,6 +16,10 @@ PACKAGES = " \
 #     Adds systemd unit and scripting to drive configuring sllin
 #     driver with lin-config utility, enabling HVAC fan control and
 #     steering wheel controls in the demo.
+# - kuksa-dbc-feeder-sllin:
+#     Adds configuration and systemd unit to run a second instance of
+#     the DBC feeder against the sllin0 interface to connect the
+#     steering wheel controls into VIS.
 # - simple-can-simulator:
 #     CAN message simulator for vehicle and engine speed message
 #     generation, with some support for the cruise control events from
@@ -25,5 +29,6 @@ RDEPENDS:${PN} = "\
     packagegroup-agl-demo-platform \
     demo-i2c-udev-conf \
     sllin-demo \
+    kuksa-dbc-feeder-sllin \
     simple-can-simulator \
 "