From 2ebfcea94eaf8e4826ce52795c43c316aada0a39 Mon Sep 17 00:00:00 2001 From: Augusto Zanellato Date: Wed, 18 Sep 2024 19:43:13 +0200 Subject: [PATCH 01/10] DetectionSensor: broadcast all state changes Closes #4753 --- src/modules/DetectionSensorModule.cpp | 14 ++++++++++---- src/modules/DetectionSensorModule.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/modules/DetectionSensorModule.cpp b/src/modules/DetectionSensorModule.cpp index 20d91a381..d637fa7c6 100644 --- a/src/modules/DetectionSensorModule.cpp +++ b/src/modules/DetectionSensorModule.cpp @@ -49,10 +49,16 @@ int32_t DetectionSensorModule::runOnce() // LOG_DEBUG("Detection Sensor Module: Current pin state: %i\n", digitalRead(moduleConfig.detection_sensor.monitor_pin)); - if ((millis() - lastSentToMesh) >= Default::getConfiguredOrDefaultMs(moduleConfig.detection_sensor.minimum_broadcast_secs) && - hasDetectionEvent()) { - sendDetectionMessage(); - return DELAYED_INTERVAL; + if ((millis() - lastSentToMesh) >= Default::getConfiguredOrDefaultMs(moduleConfig.detection_sensor.minimum_broadcast_secs)) { + if (hasDetectionEvent()) { + wasDetected = true; + sendDetectionMessage(); + return DELAYED_INTERVAL; + } else if (wasDetected) { + wasDetected = false; + sendCurrentStateMessage(); + return DELAYED_INTERVAL; + } } // Even if we haven't detected an event, broadcast our current state to the mesh on the scheduled interval as a sort // of heartbeat. We only do this if the minimum broadcast interval is greater than zero, otherwise we'll only broadcast state diff --git a/src/modules/DetectionSensorModule.h b/src/modules/DetectionSensorModule.h index ed6cddda5..eb17bf3a2 100644 --- a/src/modules/DetectionSensorModule.h +++ b/src/modules/DetectionSensorModule.h @@ -15,6 +15,7 @@ class DetectionSensorModule : public SinglePortModule, private concurrency::OSTh private: bool firstTime = true; uint32_t lastSentToMesh = 0; + bool wasDetected = false; void sendDetectionMessage(); void sendCurrentStateMessage(); bool hasDetectionEvent(); From cc89e85e712fec5fbf16d62a9207ca9636da6b6a Mon Sep 17 00:00:00 2001 From: David Huang Date: Thu, 19 Sep 2024 00:53:33 -0500 Subject: [PATCH 02/10] Another missed define for the T114 --- boards/heltec_mesh_node_t114.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/heltec_mesh_node_t114.json b/boards/heltec_mesh_node_t114.json index 5c97d8c75..2bd306eb9 100644 --- a/boards/heltec_mesh_node_t114.json +++ b/boards/heltec_mesh_node_t114.json @@ -5,7 +5,7 @@ }, "core": "nRF5", "cpu": "cortex-m4", - "extra_flags": "-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA", + "extra_flags": "-DHELTEC_T114 -DNRF52840_XXAA", "f_cpu": "64000000L", "hwids": [ ["0x239A", "0x4405"], From 7c32ab3023c3e1a19c97bf9d4b724743124e2d48 Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Thu, 19 Sep 2024 08:20:53 +0200 Subject: [PATCH 03/10] Update ms24sf1.json --- boards/ms24sf1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/ms24sf1.json b/boards/ms24sf1.json index 4e28507da..8356e3012 100644 --- a/boards/ms24sf1.json +++ b/boards/ms24sf1.json @@ -5,7 +5,7 @@ }, "core": "nRF5", "cpu": "cortex-m4", - "extra_flags": "-DARDUINO_WIO_WM1110 -DNRF52840_XXAA", + "extra_flags": "-DMS24SF1 -DNRF52840_XXAA", "f_cpu": "64000000L", "hwids": [ ["0x239A", "0x8029"], From 7289b295e85caf13c28930c795c525a0aab4a396 Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Thu, 19 Sep 2024 08:20:57 +0200 Subject: [PATCH 04/10] Update me25ls01-4y10td.json --- boards/me25ls01-4y10td.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/me25ls01-4y10td.json b/boards/me25ls01-4y10td.json index 46c526a7c..9e1d63265 100644 --- a/boards/me25ls01-4y10td.json +++ b/boards/me25ls01-4y10td.json @@ -5,7 +5,7 @@ }, "core": "nRF5", "cpu": "cortex-m4", - "extra_flags": "-DARDUINO_WIO_WM1110 -DNRF52840_XXAA", + "extra_flags": "-DME25LS01_4Y10TD -DNRF52840_XXAA", "f_cpu": "64000000L", "hwids": [ ["0x239A", "0x8029"], From 5c4c0965af040878e9270f8030673c0b3d099b0e Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Thu, 19 Sep 2024 08:21:00 +0200 Subject: [PATCH 05/10] Update nordic_pca10059.json --- boards/nordic_pca10059.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/nordic_pca10059.json b/boards/nordic_pca10059.json index b99e3c763..6540817a2 100644 --- a/boards/nordic_pca10059.json +++ b/boards/nordic_pca10059.json @@ -5,7 +5,7 @@ }, "core": "nRF5", "cpu": "cortex-m4", - "extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA", + "extra_flags": "-DNORDIC_PCA10059 -DNRF52840_XXAA", "f_cpu": "64000000L", "hwids": [ ["0x239A", "0x8029"], From 6473cf0b698176fe0dc2fb8e88155b1087cfc7fb Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Thu, 19 Sep 2024 19:48:22 +0800 Subject: [PATCH 06/10] Update RadioLib to 7.0.0 (#4771) We were not too many commits behind, and the changes since then were either for LoraWAN or useful minor bug fixes for SX1280. --- platformio.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index d561aaf74..f38ec41e4 100644 --- a/platformio.ini +++ b/platformio.ini @@ -88,8 +88,7 @@ monitor_speed = 115200 monitor_filters = direct lib_deps = -; jgromes/RadioLib@~6.6.0 - https://github.com/jgromes/RadioLib.git#3115fc2d6700a9aee05888791ac930a910f2628f + jgromes/RadioLib@~7.0.0 https://github.com/meshtastic/esp8266-oled-ssd1306.git#e16cee124fe26490cb14880c679321ad8ac89c95 ; ESP8266_SSD1306 https://github.com/mathertel/OneButton@~2.6.1 ; OneButton library for non-blocking button debounce https://github.com/meshtastic/arduino-fsm.git#7db3702bf0cfe97b783d6c72595e3f38e0b19159 @@ -162,4 +161,4 @@ lib_deps = https://github.com/meshtastic/DFRobot_LarkWeatherStation#dee914270dc7cb3e43fbf034edd85a63a16a12ee - https://github.com/gjelsoe/STK8xxx-Accelerometer.git#v0.1.1 \ No newline at end of file + https://github.com/gjelsoe/STK8xxx-Accelerometer.git#v0.1.1 From 91b4199f9d63526f254f1ced374c20194a98b749 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 19 Sep 2024 10:46:18 -0500 Subject: [PATCH 07/10] Revert "DetectionSensor: broadcast all state changes" (#4776) --- src/modules/DetectionSensorModule.cpp | 14 ++++---------- src/modules/DetectionSensorModule.h | 1 - 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/modules/DetectionSensorModule.cpp b/src/modules/DetectionSensorModule.cpp index d637fa7c6..20d91a381 100644 --- a/src/modules/DetectionSensorModule.cpp +++ b/src/modules/DetectionSensorModule.cpp @@ -49,16 +49,10 @@ int32_t DetectionSensorModule::runOnce() // LOG_DEBUG("Detection Sensor Module: Current pin state: %i\n", digitalRead(moduleConfig.detection_sensor.monitor_pin)); - if ((millis() - lastSentToMesh) >= Default::getConfiguredOrDefaultMs(moduleConfig.detection_sensor.minimum_broadcast_secs)) { - if (hasDetectionEvent()) { - wasDetected = true; - sendDetectionMessage(); - return DELAYED_INTERVAL; - } else if (wasDetected) { - wasDetected = false; - sendCurrentStateMessage(); - return DELAYED_INTERVAL; - } + if ((millis() - lastSentToMesh) >= Default::getConfiguredOrDefaultMs(moduleConfig.detection_sensor.minimum_broadcast_secs) && + hasDetectionEvent()) { + sendDetectionMessage(); + return DELAYED_INTERVAL; } // Even if we haven't detected an event, broadcast our current state to the mesh on the scheduled interval as a sort // of heartbeat. We only do this if the minimum broadcast interval is greater than zero, otherwise we'll only broadcast state diff --git a/src/modules/DetectionSensorModule.h b/src/modules/DetectionSensorModule.h index eb17bf3a2..ed6cddda5 100644 --- a/src/modules/DetectionSensorModule.h +++ b/src/modules/DetectionSensorModule.h @@ -15,7 +15,6 @@ class DetectionSensorModule : public SinglePortModule, private concurrency::OSTh private: bool firstTime = true; uint32_t lastSentToMesh = 0; - bool wasDetected = false; void sendDetectionMessage(); void sendCurrentStateMessage(); bool hasDetectionEvent(); From d3a293a0d82d044bee9c9894011862f0a38dafa6 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 19 Sep 2024 12:10:39 -0500 Subject: [PATCH 08/10] Flag semgrep to not run on self-hosted The semgrep action runs inside a docker container, and docker in podman just doesn't work. --- .github/workflows/sec_sast_semgrep_pull.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sec_sast_semgrep_pull.yml b/.github/workflows/sec_sast_semgrep_pull.yml index b6c288494..2575cbf01 100644 --- a/.github/workflows/sec_sast_semgrep_pull.yml +++ b/.github/workflows/sec_sast_semgrep_pull.yml @@ -4,7 +4,7 @@ on: pull_request jobs: semgrep-diff: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: image: returntocorp/semgrep From 114df8cb1bfa1c7d124935b48e7faec0fba99fb3 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 19 Sep 2024 13:29:17 -0500 Subject: [PATCH 09/10] Pin sensorlib version --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index f38ec41e4..9b869a036 100644 --- a/platformio.ini +++ b/platformio.ini @@ -156,7 +156,7 @@ lib_deps = https://github.com/boschsensortec/Bosch-BSEC2-Library#v1.7.2502 boschsensortec/BME68x Sensor Library@^1.1.40407 https://github.com/KodinLanewave/INA3221@^1.0.0 - lewisxhe/SensorLib@^0.2.0 + lewisxhe/SensorLib@0.2.0 mprograms/QMC5883LCompass@^1.2.0 From 0f3450ad441f766bd451e9f2d2cfea09b5730431 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 19 Sep 2024 18:21:30 -0500 Subject: [PATCH 10/10] Mark package workflows for gh hosted runners --- .github/workflows/package_amd64.yml | 2 +- .github/workflows/package_raspbian.yml | 2 +- .github/workflows/package_raspbian_armv7l.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package_amd64.yml b/.github/workflows/package_amd64.yml index ae7bf3242..0b5093f24 100644 --- a/.github/workflows/package_amd64.yml +++ b/.github/workflows/package_amd64.yml @@ -13,7 +13,7 @@ jobs: uses: ./.github/workflows/build_native.yml package-native: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: build-native steps: - name: Checkout code diff --git a/.github/workflows/package_raspbian.yml b/.github/workflows/package_raspbian.yml index 5471332c5..bcbda53e2 100644 --- a/.github/workflows/package_raspbian.yml +++ b/.github/workflows/package_raspbian.yml @@ -13,7 +13,7 @@ jobs: uses: ./.github/workflows/build_raspbian.yml package-raspbian: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: build-raspbian steps: - name: Checkout code diff --git a/.github/workflows/package_raspbian_armv7l.yml b/.github/workflows/package_raspbian_armv7l.yml index 5b9c9aa71..1308fe925 100644 --- a/.github/workflows/package_raspbian_armv7l.yml +++ b/.github/workflows/package_raspbian_armv7l.yml @@ -13,7 +13,7 @@ jobs: uses: ./.github/workflows/build_raspbian_armv7l.yml package-raspbian_armv7l: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: build-raspbian_armv7l steps: - name: Checkout code