Skip to content

Apply SX1262 register 0x8B5 patch for improved GC1109 RX sensitivity#9571

Merged
thebentern merged 3 commits into
meshtastic:developfrom
weebl2000:fix/gc1109-sx1262-register-patch
Feb 21, 2026
Merged

Apply SX1262 register 0x8B5 patch for improved GC1109 RX sensitivity#9571
thebentern merged 3 commits into
meshtastic:developfrom
weebl2000:fix/gc1109-sx1262-register-patch

Conversation

@weebl2000
Copy link
Copy Markdown
Contributor

Summary

  • Apply undocumented SX1262 register 0x8B5 patch (set LSB=1) on Heltec V4 and Wireless Tracker V2 boards with the GC1109 FEM
  • Patch recommended by Heltec engineer (@Quency-D) based on Semtech guidance
  • Guarded by USE_GC1109_PA so only affects GC1109 boards

Background

Testing in MeshCore PR #1398 showed this register patch significantly improved RX sensitivity on the Heltec V4, reducing packet loss from ~55% to ~25% — bringing it in line with a RAK4631 reference node at the same location.

The patch was originally identified via discussion in meshtastic/firmware#9029 and MeshCore PR #1249.

Test plan

  • Flash Heltec V4, verify RX sensitivity improvement via RSSI/SNR comparison with a reference node
  • Verify TX still works correctly
  • Verify no regression on other SX1262 boards (patch is behind USE_GC1109_PA guard)

@github-actions github-actions Bot added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Feb 8, 2026
@fifieldt fifieldt added the bugfix Pull request that fixes bugs label Feb 8, 2026
@weebl2000 weebl2000 force-pushed the fix/gc1109-sx1262-register-patch branch from f652731 to a327833 Compare February 9, 2026 21:21
@compumike
Copy link
Copy Markdown
Contributor

@weebl2000 Did you have to do anything special to get this to compile? I tried and it looks like RADIOLIB_GODMODE or RADIOLIB_LOW_LEVEL flags are needed to get at lora.readRegister / lora.writeRegister:
https://github.com/jgromes/RadioLib/blob/87bf5785a3ca58dae184cff7b9860bef84a09b5c/src/modules/SX126x/SX126x.h#L826-L837

(I don't think any of the CI builds would catch this because none have USE_GC1109_PA defined.)

@weebl2000 weebl2000 force-pushed the fix/gc1109-sx1262-register-patch branch from a327833 to a6cb9e0 Compare February 11, 2026 01:59
@weebl2000
Copy link
Copy Markdown
Contributor Author

@weebl2000 Did you have to do anything special to get this to compile? I tried and it looks like RADIOLIB_GODMODE or RADIOLIB_LOW_LEVEL flags are needed to get at lora.readRegister / lora.writeRegister: https://github.com/jgromes/RadioLib/blob/87bf5785a3ca58dae184cff7b9860bef84a09b5c/src/modules/SX126x/SX126x.h#L826-L837

(I don't think any of the CI builds would catch this because none have USE_GC1109_PA defined.)

I haven't tried to compile this on meshtastic. Thanks. Modified the code now to use higher level function to set the register value - this should work now.

@weebl2000 weebl2000 force-pushed the fix/gc1109-sx1262-register-patch branch 4 times, most recently from 616cecf to 0621ca4 Compare February 11, 2026 12:57
@starvald
Copy link
Copy Markdown

Thanks @weebl2000, don't have stats but my v4 is connecting much better to the mesh when i bring it to work.

@weebl2000 weebl2000 force-pushed the fix/gc1109-sx1262-register-patch branch from 0621ca4 to b4dc091 Compare February 13, 2026 10:24
@compumike
Copy link
Copy Markdown
Contributor

@weebl2000 @Quency-D Thanks for making this PR.

  • Could you describe what the 0x8B5 register LSB controls?
  • How can this change can be measured for validation?
  • Do you know who can we contact to get more information?

This information would help get this PR merged!

@weebl2000
Copy link
Copy Markdown
Contributor Author

@weebl2000 @Quency-D Thanks for making this PR.

  • Could you describe what the 0x8B5 register LSB controls?
  • How can this change can be measured for validation?
  • Do you know who can we contact to get more information?

This information would help get this PR merged!

  • I don't know what it does, just that it was recommended to set when using SX1262 alongside a GC1109.
  • Measure for validation by comparing RX (values+number of packets missed), ideally against a reference V4 without the patch enabled. It definitely works imho.
  • Contact Semtech I guess.

@weebl2000 weebl2000 force-pushed the fix/gc1109-sx1262-register-patch branch from b4dc091 to 6bc5451 Compare February 16, 2026 09:57
Copy link
Copy Markdown
Member

@caveman99 caveman99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow i don't feel confident at all to merge this, after this statement "I don't know what it does, just that it was recommended to set when using SX1262 alongside a GC1109."

Thoughts?

@weebl2000
Copy link
Copy Markdown
Contributor Author

Somehow i don't feel confident at all to merge this, after this statement "I don't know what it does, just that it was recommended to set when using SX1262 alongside a GC1109."

Thoughts?

It would be nice if Semtech can tell us what it actually does. But when the patch shows improvements and it was recommended by the manufacturers Semtech & Heltech who make the hardware, I feel like it's pretty safe to merge.

@weebl2000 weebl2000 force-pushed the fix/gc1109-sx1262-register-patch branch from 6bc5451 to 99f94d1 Compare February 16, 2026 12:46
@compumike
Copy link
Copy Markdown
Contributor

Did some more research on this and found that this 0x8B5 LSB setting has been in the official HelTecAutomation/Heltec_ESP32 repo for two years (since 2024-03-19), committed by @Heltec-Aaron-Lee:

SX126xWriteRegister(0x8B5, SX126xReadRegister(0x8B5) | 0x01);

https://github.com/HelTecAutomation/Heltec_ESP32/blame/7663bf84c4c54afddb181d64706c7ced77aea0a5/src/radio/radio.c#L992

Notably, this is applied always -- not just for #if defined(USE_GC1109_PA)! So it may be a relevant improvement for other models as well.

@Heltec-Aaron-Lee can you comment?

@compumike
Copy link
Copy Markdown
Contributor

As of today I've made email contact with engineers at Semtech and Heltec asking about this 0x8B5 register, but both said it may be a week or two due to holidays.

Regardless, the fact that it's been in the official HelTecAutomation/Heltec_ESP32 repo for two years does increase my confidence, and probably means that we might want to alpha test it for all SX126x chips -- not just with GC1109.

Sets the LSB of undocumented SX1262 register 0x8B5 on Heltec V4 and
Wireless Tracker V2 boards with the GC1109 FEM. This patch was
recommended by Heltec/Semtech and tested in MeshCore PR meshtastic#1398, where
it significantly reduced packet loss on the Heltec V4.
@weebl2000 weebl2000 force-pushed the fix/gc1109-sx1262-register-patch branch from 99f94d1 to b0a638c Compare February 21, 2026 13:16
@thebentern thebentern merged commit 9383d0b into meshtastic:develop Feb 21, 2026
77 checks passed
portablestew pushed a commit to portablestew/meshtastic-firmware that referenced this pull request Feb 22, 2026
…eshtastic#9571)

* Apply SX1262 register 0x8B5 patch for improved GC1109 RX sensitivity

Sets the LSB of undocumented SX1262 register 0x8B5 on Heltec V4 and
Wireless Tracker V2 boards with the GC1109 FEM. This patch was
recommended by Heltec/Semtech and tested in MeshCore PR meshtastic#1398, where
it significantly reduced packet loss on the Heltec V4.

* Use higher level function

* Add .venv/ to .gitignore
@Heltec-Aaron-Lee
Copy link
Copy Markdown
Contributor

When the LoRa 1262 receives signals with strong interference, the internal AGC (Automatic Gain Control) may malfunction and stop automatically adjusting. Configuring register 0x8B5 will correct this issue.

Regardless of whether the LoRa 1262 receiver has an external LNA, configuring register 0x8B5 improves AGC performance in environments with strong interference. This is especially noticeable in devices with an external LNA, where optimizing overall reception performance is more critical.

A few months ago, we sent a firmware version with register 0x8B5 configured for enthusiastic LoRa 32 V4 beta testers. Most user feedback indicated it was effective and provided a significant improvement. However, we haven't tested it in version V3 because V3's reception doesn't involve an LNA.

P.S. The latest LoRa 32 V4.3.1 hardware has incorporated user feedback, and the LoRa 1262's reception link can now be programmatically controlled to bypass the LNA or be routed directly.

@cpatulea
Copy link
Copy Markdown
Contributor

Related: #9777

@cpatulea
Copy link
Copy Markdown
Contributor

cpatulea commented Mar 1, 2026

Reddit thread about this change: https://www.reddit.com/r/meshtastic/s/7aAvwDE2Ub

@iuvi7
Copy link
Copy Markdown

iuvi7 commented Mar 10, 2026

Sorry for trouble, so actually will be better to wait for V4.3.1 to be placed on market, right? Does Heltec announces new revisions? Thank you

@weebl2000
Copy link
Copy Markdown
Contributor Author

Sorry for trouble, so actually will be better to wait for V4.3.1 to be placed on market, right? Does Heltec announces new revisions? Thank you

If you order from Heltec official store put in a note asking for Heltec v4.3.1 if you order v4 and you will receive it. 😉Got mine in today.

@iuvi7
Copy link
Copy Markdown

iuvi7 commented Mar 11, 2026

@weebl2000 Cool! Thanks! How is it as for now? Much better? Firmware you use is 2.7.20 ?

@weebl2000
Copy link
Copy Markdown
Contributor Author

Haven't gotten around to testing them side by side yet. When I do I will post results.

@tonicb78
Copy link
Copy Markdown

Tested .20 with one of the first Heltec V4 units to hit the market, the RX performance gets much worse, about -15 dB compared to firmware .15.

When “RX Boosted Gain (SX126x)” is disabled, the previous RX values are restored similar than fw .15.

@weebl2000
Copy link
Copy Markdown
Contributor Author

Tested .20 with one of the first Heltec V4 units to hit the market, the RX performance gets much worse, about -15 dB compared to firmware .15.

When “RX Boosted Gain (SX126x)” is disabled, the previous RX values are restored similar than fw .15.

Did you try with the AGC reset commit in there?

@tonicb78
Copy link
Copy Markdown

Tested .20 with one of the first Heltec V4 units to hit the market, the RX performance gets much worse, about -15 dB compared to firmware .15.
When “RX Boosted Gain (SX126x)” is disabled, the previous RX values are restored similar than fw .15.

Did you try with the AGC reset commit in there?

Just installed firmware 2.7.20.6658ec2, do I have to to do anything more?

@weebl2000
Copy link
Copy Markdown
Contributor Author

Just installed firmware 2.7.20.6658ec2, do I have to to do anything more?

6658ec2 contains the AGC reset fix which was merged around two weeks ago. If you tested this longer than 2 weeks ago then you might see very different results now on your Heltec v4 :).

@tonicb78
Copy link
Copy Markdown

Just installed firmware 2.7.20.6658ec2, do I have to to do anything more?

6658ec2 contains the AGC reset fix which was merged around two weeks ago. If you tested this longer than 2 weeks ago then you might see very different results now on your Heltec v4 :).

