diff options
Diffstat (limited to 'recipes-connectivity/kuksa-val/kuksa-dbc-feeder')
4 files changed, 105 insertions, 305 deletions
diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch index 4221df5c8..527266f27 100644 --- a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch @@ -1,215 +1,41 @@ -From 22062d99a89922e02b626e4701feaac8947af5fb Mon Sep 17 00:00:00 2001 +From c3774fed42d58f227a4ecb501c6ef1dd3a9cfcf3 Mon Sep 17 00:00:00 2001 From: Scott Murray <scott.murray@konsulko.com> -Date: Fri, 7 Oct 2022 15:54:48 -0400 +Date: Wed, 19 Apr 2023 15:55:01 -0400 Subject: [PATCH 1/2] dbc2val: add installation mechanism -Add setup.py and setup.cfg to allow installing the dbc2val module -and dbcfeeder.py in a way suitable for packaging. Some of the -imports in the scripts have been tweaked to enable running against -an installed copy of dbc2val. +Add setup.py and setup.cfg to allow installing the dbcfeederlib +module and dbcfeeder.py in a way suitable for packaging. Upstream-Status: pending Signed-off-by: Scott Murray <scott.murray@konsulko.com> + +%% original patch: 0001-dbc2val-add-installation-mechanism.patch --- - dbc2val/__init__.py | 0 - dbc2val/databroker.py | 4 +-- - dbc2val/dbc2vssmapper.py | 12 +++---- - dbc2val/dbcfeeder.py | 8 ++--- - dbc2val/gen_proto/__init__.py | 0 - dbc2val/gen_proto/sdv/__init__.py | 0 - dbc2val/gen_proto/sdv/databroker/__init__.py | 0 - .../gen_proto/sdv/databroker/v1/__init__.py | 0 - .../gen_proto/sdv/databroker/v1/broker_pb2.py | 2 +- - .../sdv/databroker/v1/broker_pb2_grpc.py | 2 +- - .../sdv/databroker/v1/collector_pb2.py | 2 +- - .../sdv/databroker/v1/collector_pb2_grpc.py | 2 +- - setup.cfg | 31 ++++++++++++++++ - setup.py | 36 +++++++++++++++++++ - 14 files changed, 82 insertions(+), 17 deletions(-) - create mode 100644 dbc2val/__init__.py - create mode 100644 dbc2val/gen_proto/__init__.py - create mode 100644 dbc2val/gen_proto/sdv/__init__.py - create mode 100644 dbc2val/gen_proto/sdv/databroker/__init__.py - create mode 100644 dbc2val/gen_proto/sdv/databroker/v1/__init__.py - create mode 100644 setup.cfg - create mode 100644 setup.py + dbc2val/setup.cfg | 30 ++++++++++++++++++++++++++++++ + dbc2val/setup.py | 14 ++++++++++++++ + 2 files changed, 44 insertions(+) + create mode 100644 dbc2val/setup.cfg + create mode 100644 dbc2val/setup.py -diff --git a/dbc2val/__init__.py b/dbc2val/__init__.py -new file mode 100644 -index 0000000..e69de29 -diff --git a/dbc2val/databroker.py b/dbc2val/databroker.py -index c1a941a..ba52980 100644 ---- a/dbc2val/databroker.py -+++ b/dbc2val/databroker.py -@@ -16,13 +16,13 @@ - import logging - - import grpc --from gen_proto.sdv.databroker.v1 import ( -+from dbc2val.gen_proto.sdv.databroker.v1 import ( - broker_pb2, - broker_pb2_grpc, - collector_pb2, - collector_pb2_grpc, - ) --from gen_proto.sdv.databroker.v1 import types_pb2 as types # for export -+from dbc2val.gen_proto.sdv.databroker.v1 import types_pb2 as types # for export - - log = logging.getLogger(__name__) - -diff --git a/dbc2val/dbc2vssmapper.py b/dbc2val/dbc2vssmapper.py -index 05b78f1..d76c068 100644 ---- a/dbc2val/dbc2vssmapper.py -+++ b/dbc2val/dbc2vssmapper.py -@@ -20,8 +20,8 @@ - - - import yaml --import transforms.mapping --import transforms.math -+from dbc2val.transforms import mapping -+from dbc2val.transforms import math - import logging - - log = logging.getLogger(__name__) -@@ -33,13 +33,13 @@ class mapper: - self.mapping = yaml.full_load(file) - - self.transforms = {} -- self.transforms["fullmapping"] = transforms.mapping.mapping( -+ self.transforms["fullmapping"] = mapping.mapping( - discard_non_matching_items=True - ) -- self.transforms["partialmapping"] = transforms.mapping.mapping( -+ self.transforms["partialmapping"] = mapping.mapping( - discard_non_matching_items=False - ) -- self.transforms["math"] = transforms.math.math() -+ self.transforms["math"] = math.math() - - for key in self.mapping.keys(): - self.mapping[key]["lastupdate"] = 0.0 -@@ -93,4 +93,4 @@ class mapper: - - def __getitem__(self, item): - return self.mapping[item] -- -\ No newline at end of file -+ -diff --git a/dbc2val/dbcfeeder.py b/dbc2val/dbcfeeder.py -index 5267369..7daaa2b 100755 ---- a/dbc2val/dbcfeeder.py -+++ b/dbc2val/dbcfeeder.py -@@ -28,16 +28,13 @@ import sys - import time - from signal import SIGINT, SIGTERM, signal - --import canplayer --import dbc2vssmapper --import dbcreader - import grpc --import j1939reader -+from dbc2val import dbc2vssmapper, dbcreader, j1939reader, canplayer - - # kuksa related - from kuksa_viss_client import KuksaClientThread - # databroker related --import databroker -+from dbc2val import databroker - - # global variable for usecase, default databroker - USE_CASE = "" -@@ -289,6 +286,7 @@ def parse_config(filename): - "/etc/dbc_feeder.ini", - "config/dbc_feeder.ini", - ] -+ configfile = None - for candidate in config_candidates: - if os.path.isfile(candidate): - configfile = candidate -diff --git a/dbc2val/gen_proto/__init__.py b/dbc2val/gen_proto/__init__.py -new file mode 100644 -index 0000000..e69de29 -diff --git a/dbc2val/gen_proto/sdv/__init__.py b/dbc2val/gen_proto/sdv/__init__.py -new file mode 100644 -index 0000000..e69de29 -diff --git a/dbc2val/gen_proto/sdv/databroker/__init__.py b/dbc2val/gen_proto/sdv/databroker/__init__.py -new file mode 100644 -index 0000000..e69de29 -diff --git a/dbc2val/gen_proto/sdv/databroker/v1/__init__.py b/dbc2val/gen_proto/sdv/databroker/v1/__init__.py +diff --git a/dbc2val/setup.cfg b/dbc2val/setup.cfg new file mode 100644 -index 0000000..e69de29 -diff --git a/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2.py b/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2.py -index 98dc94a..6deacfb 100644 ---- a/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2.py -+++ b/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2.py -@@ -12,7 +12,7 @@ from google.protobuf import symbol_database as _symbol_database - _sym_db = _symbol_database.Default() - - --from gen_proto.sdv.databroker.v1 import types_pb2 as sdv_dot_databroker_dot_v1_dot_types__pb2 -+from dbc2val.gen_proto.sdv.databroker.v1 import types_pb2 as sdv_dot_databroker_dot_v1_dot_types__pb2 - - - DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1esdv/databroker/v1/broker.proto\x12\x11sdv.databroker.v1\x1a\x1dsdv/databroker/v1/types.proto\"*\n\x14GetDatapointsRequest\x12\x12\n\ndatapoints\x18\x01 \x03(\t\"\xb0\x01\n\x12GetDatapointsReply\x12I\n\ndatapoints\x18\x01 \x03(\x0b\x32\x35.sdv.databroker.v1.GetDatapointsReply.DatapointsEntry\x1aO\n\x0f\x44\x61tapointsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.sdv.databroker.v1.Datapoint:\x02\x38\x01\"!\n\x10SubscribeRequest\x12\r\n\x05query\x18\x02 \x01(\t\"\x9c\x01\n\x0eSubscribeReply\x12=\n\x06\x66ields\x18\x01 \x03(\x0b\x32-.sdv.databroker.v1.SubscribeReply.FieldsEntry\x1aK\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.sdv.databroker.v1.Datapoint:\x02\x38\x01\"#\n\x12GetMetadataRequest\x12\r\n\x05names\x18\x01 \x03(\t\"=\n\x10GetMetadataReply\x12)\n\x04list\x18\x01 \x03(\x0b\x32\x1b.sdv.databroker.v1.Metadata2\x9b\x02\n\x06\x42roker\x12_\n\rGetDatapoints\x12\'.sdv.databroker.v1.GetDatapointsRequest\x1a%.sdv.databroker.v1.GetDatapointsReply\x12U\n\tSubscribe\x12#.sdv.databroker.v1.SubscribeRequest\x1a!.sdv.databroker.v1.SubscribeReply0\x01\x12Y\n\x0bGetMetadata\x12%.sdv.databroker.v1.GetMetadataRequest\x1a#.sdv.databroker.v1.GetMetadataReplyb\x06proto3') -diff --git a/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2_grpc.py b/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2_grpc.py -index 5c87db1..bc6be8b 100644 ---- a/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2_grpc.py -+++ b/dbc2val/gen_proto/sdv/databroker/v1/broker_pb2_grpc.py -@@ -2,7 +2,7 @@ - """Client and server classes corresponding to protobuf-defined services.""" - import grpc - --from gen_proto.sdv.databroker.v1 import broker_pb2 as sdv_dot_databroker_dot_v1_dot_broker__pb2 -+from dbc2val.gen_proto.sdv.databroker.v1 import broker_pb2 as sdv_dot_databroker_dot_v1_dot_broker__pb2 - - - class BrokerStub(object): -diff --git a/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2.py b/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2.py -index 25d69dd..ea15409 100644 ---- a/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2.py -+++ b/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2.py -@@ -12,7 +12,7 @@ from google.protobuf import symbol_database as _symbol_database - _sym_db = _symbol_database.Default() - - --from gen_proto.sdv.databroker.v1 import types_pb2 as sdv_dot_databroker_dot_v1_dot_types__pb2 -+from dbc2val.gen_proto.sdv.databroker.v1 import types_pb2 as sdv_dot_databroker_dot_v1_dot_types__pb2 - - - DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!sdv/databroker/v1/collector.proto\x12\x11sdv.databroker.v1\x1a\x1dsdv/databroker/v1/types.proto\"\xba\x01\n\x17UpdateDatapointsRequest\x12N\n\ndatapoints\x18\x01 \x03(\x0b\x32:.sdv.databroker.v1.UpdateDatapointsRequest.DatapointsEntry\x1aO\n\x0f\x44\x61tapointsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.sdv.databroker.v1.Datapoint:\x02\x38\x01\"\xaf\x01\n\x15UpdateDatapointsReply\x12\x44\n\x06\x65rrors\x18\x01 \x03(\x0b\x32\x34.sdv.databroker.v1.UpdateDatapointsReply.ErrorsEntry\x1aP\n\x0b\x45rrorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\x30\n\x05value\x18\x02 \x01(\x0e\x32!.sdv.databroker.v1.DatapointError:\x02\x38\x01\"\xba\x01\n\x17StreamDatapointsRequest\x12N\n\ndatapoints\x18\x01 \x03(\x0b\x32:.sdv.databroker.v1.StreamDatapointsRequest.DatapointsEntry\x1aO\n\x0f\x44\x61tapointsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.sdv.databroker.v1.Datapoint:\x02\x38\x01\"\xaf\x01\n\x15StreamDatapointsReply\x12\x44\n\x06\x65rrors\x18\x01 \x03(\x0b\x32\x34.sdv.databroker.v1.StreamDatapointsReply.ErrorsEntry\x1aP\n\x0b\x45rrorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\x30\n\x05value\x18\x02 \x01(\x0e\x32!.sdv.databroker.v1.DatapointError:\x02\x38\x01\"R\n\x19RegisterDatapointsRequest\x12\x35\n\x04list\x18\x01 \x03(\x0b\x32\'.sdv.databroker.v1.RegistrationMetadata\"\x9d\x01\n\x14RegistrationMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\tdata_type\x18\x02 \x01(\x0e\x32\x1b.sdv.databroker.v1.DataType\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x32\n\x0b\x63hange_type\x18\x04 \x01(\x0e\x32\x1d.sdv.databroker.v1.ChangeType\"\x93\x01\n\x17RegisterDatapointsReply\x12H\n\x07results\x18\x01 \x03(\x0b\x32\x37.sdv.databroker.v1.RegisterDatapointsReply.ResultsEntry\x1a.\n\x0cResultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x05:\x02\x38\x01\x32\xd3\x02\n\tCollector\x12n\n\x12RegisterDatapoints\x12,.sdv.databroker.v1.RegisterDatapointsRequest\x1a*.sdv.databroker.v1.RegisterDatapointsReply\x12h\n\x10UpdateDatapoints\x12*.sdv.databroker.v1.UpdateDatapointsRequest\x1a(.sdv.databroker.v1.UpdateDatapointsReply\x12l\n\x10StreamDatapoints\x12*.sdv.databroker.v1.StreamDatapointsRequest\x1a(.sdv.databroker.v1.StreamDatapointsReply(\x01\x30\x01\x62\x06proto3') -diff --git a/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2_grpc.py b/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2_grpc.py -index 419bfde..2dee751 100644 ---- a/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2_grpc.py -+++ b/dbc2val/gen_proto/sdv/databroker/v1/collector_pb2_grpc.py -@@ -2,7 +2,7 @@ - """Client and server classes corresponding to protobuf-defined services.""" - import grpc - --from gen_proto.sdv.databroker.v1 import collector_pb2 as sdv_dot_databroker_dot_v1_dot_collector__pb2 -+from dbc2val.gen_proto.sdv.databroker.v1 import collector_pb2 as sdv_dot_databroker_dot_v1_dot_collector__pb2 - - - class CollectorStub(object): -diff --git a/setup.cfg b/setup.cfg -new file mode 100644 -index 0000000..70aab60 +index 0000000..03dc6d6 --- /dev/null -+++ b/setup.cfg -@@ -0,0 +1,31 @@ ++++ b/dbc2val/setup.cfg +@@ -0,0 +1,30 @@ +[metadata] -+name = dbc2val ++name = dbcfeeder +author = Sebastian Schildt, Naresh Nayak, Wenwen Chen +author_email = sebastian.schildt@de.bosch.com, naresh.nayak@de.bosch.com, wenwen.chen@de.bosch.com +description = kuksa.val DBC feeder +long_description = file:README.md +long_description_content_type = text/markdown -+url=https://github.com/eclipse/kuksa.val ++url=https://github.com/eclipse/kuksa.val.feeders +project_urls= -+ Source=https://github.com/eclipse/kuksa.val/tree/master/kuksa_feeders/dbc2val -+ Bug Tracker=https://github.com/eclipse/kuksa.val/issues -+classifiers = ++ Source=https://github.com/eclipse/kuksa.val.feeders/tree/master/dbc2val ++ Bug Tracker=https://github.com/eclipse/kuksa.val.feeders/issues ++classifiers = + Intended Audience :: Developers + Development Status :: 3 - Alpha + Environment :: Console @@ -217,46 +43,24 @@ index 0000000..70aab60 + License :: OSI Approved :: Apache Software License + Operating System :: OS Independent + Topic :: Software Development -+ -+license_file = LICENSE.txt ++ ++license_file = ../LICENSE.txt + +[options] +python_requires = >=3.6 +install_requires= + pyserial + pyyaml -+ kuksa-viss-client -+packages=find: -+include_package_data = True -+scripts=dbc2val/dbcfeeder.py -diff --git a/setup.py b/setup.py ++ kuksa-client ++packages=dbcfeederlib ++scripts=dbcfeeder.py +diff --git a/dbc2val/setup.py b/dbc2val/setup.py new file mode 100644 -index 0000000..55951cc +index 0000000..65f9157 --- /dev/null -+++ b/setup.py -@@ -0,0 +1,36 @@ -+# To avoid shipping dbcfeeder.py in the module itself, use the -+# technique outlined at: -+# -+# https://stackoverflow.com/a/50592100 -+# -+# This can be removed if the directory structure is ever reorganized -+# more along the lines of upstream recommendations. -+# -+ -+import fnmatch -+from setuptools import find_packages, setup -+from setuptools.command.build_py import build_py as build_py_orig -+ -+exclude = ['dbc2val.dbcfeeder'] -+ -+class build_py(build_py_orig): -+ def find_package_modules(self, package, package_dir): -+ modules = super().find_package_modules(package, package_dir) -+ print("modules = %s" % modules) -+ return [(pkg, mod, file, ) for (pkg, mod, file, ) in modules -+ if not any(fnmatch.fnmatchcase(pkg + '.' + mod, pat=pattern) -+ for pattern in exclude)] ++++ b/dbc2val/setup.py +@@ -0,0 +1,14 @@ ++from setuptools import setup + +setup( + version_config={ @@ -269,8 +73,7 @@ index 0000000..55951cc + "count_commits_from_version_file": False + }, + setup_requires=['setuptools-git-versioning'], -+ cmdclass={'build_py': build_py}, +) -- -2.37.3 +2.39.2 diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0002-dbc2val-usability-improvements.patch b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0002-dbc2val-usability-improvements.patch index be88fa0ee..a3dd31be4 100644 --- a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0002-dbc2val-usability-improvements.patch +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0002-dbc2val-usability-improvements.patch @@ -1,6 +1,6 @@ -From d0730c0d643738ac683d1b5c19b117893e3b2049 Mon Sep 17 00:00:00 2001 +From 91fb1f5a92e8784446c4e354fe5a8c465d6b3cb8 Mon Sep 17 00:00:00 2001 From: Scott Murray <scott.murray@konsulko.com> -Date: Tue, 11 Oct 2022 15:28:07 -0400 +Date: Tue, 2 May 2023 16:27:04 -0400 Subject: [PATCH 2/2] dbc2val: usability improvements Changes: @@ -18,24 +18,16 @@ Upstream-Status: pending Signed-off-by: Scott Murray <scott.murray@konsulko.com> --- - dbc2val/dbcfeeder.py | 21 +++++++++++++++------ - dbc2val/dbcreader.py | 12 ++++++++---- - 2 files changed, 23 insertions(+), 10 deletions(-) + dbc2val/dbcfeeder.py | 10 ++++++++-- + dbc2val/dbcfeederlib/dbcreader.py | 11 ++++++++--- + 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dbc2val/dbcfeeder.py b/dbc2val/dbcfeeder.py -index 7daaa2b..33c2212 100755 +index d32bb04..b73b96e 100755 --- a/dbc2val/dbcfeeder.py +++ b/dbc2val/dbcfeeder.py -@@ -93,6 +93,7 @@ class Feeder: - self._connected = False - self._registered = False - self._can_queue = queue.Queue() -+ self.kuksa = None +@@ -170,7 +170,11 @@ class Feeder: - def start( - self, -@@ -134,7 +135,11 @@ class Feeder: - else: # use socketCAN log.info("Using socket CAN device '%s'", canport) - self._reader.start_listening(bustype="socketcan", channel=canport) @@ -44,60 +36,29 @@ index 7daaa2b..33c2212 100755 + except: + log.error("Could not open {}, exiting".format(canport)) + sys.exit(-1) - - # databroker related - if USE_CASE=="databroker": -@@ -151,6 +156,8 @@ class Feeder: - log.info("Shutting down...") - self._shutdown = True - # Tell others to stop -+ if USE_CASE=="kuksa" and self.kuksa is not None: -+ self.kuksa.stop() - if self._reader is not None: - self._reader.stop() - if self._player is not None: -@@ -204,9 +211,10 @@ class Feeder: - # kuksa related - if USE_CASE=="kuksa": - global kuksaconfig -- kuksa = KuksaClientThread(kuksaconfig) -- kuksa.start() -- kuksa.authorize() -+ self.kuksa = KuksaClientThread(kuksaconfig) -+ self.kuksa.start() -+ if "token" in kuksaconfig: -+ self.kuksa.authorize(kuksaconfig["token"]) - - while self._shutdown is False: - # databroker related -@@ -255,7 +263,7 @@ class Feeder: - self._provider.update_datapoint(target, value) - # kuksa related - elif USE_CASE=="kuksa": -- resp=json.loads(kuksa.setValue(target, str(value))) -+ resp=json.loads(self.kuksa.setValue(target, str(value))) - if "error" in resp: - if "message" in resp["error"]: - log.error("Error setting {}: {}".format(target, resp["error"]["message"])) -@@ -282,8 +290,9 @@ def parse_config(filename): + + self._run() + +@@ -278,8 +282,10 @@ def parse_config(filename): configfile = filename else: config_candidates = [ - "/config/dbc_feeder.ini", + "/etc/kuksa-dbc-feeder/config.ini", ++ "/etc/kuksa-dbc-feeder/dbc_feeder.ini", "/etc/dbc_feeder.ini", + "/config/dbc_feeder.ini", "config/dbc_feeder.ini", ] - configfile = None -diff --git a/dbc2val/dbcreader.py b/dbc2val/dbcreader.py -index 2500832..b537a4d 100644 ---- a/dbc2val/dbcreader.py -+++ b/dbc2val/dbcreader.py -@@ -54,8 +54,8 @@ class DBCReader: + for candidate in config_candidates: +diff --git a/dbc2val/dbcfeederlib/dbcreader.py b/dbc2val/dbcfeederlib/dbcreader.py +index 5dad41f..c2f5b55 100644 +--- a/dbc2val/dbcfeederlib/dbcreader.py ++++ b/dbc2val/dbcfeederlib/dbcreader.py +@@ -56,8 +56,8 @@ class DBCReader: Bitrate in bit/s. """ - self.bus = can.interface.Bus(*args, **kwargs) + self.bus = can.interface.Bus(*args, **kwargs) # pylint: disable=abstract-class-instantiated - rxThread = threading.Thread(target=self.rxWorker) - rxThread.start() + self.rxThread = threading.Thread(target=self.rxWorker) @@ -105,7 +66,7 @@ index 2500832..b537a4d 100644 def get_whitelist(self): log.info("Collecting signals, generating CAN ID whitelist") -@@ -83,7 +83,10 @@ class DBCReader: +@@ -86,7 +86,10 @@ class DBCReader: def rxWorker(self): log.info("Starting Rx thread") while self.run: @@ -114,16 +75,15 @@ index 2500832..b537a4d 100644 + msg = self.bus.recv(timeout=1) + except Exception: + break + log.debug("processing message from CAN bus") if msg and msg.arbitration_id in self.canidwl: try: - decode = self.db.decode_message(msg.arbitration_id, msg.data) -@@ -105,4 +108,5 @@ class DBCReader: +@@ -113,3 +116,5 @@ class DBCReader: def stop(self): self.run = False -- + self.bus.shutdown() + self.rxThread.join() -- -2.37.3 +2.39.2 diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-fix-token-file-configuration-option.patch b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-fix-token-file-configuration-option.patch new file mode 100644 index 000000000..e3f3de655 --- /dev/null +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0003-dbc2val-fix-token-file-configuration-option.patch @@ -0,0 +1,32 @@ +From e2b5305a48a8c5ce5c149437e44d1b82f4b94432 Mon Sep 17 00:00:00 2001 +From: Scott Murray <scott.murray@konsulko.com> +Date: Mon, 8 May 2023 14:58:06 -0400 +Subject: [PATCH] dbc2val: fix token file configuration option + +The client library changed the token option name to +'token_or_tokenfile', update things to match so that token +location can be configured again for dbcfeeder.py. + +Upstream-Status: pending + +Signed-off-by: Scott Murray <scott.murray@konsulko.com> +--- + dbc2val/dbcfeederlib/serverclientwrapper.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dbc2val/dbcfeederlib/serverclientwrapper.py b/dbc2val/dbcfeederlib/serverclientwrapper.py +index 851516b..4f44913 100644 +--- a/dbc2val/dbcfeederlib/serverclientwrapper.py ++++ b/dbc2val/dbcfeederlib/serverclientwrapper.py +@@ -60,7 +60,7 @@ class ServerClientWrapper(clientwrapper.ClientWrapper): + self._client_config["insecure"] = not self._tls + # Do not set token if it is empty to allow default client lib info to be used + if self._token_path != "": +- self._client_config["token"] = self._token_path ++ self._client_config["token_or_tokenfile"] = self._token_path + + # TODO add data for root cert if using TLS and if given + +-- +2.39.2 + diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/config.ini b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/config.ini index 7da8381f0..411c7bc47 100644 --- a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/config.ini +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/config.ini @@ -1,21 +1,26 @@ [general] -# use case: -# switch between databroker and kuksa -# default kuksa -usecase = kuksa +# server type: +# switch between kuksa_databroker and kuksa_val_server +server_type = kuksa_val_server # VSS mapping file -mapping=/etc/kuksa-dbc-feeder/mapping.yml +mapping = /usr/share/vss/vss.json -[kuksa_val] -# kuksa VSS server address -server=wss://localhost:8090 -# JWT security token file -token=/etc/kuksa-dbc-feeder/dbc_feeder.json.token +# IP address for server (KUKSA.val Server or Databroker) +ip = localhost + +# Port for server (KUKSA.val Server or Databroker) +port = 8090 + +# Shall TLS be used (default False for Databroker, True for KUKSA.val Server) +tls = True + +# Token file for authorization. +token = /etc/kuksa-dbc-feeder/dbc_feeder.json.token [can] # CAN port -port=can0 -#Enable SAE-J1939 Mode. False: ignore -j1939=False +port = can0 +# Enable SAE-J1939 Mode. False: ignore +j1939 = False # DBC file used to parse CAN messages -dbcfile=/etc/kuksa-dbc-feeder/agl-vcar.dbc +dbcfile = /etc/kuksa-dbc-feeder/agl-vcar.dbc |