diff options
| author | John Klug <john.klug@multitech.com> | 2017-01-23 12:32:29 -0600 |
|---|---|---|
| committer | John Klug <john.klug@multitech.com> | 2017-01-23 12:32:29 -0600 |
| commit | 077ac5882dac3d1ff33af36550df173bb5af8217 (patch) | |
| tree | 17364c835c8fed319548b1fa127de48d81eaa6f1 | |
| parent | d35110e29ce7806177b2e15704fca18896881b7d (diff) | |
| parent | 599b7325d9eec4eeaf818ff9bd8f5f7a3d7638e2 (diff) | |
| download | meta-mlinux-077ac5882dac3d1ff33af36550df173bb5af8217.tar.gz meta-mlinux-077ac5882dac3d1ff33af36550df173bb5af8217.tar.bz2 meta-mlinux-077ac5882dac3d1ff33af36550df173bb5af8217.zip | |
Merge branch 'master' of gitlab.multitech.net:mirrors/meta-mlinux
22 files changed, 780 insertions, 212 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index e07d2a9..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,36 +0,0 @@ -variables: - GIT_STRATEGY: none - -before_script: - - test -d mlinux || git clone git@gitlab.multitech.net:mirrors/mlinux.git - - cd mlinux - - git pull - - (test -f env-oe.sh && ./setup.sh --update) || ./setup.sh - - source env-oe.sh - - cd layers/meta-mlinux - - git fetch - - git checkout $CI_BUILD_REF - - cd ../.. - -cache: - untracked: true - -mtcdt_mlinux: - stage: build - tags: - - mlinux - script: - - bitbake mlinux-factory-image - artifacts: - paths: - - mlinux/build/tmp/deploy/images/mtcdt/*-upgrade.bin - -mtcap_mlinux: - stage: build - tags: - - mlinux - script: - - MACHINE=mtcap bitbake mlinux-mtcap-image - artifacts: - paths: - - mlinux/build/tmp/deploy/images/mtcap/*-upgrade.bin diff --git a/conf/distro/mlinux.conf b/conf/distro/mlinux.conf index 9a8011d..e4b199e 100644 --- a/conf/distro/mlinux.conf +++ b/conf/distro/mlinux.conf @@ -1,7 +1,7 @@ DISTRO = "mlinux" DISTRO_NAME = "mLinux" DISTRO_BASE_VERSION = "3.2" -DISTRO_VERSION = "${DISTRO_BASE_VERSION}.4" +DISTRO_VERSION = "${DISTRO_BASE_VERSION}.5" DISTRO_CODENAME = "" SDK_VENDOR = "-mlinux" SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}" diff --git a/prod-scripts/MTCDT-0.1/cdteep.sh b/prod-scripts/MTCDT-0.1/cdteep.sh new file mode 100755 index 0000000..c0e1e14 --- /dev/null +++ b/prod-scripts/MTCDT-0.1/cdteep.sh @@ -0,0 +1,110 @@ +#!/bin/sh +# This scripts follows old school option rules, and all +# options must come before parameters. Four parameters +# are required. Options requiring parameters must be +# followed by their parameter, with or without a space. +# Options not requiring parameters can be ganged, and may +# precede a single option requiring a parameter. +# +MYNAME=cdteep.sh +out="/sys/bus/i2c/devices/0-0056/eeprom" +vendor_id="Multi-Tech Systems" +hw_version="MTCDT-0.1" + + +# Set the MTCDT EEPROM +function usage { + echo "${MYNAME}"' -d -g -b "bt_mac_addr" -w "wifi_mac_addr" -i "imei number" -l "product-id" "device-id" "uuid" "eth_mac_addr"' >&2 + cat <<!EOF >&2 + assumptions: + All options are optional and must come first. + -b and -w require a following mac address + -d displays the PROM, do not write. Ignores other parameters. + -g GPS capability. + -l lora capability. + -i requires a following imei number + + Example + cdteep.sh -lb 01:12:AB:C3:23:FE MTCDT-210L 3489235379 125-6356-2283-9792 12:34:AB:CD:8F:34 + To add wifimac and remove lora: + ${MYNAME} -b 01:12:AB:C3:23:FE -w 04:16:3C:C3:45:75 MTCDT-210L 3489235379 125-6356-2283-9792 12:34:AB:CD:8F:34 + + product-id, device-id, uuid and eth_mac_addr are required. + + -d display EEPROM + -g capa-GPS + -l capa-Lora + The following fields are fixed: + out-file ${out} + vendor-id ${vendor_id} + hw-version ${hw_version} +!EOF + exit 1 +} + +((display=0)) + +while getopts b:dgw:i:l opt ; do +echo looking at opt $opt + case $opt in + b) + bt_mac_addr="$OPTARG" + barg="--mac-bluetooth ${OPTARG} --capa-bluetooth" + ;; + w) + wifi_mac_addr="$OPTARG" + warg="--mac-wifi ${OPTARG} --capa-wifi" + ;; + i) + imei="$OPTARG" + if ((${#imei} == 0)) ; then + echo "i option requires an imei number." >&2 + usage + fi + iarg="--imei ${OPTARG}" + ;; + l) + larg="--capa-lora" + ;; + d) + echo -e "\n\nEEPROM contents" + echo "-----------------" + mts-id-eeprom --in-file $out + exit + ;; + g) + gps="--capa-gps" + ;; + \?) + usage + ;; + :) + echo "Option -$OPTARG requires an argument." >&2 + usage + ;; + esac +done + + +shift $((OPTIND-1)) + +if (($# != 4)) ; then + echo Need 4 parameters beyond the options. >&2 + echo "You specified $#." >&2 + usage + exit 1 +fi +product_id=$1 +device_id=$2 +uuid=$3 +mac=$4 + +mts-id-eeprom --out-file $out --out-format bin --vendor-id "$vendor_id" \ + --product-id "$product_id" --device-id "$device_id" \ + --hw-version "$hw_version" --mac-addr $mac \ + ${warg} ${barg} \ + ${iarg} ${larg} ${gps} --uuid "$uuid" + +echo -e "\n\nNew contents" +echo "-----------------" +mts-id-eeprom --in-file $out diff --git a/recipes-connectivity/lora/lora-network-server_1.0.18.bb b/recipes-connectivity/lora/lora-network-server_1.0.21.bb index 1a7aab6..5091b9d 100644 --- a/recipes-connectivity/lora/lora-network-server_1.0.18.bb +++ b/recipes-connectivity/lora/lora-network-server_1.0.21.bb @@ -13,8 +13,8 @@ SRC_URI = "http://multitech.net/downloads/lora-network-server_${TUNE_PKGARCH}_${ file://lora-network-server.logrotate.conf \ " -SRC_URI[md5sum] = "9e83c88149fc9b9c969034edcc6371f8" -SRC_URI[sha256sum] = "1e94620eed249c0c431987ac64850e329f7506ddd2d3c2ff6de0a554cb76ed52" +SRC_URI[md5sum] = "5d8e6f207fa95c53844c8992a999a014" +SRC_URI[sha256sum] = "af454f942c8b441580b014087d4c707affc5016451a12ff493e63b4530ad10d9" # binaries are already stripped, so suppress warning INSANE_SKIP_${PN} = "already-stripped" diff --git a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.0.0.MTCAP-LORA-1-5.EU868.basic b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.0.0.MTCAP-LORA-1-5.EU868.basic index 8f8d93d..e29b1f1 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.0.0.MTCAP-LORA-1-5.EU868.basic +++ b/recipes-connectivity/lora/lora-packet-forwarder/global_conf.json.3.0.0.MTCAP-LORA-1-5.EU868.basic @@ -1,17 +1,17 @@ { "SX1301_conf": { "lorawan_public": true, - "clksrc": 0, /* radio_0 provides clock to concentrator */ + "clksrc": 0, "lbt_cfg": { "enable": false, - "rssi_target": 160, /* rssi in dBm = -lbt_rssi_target/2 */ + "rssi_target": 160, "nb_channel": 1, "start_freq": 869525000, "scan_time_us": 5000, "tx_delay_1ch_us": 4000000, "tx_delay_2ch_us": 4000000 }, - "antenna_gain": 1.4, /* antenna gain, in dBi */ + "antenna_gain": 1.4, "radio_0": { "enable": true, "type": "SX1257", @@ -29,55 +29,46 @@ "tx_enable": false }, "chan_multiSF_0": { - /* Lora MAC channel, 125kHz, all SF, 868.1 MHz */ "enable": true, "radio": 1, "if": -400000 }, "chan_multiSF_1": { - /* Lora MAC channel, 125kHz, all SF, 868.3 MHz */ "enable": true, "radio": 1, "if": -200000 }, "chan_multiSF_2": { - /* Lora MAC channel, 125kHz, all SF, 868.5 MHz */ "enable": true, "radio": 1, "if": 0 }, "chan_multiSF_3": { - /* Lora MAC channel, 125kHz, all SF, 867.1 MHz */ "enable": true, "radio": 0, "if": -400000 }, "chan_multiSF_4": { - /* Lora MAC channel, 125kHz, all SF, 867.3 MHz */ "enable": true, "radio": 0, "if": -200000 }, "chan_multiSF_5": { - /* Lora MAC channel, 125kHz, all SF, 867.5 MHz */ "enable": true, "radio": 0, "if": 0 }, "chan_multiSF_6": { - /* Lora MAC channel, 125kHz, all SF, 867.7 MHz */ "enable": true, "radio": 0, "if": 200000 }, "chan_multiSF_7": { - /* Lora MAC channel, 125kHz, all SF, 867.9 MHz */ "enable": true, "radio": 0, "if": 400000 }, "chan_Lora_std": { - /* Lora MAC channel, 250kHz, SF7, 868.3 MHz */ "enable": true, "radio": 1, "if": -200000, @@ -85,7 +76,6 @@ "spread_factor": 7 }, "chan_FSK": { - /* FSK 50kbps channel, 868.8 MHz */ "enable": true, "radio": 1, "if": 300000, @@ -93,130 +83,110 @@ "datarate": 50000 }, "tx_lut_0": { - /* TX gain table, index 0 */ "pa_gain": 0, "mix_gain": 9, "rf_power": -6, "dig_gain": 1 }, "tx_lut_1": { - /* TX gain table, index 1 */ "pa_gain": 0, "mix_gain": 12, "rf_power": -3, "dig_gain": 1 }, "tx_lut_2": { - /* TX gain table, index 2 */ "pa_gain": 1, "mix_gain": 8, "rf_power": 0, "dig_gain": 2 }, "tx_lut_3": { - /* TX gain table, index 3 */ "pa_gain": 1, "mix_gain": 11, "rf_power": 3, "dig_gain": 3 }, "tx_lut_4": { - /* TX gain table, index 4 */ "pa_gain": 1, "mix_gain": 10, "rf_power": 6, "dig_gain": 0 }, "tx_lut_5": { - /* TX gain table, index 5 */ "pa_gain": 2, "mix_gain": 11, "rf_power": 10, "dig_gain": 3 }, "tx_lut_6": { - /* TX gain table, index 6 */ "pa_gain": 2, "mix_gain": 9, "rf_power": 11, "dig_gain": 1 }, "tx_lut_7": { - /* TX gain table, index 7 */ "pa_gain": 2, "mix_gain": 9, "rf_power": 12, "dig_gain": 0 }, "tx_lut_8": { - /* TX gain table, index 8 */ "pa_gain": 2, "mix_gain": 11, "rf_power": 13, "dig_gain": 2 }, "tx_lut_9": { - /* TX gain table, index 9 */ "pa_gain": 2, "mix_gain": 11, "rf_power": 14, "dig_gain": 1 }, "tx_lut_10": { - /* TX gain table, index 10 */ "pa_gain": 2, "mix_gain": 12, "rf_power": 16, "dig_gain": 0 }, "tx_lut_11": { - /* TX gain table, index 11 */ "pa_gain": 3, "mix_gain": 10, "rf_power": 20, "dig_gain": 3 }, "tx_lut_12": { - /* TX gain table, index 12 */ "pa_gain": 3, "mix_gain": 9, "rf_power": 23, "dig_gain": 0 }, "tx_lut_13": { - /* TX gain table, index 13 */ "pa_gain": 3, "mix_gain": 12, "rf_power": 25, "dig_gain": 2 }, "tx_lut_14": { - /* TX gain table, index 14 */ "pa_gain": 3, "mix_gain": 13, "rf_power": 26, "dig_gain": 0 }, "tx_lut_15": { - /* TX gain table, index 15 */ "pa_gain": 3, "mix_gain": 15, "rf_power": 27, "dig_gain": 0 } }, - "gateway_conf": { - "gateway_ID": "AA555A0000000000", - /* change with default server address/ports, or overwrite in local_conf.json */ + "gateway_ID": "<WILL-BE-AUTO-REPLACED-WITH-LORA-EUI>", "server_address": "localhost", "serv_port_up": 1680, "serv_port_down": 1680, - /* adjust the following parameters for your network */ "keepalive_interval": 10, "stat_interval": 30, "push_timeout_ms": 100, - /* forward only valid packets */ "forward_crc_valid": true, "forward_crc_error": false, "forward_crc_disabled": false diff --git a/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb b/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb index ada0493..e9ff489 100644 --- a/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb +++ b/recipes-connectivity/lora/lora-packet-forwarder_3.0.0.bb @@ -47,26 +47,21 @@ do_install() { install -m 755 util_ack/util_ack ${D}${LORA_DIR}/forwarder-utils/ install -m 755 util_tx_test/util_tx_test ${D}${LORA_DIR}/forwarder-utils/ install -m 755 ${WORKDIR}/README.md ${D}${LORA_DIR}/ + + install -d ${D}${sysconfdir}/default + install -m 0644 ${WORKDIR}/lora-packet-forwarder.default ${D}${sysconfdir}/default/lora-packet-forwarder + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/lora-packet-forwarder.init ${D}${sysconfdir}/init.d/lora-packet-forwarder } do_install_append_mtcdt() { install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0 install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5 - - install -d ${D}${sysconfdir}/default - install -m 0644 ${WORKDIR}/lora-packet-forwarder.default ${D}${sysconfdir}/default/lora-packet-forwarder - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/lora-packet-forwarder.init ${D}${sysconfdir}/init.d/lora-packet-forwarder } do_install_append_mtcap() { install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTCAP-LORA-1-5.EU868.basic ${D}${LORA_DIR}/global_conf.json - - install -d ${D}${sysconfdir}/default - install -m 0644 ${WORKDIR}/lora-packet-forwarder.default ${D}${sysconfdir}/default/lora-packet-forwarder - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/lora-packet-forwarder.init ${D}${sysconfdir}/init.d/lora-packet-forwarder } FILES_${PN} += "${LORA_DIR}" diff --git a/recipes-core/images/mlinux-factory-image.bb b/recipes-core/images/mlinux-factory-image.bb index 6ce05ab..c50619b 100644 --- a/recipes-core/images/mlinux-factory-image.bb +++ b/recipes-core/images/mlinux-factory-image.bb @@ -1,5 +1,6 @@ # Conduit 0.0 or 0.1 without RS9113 require mlinux-base-image.bb +DESCRIPTION = "mLinux factory image" LIGHTTPD = "lighttpd \ lighttpd-module-cgi lighttpd-module-indexfile \ @@ -80,6 +81,8 @@ IMAGE_INSTALL += "sms-utils" # Multi-Tech GPS Utility IMAGE_INSTALL += "venus-gps" IMAGE_INSTALL += "pps-tools" -IMAGE_INSTALL += "gpsd" + +# When ntp is to use the GPS, gps-utils is required +IMAGE_INSTALL += "gpsd ntp ntp-utils gps-utils gpsd-udev" IMAGE_INSTALL += "uvccapture" diff --git a/recipes-core/images/mlinux-rs9113-base-image.bb b/recipes-core/images/mlinux-rs9113-base-image.bb index a4e9f23..8aab186 100644 --- a/recipes-core/images/mlinux-rs9113-base-image.bb +++ b/recipes-core/images/mlinux-rs9113-base-image.bb @@ -1,5 +1,5 @@ require mlinux-base-image.bb -DESCRIPTION = "mLinux base image" +DESCRIPTION = "mLinux base image with rs9113 drivers" # Extra stuff to install IMAGE_INSTALL += " rs9113 " diff --git a/recipes-core/images/mlinux-rs9113-factory-image.bb b/recipes-core/images/mlinux-rs9113-factory-image.bb index bf2beaa..3fe2ca6 100644 --- a/recipes-core/images/mlinux-rs9113-factory-image.bb +++ b/recipes-core/images/mlinux-rs9113-factory-image.bb @@ -1,84 +1,5 @@ -require mlinux-rs9113-base-image.bb +require mlinux-factory-image.bb +DESCRIPTION = "mLinux factory image with rs9113 drivers" -LIGHTTPD = "lighttpd \ - lighttpd-module-cgi lighttpd-module-indexfile \ - lighttpd-module-redirect lighttpd-module-auth \ - lighttpd-module-access lighttpd-module-accesslog \ - lighttpd-module-rewrite lighttpd-module-proxy lighttpd-module-fastcgi \ - lighttpd-module-scgi lighttpd-module-alias \ - lighttpd-module-dirlisting lighttpd-module-staticfile \ - " - -# Lighttpd web server -IMAGE_INSTALL += "${LIGHTTPD}" - -IMAGE_INSTALL += "sqlite3" - -IMAGE_INSTALL += "autossh" - -# Monit system/process monitor -IMAGE_INSTALL += "monit" - -# LoRa support (MTAC-LORA accessory card) -IMAGE_INSTALL += "lora-gateway-utils lora-network-server lora-query" - -# MQTT server -IMAGE_INSTALL += "mosquitto mosquitto-clients" - -# Perl support -IMAGE_INSTALL += "perl" -IMAGE_INSTALL += "perl-module-io perl-module-fcntl" -# not in meta-oe or oe-core... -#IMAGE_INSTALL += "libdevice-serialport-perl" -#IMAGE_INSTALL += "libexpect-perl" - -# Python support -IMAGE_INSTALL += "python" -# Python modules -IMAGE_INSTALL += "python-async \ -python-argparse \ -python-compression \ -python-dateutil \ -python-html \ -python-psutil \ -python-pycurl \ -python-pyopenssl \ -python-pyserial \ -python-pyudev \ -python-pyusb \ -python-simplejson \ -python-sqlite3 \ -python-syslog \ -python-textutils \ -python-unixadmin \ -python-xml \ -" - -# Ruby support -IMAGE_INSTALL += "ruby" -IMAGE_INSTALL += "ruby-sqlite3" -IMAGE_INSTALL += "ruby-serialport" - -# OpenJDK Java runtime -IMAGE_INSTALL += "openjdk-7-jre" -# OpenJDK with JamVM VM (Multi-Tech default) -IMAGE_INSTALL += "openjdk-7-vm-jamvm" -# OpenJDK with CACAO VM (run with 'java -cacao') -IMAGE_INSTALL += "openjdk-7-vm-cacao" -# OpenJDK Zero VM (run with 'java -zero') -IMAGE_INSTALL += "openjdk-7-vm-zero" - -# PHP support -IMAGE_INSTALL += "php php-cli php-cgi" - -# Node.js support -IMAGE_INSTALL += "nodejs nodejs-npm" - -# Multi-Tech SMS Utility (see http://git.multitech.net) -IMAGE_INSTALL += "sms-utils" -# Multi-Tech GPS Utility -IMAGE_INSTALL += "venus-gps" -IMAGE_INSTALL += "pps-tools" -IMAGE_INSTALL += "gpsd" - -IMAGE_INSTALL += "uvccapture" +# Extra stuff to install +IMAGE_INSTALL += " rs9113 " diff --git a/recipes-navigation/gpsd/gpsd-3.16/0005-suppress-text-in-binary.patch b/recipes-navigation/gpsd/gpsd-3.16/0005-suppress-text-in-binary.patch index 34c9924..f338126 100644 --- a/recipes-navigation/gpsd/gpsd-3.16/0005-suppress-text-in-binary.patch +++ b/recipes-navigation/gpsd/gpsd-3.16/0005-suppress-text-in-binary.patch @@ -1,12 +1,12 @@ diff -u old/gpsctl.c new/gpsctl.c --- old/gpsctl.c 2017-01-03 15:57:50.517120891 -0600 -+++ new/gpsctl.c 2017-01-03 15:58:05.025120861 -0600 ++++ new/gpsctl.c 2017-01-03 18:31:21.421101434 -0600 @@ -175,7 +175,7 @@ int option, status; char *device = NULL, *devtype = NULL; char *speed = NULL, *control = NULL, *rate = NULL; - bool to_binary = false, to_nmea = false, reset = false; -+ bool to_binary = false, to_nmea = false, reset = false, cstring = false; ++ bool to_binary = false, to_nmea = false, reset = false, control_string = false; bool lowlevel=false, echo=false; struct gps_data_t gpsdata; const struct gps_type_t *forcetype = NULL; @@ -14,16 +14,17 @@ diff -u old/gpsctl.c new/gpsctl.c #ifdef CONTROLSEND_ENABLE control = optarg; lowlevel = true; -+ cstring = true; ++ control_string = true; if ((cooklen = hex_escapes(cooked, control)) <= 0) { gpsd_log(&context.errout, LOG_ERROR, "invalid escape string (error %d)\n", (int)cooklen); -@@ -443,7 +444,7 @@ +@@ -704,7 +705,8 @@ + } } - /* if no control operation was specified, just ID the device */ -- if (speed==NULL && rate == NULL && !to_nmea && !to_binary && !reset) { -+ if (speed==NULL && rate == NULL && !to_nmea && !to_binary && !reset && !cstring) { - (void)printf("%s identified as a %s", - gpsdata.dev.path, gpsdata.dev.driver); - if (gpsdata.dev.subtype[0] != '\0') { +- (void)printf("%s identified as a %s at %u baud.\n", ++ if(!control_string) ++ (void)printf("%s identified as a %s at %u baud.\n", + device, gpsd_id(&session), + session.gpsdata.dev.baudrate); + diff --git a/recipes-navigation/gpsd/gpsd-3.16/0006-itu_r_tf_460_6.patch b/recipes-navigation/gpsd/gpsd-3.16/0006-itu_r_tf_460_6.patch new file mode 100644 index 0000000..8e8d814 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.16/0006-itu_r_tf_460_6.patch @@ -0,0 +1,23 @@ +diff -Naur old/ntpshmwrite.c new/ntpshmwrite.c +--- old/ntpshmwrite.c 2017-01-23 10:00:05.497129473 -0600 ++++ new/ntpshmwrite.c 2017-01-23 09:47:58.881627772 -0600 +@@ -32,11 +32,18 @@ + * NTP expects leap pending for only 1 month prior to insertion + * Per http://bugs.ntp.org/1090 */ + (void)gmtime_r( &(td->real.tv_sec), &tm); ++/* 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 + 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 + * + * ntpd does this: diff --git a/recipes-navigation/gpsd/gpsd-3.16/0006-ubxtimelps.patch b/recipes-navigation/gpsd/gpsd-3.16/0006-ubxtimelps.patch new file mode 100644 index 0000000..e715847 --- /dev/null +++ b/recipes-navigation/gpsd/gpsd-3.16/0006-ubxtimelps.patch @@ -0,0 +1,200 @@ +diff -Naur old/driver_ubx.c new/driver_ubx.c +--- old/driver_ubx.c 2017-01-19 14:12:25.099231346 -0600 ++++ new/driver_ubx.c 2017-01-19 15:13:58.552152991 -0600 +@@ -57,6 +57,29 @@ + #define UBX_CFG_LEN 20 + #define outProtoMask 14 + ++#ifdef UBLOXTIMELS_ENABLE ++/* UBX-NAV-TIMELS support */ ++static char *srcOfCurrLs[] = { ++ "firmware", ++ "GPS GLONASS difference", ++ "GPS", ++ "SBAS", ++ "BeiDou", ++ "Galileo", ++ "Aided data", ++ "Configured" ++}; ++static char *srcOfLsChange[] = { ++ "No Source", ++ "Undefined", ++ "GPS", ++ "SBAS", ++ "BeiDou", ++ "Galileo", ++ "GLONOSS", ++}; ++#endif /* UBLOXTIMELS_ENABLE */ ++ + static gps_mask_t ubx_parse(struct gps_device_t *session, unsigned char *buf, + size_t len); + static gps_mask_t ubx_msg_nav_dop(struct gps_device_t *session, +@@ -237,6 +260,89 @@ + return mask; + } + ++#ifdef UBLOXTIMELS_ENABLE ++/** ++ * Navigation time to leap second ++ * ++ * Sets leap_notify if leap second is < 23 hours away. ++ */ ++static void ++ubx_msg_nav_timels(struct gps_device_t *session, unsigned char *buf, ++ size_t data_len) ++{ ++ int version; ++ unsigned int flags; ++ int valid_curr_ls; ++ int valid_time_to_ls_event; ++ ++ if (data_len != 24) { ++ gpsd_log(&session->context->errout, LOG_WARN, ++ "UBX-NAV-TIMELS: unexpected length %d, expecting 24\n", ++ data_len); ++ return; ++ } ++ version = getsb(buf,4); ++ /* Only version 0 is defined so far. */ ++ flags = (unsigned int)getub(buf, 23); ++ gpsd_log(&session->context->errout, LOG_DATA, ++ "UBX-NAV-TIMELS: flags 0x%x message version %d\n",flags, version); ++ valid_curr_ls = flags & UBX_TIMELS_VALID_CURR_LS; ++ valid_time_to_ls_event = flags & UBX_TIMELS_VALID_TIME_LS_EVT; ++ if(valid_curr_ls) { ++ unsigned int src_of_curr_ls = getub(buf,8); ++ int curr_ls = getsb(buf,9); ++ char *src = "Unknown"; ++ ++ if(src_of_curr_ls < (sizeof srcOfCurrLs/(sizeof srcOfCurrLs[0]))) ++ src = srcOfCurrLs[src_of_curr_ls]; ++ ++ gpsd_log(&session->context->errout, LOG_DATA, ++ "UBX-NAV-TIMELS: source_of_current_leapsecond=%u:%s curr_ls=%d\n", ++ src_of_curr_ls,src,curr_ls); ++ session->context->leap_seconds = curr_ls; ++ session->context->valid |= LEAP_SECOND_VALID; ++ } /* Valid current leap second */ ++ if(valid_time_to_ls_event) { ++ char *src="Unknown"; ++ unsigned int src_of_ls_change; ++ unsigned short dateOfLSGpsWn, dateOfLSGpsDn; ++ int lsChange = getsb(buf,11); ++ int timeToLsEvent = getles32(buf,12); ++ src_of_ls_change = getub(buf,10); ++ if(src_of_ls_change < (sizeof srcOfLsChange/(sizeof srcOfLsChange[0]))) ++ src = srcOfLsChange[src_of_ls_change]; ++ dateOfLSGpsWn = getles16(buf,16); ++ dateOfLSGpsDn = getles16(buf,18); ++ gpsd_log(&session->context->errout, LOG_DATA, ++ "UBX_NAV_TIMELS: source_of_leapsecond_change=%u:%s " ++ "leapSecondChage=%d timeToLsEvent=%d\n", ++ src_of_ls_change,src,lsChange,timeToLsEvent); ++ gpsd_log(&session->context->errout, LOG_DATA, ++ "UBX_NAV_TIMELS: dateOfLSGpsWn=%d dateOfLSGpsDn=%d\n", ++ dateOfLSGpsWn,dateOfLSGpsDn); ++ if(timeToLsEvent < 60*60*23 && timeToLsEvent > 0) { ++ if(lsChange == 0) ++ session->context->leap_notify = LEAP_NOWARNING; ++ else if (lsChange == 1) ++ session->context->leap_notify = LEAP_ADDSECOND; ++ else if (lsChange == -1) ++ session->context->leap_notify = LEAP_DELSECOND; ++ } else ++ session->context->leap_notify = LEAP_NOWARNING; ++ ++ if (session->context->leap_notify == LEAP_ADDSECOND) ++ gpsd_log(&session->context->errout,LOG_INF, ++ "UBX_NAV_TIMELS: Add leap second today\n"); ++ else if (session->context->leap_notify == LEAP_DELSECOND) ++ gpsd_log(&session->context->errout,LOG_INF, ++ "UBX_NAV_TIMELS: Remove leap second today\n"); ++ ++ gpsd_log(&session->context->errout, LOG_DATA, ++ "UBX_NAV_TIMELS: leaving: leap_notify=%d\n", ++ session->context->leap_notify); ++ } ++} ++#endif /* UBLOXTIMELS_ENABLE */ + /** + * Geodetic position solution message + */ +@@ -523,13 +629,22 @@ + case UBX_NAV_EKFSTATUS: + gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_EKFSTATUS\n"); + break; +- ++ case UBX_NAV_TIMELS: ++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_NAV_TIMELS\n"); ++#ifdef UBLOXTIMELS_ENABLE ++ ubx_msg_nav_timels(session, &buf[UBX_PREFIX_LEN],data_len); ++#endif // UBLOXTIMELS_ENABLE ++ break; + case UBX_RXM_RAW: + gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_RAW\n"); + break; + case UBX_RXM_SFRB: ++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_SFRB\n"); + mask = ubx_msg_sfrb(session, &buf[UBX_PREFIX_LEN]); + break; ++ case UBX_RXM_SFRBX: ++ gpsd_log(&session->context->errout, LOG_DATA, "UBX_RXM_SFRBX\n"); ++ break; + case UBX_RXM_SVSI: + gpsd_log(&session->context->errout, LOG_PROG, "UBX_RXM_SVSI\n"); + break; +@@ -955,6 +1070,12 @@ + msg[1] = 0x20; /* msg id = UBX_NAV_TIMEGPS */ + msg[2] = 0x01; /* rate */ + (void)ubx_write(session, 0x06u, 0x01, msg, 3); ++#ifdef UBLOXTIMELS_ENABLE ++ msg[0] = 0x01; /* class */ ++ msg[1] = 0x26; /* msg id = UBX_NAV_TIMELS */ ++ msg[2] = 0xff; /* rate */ ++#endif /* UBLOXTIMELS_ENABLE */ ++ (void)ubx_write(session, 0x06u, 0x01, msg, 3); + msg[0] = 0x01; /* class */ + msg[1] = 0x30; /* msg id = NAV-SVINFO */ + msg[2] = 0x0a; /* rate */ +diff -Naur old/driver_ubx.h new/driver_ubx.h +--- old/driver_ubx.h 2017-01-19 14:12:25.099231346 -0600 ++++ new/driver_ubx.h 2017-01-19 14:01:48.177653001 -0600 +@@ -35,6 +35,7 @@ + UBX_NAV_TIMEGPS = UBX_MSGID(UBX_CLASS_NAV, 0x20), + UBX_NAV_TIMEUTC = UBX_MSGID(UBX_CLASS_NAV, 0x21), + UBX_NAV_CLOCK = UBX_MSGID(UBX_CLASS_NAV, 0x22), ++ UBX_NAV_TIMELS = UBX_MSGID(UBX_CLASS_NAV, 0x26), + UBX_NAV_SVINFO = UBX_MSGID(UBX_CLASS_NAV, 0x30), + UBX_NAV_DGPS = UBX_MSGID(UBX_CLASS_NAV, 0x31), + UBX_NAV_SBAS = UBX_MSGID(UBX_CLASS_NAV, 0x32), +@@ -42,6 +43,7 @@ + + UBX_RXM_RAW = UBX_MSGID(UBX_CLASS_RXM, 0x10), + UBX_RXM_SFRB = UBX_MSGID(UBX_CLA |