Yes, this was tested, my node is FCS4, did some tests with direct nodes around me, for example:

2.7.15 with RX boosted on:

→ Forward: Rubí - FCSv4 [FCS4] (6.0 dB) → Grande [Grnd] [71.1 km]
← Return: Grande [Grnd] (5.5 dB) → Rubí - FCSv4 [FCS4] [71.1 km]

2.7.20 with RX boosted on:

→ Forward: Rubí - FCSv4 [FCS4] (6.3 dB) → Grande [Grnd] [71.1 km]
← Return: Grande [Grnd] (-7.3 dB) → Rubí - FCSv4 [FCS4] [71.1 km]

2.7.20 with RX boosted of:

→ Forward: Rubí - FCSv4 [FCS4] (5.5 dB) → Grande [Grnd] [71.1 km]
← Return: Grande [Grnd] (6.5 dB) → Rubí - FCSv4 [FCS4] [71.1 km]

@weebl2000
Copy link
Copy Markdown
Contributor Author

That's a big difference. Does your node FCSv4 have a lot of interference from cell towers close by?

@tonicb78
Copy link
Copy Markdown

That's a big difference. Does your node FCSv4 have a lot of interference from cell towers close by?

Yes, I think there is quite a bit of interference from nearby cell towers. In my area, both Heltec V3 and V4 are deaf without a filter—I use a cavity filter and the difference is huge; without it, I barely hear anything.

@weebl2000
Copy link
Copy Markdown
Contributor Author

That's a big difference. Does your node FCSv4 have a lot of interference from cell towers close by?

Yes, I think there is quite a bit of interference from nearby cell towers. In my area, both Heltec V3 and V4 are deaf without a filter—I use a cavity filter and the difference is huge; without it, I barely hear anything.

Try setting the agc reset interval to less than 60 seconds, maybe 5-10 sec, might help with your deafness. https://github.com/meshtastic/firmware/blob/develop/src/mesh/RadioLibInterface.h#L22

@iuvi7
Copy link
Copy Markdown

iuvi7 commented Mar 13, 2026

@weebl2000 if this change of frequency affect battery consumption in any way? thanks

@ndoo
Copy link
Copy Markdown
Contributor

ndoo commented Mar 13, 2026

That's a big difference. Does your node FCSv4 have a lot of interference from cell towers close by?

Yes, I think there is quite a bit of interference from nearby cell towers. In my area, both Heltec V3 and V4 are deaf without a filter—I use a cavity filter and the difference is huge; without it, I barely hear anything.

Try setting the agc reset interval to less than 60 seconds, maybe 5-10 sec, might help with your deafness. https://github.com/meshtastic/firmware/blob/develop/src/mesh/RadioLibInterface.h#L22

I have a node near cell towers too and we have been testing the recent AGC reset tuning.

Should we try the shorter interval with Rx boosted on or off?

Does this also have a negative effect of missing preambles?

@weebl2000
Copy link
Copy Markdown
Contributor Author

@iuvi7 I would think effect on on battery consumption is minimal
@ndoo reset happens in 10-15 milliseconds, change of missing preambles isn't too big imho.

@iuvi7
Copy link
Copy Markdown

iuvi7 commented Mar 14, 2026

This is really weird. some in local community have bad effect of latest firmware and some very good one

@weebl2000
Copy link
Copy Markdown
Contributor Author

weebl2000 commented Mar 14, 2026

iuvi7

I suspect anyone with heltec v4.3 will have bad results currently. It seems the LNA is disabled by default. You will need to set config.lora.fem_lna_mode to enabled. Honestly, it should be enabled by default and only disabled if it causes problem.

Just raised #9906

@iuvi7
Copy link
Copy Markdown

iuvi7 commented Mar 14, 2026

What steps should be made for user far from coding to change config.lora.fem_lna_mode ? It is something that could be found just in usual user Settings in Meshtastic App? Thanks

@compumike
Copy link
Copy Markdown
Contributor

Tested .20 with one of the first Heltec V4 units to hit the market, the RX performance gets much worse, about -15 dB compared to firmware .15.

I haven't had time to investigate yet, but I may be experiencing similar RX degradation after recompiling to 4890f70 (not pointing at that commit; that's just when I pulled develop). (Also earlier Heltec V4 unit.) @tonicb78 did anything fix this for you yet?

@weebl2000
Copy link
Copy Markdown
Contributor Author

Tested .20 with one of the first Heltec V4 units to hit the market, the RX performance gets much worse, about -15 dB compared to firmware .15.

I haven't had time to investigate yet, but I may be experiencing similar RX degradation after recompiling to 4890f70 (not pointing at that commit; that's just when I pulled develop). (Also earlier Heltec V4 unit.) @tonicb78 did anything fix this for you yet?

See PR #9906 - try building that commit.

@tonicb78
Copy link
Copy Markdown

Tested .20 with one of the first Heltec V4 units to hit the market, the RX performance gets much worse, about -15 dB compared to firmware .15.

I haven't had time to investigate yet, but I may be experiencing similar RX degradation after recompiling to 4890f70 (not pointing at that commit; that's just when I pulled develop). (Also earlier Heltec V4 unit.) @tonicb78 did anything fix this for you yet?

Hi, I’ve only been able to test with the default alpha firmware; I haven’t had time to compile with the mentioned changes.

From my tests, with “RX boost” disabled, it works similarly to the beta versions (.15), but when that option is enabled, the RX becomes very unstable. I’ve also noticed that power consumption seems lower.

@weebl2000
Copy link
Copy Markdown
Contributor Author

From my tests, with “RX boost” disabled, it works similarly to the beta versions (.15), but when that option is enabled, the RX becomes very unstable. I’ve also noticed that power consumption seems lower.

Please try this firmware from #9906:

