diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 8a25829e4..1d86520d0 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -240,6 +240,7 @@ jobs: needs: [build] steps: - uses: actions/checkout@v6 + if: github.event_name == 'pull_request_target' with: filter: blob:none # means we download all the git history but none of the commit (except ones with checkout like the head) fetch-depth: 0 @@ -253,18 +254,24 @@ jobs: uses: actions/upload-artifact@v6 id: upload-manifest with: - name: manifests-all + name: manifests-${{ github.sha }} overwrite: true - path: | - manifests-new/*.mt.json + path: manifests-new/*.mt.json - name: Find the merge base + if: github.event_name == 'pull_request_target' run: echo "MERGE_BASE=$(git merge-base "origin/$base" "$head")" >> $GITHUB_ENV env: base: ${{ github.base_ref }} - head: ${{ github.head_ref }} + head: ${{ github.sha }} - name: Download the old manifests - run: gh run download -R ${{ github.repository }} --commit ${{ env.MERGE_BASE }} --name manifests-all --dir manifest-old/ + if: github.event_name == 'pull_request_target' + run: gh run download -R "$repo" --name "manifests-$merge_base" --dir manifest-old/ + env: + GH_TOKEN: ${{ github.token }} + merge_base: ${{ env.MERGE_BASE }} + repo: ${{ github.repository }} - name: Do scan and post comment + if: github.event_name == 'pull_request_target' run: python3 bin/shame.py ${{ github.event.pull_request.number }} manifests-old/ manifests-new/ release-artifacts: diff --git a/.gitignore b/.gitignore index cc742c6c1..06e8c472f 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,12 @@ src/mesh/raspihttp/private_key.pem # Ignore logo (set at build time with platformio-custom.py) data/boot/logo.* + +# pioarduino platform +managed_components/* +arduino-lib-builder* +dependencies.lock +idf_component.yml +CMakeLists.txt +sdkconfig.* +.dummy/* diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index c20066f7f..3656ae32c 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,9 +9,9 @@ plugins: lint: enabled: - checkov@3.2.495 - - renovate@42.64.1 + - renovate@42.66.8 - prettier@3.7.4 - - trufflehog@3.92.3 + - trufflehog@3.92.4 - yamllint@1.37.1 - bandit@1.9.2 - trivy@0.68.2 diff --git a/bin/build-nrf52.sh b/bin/build-nrf52.sh index e3a421865..edcc2add2 100755 --- a/bin/build-nrf52.sh +++ b/bin/build-nrf52.sh @@ -21,13 +21,14 @@ rm -f $BUILDDIR/firmware* export APP_VERSION=$VERSION basename=firmware-$1-$VERSION +ota_basename=${basename}-ota pio run --environment $1 -t mtjson # -v cp $BUILDDIR/$basename.elf $OUTDIR/$basename.elf echo "Copying NRF52 dfu (OTA) file" -cp $BUILDDIR/$basename.zip $OUTDIR/$basename.zip +cp $BUILDDIR/$basename.zip $OUTDIR/$ota_basename.zip echo "Copying NRF52 UF2 file" cp $BUILDDIR/$basename.uf2 $OUTDIR/$basename.uf2 diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 5779167ab..140ac3e2a 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,9 +87,6 @@ - - https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.18 - https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.17 diff --git a/bin/platformio-custom.py b/bin/platformio-custom.py index 3fdbffb70..b6560f35b 100644 --- a/bin/platformio-custom.py +++ b/bin/platformio-custom.py @@ -17,6 +17,8 @@ lfsbin = f"{progname.replace('firmware-', 'littlefs-')}.bin" def manifest_gather(source, target, env): out = [] + board_platform = env.BoardConfig().get("platform") + needs_ota_suffix = board_platform == "nordicnrf52" check_paths = [ progname, f"{progname}.elf", @@ -32,8 +34,11 @@ def manifest_gather(source, target, env): for p in check_paths: f = env.File(env.subst(f"$BUILD_DIR/{p}")) if f.exists(): + manifest_name = p + if needs_ota_suffix and p == f"{progname}.zip": + manifest_name = f"{progname}-ota.zip" d = { - "name": p, + "name": manifest_name, "md5": f.get_content_hash(), # Returns MD5 hash "bytes": f.get_size() # Returns file size in bytes } diff --git a/debian/changelog b/debian/changelog index ccaffa3cf..b9212c1be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,3 @@ -meshtasticd (2.7.18.0) unstable; urgency=medium - - * Version 2.7.18 - - -- GitHub Actions Sat, 20 Dec 2025 15:47:25 +0000 - meshtasticd (2.7.17.0) unstable; urgency=medium * Version 2.7.17 diff --git a/platformio.ini b/platformio.ini index cb8da746f..6e28a7eda 100644 --- a/platformio.ini +++ b/platformio.ini @@ -64,7 +64,7 @@ monitor_speed = 115200 monitor_filters = direct lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp8266-oled-ssd1306 packageName=https://github.com/meshtastic/esp8266-oled-ssd1306 gitBranch=master - https://github.com/meshtastic/esp8266-oled-ssd1306/archive/2887bf4a19f64d92c984dcc8fd5ca7429e425e4a.zip + https://github.com/meshtastic/esp8266-oled-ssd1306/archive/b34c6817c25d6faabb3a8a162b5d14fb75395433.zip # renovate: datasource=git-refs depName=meshtastic-OneButton packageName=https://github.com/meshtastic/OneButton gitBranch=master https://github.com/meshtastic/OneButton/archive/fa352d668c53f290cfa480a5f79ad422cd828c70.zip # renovate: datasource=git-refs depName=meshtastic-arduino-fsm packageName=https://github.com/meshtastic/arduino-fsm gitBranch=master diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 2d4bad854..9052ee17c 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -805,7 +805,8 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.external_notification.output_ms = 500; moduleConfig.external_notification.nag_timeout = 2; #endif -#if defined(RAK4630) || defined(RAK11310) || defined(RAK3312) || defined(MUZI_BASE) || defined(ELECROW_ThinkNode_M3) +#if defined(RAK4630) || defined(RAK11310) || defined(RAK3312) || defined(MUZI_BASE) || defined(ELECROW_ThinkNode_M3) || \ + defined(ELECROW_ThinkNode_M6) // Default to PIN_LED2 for external notification output (LED color depends on device variant) moduleConfig.external_notification.enabled = true; moduleConfig.external_notification.output = PIN_LED2; diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 0fa09df74..f7116e701 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -429,7 +429,9 @@ int32_t PositionModule::runOnce() if (lastGpsSend == 0 || msSinceLastSend >= intervalMs) { if (waitingForFreshPosition) { +#ifdef GPS_DEBUG LOG_DEBUG("Skip initial position send; no fresh position since boot"); +#endif } else if (nodeDB->hasValidPosition(node)) { lastGpsSend = now; diff --git a/src/modules/PositionModule.h b/src/modules/PositionModule.h index 4a2415058..32e499531 100644 --- a/src/modules/PositionModule.h +++ b/src/modules/PositionModule.h @@ -69,7 +69,7 @@ class PositionModule : public ProtobufModule, private concu // In event mode we want to prevent excessive position broadcasts // we set the minimum interval to 5m const uint32_t minimumTimeThreshold = - max(300000, Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30)); + max(uint32_t(300000), Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30)); #else const uint32_t minimumTimeThreshold = Default::getConfiguredOrDefaultMs(config.position.broadcast_smart_minimum_interval_secs, 30); diff --git a/src/modules/StatusLEDModule.cpp b/src/modules/StatusLEDModule.cpp index 04cd7326f..8738c16ca 100644 --- a/src/modules/StatusLEDModule.cpp +++ b/src/modules/StatusLEDModule.cpp @@ -20,7 +20,7 @@ int StatusLEDModule::handleStatusUpdate(const meshtastic::Status *arg) switch (arg->getStatusType()) { case STATUS_TYPE_POWER: { meshtastic::PowerStatus *powerStatus = (meshtastic::PowerStatus *)arg; - if (powerStatus->getHasUSB()) { + if (powerStatus->getHasUSB() || powerStatus->getIsCharging()) { power_state = charging; if (powerStatus->getBatteryChargePercent() >= 100) { power_state = charged; diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index b3d12bb34..52910d6e9 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -279,7 +279,7 @@ void portduinoSetup() // RAK6421-13300-S1:aabbcc123456:5ba85807d92138b7519cfb60460573af:3061e8d8 // :mac address :<16 random unique bytes in hexidecimal> : crc32 // crc32 is calculated on the eeprom string up to but not including the final colon - if (strlen(autoconf_product) < 6) { + if (strlen(autoconf_product) < 6 && portduino_config.i2cdev != "") { try { char *mac_start = nullptr; char *devID_start = nullptr; @@ -874,4 +874,4 @@ void readGPIOFromYaml(YAML::Node sourceNode, pinMapping &destPin, int pinDefault destPin.line = destPin.pin; destPin.gpiochip = portduino_config.lora_default_gpiochip; } -} \ No newline at end of file +} diff --git a/variants/nrf52840/ELECROW-ThinkNode-M3/platformio.ini b/variants/nrf52840/ELECROW-ThinkNode-M3/platformio.ini index 7dadc27ee..0ed46896f 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M3/platformio.ini +++ b/variants/nrf52840/ELECROW-ThinkNode-M3/platformio.ini @@ -15,5 +15,5 @@ lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=custom.pio depName=nRF52_PWM packageName=khoih-prog/library/nRF52_PWM khoih-prog/nRF52_PWM@1.0.1 - # renovate: datasource=custom.pio depName=PCF8563 packageName=lewisxhe/library/PCF8563_Library - lewisxhe/PCF8563_Library@1.0.1 + ; # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib + ; lewisxhe/SensorLib@0.3.3 diff --git a/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h b/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h index a27a344d2..29a6c85fd 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h +++ b/variants/nrf52840/ELECROW-ThinkNode-M3/variant.h @@ -114,7 +114,8 @@ extern "C" { #define LR11X0_DIO_AS_RF_SWITCH // PCF8563 RTC Module -#define PCF8563_RTC 0x51 +// REVISIT https://github.com/meshtastic/firmware/pull/9084 +// #define PCF8563_RTC 0x51 #ifdef __cplusplus } diff --git a/variants/nrf52840/ELECROW-ThinkNode-M6/platformio.ini b/variants/nrf52840/ELECROW-ThinkNode-M6/platformio.ini index 8f1a660cd..18108df83 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M6/platformio.ini +++ b/variants/nrf52840/ELECROW-ThinkNode-M6/platformio.ini @@ -12,5 +12,5 @@ build_flags = ${nrf52840_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/ELECROW-ThinkNode-M6> lib_deps = ${nrf52840_base.lib_deps} - # renovate: datasource=custom.pio depName=PCF8563 packageName=lewisxhe/library/PCF8563_Library - lewisxhe/PCF8563_Library@1.0.1 + ; # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib + ; lewisxhe/SensorLib@0.3.3 diff --git a/variants/nrf52840/ELECROW-ThinkNode-M6/variant.cpp b/variants/nrf52840/ELECROW-ThinkNode-M6/variant.cpp index 09872d409..9c7b521ef 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M6/variant.cpp +++ b/variants/nrf52840/ELECROW-ThinkNode-M6/variant.cpp @@ -41,3 +41,30 @@ void initVariant() pinMode(VDD_FLASH_EN, OUTPUT); digitalWrite(VDD_FLASH_EN, HIGH); } + +// called from main-nrf52.cpp during the cpuDeepSleep() function +void variant_shutdown() +{ + // This sets the pin to OUTPUT and LOW for the pins *not* in the if block. + for (int pin = 0; pin < 48; pin++) { + if (pin == PIN_GPS_EN || pin == ADC_CTRL || pin == PIN_BUTTON1 || pin == PIN_SPI_MISO || pin == PIN_SPI_MOSI || + pin == PIN_SPI_SCK) { + continue; + } + pinMode(pin, OUTPUT); + digitalWrite(pin, LOW); + if (pin >= 32) { + NRF_P1->DIRCLR = (1 << (pin - 32)); + } else { + NRF_GPIO->DIRCLR = (1 << pin); + } + } + + digitalWrite(PIN_GPS_EN, LOW); + digitalWrite(ADC_CTRL, LOW); + // digitalWrite(RTC_POWER, LOW); + + nrf_gpio_cfg_input(PIN_BUTTON1, NRF_GPIO_PIN_PULLUP); // Configure the pin to be woken up as an input + nrf_gpio_pin_sense_t sense1 = NRF_GPIO_PIN_SENSE_LOW; + nrf_gpio_cfg_sense_set(PIN_BUTTON1, sense1); +} diff --git a/variants/nrf52840/ELECROW-ThinkNode-M6/variant.h b/variants/nrf52840/ELECROW-ThinkNode-M6/variant.h index d30b88d66..984f967d8 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M6/variant.h +++ b/variants/nrf52840/ELECROW-ThinkNode-M6/variant.h @@ -44,8 +44,10 @@ extern "C" { #define LED_BLUE -1 #define LED_CHARGE (12) #define LED_PAIRING (7) +#define PIN_LED2 LED_PAIRING -#define LED_STATE_ON 1 +#define LED_STATE_ON HIGH +#define LED_STATE_OFF LOW // USB power detection #define EXT_PWR_DETECT (13) @@ -119,7 +121,8 @@ static const uint8_t A0 = PIN_A0; #define PIN_SERIAL2_TX (24) // PCF8563 RTC Module -#define PCF8563_RTC 0x51 +// REVISIT https://github.com/meshtastic/firmware/pull/9084 +// #define PCF8563_RTC 0x51 // SPI #define SPI_INTERFACES_COUNT 1 diff --git a/version.properties b/version.properties index 0a028eff0..8e40687e9 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 18 +build = 17