summaryrefslogtreecommitdiff
path: root/recipes-navigation
diff options
context:
space:
mode:
authorSerhii Voloshynov <serhii.voloshynov@globallogic.com>2022-02-08 09:46:51 +0200
committerSerhii Voloshynov <serhii.voloshynov@globallogic.com>2022-02-08 18:04:03 +0200
commit8d0fe8e515310454783d71ed35c0a1ebcfb90b97 (patch)
treebe1fe41ebc724785beab69683976cb9d13af4d4a /recipes-navigation
parent33a31e40cef0990a449dbc3f6649662a02379f07 (diff)
downloadmeta-mlinux-8d0fe8e515310454783d71ed35c0a1ebcfb90b97.tar.gz
meta-mlinux-8d0fe8e515310454783d71ed35c0a1ebcfb90b97.tar.bz2
meta-mlinux-8d0fe8e515310454783d71ed35c0a1ebcfb90b97.zip
GPS sometimes does not detected on device start
Diffstat (limited to 'recipes-navigation')
-rw-r--r--recipes-navigation/gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch37
-rw-r--r--recipes-navigation/gpsd/gpsd-3.23/0006-ubxtimelps.patch77
-rw-r--r--recipes-navigation/gpsd/gpsd-3.23/0007-add-gll-vtg.patch74
-rw-r--r--recipes-navigation/gpsd/gpsd_3.23.bb (renamed from recipes-navigation/gpsd/gpsd_3.23.1.bb)11
4 files changed, 196 insertions, 3 deletions
diff --git a/recipes-navigation/gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch b/recipes-navigation/gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch
new file mode 100644
index 0000000..e17cfad
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.23/0006-itu_r_tf_460_6.patch
@@ -0,0 +1,37 @@
+From 799f41e6bf0955d04510f16b33cdf731d27a597a Mon Sep 17 00:00:00 2001
+From: Mykyta Dorokhin <mykyta.dorokhin@globallogic.com>
+Date: Tue, 28 Dec 2021 15:46:42 +0200
+Subject: [PATCH] Reintegrate 0006-itu_r_tf_460_6.patch
+
+---
+ gpsd/ntpshmwrite.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gpsd/ntpshmwrite.c b/gpsd/ntpshmwrite.c
+index 3f2ded3..5f0524b 100644
+--- a/gpsd/ntpshmwrite.c
++++ b/gpsd/ntpshmwrite.c
+@@ -39,11 +39,20 @@ void ntp_write(volatile struct shmTime *shmseg,
+ * ITU-R TF.460-6, Section 2.1, says laep seconds can be primarily
+ * in Jun/Dec but may be in March or September
+ */
++
++/* This code contradicts page 3 section 2.1 of ITU-R RV.460-6 that
++ * leap second may occur at the last second of a month, with
++ * preference for December and June, 2nd preference to March and
++ * September.
++ * https://www.itu.int/dms_pubrec/itu-r/rec/tf/R-REC-TF.460-6-200202-I!!PDF-E.pdf
++ */
++#ifdef NOTITU_R_TF_460_6
+ (void)gmtime_r( &(td->real.tv_sec), &tm);
+ if ( 5 != tm.tm_mon && 11 != tm.tm_mon ) {
+ /* Not june, not December, no way */
+ leap_notify = LEAP_NOWARNING;
+ }
++#endif /* NOTITU_R_TF_460_6 */
+
+ /* we use the shmTime mode 1 protocol
+ *
+--
+2.25.1
+
diff --git a/recipes-navigation/gpsd/gpsd-3.23/0006-ubxtimelps.patch b/recipes-navigation/gpsd/gpsd-3.23/0006-ubxtimelps.patch
new file mode 100644
index 0000000..6f92aea
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.23/0006-ubxtimelps.patch
@@ -0,0 +1,77 @@
+From 830a414311ee287340b11b60f5c6bb58aad7074f Mon Sep 17 00:00:00 2001
+From: Mykyta Dorokhin <mykyta.dorokhin@globallogic.com>
+Date: Tue, 28 Dec 2021 15:35:38 +0200
+Subject: [PATCH] Add missing leap seconds parts
+
+---
+ SConscript | 1 +
+ drivers/driver_ubx.c | 19 +++++++++++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/SConscript b/SConscript
+index 8c6136d..3ae2a7b 100644
+--- a/SConscript
++++ b/SConscript
+@@ -315,6 +315,7 @@ boolopts = (
+ ("tripmate", True, "DeLorme TripMate support"),
+ ("tsip", True, "Trimble TSIP support"),
+ ("ublox", True, "u-blox Protocol support"),
++ ("ubloxtimels", False, "u-blox UBX-NAV-TIMELS support (leap second)"),
+ # Non-GPS protocols
+ ("aivdm", True, "AIVDM support"),
+ ("gpsclock", True, "GPSClock support"),
+diff --git a/drivers/driver_ubx.c b/drivers/driver_ubx.c
+index bea2de0..e9f8a1c 100644
+--- a/drivers/driver_ubx.c
++++ b/drivers/driver_ubx.c
+@@ -3798,7 +3798,10 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf,
+ mask = ubx_msg_nav_timegps(session, &buf[UBX_PREFIX_LEN], data_len);
+ break;
+ case UBX_NAV_TIMELS:
++ GPSD_LOG(LOG_PROG, &session->context->errout, "UBX_NAV_TIMELS\n");
++#ifdef UBLOXTIMELS_ENABLE
+ mask = ubx_msg_nav_timels(session, &buf[UBX_PREFIX_LEN], data_len);
++#endif // UBLOXTIMELS_ENABLE
+ break;
+ case UBX_NAV_TIMEQZSS:
+ GPSD_LOG(LOG_PROG, &session->context->errout, "UBX-NAV-TIMEQZSS\n");
+@@ -3853,6 +3856,7 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf,
+ GPSD_LOG(LOG_PROG, &session->context->errout, "UBX-RXM-RTCM\n");
+ break;
+ case UBX_RXM_SFRB:
++ GPSD_LOG(LOG_DATA, &session->context->errout, "UBX_RXM_SFRB\n");
+ mask = ubx_msg_rxm_sfrb(session, &buf[UBX_PREFIX_LEN], data_len);
+ break;
+ case UBX_RXM_SFRBX:
+@@ -4267,6 +4271,14 @@ ubx_cfg_prt(struct gps_device_t *session, speed_t speed, const char parity,
+ (void)ubx_write(session, UBX_CLASS_CFG, 0x01, msg, 3);
+ }
+
++#ifdef UBLOXTIMELS_ENABLE
++ msg[0] = 0x01; /* class */
++ msg[1] = 0x26; /* msg id = UBX_NAV_TIMELS */
++ msg[2] = 0xff; /* rate */
++ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
++#endif /* UBLOXTIMELS_ENABLE */
++
++
+ } else { /* MODE_BINARY */
+ // nmea to turn off
+ const unsigned char nmea_off[] = {
+@@ -4349,6 +4361,13 @@ ubx_cfg_prt(struct gps_device_t *session, speed_t speed, const char parity,
+ (void)ubx_write(session, UBX_CLASS_CFG, 0x01, msg, 3);
+ }
+
++#ifdef UBLOXTIMELS_ENABLE
++ msg[0] = 0x01; /* class */
++ msg[1] = 0x26; /* msg id = UBX_NAV_TIMELS */
++ msg[2] = 0xff; /* rate */
++ (void)ubx_write(session, 0x06u, 0x01, msg, 3);
++#endif /* UBLOXTIMELS_ENABLE */
++
+ /* if protver unknown, turn on everything. Which may be too
+ * much for slower serial port speeds. Hope that we know protver
+ * later and can fix things then. */
+--
+2.25.1
+
diff --git a/recipes-navigation/gpsd/gpsd-3.23/0007-add-gll-vtg.patch b/recipes-navigation/gpsd/gpsd-3.23/0007-add-gll-vtg.patch
new file mode 100644
index 0000000..777c0ca
--- /dev/null
+++ b/recipes-navigation/gpsd/gpsd-3.23/0007-add-gll-vtg.patch
@@ -0,0 +1,74 @@
+From 596089b8582097c1f934a5d25035353f00118965 Mon Sep 17 00:00:00 2001
+From: Mykyta Dorokhin <mykyta.dorokhin@globallogic.com>
+Date: Tue, 28 Dec 2021 15:56:07 +0200
+Subject: [PATCH] add GLL and VTG to 'gpspipe -r' output in binary mode
+
+---
+ gpsd/pseudonmea.c | 37 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/gpsd/pseudonmea.c b/gpsd/pseudonmea.c
+index 2d63d0f..feb9867 100644
+--- a/gpsd/pseudonmea.c
++++ b/gpsd/pseudonmea.c
+@@ -171,6 +171,21 @@ void gpsd_position_fix_dump(struct gps_device_t *session,
+ * Differential base station ID */
+ (void)strlcat(bufp, ",", len);
+ nmea_add_checksum(bufp);
++
++ //$GNGGA,103527.00,4957.22994,N,03618.97862,E,1,12,0.89,180.3,M,17.0,M,,*4B
++ //$GNGLL,4957.22997,N,03618.97858,E,103526.00,A,A*7B
++ //we use the same values as in GGA sentence
++ char *bufgll = &bufp[strlen(bufp)];
++ (void)snprintf(bufgll, len,
++ "$GPGLL,%s,%c,%s,%c,%s,%c,A,",
++ lat_str,
++ ((session->gpsdata.fix.latitude > 0) ? 'N' : 'S'),
++ lon_str,
++ ((session->gpsdata.fix.longitude > 0) ? 'E' : 'W'),
++ time_str,
++ ((fixquality != FIX_QUALITY_INVALID) ? 'A' : 'V')
++ );
++ nmea_add_checksum(bufgll);
+ }
+ }
+
+@@ -183,6 +198,7 @@ static void gpsd_transit_fix_dump(struct gps_device_t *session,
+ char lat_str[BUF_SZ];
+ char lon_str[BUF_SZ];
+ char speed_str[BUF_SZ];
++ char kspeed_str[BUF_SZ];
+ char track_str[BUF_SZ];
+ char var_str[BUF_SZ];
+ char *var_dir = "";
+@@ -231,6 +247,27 @@ static void gpsd_transit_fix_dump(struct gps_device_t *session,
+ time2_str,
+ var_str, var_dir);
+ nmea_add_checksum(bufp);
++
++ //$GNRMC,114740.00,A,4957.22826,N,03618.97015,E,0.054,,091220,,,A*65
++ //$GNVTG,,T,,M,0.054,N,0.100,K,A*3D
++ //1 = Track made good
++ //2 = Fixed text 'T' indicates that track made good is relative to true north
++ //3 = Track made good, degrees Magnetic
++ //4 = Magnetic track indicator - 'M'
++ //5 = Speed over ground in knots
++ //6 = Fixed text 'N' indicates that speed over ground in in knots
++ //7 = Speed over ground in kilometers/hour
++ //8 = Fixed text 'K' indicates that speed over ground is in kilometers/hour
++ //we use the same values as in RMC sentence
++ char *bufvtg = &bufp[strlen(bufp)];
++ (void)snprintf(bufvtg, len,
++ "$GPVTG,%s,T,%s,M,%s,N,%s,K,A,",
++ track_str,
++ track_str,//it is not Magnetic track, but may be it is enough
++ speed_str,
++ f_str(session->gpsdata.fix.speed, "%.4f", kspeed_str)
++ );
++ nmea_add_checksum(bufvtg);
+ }
+
+ static void gpsd_binary_satellite_dump(struct gps_device_t *session,
+--
+2.25.1
+
diff --git a/recipes-navigation/gpsd/gpsd_3.23.1.bb b/recipes-navigation/gpsd/gpsd_3.23.bb
index 4663856..166ce0a 100644
--- a/recipes-navigation/gpsd/gpsd_3.23.1.bb
+++ b/recipes-navigation/gpsd/gpsd_3.23.bb
@@ -18,7 +18,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz \
file://gpsd.service \
"
-SRC_URI[sha256sum] = "0b991ce9a46538c4ea450f7a8ee428ff44fb4f8d665fddf2ffe40fe0ae9a6c09"
+SRC_URI[sha256sum] = "522c2362a7eb2d7ac37eaa1504f12aded1c373479a87ba06cc6795974b567bbc"
inherit scons update-rc.d python3-dir python3native systemd update-alternatives pkgconfig
@@ -119,7 +119,7 @@ do_install() {
export DESTDIR="${D}"
# prefix is used for RPATH and DESTDIR/prefix for installation
- ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} udev-install ${EXTRA_OESCONS} || \
+ ${STAGING_BINDIR_NATIVE}/scons prefix=${prefix} python_libdir=${libdir} install ${EXTRA_OESCONS} || \
bbfatal "scons install execution failed."
}
@@ -134,10 +134,15 @@ do_install_append() {
install -m 0755 ${WORKDIR}/gpsd_fixed.sh ${D}${sbindir}/gpsd_fixed
install -m 0755 ${WORKDIR}/gpsd_settime.sh ${D}${sbindir}/gpsd_settime
+ #support for udev
+ install -d ${D}/${sysconfdir}/udev/rules.d
+ install -m 0644 ${S}/gpsd.rules.in ${D}/${sysconfdir}/udev/rules.d/
+ install -d ${D}${base_libdir}/udev/
+ install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
# Support for python
install -d ${D}${PYTHON_SITEPACKAGES_DIR}/gps
- install -m 755 ${D}${libdir}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps
+ install -m 755 ${S}/gps/*.py ${D}${PYTHON_SITEPACKAGES_DIR}/gps
# support for dev (development)
mkdir -p -m 0644 ${D}/${includedir}/gps