ssp97 added a commit to ssp97/meshtastic_fw that referenced this pull request Apr 11, 2026
* fix some random compiler warnings (#9596)

* Modify the dependency library of v4-tft (#9507)

* Update protobufs (#9605)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Modify the dependency library of v4-tft (#9507)

* BaseUI: Favorite Screen Signal Quality improvement (#9566)

* Favorite Signal Quality improvement

* Show Voltage if node shares it.

* Trunk Fix

* Change Favorite tittle to encase name with Asterisks

* Add Pluggin In condition for Battery Line

* Adjust getUptimeStr Prefixes

* Create isAPIConnected for SharedCommon usage

* Correct leftSideSpacing to account for isAPIConnected

---------

Co-authored-by: Jason P <applewiz@mac.com>

* ExternalNotification and StatusLED now call AmbientLighting to update… (#9554)

* ExternalNotification and StatusLED now call AmbientLighting to update RGB LEDs. Add optional heartbeat

* Don't overwrite RGB state if heartbeat is disabled.

* Use the right define

* Remove another .h and make rgb static

* move rgb objects into AmbientLighting class

* Straighten out AmbientLighting Thread object

* Use %f for floats

* Fixes on SCD4X admin comands (#9607)

* Fixes on SCD4X admin comands

* Minor fix in logs for SEN5X

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* feat/add sfa30 (#9372)

* Move PMSA003I to separate class and update AQ telemetry

* AirQualityTelemetry module not depend on PM sensor presence

* Remove commented line

* Fixes on PMS class

* Add missing warmup period to wakeUp function

* Fixes on compilation for different variants

* Add functions to check for I2C bus speed and set it

* Initial implementation for SFA30Sensor

* Move PMSA003I to separate class and update AQ telemetry

* AirQualityTelemetry module not depend on PM sensor presence

* Remove commented line

* Fixes on PMS class

* Add missing warmup period to wakeUp function

* Fixes on compilation for different variants

* Add functions to check for I2C bus speed and set it

* Add ScreenFonts.h

Co-authored-by: Hannes Fuchs <hannes.fuchs+git@0xef.de>

* PMSA003I 1st round test

* Fix I2C scan speed

* Fix minor issues and bring back I2C SPEED def

* Remove PMSA003I library as its no longer needed

* Add functional SCD4X

* Fix screen frame for CO2

* Add admin commands to SCD4X class

* Add further admin commands and fixes.

* Remove unused I2C speed functions and cleanup

* Cleanup of SEN5X specific code added from switching branches
* Remove SCAN_I2C_CLOCK_SPEED block as its not needed
* Remove associated functions for setting I2C speed

* Unify build epoch to add flag in platformio-custom.py (#7917)

* Unify build_epoch replacement logic in platformio-custom

* Missed one

* Fix build error in rak_wismesh_tap_v2 (#7905)

In the logs was:
"No screen resolution defined in build_flags. Please define DISPLAY_SIZE."

set according to similar devices.

* Put guards in place around debug heap operations (#7955)

* Put guards in place around debug heap operations

* Add macros to clean up code

* Add pointer as well

* Cleanup

* Fix memory leak in NextHopRouter: always free packet copy when removing from pending

* Formatting

* Only queue 2 client notification

* Merge pull request #7965 from compumike/compumike/fix-nrf52-bluetooth-memory-leak

Fix memory leak in `NRF52Bluetooth`: allocate `BluetoothStatus` on stack, not heap

* Merge pull request #7964 from compumike/compumike/fix-nimble-bluetooth-memory-leak

Fix memory leak in `NimbleBluetooth`: allocate `BluetoothStatus` on stack, not heap

* Update protobufs (#7973)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* T-Lora Pager: Support LR1121 and SX1280 models (#7956)

* T-Lora Pager: Support LR1121 and SX1280 models

* Remove ifdefs

* Trunk

* Trunk

* Static memory pool allocation (#7966)

* Static memory pool

* Initializer

* T-Lora Pager: Support LR1121 and SX1280 models (#7956)

* T-Lora Pager: Support LR1121 and SX1280 models

* Remove ifdefs

---------

Co-authored-by: WillyJL <me@willyjl.dev>

* Portduino dynamic alloc

* Missed

* Drop the limit

* Update meshtastic-esp8266-oled-ssd1306 digest to 0cbc26b (#7977)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix json report crashes on esp32 (#7978)

* Tweak maximums

* Fix DRAM overflow on old esp32 targets

* Guard bad time warning logs using GPS_DEBUG (#7897)

In 2.7.7 / 2.7.8 we introduced some new checks for time accuracy.

In combination, these result in a spamming of the logs when a bad time is found

When the GPS is active, we're calling the GPS thread every 0.2secs.

So this log could be printed 4,500 times in a no-lock scenario :)

Reserve this experience for developers using GPS_DEBUG.

Fixes https://github.com/meshtastic/firmware/issues/7896

* Scale probe buffer size based on current baud rate (#7975)

* Scale probe buffer size based on current baud rate

* Throttle bad time validation logging and fix time comparison logic

* Remove comment

* Missed the other instances

* Copy pasta

* Fix GPS gm_mktime memory leak (#7981)

* Fix overflow of time value (#7984)

* Fix overflow of time value

* Revert "Fix overflow of time value"

This reverts commit 084796920179e80a7500d36c25fd4d82b3ef4214.

* That got boogered up

* Remove PMSA003 include from modules

* Add flag to exclude air quality module

* Rework PMSA003I to align with new I2C scanner

* Reworks AQ telemetry to match new dynamic allocation method
* Adds VBLE_I2C_CLOCK_SPEED build flag for sensors with different I2C speed requirements
* Reworks PMSA003I

* Move add sensor template to separate file

* Split telemetry on screen options

* Add variable I2C clock compile flag

* Added to Seeed Xiao S3 as demo

* Fix drawFrame in AQ module

* Module settings override to i2cScan module function

* Move to CAN_RECLOCK_I2C per architecture

* Add reclock function in TelemetrySensor.cpp
* Add flag in ESP32 common

* Minor fix

* Move I2C reclock function to src/detect

* Fix uninitMemberVar errors and compile issue

* Make sleep, wakeUp functions generic

* Fix STM32 builds

* Add exclude AQ sensor to builds that have environmental sensor excludes
* Add includes to AddI2CSensorTemplate.h

* SEN5X first pass

* WIP Sen5X functions

* Further (non-working) progress in SEN5X

* WIP Sen5X functions

* Changes on SEN5X library - removing pm_env as well

* Small cleanup of SEN5X sensors

* Minor change for SEN5X detection

* Remove dup code

* Enable PM sensor before sending telemetry.

This enables the PM sensor for a predefined period to allow for warmup.

Once telemetry is sent, the sensor shuts down again.

* Small cleanups in SEN5X sensor

* Add dynamic measurement interval for SEN5X

* Only disable SEN5X if enough time after reading.

* Idle for SEN5X on communication error

* Cleanup of logs and remove unnecessary delays

* Small TODO

* Settle on uint16_t for SEN5X PM data

* Make AQTelemetry sensors non-exclusive

* Implementation of cleaning in FS prefs and cleanup

* Remove unnecessary LOGS
* Add cleaning date storage in FS
* Report non-cumulative PN

* Bring back detection code for SEN5X after branch rebase

* Add placeholder for admin message

* Add VOC measurements and persistence (WIP)

* Adds VOC measurements and state
* Still not working on VOC Index persistence
* Should it stay in continuous mode?

* Add one-shot mode config flag to SEN5X

* Add nan checks on sensor data from SEN5X

* Working implementation on VOCState

* Adds initial timer for SEN55 to not sleep if VOCstate is not stable (1h)
* Adds conditions for stability and sensor state

* Fixes on VOC state and mode swtiching

* Adds a new RHT/Gas only mode, with 3600s stabilization time
* Fixes the VOCState buffer mismatch
* Fixes SEN50/54/55 model mistake

* Adapt SEN5X to new sensor list structure. Improve reclock.

* Improve reClockI2C conditions for different variants
* Add sleep, wakeUp, pendingForReady, hasSleep functions to PM sensors to save battery
* Add SEN5X

* Fix merge errors

* Small reordering in PMS class for consistency

* If one sensor fails, AQ telemetry still reports data

* Small formatting fix

* Add SEN5X to AQI in ScanI2C

* SCD4X now part of AQ module with template list

* Fixes difference between idle and sleep
* In LowPower, sleep is disabled
* Requires testing for I2C clock comms for commands

* Remove unnecessary import

* Add co2 to serialized AQ metrics

* Add SFA30 with new sensor template in AQ module

* Update library dependencies in platformio.ini

* Fix unitialized variables in SEN5X constructor

* Fix missing import

* Fix uninitMemberVars

* Fix import error for SCD4X

* Fix I2CClock logic

* Fix not reclocking back to 700000Hz

* Fix multiple sensors being read simultaneously

*  The logic in AQ module is different to the one in EnvironmentTelemetryModule.  In Env module, if any sensor fails to getMetrics, no valid flag for the module. This prevents other sensors to report data.

* Fix pending clock change in PMSA003

* Cleanup of SEN5X class

* Exclude AQ sensor from wio-e5 due to flash limitations

* Fix I2C clock change logic

* Make sure clock is always set to needed value

* Fix returns

* Fix trunk

* Fix on condition in reclock

* Fix trunk

* Final SFA30 class implementation

* Add HCHO to screen and improve logs

* Add metrics to mesh packet serializer

* Minor fixes in logs

* OCD tidy up of logs

* Fix sleep function

* Remove old I2C_CLOCK_SPEED code

---------

Co-authored-by: nikl <nikl174@mailbox.org>
Co-authored-by: Hannes Fuchs <hannes.fuchs+git@0xef.de>
Co-authored-by: Nashui-Yan <yannashui10@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Tom Fifield <tom@tomfifield.net>
Co-authored-by: Mike Robbins <mrobbins@alum.mit.edu>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
Co-authored-by: WillyJL <me@willyjl.dev>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Upgrade trunk (#9615)

* chore(deps): update adafruit mpu6050 to v2.2.9 (#9611)

* Log rxBad PacketHeaders with more info (id, relay_node) like printPacket, so we can try to match RX errors to other packets in the logs. (#9614)

* chore(deps): update sensirion core to v0.7.3 (#9613)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update neopixel to v1.15.4 (#9616)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Exclude status message module

* fix: zero entire public key array instead of only first byte (#9619)

* Update protobufs (#9621)

* Xiao NRF - define suitable i2c pins for the sub-variants (#8866)

Co-authored-by: Christian Walther <cwalther@gmx.ch>

* Upgrade trunk (#9631)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Update src/detect/ScanI2C.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/modules/Telemetry/Sensor/SFA30Sensor.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/modules/Telemetry/Sensor/SFA30Sensor.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/modules/Telemetry/Sensor/SFA30Sensor.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/mesh/NodeDB.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* convert GPS global and some new in gps.cpp to unique_ptr (#9628)

Trying this to see if anything bad happen if I were to replace most raw pointers with unique_ptr.

I didn't used std::make_unique since it is only supported in C++14 and onwards but until we update esp32 to arduino 3.x the ESP32 xtensa chips use a C++11 std.

* replace delete in RedirectablePrint.cpp with std::unique_ptr (#9642)

Is part of the unique_ptr modernization effort.

* replace delete in EInkDynamicDisplay.{cpp,h} with std::unique_ptr (#9643)

Is part of the unique_ptr modernization effort.

* Undefine LED_BUILTIN for Heltec v2 variant (#9647)

* Undefine LED_BUILTIN for Heltec v2 variant

* Undefine LED_BUILTIN for Heltec v2.1 variant

---------

Co-authored-by: Jorropo <jorropo.pgm@gmail.com>

* replace delete in RadioInterface.cpp with std::unique_ptr (#9645)

Is part of the unique_ptr modernization effort.

* fix typo in PIN_GPS_SWITCH (#9648)

Wasn't caught by CI.

* replace delete in CryptoEngine.{cpp,h} with std::unique_ptr (#9649)

Is part of the unique_ptr modernization effort.

* workaround NCP5623 and LP5562 I2C builds (#9652)

Theses two appear to be buggy on r1-neo and nomadstar meteor pro, they rely on Wire.h being included previously to their import.

Idk why other platforms using the same smart LEDs are working while theses ones don't.

This should make CI green on the dev branch.

* replace delete in AudioThread.h with std::unique_ptr (#9651)

Is part of the unique_ptr modernization effort.

* Add USB_MODE=1 for Station G2 (#9660)

* InkHUD: Favorite Map Applet (#9654)

* fix a lot of low level cppcheck warnings (#9623)

* simplify the observer pattern, since all the called functions are const getters.
* use arduino macro over std: for numerical values and refactor local variables in drawScrollbar()
* oh, so Cppcheck actually complained about const pointers not being const.
* slowly getting out of ifdef hell
* fix inkHUD warnings as well
* last 2 check warnings
* git checks should fail on low defects from now on

* Feat/add scd30 (#9609)

* Merge develop into SCD30

* Add SCD30 class

* Fix logging and admin commands

* Minor cleanup and logging improvements

* Minor formatting issue

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Improvements on setTemperature

* Fix casting float-uint16_t
* Pass 100 for resetting temperature offset

* Fix issues pointed out by copilot

* Add quick reboot to set interval quicker on scd30

* Change saveState to only happen after boot and minor log changes

* Fix missing semicolon in one shot mode log

---------

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Upgrade trunk (#9661)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* fix: respect DontMqttMeBro flag regardless of channel PSK (#9626)

The previous PSK check was broken from its introduction in #4643 —
memcmp was used in boolean context without comparing to 0, inverting
the condition. Since no one noticed for over a year, the PSK-based
filtering provided no practical value. Simplifying to always respect
the sender's preference is both more correct and easier to reason about.

* our firmware action is too clever

Update pio_target and add pio_opts for checks.

* fix detection of SCD30 by checking if the size of the return from a 2 byte register read is correct (#9664)

* fix detection of SCD30 by checking if thee size of the return from a 2 byte register read is correct
fix signedness warning in PMSA003 sensor code.

* Add alternate path for LPS22HB

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* check EndTransmission for errors and compare returned length to expected value

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* #9623 resolved a local shadow of next_key by converting it to int. (#9665)

* zip a few gitrefs down (#9672)

* InkHUD: Allow non-system applets to subscribe to input events (#9514)

* Allow inkhud user applets to consume inputs with opt-in system
Adds a way for applets to subscribe to input events while keeping it off
by default to preserve compatibility and expected behaviours. Adds
example for use as well.
* Add check for nullptr on getActiveApplet uses
* Remove redundant includes
* Move subscribedInputs to protected
* More consistent naming scheme

* Upgrade trunk (#9671)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Concurrency: Modern Periodic wrapper class. (#9501)

* chore(deps): update actions/stale action to v10.2.0 (#9669)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fake IAQ values on Non-BSEC2 platforms like Platformio and the original ESP32 (#9663)

* BSEC2 Replacement
- add approximation for IAQ to non-BSEC2 platforms.
- Re-add this sensor to ESP32 targets, and refactor env_extra includes.
- Fix C++ 11 compatibility
* Check for gas resistance 0

* Upgrade trunk (#9683)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* ULED_BUILTIN for 9m2ibr_aprs_lora_tracker (#9685)

* Upgrade trunk (#9692)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Develop to master (#9618)

* Don't ever define PIN_LED or BLE_LED_INVERTED (#9494)

* Don't ever define PIN_LED

* Deprecate BLE_LED_INVERTED

* Add StatusMessage module and config overrides (#9351)

* Add StatusMessage module and config overrides

* Trunk

* Don't reboot node simply for a StatusMessage config update

* Missed in reviews - fixing send bubble (#9505)

* Prefer EXT_PWR_DETECT pin over chargingVolt to detect power unplugged (#9511)

* Make sure we always return a value in NodeDB::restorePreferences() (#9516)

In case FScom is not defined there is no return statement. This
moves the return outside of the ifdef to make sure a defined
value is returned.

* Inkhud battery icon improvements. (#9513)

* Inkhud battery icon improvements.
Fixes the battery icon draining from the flat side towards the bump, which is backwards from general design language seen on most devices
By request of kr0n05_ on discord, adds the ability to mirror the battery icon which fixes that issue in another way, and is also a common design seen on other devices.

* Remove option for icon mirroring

* Add border + dither to battery to prevent font overlap

* Fix trunk format

* Code cleanup, courtesy of Xaositek.

* Add reply bot module with DM-only responses and rate limiting (#9456)

* Implement Meshtastic reply bot module with ping and status features

Adds a reply bot module that listens for /ping, /hello, and /test commands received via direct messages or broadcasts on the primary channel. The module always replies via direct message to the sender only, reporting hop count, RSSI, and SNR. Per-sender cooldowns are enforced to reduce network spam, and the module can be excluded at build time via a compile flag. Updates include the new module source files and required build configuration changes.

* Update ReplyBotModule.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/ReplyBotModule.h

Match the existing MESHTASTIC_EXCLUDE_* guard pattern so the module is excluded by default.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/ReplyBotModule.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Tidying up

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* HotFix for ReplyBot - Modules.cpp included and moved configuration.h (#9532)

* Undefine LED_BUILTIN (#9531)

Keep variant in sync with
https://github.com/meshtastic/firmware/commit/df40085

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Add agc reset attempt (#8163)

* Add agc reset attempt

* Add radioLibInterface include

* Trunk

* AGC reset don't crash, don't naively call

* Update src/main.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Use Throttle function

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove unused hmx variable (#9529)

The variable is not used at all in the function, remove it to
silence the compiler warning.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Rename LED_PIN to LED_POWER, move handling out of main to dedicated module (#9512)

* Rename LED_PIN to LED_POWER, move handling out of main to dedicated module

* Misc

* Remove errant endif

* Fix hop_limit upgrade detection (#9550)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* meshtasticd: Fix install on Fedora 43 (#9556)

* RPM: Include meshtasticd-start.sh (#9561)

* Add Slash Key to VirtualKeyboard (#9563)

Addition of ? and / to the virtual Keyboard via short and long press

* Add support for CW2015 LiPo battery fuel gauge (#9564)

* Add support for CW2015 LiPo battery fuel gauge

* Address Copilot's concerns, minor fixups

* Make LED_POWER blip even in critical battery (#9545)

* Enable FORTIFY and SP for native builds (#9537)

* Enable FORITFY and NX for native builds

meshtasticd does have an executable stack and is not built with fortify, which makes exploitation of memory corruption bugs easier than it has to be. This enables fortify and a non-executable stack.

This gives the following improvements on Debian Trixie:

$ checksec --file=./.pio/build/native/meshtasticd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH	Symbols		FORTIFY	Fortified	Fortifiable	FILE
Partial RELRO   No canary found   NX enabled    PIE enabled     No RPATH   No RUNPATH   13516 Symbols	  No	0		17		./.pio/build/native/meshtasticd

$ checksec --file=./.pio/build/native/meshtasticd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH	Symbols		FORTIFY	Fortified	Fortifiable	FILE
Partial RELRO   Canary found      NX enabled    PIE enabled     No RPATH   No RUNPATH   13519 Symbols	  Yes	12		20		./.pio/build/native/meshtasticd

Tested with --sim mode I do not get any crashes or similar.

* Enable FORTIFY and NX for native builds

meshtasticd does have an executable stack and is not built with fortify, which makes exploitation of memory corruption bugs easier than it has to be. This enables fortify and a non-executable stack.

This gives the following improvements on Debian Trixie:

$ checksec --file=./.pio/build/native/meshtasticd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH	Symbols		FORTIFY	Fortified	Fortifiable	FILE
Partial RELRO   No canary found   NX enabled    PIE enabled     No RPATH   No RUNPATH   13516 Symbols	  No	0		17		./.pio/build/native/meshtasticd

$ checksec --file=./.pio/build/native/meshtasticd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH	Symbols		FORTIFY	Fortified	Fortifiable	FILE
Partial RELRO   Canary found      NX enabled    PIE enabled     No RPATH   No RUNPATH   13519 Symbols	  Yes	12		20		./.pio/build/native/meshtasticd

Tested with --sim mode I do not get any crashes or similar.

* Enable FORTIFY and SP for native builds

meshtasticd does have a stack canaries and is not built with fortify, which makes exploitation of memory corruption bugs easier than it has to be. This enables fortify and stack canaries.

This gives the following improvements on Debian Trixie:

$ checksec --file=./.pio/build/native/meshtasticd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH	Symbols		FORTIFY	Fortified	Fortifiable	FILE
Partial RELRO   No canary found   NX enabled    PIE enabled     No RPATH   No RUNPATH   13516 Symbols	  No	0		17		./.pio/build/native/meshtasticd

$ checksec --file=./.pio/build/native/meshtasticd
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH	Symbols		FORTIFY	Fortified	Fortifiable	FILE
Partial RELRO   Canary found      NX enabled    PIE enabled     No RPATH   No RUNPATH   13519 Symbols	  Yes	12		20		./.pio/build/native/meshtasticd

Tested with --sim mode I do not get any crashes or similar.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Update built-in documentation for current method of implementation (#9592)

* Refactor logging in ProtobufModule to ensure message details are logged after successful decoding (#9536)

* Automated version bumps (#9604)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Add missing openocd_target to custom nrf52 boards (#9603)

This stops platformio complaining about `Missing target configuration for me25ls01-4y10td` etc when trying to flash with nrfutil.

* Add sdl libs for native builds (#9595)

* Add sdl libs for native builds

* Alpine try again

* fix some random compiler warnings (#9596)

* Modify the dependency library of v4-tft (#9507)

* BaseUI: Favorite Screen Signal Quality improvement (#9566)

* Favorite Signal Quality improvement

* Show Voltage if node shares it.

* Trunk Fix

* Change Favorite tittle to encase name with Asterisks

* Add Pluggin In condition for Battery Line

* Adjust getUptimeStr Prefixes

* Create isAPIConnected for SharedCommon usage

* Correct leftSideSpacing to account for isAPIConnected

---------

Co-authored-by: Jason P <applewiz@mac.com>

* ExternalNotification and StatusLED now call AmbientLighting to update… (#9554)

* ExternalNotification and StatusLED now call AmbientLighting to update RGB LEDs. Add optional heartbeat

* Don't overwrite RGB state if heartbeat is disabled.

* Use the right define

* Remove another .h and make rgb static

* move rgb objects into AmbientLighting class

* Straighten out AmbientLighting Thread object

* Use %f for floats

* Fixes on SCD4X admin comands (#9607)

* Fixes on SCD4X admin comands

* Minor fix in logs for SEN5X

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* feat/add sfa30 (#9372)

* Move PMSA003I to separate class and update AQ telemetry

* AirQualityTelemetry module not depend on PM sensor presence

* Remove commented line

* Fixes on PMS class

* Add missing warmup period to wakeUp function

* Fixes on compilation for different variants

* Add functions to check for I2C bus speed and set it

* Initial implementation for SFA30Sensor

* Move PMSA003I to separate class and update AQ telemetry

* AirQualityTelemetry module not depend on PM sensor presence

* Remove commented line

* Fixes on PMS class

* Add missing warmup period to wakeUp function

* Fixes on compilation for different variants

* Add functions to check for I2C bus speed and set it

* Add ScreenFonts.h

Co-authored-by: Hannes Fuchs <hannes.fuchs+git@0xef.de>

* PMSA003I 1st round test

* Fix I2C scan speed

* Fix minor issues and bring back I2C SPEED def

* Remove PMSA003I library as its no longer needed

* Add functional SCD4X

* Fix screen frame for CO2

* Add admin commands to SCD4X class

* Add further admin commands and fixes.

* Remove unused I2C speed functions and cleanup

* Cleanup of SEN5X specific code added from switching branches
* Remove SCAN_I2C_CLOCK_SPEED block as its not needed
* Remove associated functions for setting I2C speed

* Unify build epoch to add flag in platformio-custom.py (#7917)

* Unify build_epoch replacement logic in platformio-custom

* Missed one

* Fix build error in rak_wismesh_tap_v2 (#7905)

In the logs was:
"No screen resolution defined in build_flags. Please define DISPLAY_SIZE."

set according to similar devices.

* Put guards in place around debug heap operations (#7955)

* Put guards in place around debug heap operations

* Add macros to clean up code

* Add pointer as well

* Cleanup

* Fix memory leak in NextHopRouter: always free packet copy when removing from pending

* Formatting

* Only queue 2 client notification

* Merge pull request #7965 from compumike/compumike/fix-nrf52-bluetooth-memory-leak

Fix memory leak in `NRF52Bluetooth`: allocate `BluetoothStatus` on stack, not heap

* Merge pull request #7964 from compumike/compumike/fix-nimble-bluetooth-memory-leak

Fix memory leak in `NimbleBluetooth`: allocate `BluetoothStatus` on stack, not heap

* Update protobufs (#7973)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* T-Lora Pager: Support LR1121 and SX1280 models (#7956)

* T-Lora Pager: Support LR1121 and SX1280 models

* Remove ifdefs

* Trunk

* Trunk

* Static memory pool allocation (#7966)

* Static memory pool

* Initializer

* T-Lora Pager: Support LR1121 and SX1280 models (#7956)

* T-Lora Pager: Support LR1121 and SX1280 models

* Remove ifdefs

---------

Co-authored-by: WillyJL <me@willyjl.dev>

* Portduino dynamic alloc

* Missed

* Drop the limit

* Update meshtastic-esp8266-oled-ssd1306 digest to 0cbc26b (#7977)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix json report crashes on esp32 (#7978)

* Tweak maximums

* Fix DRAM overflow on old esp32 targets

* Guard bad time warning logs using GPS_DEBUG (#7897)

In 2.7.7 / 2.7.8 we introduced some new checks for time accuracy.

In combination, these result in a spamming of the logs when a bad time is found

When the GPS is active, we're calling the GPS thread every 0.2secs.

So this log could be printed 4,500 times in a no-lock scenario :)

Reserve this experience for developers using GPS_DEBUG.

Fixes https://github.com/meshtastic/firmware/issues/7896

* Scale probe buffer size based on current baud rate (#7975)

* Scale probe buffer size based on current baud rate

* Throttle bad time validation logging and fix time comparison logic

* Remove comment

* Missed the other instances

* Copy pasta

* Fix GPS gm_mktime memory leak (#7981)

* Fix overflow of time value (#7984)

* Fix overflow of time value

* Revert "Fix overflow of time value"

This reverts commit 084796920179e80a7500d36c25fd4d82b3ef4214.

* That got boogered up

* Remove PMSA003 include from modules

* Add flag to exclude air quality module

* Rework PMSA003I to align with new I2C scanner

* Reworks AQ telemetry to match new dynamic allocation method
* Adds VBLE_I2C_CLOCK_SPEED build flag for sensors with different I2C speed requirements
* Reworks PMSA003I

* Move add sensor template to separate file

* Split telemetry on screen options

* Add variable I2C clock compile flag

* Added to Seeed Xiao S3 as demo

* Fix drawFrame in AQ module

* Module settings override to i2cScan module function

* Move to CAN_RECLOCK_I2C per architecture

* Add reclock function in TelemetrySensor.cpp
* Add flag in ESP32 common

* Minor fix

* Move I2C reclock function to src/detect

* Fix uninitMemberVar errors and compile issue

* Make sleep, wakeUp functions generic

* Fix STM32 builds

* Add exclude AQ sensor to builds that have environmental sensor excludes
* Add includes to AddI2CSensorTemplate.h

* SEN5X first pass

* WIP Sen5X functions

* Further (non-working) progress in SEN5X

* WIP Sen5X functions

* Changes on SEN5X library - removing pm_env as well

* Small cleanup of SEN5X sensors

* Minor change for SEN5X detection

* Remove dup code

* Enable PM sensor before sending telemetry.

This enables the PM sensor for a predefined period to allow for warmup.

Once telemetry is sent, the sensor shuts down again.

* Small cleanups in SEN5X sensor

* Add dynamic measurement interval for SEN5X

* Only disable SEN5X if enough time after reading.

* Idle for SEN5X on communication error

* Cleanup of logs and remove unnecessary delays

* Small TODO

* Settle on uint16_t for SEN5X PM data

* Make AQTelemetry sensors non-exclusive

* Implementation of cleaning in FS prefs and cleanup

* Remove unnecessary LOGS
* Add cleaning date storage in FS
* Report non-cumulative PN

* Bring back detection code for SEN5X after branch rebase

* Add placeholder for admin message

* Add VOC measurements and persistence (WIP)

* Adds VOC measurements and state
* Still not working on VOC Index persistence
* Should it stay in continuous mode?

* Add one-shot mode config flag to SEN5X

* Add nan checks on sensor data from SEN5X

* Working implementation on VOCState

* Adds initial timer for SEN55 to not sleep if VOCstate is not stable (1h)
* Adds conditions for stability and sensor state

* Fixes on VOC state and mode swtiching

* Adds a new RHT/Gas only mode, with 3600s stabilization time
* Fixes the VOCState buffer mismatch
* Fixes SEN50/54/55 model mistake

* Adapt SEN5X to new sensor list structure. Improve reclock.

* Improve reClockI2C conditions for different variants
* Add sleep, wakeUp, pendingForReady, hasSleep functions to PM sensors to save battery
* Add SEN5X

* Fix merge errors

* Small reordering in PMS class for consistency

* If one sensor fails, AQ telemetry still reports data

* Small formatting fix

* Add SEN5X to AQI in ScanI2C

* SCD4X now part of AQ module with template list

* Fixes difference between idle and sleep
* In LowPower, sleep is disabled
* Requires testing for I2C clock comms for commands

* Remove unnecessary import

* Add co2 to serialized AQ metrics

* Add SFA30 with new sensor template in AQ module

* Update library dependencies in platformio.ini

* Fix unitialized variables in SEN5X constructor

* Fix missing import

* Fix uninitMemberVars

* Fix import error for SCD4X

* Fix I2CClock logic

* Fix not reclocking back to 700000Hz

* Fix multiple sensors being read simultaneously

*  The logic in AQ module is different to the one in EnvironmentTelemetryModule.  In Env module, if any sensor fails to getMetrics, no valid flag for the module. This prevents other sensors to report data.

* Fix pending clock change in PMSA003

* Cleanup of SEN5X class

* Exclude AQ sensor from wio-e5 due to flash limitations

* Fix I2C clock change logic

* Make sure clock is always set to needed value

* Fix returns

* Fix trunk

* Fix on condition in reclock

* Fix trunk

* Final SFA30 class implementation

* Add HCHO to screen and improve logs

* Add metrics to mesh packet serializer

* Minor fixes in logs

* OCD tidy up of logs

* Fix sleep function

* Remove old I2C_CLOCK_SPEED code

---------

Co-authored-by: nikl <nikl174@mailbox.org>
Co-authored-by: Hannes Fuchs <hannes.fuchs+git@0xef.de>
Co-authored-by: Nashui-Yan <yannashui10@gmail.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Tom Fifield <tom@tomfifield.net>
Co-authored-by: Mike Robbins <mrobbins@alum.mit.edu>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
Co-authored-by: WillyJL <me@willyjl.dev>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Log rxBad PacketHeaders with more info (id, relay_node) like printPacket, so we can try to match RX errors to other packets in the logs. (#9614)

* Exclude status message module

* fix: zero entire public key array instead of only first byte (#9619)

* Update protobufs (#9621)

* Xiao NRF - define suitable i2c pins for the sub-variants (#8866)

Co-authored-by: Christian Walther <cwalther@gmx.ch>

* Update src/detect/ScanI2C.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/modules/Telemetry/Sensor/SFA30Sensor.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/modules/Telemetry/Sensor/SFA30Sensor.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/modules/Telemetry/Sensor/SFA30Sensor.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* Update src/mesh/NodeDB.cpp

Co-authored-by: Wessel <wessel@weebl.me>

* convert GPS global and some new in gps.cpp to unique_ptr (#9628)

Trying this to see if anything bad happen if I were to replace most raw pointers with unique_ptr.

I didn't used std::make_unique since it is only supported in C++14 and onwards but until we update esp32 to arduino 3.x the ESP32 xtensa chips use a C++11 std.

* replace delete in RedirectablePrint.cpp with std::unique_ptr (#9642)

Is part of the unique_ptr modernization effort.

* replace delete in EInkDynamicDisplay.{cpp,h} with std::unique_ptr (#9643)

Is part of the unique_ptr modernization effort.

* Undefine LED_BUILTIN for Heltec v2 variant (#9647)

* Undefine LED_BUILTIN for Heltec v2 variant

* Undefine LED_BUILTIN for Heltec v2.1 variant

---------

Co-authored-by: Jorropo <jorropo.pgm@gmail.com>

* replace delete in RadioInterface.cpp with std::unique_ptr (#9645)

Is part of the unique_ptr modernization effort.

* fix typo in PIN_GPS_SWITCH (#9648)

Wasn't caught by CI.

* replace delete in CryptoEngine.{cpp,h} with std::unique_ptr (#9649)

Is part of the unique_ptr modernization effort.

* workaround NCP5623 and LP5562 I2C builds (#9652)

Theses two appear to be buggy on r1-neo and nomadstar meteor pro, they rely on Wire.h being included previously to their import.

Idk why other platforms using the same smart LEDs are working while theses ones don't.

This should make CI green on the dev branch.

* replace delete in AudioThread.h with std::unique_ptr (#9651)

Is part of the unique_ptr modernization effort.

* Add USB_MODE=1 for Station G2 (#9660)

* InkHUD: Favorite Map Applet (#9654)

* fix a lot of low level cppcheck warnings (#9623)

* simplify the observer pattern, since all the called functions are const getters.
* use arduino macro over std: for numerical values and refactor local variables in drawScrollbar()
* oh, so Cppcheck actually complained about const pointers not being const.
* slowly getting out of ifdef hell
* fix inkHUD warnings as well
* last 2 check warnings
* git checks should fail on low defects from now on

* Feat/add scd30 (#9609)

* Merge develop into SCD30

* Add SCD30 class

* Fix logging and admin commands

* Minor cleanup and logging improvements

* Minor formatting issue

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Improvements on setTemperature

* Fix casting float-uint16_t
* Pass 100 for resetting temperature offset

* Fix issues pointed out by copilot

* Add quick reboot to set interval quicker on scd30

* Change saveState to only happen after boot and minor log changes

* Fix missing semicolon in one shot mode log

---------

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* fix: respect DontMqttMeBro flag regardless of channel PSK (#9626)

The previous PSK check was broken from its introduction in #4643 —
memcmp was used in boolean context without comparing to 0, inverting
the condition. Since no one noticed for over a year, the PSK-based
filtering provided no practical value. Simplifying to always respect
the sender's preference is both more correct and easier to reason about.

* our firmware action is too clever

Update pio_target and add pio_opts for checks.

* fix detection of SCD30 by checking if the size of the return from a 2 byte register read is correct (#9664)

* fix detection of SCD30 by checking if thee size of the return from a 2 byte register read is correct
fix signedness warning in PMSA003 sensor code.

* Add alternate path for LPS22HB

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* check EndTransmission for errors and compare returned length to expected value

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* #9623 resolved a local shadow of next_key by converting it to int. (#9665)

* zip a few gitrefs down (#9672)

* InkHUD: Allow non-system applets to subscribe to input events (#9514)

* Allow inkhud user applets to consume inputs with opt-in system
Adds a way for applets to subscribe to input events while keeping it off
by default to preserve compatibility and expected behaviours. Adds
example for use as well.
* Add check for nullptr on getActiveApplet uses
* Remove redundant includes
* Move subscribedInputs to protected
* More consistent naming scheme

* Fake IAQ values on Non-BSEC2 platforms like Platformio and the original ESP32 (#9663)

* BSEC2 Replacement
- add approximation for IAQ to non-BSEC2 platforms.
- Re-add this sensor to ESP32 targets, and refactor env_extra includes.
- Fix C++ 11 compatibility
* Check for gas resistance 0

* ULED_BUILTIN for 9m2ibr_aprs_lora_tracker (#9685)

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
Co-authored-by: Jason P <applewiz@mac.com>
Co-authored-by: Eric Sesterhenn <eric.sesterhenn@x41-dsec.de>
Co-authored-by: Vortetty <33466216+Vortetty@users.noreply.github.com>
Co-authored-by: Mattatat25 <108779801+mattatat25@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Max <rekin.m@gmail.com>
Co-authored-by: Colby Dillion <colby.dillion@pacshealth.com>
Co-authored-by: Austin <vidplace7@gmail.com>
Co-authored-by: Tom <116762865+NomDeTom@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chloe Bethel <chloe@9net.org>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Quency-D <55523105+Quency-D@users.noreply.github.com>
Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>
Co-authored-by: oscgonfer <oscgonfer@users.noreply.github.com>
Co-authored-by: nikl <nikl174@mailbox.org>
Co-authored-by: Hannes Fuchs <hannes.fuchs+git@0xef.de>
Co-authored-by: Nashui-Yan <yannashui10@gmail.com>
Co-authored-by: Tom Fifield <tom@tomfifield.net>
Co-authored-by: Mike Robbins <mrobbins@alum.mit.edu>
Co-authored-by: WillyJL <me@willyjl.dev>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Wessel <wessel@weebl.me>
Co-authored-by: Christian Walther <cwalther@gmx.ch>
Co-authored-by: Jorropo <jorropo.pgm@gmail.com>
Co-authored-by: Eric Barch <ericb@ericbarch.com>
Co-authored-by: Clive Blackledge <clive@ansible.org>

* Trunk

* Update meshtastic-GxEPD2 digest to c7eb4c3 (#9694)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* skip header items when enabling the InkHUD menu cursor (#9552)

* onNavUp() sets the menu cursor to the last item if not shown

* skip headers when showing the menu cursor in onNavUp() and onNavDown()

* skip headers when showing the menu cursor in onButtonShortPress()

* brace cursor incrementing

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com>

* Upgrade trunk (#9696)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* BLE Pairing fix (#9701)

* BLE Pairing fix

* gating for consistency

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Revert "Add agc reset attempt (#8163)" (#9702)

This reverts commit ac611c4b6262ae54336317c9e4167827ba6edd78.

* Add #include "RadioLibInterface.h"

* Hold GC1109 FEM power during deep sleep for LNA RX wake (#9572)

* Hold GC1109 PA_POWER and PA_EN during deep sleep for LNA RX wake

Use rtc_gpio_hold_en to latch PA_POWER (LDO) and PA_EN (CSD) HIGH
during deep sleep so the GC1109 LNA remains powered for wake-on-packet
RX. Previously these pins used weak pull-ups which could lose state.

On deep sleep wake, skip these pins in the blanket RTC hold release and
instead release them in SX126xInterface::init() after GPIO registers are
set HIGH first, avoiding a power glitch on the GC1109.

Trade-off: ~6.5mA additional deep sleep current for significantly
improved wake-on-packet RX sensitivity (~17dB).

Reference: https://github.com/meshcore-dev/MeshCore/pull/1600

* Add LDO startup delay before GC1109 chip enable

TLV75733P LDO has ~550us startup time (datasheet tSTR). On cold boot,
wait 1ms for VBAT to stabilise before driving CSD/CPS, per GC1109
power-on sequence requirement. On deep sleep wake the LDO is held on
via RTC latch so no delay is needed.

* Fix/rak3401 button (#9668)

* RadioLib edge-triggered interrupts robustness (#9658)

* Fix potential race condition (read, ISR write, clear) in NotifiedWorkerThread

* Check for missed edge-triggered interrupts race condition between startReceive and enableInterrupt

* Occasionally poll to catch missed RX_DONE interrupts. (RadioLibInterface::pollMissedIrqs)

* Simplify RadioLibInterface::checkRxDoneIrqFlag()

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Limit http connections and add free heap check before allocating for SSL (#9693)

* Reduce maximum concurrent HTTPS connections to save memory

* Add heap check and limit connections to prevent HTTPS connection related crashes

* Use Throttle::isWithinTimespanMs for overflow-safe heap warning throttle

* Update src/mesh/http/WebServer.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix double-free heap corruption and parser leak in web server handlers

- Remove double-free in handleFsBrowseStatic, handleNodes, handleScanNetworks:
  JSONValue(const JSONArray&) shallow-copies pointers, so delete value already
  recursively frees all elements. The explicit cleanup loops were deleting the
  same pointers a second time, corrupting the ESP32 heap allocator metadata.
  This is the likely root cause of #8827 (SSL setup failures after uptime).
- Fix memory leak in handleFormUpload: two early-return paths were missing
  delete parser.
- Remove unused global HTTPClient httpClient and its includes.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply SX1262 register 0x8B5 patch for improved GC1109 RX sensitivity (#9571)

* Apply SX1262 register 0x8B5 patch for improved GC1109 RX sensitivity

Sets the LSB of undocumented SX1262 register 0x8B5 on Heltec V4 and
Wireless Tracker V2 boards with the GC1109 FEM. This patch was
recommended by Heltec/Semtech and tested in MeshCore PR #1398, where
it significantly reduced packet loss on the Heltec V4.

* Use higher level function

* Add .venv/ to .gitignore

* chore(deps): update radiolib to v7.6.0 (#9695)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update radiolib to v7.6.0 (#9695)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Split module includes for AQ module (#9711)

* Upgrade trunk (#9724)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Support mini ePaper S3 Kit (#9335)

* initial draft

* update DC pin

* add ADC channel

* fix e-ink display

* update GxEPD2 reference

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* meshtasticd: Add Luckfox Lyra Hat pinmaps (#9730)

Luckfox Lyra Plus + Waveshare Pi Pico Hat
Luckfox Lyra Ultra + wehooper4's "Luckfox Ultra" hat.

* chore(deps): update meshtastic-st7789 digest to 9ee76d6 (#9729)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update sensorlib to v0.3.4 (#9727)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Upgrade trunk (#9731)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* FIx loophole with telemetry coercion

* Implement 'agc' reset for SX126x & LR11x0 chip families (#9705)

* Implement 'agc' reset for SX126x chip family

There's no actual agc on SX126x chips but you can reset the analog
registers by doing a warm sleep & running calibration.

* Address PR comments & implement for LR11x0 too

* calibrate for configured frequency band

* Gate LR11X0_AGC_RESET

* Align telemetry broadcast want_response behavior with traceroute (#9717)

* Align telemetry broadcast want_response behavior with traceroute

* Fixes

* Reduce side-effects by making the telemetry modules handle the ignorerequest

* Remove unnecessary ignoreRequest flag

* Try inheriting from MeshModule

* Add exclusion for sensor/router roles and add base telem module

* Update protobufs (#9739)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* fail cppcheck on low already. Code quality for the win.

* Remove unused global rIf that shadows locals and fails cppcheck (#9743)

I noticed because my PR failed

* hopefully fix remaining cppcheck issues (#9745)

* Revert "Fix/rak3401 button (#9668)" (#9747)

This reverts commit a5523b04ef30bb5c62a56abd2f49c5a592b628ad.

* Upgrade trunk (#9744)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Add GPIO_DETECT_PA portduino config, and support 13302 detection with it (#9741)

* Add GPIO_DETECT_PA portduino config, and support 13302 detection with it.

* Tweak PA detect gpio to use pinMapping

* minor yaml output fixes

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* platform: nrf52: Fix typo in BLEDfuSecure filename (#9709)

Change file name from BLEDfuScure.cpp to BLEDfuSecure.cpp. Fix filenames
in documentation.

Signed-off-by: Koko <github@kokosoftware.pl>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Add Transmit history persistence for respecting traffic intervals between reboots (#9748)

* Add transmit history for throttling that persists between reboots

* Fix RAK long press detection to prevent phantom shutdowns from floating pins

* Update test/test_transmit_history/test_main.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Test fixes and placeholder for content handler tests

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix Bluetooth on RAK Ethernet Gateway by removing MESHTASTIC_EXCLUDE_POWER_FSM from build_flags (#9755)

* chore(deps): update adafruit_tsl2561 to v1.1.3 (#9757)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update adafruit mlx90614 to v2.1.6 (#9756)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update platformio/espressif32 to v6.13.0 (#9759)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update platformio/nordicnrf52 to v10.11.0 (#9760)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix(MQTT): Send first MapReport as soon as possible (#8872)

* fix(MQTT): First MapReport does not get sent

Throttle::isWithinTimespanMs(last_report_to_map, map_publish_interval_msecs) is
used to maintain the map reporting interval, but because last_report_to_map has
an initial value of 0, the map report routine does not start until the system
millis() time has passed map_publish_interval_msecs.

Fix this by adding a check that last_report_to_map is not 0.

Signed-off-by: Andrew Yong <me@ndoo.sg>

* feat(MQTT): Send MapReporting immediately upon location fix

Do not update last_report_to_map when Map Report is attempted without a valid
location, as this results in waiting up to an hour (or configured Map Report
interval).

That usually happens because most nodes do not keep GPS warm, so GPS usually
locks after the first attempt at Map Report.

This change also results in the log WARNing message getting spammed until a
location is obtained, so remove the message for now.

Signed-off-by: Andrew Yong <me@ndoo.sg>

* feat(MQTT): Throttled warning when position is not available for MapReport

Signed-off-by: Andrew Yong <me@ndoo.sg>

---------

Signed-off-by: Andrew Yong <me@ndoo.sg>

* Don't launch canned message when waking screen or silencing notification (#9762)

* Don't launch canned message when waking screen or silencing notification

* Add screen ifdefs

* Get the #if right

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Fix mqtt test

* Unlock 0x8B5 register macro guard for SX162 (#9777)

* chore(deps): update adafruit ahtx0 to v2.0.6 (#9766)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update adafruit dps310 to v1.1.6 (#9763)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update platformio/ststm32 to v19.5.0 (#9764)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Upgrade trunk (#9752)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Increase PSRAM malloc threshold from 256 bytes to 2048 bytes (#9758)

* enhancement(mesh): remove late packets from tx queue when full (#9779)

* enhance tx queue priority management

In busy environments, especially for ROUTER_LATE role, tx queue
fills very quickly. Delayed packets became late but new packets
to be retransmitted won't be put into the tx queue as old ones
stay there for a very long time (even a minute or more). This change
makes meshtastic prioritize new packets over late packets from tx queue
and allows to remove late packet from back of tx queue when there
is no space for a new one.

* apply copilot recommendation for cast

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Update log verbiage to remove GC1109 reference

* avoid memory leak when possibly malformed packet received (#9781)

getByIndex allocates memory and returns dummy channel whenever
chIndex validation fails. Comment implies this may happen
when malformed packet is received. The fix changes implementation
so static dummyChannel is returned in such case.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Bug: Mqtt fix testcase due to immediately sending MapReport (#8872) (#9784)

* Add ESP32 Power Management lessons learned document

Documents our experimentation with ESP-IDF DFS and why it doesn't
work well for Meshtastic (RTOS locks, BLE locks, USB issues).

Proposes simpler alternative: manual setCpuFrequencyMhz() control
with explicit triggers for when to go fast vs slow.

* Added a lambda function to clear startup output in the MQTT unit test to ensure a clean state before and after the MQTT subscription process.

* Upgrade trunk (#9785)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* chore(deps): update github artifact actions (#9767)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update crazy-max/ghaction-import-gpg action to v7 (#9787)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add ADS1115 ADC to recognition as used on RAK6421 Hat (#9790)

* Remove "x" permission bits from some source files (#9794)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Upgrade trunk (#9795)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Update protobufs (#9797)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* Improve resource cleanup on connection close (and make server API a unique pointer) (#9799)

* Improve resource cleanup on connection close

* Copilot had some good feedback. Let's just make the api a unique pointer

* Update src/mesh/api/ServerAPI.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Copilot stupidly suggesting we call protected methods

* Gotta do it in the superclasses as well

* Fix moar

* Refactor MQTT unit test to ensure proper subscription handling and clear side effects

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* spelling fixes (#9801)

45 corrections in c++ source comments
limited to 27 files in src/gps src/graphics src/input

* chore(deps): update docker/login-action action to v4 (#9806)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update docker/setup-qemu-action action to v4 (#9807)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Deb: Handle offline builds more gracefully (#9791)

* Upgrade trunk (#9805)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* chore(deps): update arduinojson to v6.21.6 (#9788)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dorny/test-reporter action to v2.6.0 (#9796)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Scaling tweaks (#9653)

* refactor: update throttling factor calculation and add unit tests for scaling behavior

* refactor: adjust throttling factor calculation for improved accuracy in different configurations

* Update src/mesh/Default.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/mesh/Default.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: enhance throttling factor calculation and introduce pow_of_2 utility function

* refactor: improve expected ms calculation in unit tests for Default::getConfiguredOrDefaultMsScaled

* refactor: improve scaling logic for routers and sensors in computeExpectedMs function

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add heltec-v4.3 board (#9753)

* Add heltec-v4.3 board

* Modify LNA control display content

* Fix Heltec Tracker v2 FEM control

* Use trunk to fix formatting issues.

* Optimize the fem initialization control logic.

* Update src/mesh/RadioInterface.h change #ifdef to #if

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Change LORA_PA_EN to LORA_GC1109_PA_EN.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove the NodeDB.h include.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Change tx_gain to a const variable.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixed the issue where ARCH_PORTDUINO lacked the NUM_PA_POINTS macro.

* Remove the comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Move #pragma once to the first line.

* Remove the FEM LNA control menu.

* Add description for KCT8103L.

---------

Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Add some lora parameter clamping logic to coalesce to defaults and enforce some bounds (#9808)

* Add back FEM LNA mode configuration for LoRa (#9809)

* Add back FEM LNA mode configuration for LoRa

* Update src/mesh/NodeDB.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/modules/AdminModule.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* copilot garbage

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* spelling fixes in .md files (#9810)

9 fixes across 6 files
notably includes github/pull_request_template.md

* fix: add ROUTER_LATE to infrastructure init and config preservation (#9820)

ROUTER_LATE now preserves node_info_broadcast_secs during factory
reset and auto-enables Store & Forward server mode, matching ROUTER
infrastructure behavior.

* fix: add ROUTER_LATE to telemetry impolite role check (#9819)

ROUTER_LATE should be treated as an impolite telemetry role like
ROUTER, responding to multi-hop broadcast requests and using
aggressive send timing without channel utilization checks.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Update protobufs (#9825)

Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>

* fix: prevent router-like roles from auto-favoriting DM peers (#9821)

ROUTER and ROUTER_LATE should not accumulate favorites by sending DMs.
Also replaces magic number 12 with meshtastic_Config_DeviceConfig_Role_CLIENT_BASE.

* Upgrade trunk (#9823)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* fix: add ROUTER_LATE and TAK_TRACKER to congestion scaling exemption (#9818)

ROUTER_LATE already has high base intervals and should not be further
scaled by congestion. TAK_TRACKER is a tracker variant that should
skip congestion scaling like TRACKER does.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* fix: treat ROUTER_LATE like ROUTER for power management and defaults (#9815)

ROUTER_LATE is an infrastructure relay that should use the same power
assumptions, interval defaults, and LoRa wake behavior as ROUTER.
Without this, ROUTER_LATE uses client-class defaults and will not
wake on LoRa activity from deep sleep, making it a broken relay.

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* fix: add ROUTER_LATE to rebroadcast integrity checks (#9816)

Adds ROUTER_LATE and CLIENT_BASE to preferred rebroadcaster check
(skip unsolicited NodeInfo) and prevents ROUTER_LATE from setting
rebroadcast mode to NONE, which would silently break relaying.

* Add explicit dependency on mklittlefs. (#9708)

This fixes builds in very clean environment with default build target (e.g.
-t buildfs *not* explicitly specified).

Tested: pio run -e heltec-v3

Fixes #9035

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* More RAK6421 work (#9813)

* Add Portduino Enable pins

* Add hat plus custom fields

* Punt on the GPIO device detection for now

* Simplify TX_GAIN_LORA for RAK13302

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Don't double-blink Thinknode-M1 Power LED while charging (#9829)

* Don't double-blink Thinknode-M1 Power LED while charging

* Drop Double Define

* chore(deps): update docker/metadata-action action to v6 (#9833)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update docker/build-push-action action to v7 (#9832)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update docker/setup-buildx-action action to v4 (#9824)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Cardputer Kit (#9540)

* Cardputer Kit
BMI270 WIP

* BMI270 support

* verify that the number of bytes read matches the requested length

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* trunk'd

* remove excessive logging

* Kick the screen when unsleeping

* Update the st7789 library, and enable displayon and displayoff

* Battery detection

* Default to arrow keys and enter, while in menus.

* Enable Backlight control

* Update src/detect/ScanI2CTwoWire.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* updateState method now accepts shouldRequestFocus parameter for better maintainability

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* fix(t1000e): reclassify P0.04 as sensor power enable GPIO (#9826)

P0.04 is a digital power-enable pin for the NTC/LUX sensors, not an ADC
input. The old code was calling analogRead() on a floating GPIO that
happened to read ~mid-rail, coincidentally producing reasonable
temperature values.

- Rename T1000X_VCC_PIN to T1000X_SENSOR_EN_PIN and drive it HIGH in
initVariant() for both T1000-E and T1000-S variants
- Read BATTERY_PIN (with ADC_MULTIPLIER) instead, clamped to the 3.0V
LDO output (NTC_REF_VCC) for the NTC resistance calculation

* Upgrade trunk (#9835)

Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com>

* Update Heltec Tracker v2 to version KCT8103L. (#9822)

* Update Heltec Tracker v2 to version KCT8103L.

* Fixed the issue of inaccurate comments.

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* PPA: Remove Ubuntu 25.04, Add 26.04 (#9789)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* InkHUD: Nodelist cleanup (#9737)

* Nodelist cleanup

* Trunk fix

* getTextWidth cleanup

Updated the lambda to cache width in textW and reuse it instead of repeatedly calling getTextWidth(text) for unchanged text.

* Putting back hopAway ==0  condition as mentioned relayed signal is missleading

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Fix WisMesh Tap V2 env mess (#9734)

* Fix environment mess with wismesh tap v2

* Address feedback

* Fix nRF52 AsyncUDP multicast TX/RX race condition causing garbled packets (#9765)

socketSendUDP() calls yield() while waiting for SEND_OK, allowing the
cooperative scheduler to run AsyncUDP::runOnce(). When runOnce() calls
parsePacket() on the same socket during an active send, the multicast
loopback packet arriving from the switch produces a garbled 8-byte RX
header (wrong source IP, wrong payload length), leading to protobuf
decode errors in UdpMulticastHandler.

Add a volatile isSending flag that writeTo() sets around endPacket()
(the only yield point). runOnce() checks this flag and skips
parsePacket() while a send is in progress. Loopback packets stay
buffered in the W5100S RX buffer and are read cleanly on the next
poll cycle.

Also propagate writeTo() return value in UdpMulticastHandler::onSend()
instead of unconditionally returning true.

Made-with: Cursor

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Add json file rotation option (#9783)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>

* Add APIPort to native config (#9840)

* chore(deps): update neopixel to v1.15.4 (#9839)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update meshtastic-esp32_https_server digest to b78f12c (#9851)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Add convenience userpref for disabling lora during development and testing

* Debian: Extend sourcedeb cache expiration (#9858)

Addendum to PR #9791
The sourcedebs cannot currently be built offline >30 days after release. Extend the cache-expiry-mangling hack to sourcedeb packaging.

* G…
henrypotgieter referenced this pull request in markqvist/RNode_Firmware Apr 20, 2026
thebentern pushed a commit that referenced this pull request Apr 21, 2026
…ity (#10219)

The CALIBRATE_ALL (0x7F) command inside resetAGC() clears bit 0 of the
undocumented 0x8B5 register. That bit is set once in init() by #9571 and
#9777 to improve SX1262 RX sensitivity, and the AGC-reset path was not
re-applying it. Result: every SX1262 node silently loses the RX
sensitivity patch ~60s after boot and never recovers until reboot.

Empirically confirmed on Heltec Mesh Node T114 (nRF52840 + SX1262):
  - Post-calibration read of 0x8B5 = 0x04 (bit 0 cleared)
  - After re-apply: 0x05 (bit 0 set)
Reproducible every AGC_RESET_INTERVAL_MS tick.

Fix re-applies the register bit alongside the existing post-calibration
re-applies (setDio2AsRfSwitch, setRxBoostedGainMode).
thebentern pushed a commit that referenced this pull request Apr 21, 2026
…ity (#10219)

The CALIBRATE_ALL (0x7F) command inside resetAGC() clears bit 0 of the
undocumented 0x8B5 register. That bit is set once in init() by #9571 and
#9777 to improve SX1262 RX sensitivity, and the AGC-reset path was not
re-applying it. Result: every SX1262 node silently loses the RX
sensitivity patch ~60s after boot and never recovers until reboot.

Empirically confirmed on Heltec Mesh Node T114 (nRF52840 + SX1262):
  - Post-calibration read of 0x8B5 = 0x04 (bit 0 cleared)
  - After re-apply: 0x05 (bit 0 set)
Reproducible every AGC_RESET_INTERVAL_MS tick.

Fix re-applies the register bit alongside the existing post-calibration
re-applies (setDio2AsRfSwitch, setRxBoostedGainMode).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.