Skip to content

fix(kiss): periodic noise floor calibration and AGC reset#1591

Merged
ripplebiz merged 2 commits intomeshcore-dev:devfrom
agessaman:fix-kiss-noise-floor
Feb 7, 2026
Merged

fix(kiss): periodic noise floor calibration and AGC reset#1591
ripplebiz merged 2 commits intomeshcore-dev:devfrom
agessaman:fix-kiss-noise-floor

Conversation

@agessaman
Copy link
Contributor

In the previous implementation, the noise floor was calibrated once and the value was returned for the entire time the radio was active. This makes a change to:

  • Trigger noise floor calibration every 2s and AGC reset every 30s in main loop.
  • Reorder loop to match Dispatcher: calibrate + radio.loop() before AGC reset and recvRaw() so RSSI is never sampled right after startReceive().
  • Update protocol doc with calibration intervals and typical noise floor range.
  • Add limited variant platformio.ini configs for KISS modem (heltec_v3, rak4631).

- Trigger noise floor calibration every 2s and AGC reset every 30s in main loop.
- Reorder loop to match Dispatcher: calibrate + radio.loop() before AGC reset
  and recvRaw() so RSSI is never sampled right after startReceive().
- Update protocol doc with calibration intervals and typical noise floor range.
- Variant platformio.ini updates (heltec_v3, rak4631).
@agessaman
Copy link
Contributor Author

Just a quick follow-up, this appears to be working well. I monitored the noise floor using pyMC_Repeater and the graph shows regular updates but a relatively consistent noise floor. The initial very flat lines were the result of the firmware with no noise floor recalibration logic.

image

next_noise_floor_calib_ms = millis();
}
radio_driver.loop();

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are there plans to add some Listen-Before-Talk logic here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That seems like a design preference. @ViezeVingertjes did the original work, I just added the necessary functions to get the KISS modem working properly with pyMC_core.

He has implemented CMD_IS_CHANNEL_BUSY (0x11) which returns RESP_CHANNEL_BUSY (0x31) with one byte: 0x00 = clear, 0x01 = busy. The KISS modem is kind of a dumb pipe and the user software can manage its own LBT like the repeater firmware calling _radio.isReceiving().

@ViezeVingertjes
Copy link
Contributor

Nice find. 👍🏼

@ripplebiz
Copy link
Collaborator

Nice find. 👍🏼

Nice find. 👍🏼

If you're OK with this PR, I'll merge it

@ViezeVingertjes
Copy link
Contributor

ViezeVingertjes commented Feb 5, 2026

Nice find. 👍🏼

If you're OK with this PR, I'll merge it

LGTM; only remark would be the comments hehe... claude loves to comment.
But technically that doesnt make much of a difference.

@agessaman
Copy link
Contributor Author

Yeah, sorry. I did a "hey, did I miss anything" pass and he was like, "here are more comments!"

I can reduce/eliminate them if you prefer.

@ViezeVingertjes
Copy link
Contributor

Yeah, sorry. I did a "hey, did I miss anything" pass and he was like, "here are more comments!"

I can reduce/eliminate them if you prefer.

Only if you have time for it! otherwise, just let them be, for another time hehe.

@agessaman
Copy link
Contributor Author

I cleaned up or removed most of the comments my ever-helpful robot friend decided to add. Sorry about that. 😖

@ripplebiz ripplebiz merged commit 6502067 into meshcore-dev:dev Feb 7, 2026
@agessaman agessaman deleted the fix-kiss-noise-floor branch February 7, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants