nwl-distro: Add gnss-mgr to test tools

This tool is used to enable and configure the gnss receiver.

id:502637
This commit is contained in:
Alexandre Bard 2024-02-27 11:36:00 +01:00
parent 2837a9f876
commit c5dd7ce5e8
5 changed files with 134 additions and 0 deletions

View File

@ -19,4 +19,6 @@ RDEPENDS:${PN} = " \
\ \
modemmanager \ modemmanager \
wwan-config \ wwan-config \
\
gnss-mgr \
" "

View File

@ -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
}

View File

@ -0,0 +1,23 @@
From e1dc9e6a5e683dd8ed09a319d06ef0be8d0022cb Mon Sep 17 00:00:00 2001
From: Alexandre Bard <alexandre.bard@netmodule.com>
Date: Tue, 27 Feb 2024 11:33:39 +0100
Subject: [PATCH] setup.py: Make compatible with kirkstone
Signed-off-by: Alexandre Bard <alexandre.bard@netmodule.com>
---
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',

View File

@ -0,0 +1,34 @@
From 88eb6099cecfaa344dee3cacec54db0cd24f542f Mon Sep 17 00:00:00 2001
From: Alexandre Bard <alexandre.bard@netmodule.com>
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 <alexandre.bard@netmodule.com>
---
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

View File

@ -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"