From 419820f4836d4b26a38180c39e59fb100722133e Mon Sep 17 00:00:00 2001 From: caveman99 <25002+caveman99@users.noreply.github.com> Date: Wed, 15 May 2024 12:47:31 +0000 Subject: [PATCH 1/4] [create-pull-request] automated change --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 32 +++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/protobufs b/protobufs index 1bfe0354d..bee9ddc71 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 1bfe0354d101a6a71ea1354ea158e59193671a0b +Subproject commit bee9ddc71677e974568a5a95362d78acac6bb974 diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index b6b08f2e7..7748dd6b3 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -47,7 +47,17 @@ typedef enum _meshtastic_TelemetrySensorType { /* RCWL-9620 Doppler Radar Distance Sensor, used for water level detection */ meshtastic_TelemetrySensorType_RCWL9620 = 16, /* Sensirion High accuracy temperature and humidity */ - meshtastic_TelemetrySensorType_SHT4X = 17 + meshtastic_TelemetrySensorType_SHT4X = 17, + /* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. */ + meshtastic_TelemetrySensorType_VEML7700 = 18, + /* MLX90632 non-contact IR temperature sensor. */ + meshtastic_TelemetrySensorType_MLX90632 = 19, + /* TI OPT3001 Ambient Light Sensor */ + meshtastic_TelemetrySensorType_OPT3001 = 20, + /* Lite On LTR-390UV-01 UV Light Sensor */ + meshtastic_TelemetrySensorType_LTR390UV = 21, + /* AMS TSL25911FN RGB Light Sensor */ + meshtastic_TelemetrySensorType_TSL25911FN = 22 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -84,6 +94,10 @@ typedef struct _meshtastic_EnvironmentMetrics { uint16_t iaq; /* RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm. */ float distance; + /* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. */ + float lux; + /* VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor. */ + float white_lux; } meshtastic_EnvironmentMetrics; /* Power Metrics (voltage / current / etc) */ @@ -154,8 +168,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SHT4X -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SHT4X+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_TSL25911FN +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_TSL25911FN+1)) @@ -165,12 +179,12 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_DeviceMetrics_init_default {0, 0, 0, 0, 0} -#define meshtastic_EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_PowerMetrics_init_default {0, 0, 0, 0, 0, 0} #define meshtastic_AirQualityMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} #define meshtastic_DeviceMetrics_init_zero {0, 0, 0, 0, 0} -#define meshtastic_EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_PowerMetrics_init_zero {0, 0, 0, 0, 0, 0} #define meshtastic_AirQualityMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} @@ -189,6 +203,8 @@ extern "C" { #define meshtastic_EnvironmentMetrics_current_tag 6 #define meshtastic_EnvironmentMetrics_iaq_tag 7 #define meshtastic_EnvironmentMetrics_distance_tag 8 +#define meshtastic_EnvironmentMetrics_lux_tag 9 +#define meshtastic_EnvironmentMetrics_white_lux_tag 10 #define meshtastic_PowerMetrics_ch1_voltage_tag 1 #define meshtastic_PowerMetrics_ch1_current_tag 2 #define meshtastic_PowerMetrics_ch2_voltage_tag 3 @@ -231,7 +247,9 @@ X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \ X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \ X(a, STATIC, SINGULAR, FLOAT, current, 6) \ X(a, STATIC, SINGULAR, UINT32, iaq, 7) \ -X(a, STATIC, SINGULAR, FLOAT, distance, 8) +X(a, STATIC, SINGULAR, FLOAT, distance, 8) \ +X(a, STATIC, SINGULAR, FLOAT, lux, 9) \ +X(a, STATIC, SINGULAR, FLOAT, white_lux, 10) #define meshtastic_EnvironmentMetrics_CALLBACK NULL #define meshtastic_EnvironmentMetrics_DEFAULT NULL @@ -291,7 +309,7 @@ extern const pb_msgdesc_t meshtastic_Telemetry_msg; #define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size #define meshtastic_AirQualityMetrics_size 72 #define meshtastic_DeviceMetrics_size 27 -#define meshtastic_EnvironmentMetrics_size 39 +#define meshtastic_EnvironmentMetrics_size 49 #define meshtastic_PowerMetrics_size 30 #define meshtastic_Telemetry_size 79 From bd9156de24196ce99b6bdda8a0c615565c31cea0 Mon Sep 17 00:00:00 2001 From: Ken McGuire Date: Wed, 15 May 2024 11:12:46 -0600 Subject: [PATCH 2/4] GPS Chechsum failures (#3900) * Portduino multiple logging levels * Fixes based on GPSFan work * Fix derped logic * Correct size field for AID message * Reformat to add comments, beginning of GPS rework * Update PM2 message for Neo-6 * Correct ECO mode logic as ECO mode is only for Neo-6 * Cleanup ubx.h add a few more comments * GPS rework, changes for M8 and stub for M10 * Add VALSET commands for u-blox M10 receivers * Add VALSET commands for u-blox M10 receivers tweak M8 commands add comments for VALSET configuration commands * Add commands to init M10 receivers, tweak the M8 init sequence, this is a WIP as there are still some issues during init. Add M10 version of PMREQ. * Add wakeup source of uartrx to PMREQ_10 The M10 does not respond to commands when asleep, may need to do this for the M8 as well * Enable NMEA messages on USB port. Normally, it is a good idea to disable messages on unused ports. Native Linux needs to be able to use GNSS modules connected via via either serial or USB. In the future I2C connections may be required, but are not enabled for now. * Save the config for all u-blox receiver types. The M10 supports this command in addition to saving using the VALSET commands for the RAM & BBR layers. * Address Issue #3779 RAK12500 GPS Checksum failures Remove NMEA sentences that are not processed by TinyGPS++ or Meshtastic. --------- Co-authored-by: Jonathan Bennett Co-authored-by: Ben Meadors --- src/gps/GPS.cpp | 3 +++ src/gps/ubx.h | 31 ++++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/gps/GPS.cpp b/src/gps/GPS.cpp index eaae049b5..4335244f0 100644 --- a/src/gps/GPS.cpp +++ b/src/gps/GPS.cpp @@ -472,6 +472,9 @@ bool GPS::setup() // Turn off GSV messages, we don't really care about which and where the sats are, maybe someday. _serial_gps->write("$CFGMSG,0,3,0\r\n"); delay(250); + // Turn off GSA messages, TinyGPS++ doesn't use this message. + _serial_gps->write("$CFGMSG,0,2,0\r\n"); + delay(250); // Turn off NOTICE __TXT messages, these may provide Unicore some info but we don't care. _serial_gps->write("$CFGMSG,6,0,0\r\n"); delay(250); diff --git a/src/gps/ubx.h b/src/gps/ubx.h index 5b2cb24ce..0a382a8a3 100644 --- a/src/gps/ubx.h +++ b/src/gps/ubx.h @@ -206,14 +206,14 @@ const uint8_t GPS::_message_GLL[] = { 0x00 // Reserved }; -// Enable GSA. GSA - GPS DOP and active satellites, used for detailing the satellites used in the positioning and +// Disable GSA. GSA - GPS DOP and active satellites, used for detailing the satellites used in the positioning and // the DOP (Dilution of Precision) const uint8_t GPS::_message_GSA[] = { 0xF0, 0x02, // NMEA ID for GSA 0x00, // Rate for DDC - 0x01, // Rate for UART1 + 0x00, // Rate for UART1 0x00, // Rate for UART2 - 0x01, // Rate for USB usefull for native linux + 0x00, // Rate for USB usefull for native linux 0x00, // Rate for SPI 0x00 // Reserved }; @@ -402,23 +402,28 @@ const uint8_t GPS::_message_VALSET_DISABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x00, // BBR layer config message: // b5 62 06 8a 09 00 00 02 00 00 07 00 92 20 06 5a 58 -// Turn NMEA GSA, GGA, RMC messages on: -// Ram layer config message: -// b5 62 06 8a 13 00 00 01 00 00 c0 00 91 20 01 bb 00 91 20 01 ac 00 91 20 01 e1 3b - -// BBR layer config message: -// b5 62 06 8a 13 00 00 02 00 00 c0 00 91 20 01 bb 00 91 20 01 ac 00 91 20 01 e2 4d +// Turn NMEA GGA, RMC messages on: +// Layer config messages: +// RAM: +// b5 62 06 8a 0e 00 00 01 00 00 bb 00 91 20 01 ac 00 91 20 01 6a 8f +// BBR: +// b5 62 06 8a 0e 00 00 02 00 00 bb 00 91 20 01 ac 00 91 20 01 6b 9c +// FLASH: +// b5 62 06 8a 0e 00 00 04 00 00 bb 00 91 20 01 ac 00 91 20 01 6d b6 +// Doing this for the FLASH layer isn't really required since we save the config to flash later const uint8_t GPS::_message_VALSET_DISABLE_TXT_INFO_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x92, 0x20, 0x03}; const uint8_t GPS::_message_VALSET_DISABLE_TXT_INFO_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x07, 0x00, 0x92, 0x20, 0x03}; -const uint8_t GPS::_message_VALSET_ENABLE_NMEA_RAM[] = {0x00, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x91, 0x20, 0x01, 0xbb, - 0x00, 0x91, 0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01}; -const uint8_t GPS::_message_VALSET_ENABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x00, 0xc0, 0x00, 0x91, 0x20, 0x01, 0xbb, - 0x00, 0x91, 0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01}; + +const uint8_t GPS::_message_VALSET_ENABLE_NMEA_RAM[] = {0x00, 0x01, 0x00, 0x00, 0xbb, 0x00, 0x91, + 0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01}; +const uint8_t GPS::_message_VALSET_ENABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x00, 0xbb, 0x00, 0x91, + 0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01}; const uint8_t GPS::_message_VALSET_DISABLE_SBAS_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x31, 0x10, 0x00, 0x05, 0x00, 0x31, 0x10, 0x00}; const uint8_t GPS::_message_VALSET_DISABLE_SBAS_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x31, 0x10, 0x00, 0x05, 0x00, 0x31, 0x10, 0x00}; + /* Operational issues with the M10: From 9e8ca69a11ee8ad2b53f16fb2f3eeeba7f76bef6 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Wed, 15 May 2024 22:24:25 +0200 Subject: [PATCH 3/4] bin: remove unused import in buildinfo.py This was originally added in b1c30f06509459e5afc5291de067b1946ae4ddd5 and it now do nothing since 361556a6a7913104c513c8f8029efe090267bb9f because it now use readprops. --- bin/buildinfo.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/buildinfo.py b/bin/buildinfo.py index 6b123c9cf..5aecad1bd 100755 --- a/bin/buildinfo.py +++ b/bin/buildinfo.py @@ -1,9 +1,8 @@ #!/usr/bin/env python3 -import configparser import sys + from readprops import readProps - -verObj = readProps('version.properties') +verObj = readProps("version.properties") propName = sys.argv[1] print(f"{verObj[propName]}") From 53dea44983bf1a2ee9bec096b2f3cf74167ffe3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 16 May 2024 01:08:52 +0200 Subject: [PATCH 4/4] Revert "Merge pull request #3898 from meshtastic/create-pull-request/patch" This reverts commit 938aba481a9faed90aae4ddac636513dc7d594ff, reversing changes made to 7810e59b0c3fe392c75ed6222558d1d12a1dc201. --- protobufs | 2 +- src/mesh/generated/meshtastic/telemetry.pb.h | 32 +++++--------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/protobufs b/protobufs index bee9ddc71..1bfe0354d 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit bee9ddc71677e974568a5a95362d78acac6bb974 +Subproject commit 1bfe0354d101a6a71ea1354ea158e59193671a0b diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index 7748dd6b3..b6b08f2e7 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -47,17 +47,7 @@ typedef enum _meshtastic_TelemetrySensorType { /* RCWL-9620 Doppler Radar Distance Sensor, used for water level detection */ meshtastic_TelemetrySensorType_RCWL9620 = 16, /* Sensirion High accuracy temperature and humidity */ - meshtastic_TelemetrySensorType_SHT4X = 17, - /* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. */ - meshtastic_TelemetrySensorType_VEML7700 = 18, - /* MLX90632 non-contact IR temperature sensor. */ - meshtastic_TelemetrySensorType_MLX90632 = 19, - /* TI OPT3001 Ambient Light Sensor */ - meshtastic_TelemetrySensorType_OPT3001 = 20, - /* Lite On LTR-390UV-01 UV Light Sensor */ - meshtastic_TelemetrySensorType_LTR390UV = 21, - /* AMS TSL25911FN RGB Light Sensor */ - meshtastic_TelemetrySensorType_TSL25911FN = 22 + meshtastic_TelemetrySensorType_SHT4X = 17 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -94,10 +84,6 @@ typedef struct _meshtastic_EnvironmentMetrics { uint16_t iaq; /* RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm. */ float distance; - /* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor. */ - float lux; - /* VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor. */ - float white_lux; } meshtastic_EnvironmentMetrics; /* Power Metrics (voltage / current / etc) */ @@ -168,8 +154,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_TSL25911FN -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_TSL25911FN+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SHT4X +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SHT4X+1)) @@ -179,12 +165,12 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_DeviceMetrics_init_default {0, 0, 0, 0, 0} -#define meshtastic_EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_EnvironmentMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_PowerMetrics_init_default {0, 0, 0, 0, 0, 0} #define meshtastic_AirQualityMetrics_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Telemetry_init_default {0, 0, {meshtastic_DeviceMetrics_init_default}} #define meshtastic_DeviceMetrics_init_zero {0, 0, 0, 0, 0} -#define meshtastic_EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define meshtastic_EnvironmentMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_PowerMetrics_init_zero {0, 0, 0, 0, 0, 0} #define meshtastic_AirQualityMetrics_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define meshtastic_Telemetry_init_zero {0, 0, {meshtastic_DeviceMetrics_init_zero}} @@ -203,8 +189,6 @@ extern "C" { #define meshtastic_EnvironmentMetrics_current_tag 6 #define meshtastic_EnvironmentMetrics_iaq_tag 7 #define meshtastic_EnvironmentMetrics_distance_tag 8 -#define meshtastic_EnvironmentMetrics_lux_tag 9 -#define meshtastic_EnvironmentMetrics_white_lux_tag 10 #define meshtastic_PowerMetrics_ch1_voltage_tag 1 #define meshtastic_PowerMetrics_ch1_current_tag 2 #define meshtastic_PowerMetrics_ch2_voltage_tag 3 @@ -247,9 +231,7 @@ X(a, STATIC, SINGULAR, FLOAT, gas_resistance, 4) \ X(a, STATIC, SINGULAR, FLOAT, voltage, 5) \ X(a, STATIC, SINGULAR, FLOAT, current, 6) \ X(a, STATIC, SINGULAR, UINT32, iaq, 7) \ -X(a, STATIC, SINGULAR, FLOAT, distance, 8) \ -X(a, STATIC, SINGULAR, FLOAT, lux, 9) \ -X(a, STATIC, SINGULAR, FLOAT, white_lux, 10) +X(a, STATIC, SINGULAR, FLOAT, distance, 8) #define meshtastic_EnvironmentMetrics_CALLBACK NULL #define meshtastic_EnvironmentMetrics_DEFAULT NULL @@ -309,7 +291,7 @@ extern const pb_msgdesc_t meshtastic_Telemetry_msg; #define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size #define meshtastic_AirQualityMetrics_size 72 #define meshtastic_DeviceMetrics_size 27 -#define meshtastic_EnvironmentMetrics_size 49 +#define meshtastic_EnvironmentMetrics_size 39 #define meshtastic_PowerMetrics_size 30 #define meshtastic_Telemetry_size 79