From c5dd7ce5e85b9535c80330b0141492a862c1e4db Mon Sep 17 00:00:00 2001 From: Alexandre Bard Date: Tue, 27 Feb 2024 11:36:00 +0100 Subject: [PATCH] nwl-distro: Add gnss-mgr to test tools This tool is used to enable and configure the gnss receiver. id:502637 --- .../packagegroup-nwl-test-tools.bb | 2 + .../recipes-navigation/gnss-mgr/gnss-mgr.bb | 51 +++++++++++++++++++ ...up.py-Make-compatible-with-kirkstone.patch | 23 +++++++++ ...2-gnss-mgr.service-Hotfix-for-gemini.patch | 34 +++++++++++++ .../recipes-navigation/nmubxlib/nmubxlib.bb | 24 +++++++++ 5 files changed, 134 insertions(+) create mode 100644 layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr.bb create mode 100644 layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0001-setup.py-Make-compatible-with-kirkstone.patch create mode 100644 layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0002-gnss-mgr.service-Hotfix-for-gemini.patch create mode 100644 layers/meta-nwl-distro/recipes-navigation/nmubxlib/nmubxlib.bb diff --git a/layers/meta-nwl-distro/recipes-core/packagegroups/packagegroup-nwl-test-tools.bb b/layers/meta-nwl-distro/recipes-core/packagegroups/packagegroup-nwl-test-tools.bb index d03140a..ffb2f43 100644 --- a/layers/meta-nwl-distro/recipes-core/packagegroups/packagegroup-nwl-test-tools.bb +++ b/layers/meta-nwl-distro/recipes-core/packagegroups/packagegroup-nwl-test-tools.bb @@ -19,4 +19,6 @@ RDEPENDS:${PN} = " \ \ modemmanager \ wwan-config \ + \ + gnss-mgr \ " diff --git a/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr.bb b/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr.bb new file mode 100644 index 0000000..9b5ba60 --- /dev/null +++ b/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr.bb @@ -0,0 +1,51 @@ +DESCRIPTION = "NetModule GNSS management tool" +LICENSE = "LGPL-3.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=3000208d539ec061b899bce1d9ce9404" + +RDEPENDS:${PN} += " \ + python3-setuptools \ + nmubxlib \ + python3-systemd \ + " + +DEPENDS = "python3-setuptools-scm-native" + +inherit setuptools3 +inherit gitpkgv + +inherit systemd +SYSTEMD_SERVICE:${PN} = "gnss-mgr.service" + +inherit allarch + +# Package Version (built from tags) +PKGV = "${GITPKGVTAG}" +# Recipe Version +PV = "1.0-git${SRCPV}" +PR = "r1" + +SRC_URI = "git://gitlab.com/netmodule/tools/gnssmgr.git;protocol=ssh;user=git;branch=master \ + file://0001-setup.py-Make-compatible-with-kirkstone.patch \ + file://0002-gnss-mgr.service-Hotfix-for-gemini.patch \ + " +SRCREV = "3d80bb4871ddc2e3e84553a86b767b419b96148f" +S = "${WORKDIR}/git" + +PACKAGES =+ "${PN}-test" +SUMMARY:${PN}-test = "Addon to gnss-mgr for testing purposes" +FILES:${PN}-test = "${bindir}/gnss-config-reader" + +do_install:append() { + install -d ${D}${sysconfdir}/gnss + install -m 0644 ${S}/config/gnss-neom8.conf ${D}${sysconfdir}/gnss/gnss0.conf + + install -d ${D}/${sbindir}/ + install -m 0755 ${S}/systemd/gnss-mgr-service.py ${D}${sbindir}/gnss-mgr-service + + install -d ${D}/${systemd_unitdir}/system/ + install -m 0644 ${S}/systemd/gnss-mgr.service ${D}/${systemd_unitdir}/system/ + + # Test tool + install -d ${D}${bindir}/ + install -m 0755 ${S}/testing/gnss-config-reader.py ${D}${bindir}/gnss-config-reader +} diff --git a/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0001-setup.py-Make-compatible-with-kirkstone.patch b/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0001-setup.py-Make-compatible-with-kirkstone.patch new file mode 100644 index 0000000..d52046b --- /dev/null +++ b/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0001-setup.py-Make-compatible-with-kirkstone.patch @@ -0,0 +1,23 @@ +From e1dc9e6a5e683dd8ed09a319d06ef0be8d0022cb Mon Sep 17 00:00:00 2001 +From: Alexandre Bard +Date: Tue, 27 Feb 2024 11:33:39 +0100 +Subject: [PATCH] setup.py: Make compatible with kirkstone + +Signed-off-by: Alexandre Bard +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 8d3714e..cda325e 100644 +--- a/setup.py ++++ b/setup.py +@@ -5,7 +5,7 @@ from setuptools import setup, find_packages + setup( + name='gnss_mgr', + version_format='{tag}.{commitcount}+{gitsha}', +- setup_requires=['setuptools-git-version'], ++ setup_requires=['setuptools-scm'], + description='GNSS Manager', + author='Marc Mattmüller', + author_email='marc.mattmueller@netmodule.com', diff --git a/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0002-gnss-mgr.service-Hotfix-for-gemini.patch b/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0002-gnss-mgr.service-Hotfix-for-gemini.patch new file mode 100644 index 0000000..2cad62f --- /dev/null +++ b/layers/meta-nwl-distro/recipes-navigation/gnss-mgr/gnss-mgr/0002-gnss-mgr.service-Hotfix-for-gemini.patch @@ -0,0 +1,34 @@ +From 88eb6099cecfaa344dee3cacec54db0cd24f542f Mon Sep 17 00:00:00 2001 +From: Alexandre Bard +Date: Thu, 29 Feb 2024 15:03:02 +0100 +Subject: [PATCH] gnss-mgr.service: Hotfix for gemini + +Start the gnss receiver as part of the service startup because it is not +started automatically. + +Signed-off-by: Alexandre Bard +--- + systemd/gnss-mgr.service | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/systemd/gnss-mgr.service b/systemd/gnss-mgr.service +index 4694bee..2aa0a9b 100644 +--- a/systemd/gnss-mgr.service ++++ b/systemd/gnss-mgr.service +@@ -1,13 +1,14 @@ + [Unit] + Description=GNSS Manager +-Requires=dev-gnss0.device +-After=dev-gnss0.device + + [Service] + Type=oneshot + RemainAfterExit=yes ++ExecStartPre=/bin/sh -c 'gpioset $(gpiofind "GNSS_RST~")=1' ++ExecStartPre=sleep 5 + ExecStart=/usr/sbin/gnss-mgr-service start + ExecStop=/usr/sbin/gnss-mgr-service stop ++ExecStopPost=/bin/sh -c 'gpioset $(gpiofind "GNSS_RST~")=0' + ExecReload=/usr/sbin/gnss-mgr-service reload + StandardOutput=null + diff --git a/layers/meta-nwl-distro/recipes-navigation/nmubxlib/nmubxlib.bb b/layers/meta-nwl-distro/recipes-navigation/nmubxlib/nmubxlib.bb new file mode 100644 index 0000000..ad097a0 --- /dev/null +++ b/layers/meta-nwl-distro/recipes-navigation/nmubxlib/nmubxlib.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "Library implementing UBX protocol for u-blox gnss modems" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=331a9220a74b05f133bf1ef09b6903b2" + +RDEPENDS:${PN} += " \ + python3-setuptools \ + " + +DEPENDS = "python3-setuptools-scm-native" + +inherit setuptools3 +inherit gitpkgv + +# Package Version (built from tags) +PKGV = "${GITPKGVTAG}" +# Recipe Version +PV = "1.0-git${SRCPV}" +PR = "r1" + +SRC_URI = "git://gitlab.com/netmodule/tools/nmubxlib.git;protocol=ssh;user=git;branch=master" +SRCREV = "7c22b57cdd169a6651cb0c17a215d1e448727bcb" +S = "${WORKDIR}/git" + +