Repeater, room server, sensor, companion: a node with the RX duty cycle on no longer stops transmitting

Changelog: Repeater, room server, sensor, companion: a node with the RX duty cycle (`radio.rxps`) on no longer stops transmitting, `set radio.rxps off` takes effect at once, and a node silent for weeks keeps sending
Changelog-cs: Repeater, room server, sensor, companion: uzel se zapnutým RX duty cycle (`radio.rxps`) už nepřestane vysílat, `set radio.rxps off` platí hned a uzel, který týdny mlčel, dál vysílá
Changelog-topic: rxps-stall-46
This commit is contained in:
tth committed 2026-12-04 00:09:28 +01:00
1 parent 63823f526b
commit 9daead0089
3 files changed
+60 -3

No files matched your search

+6
View File
@@ -157,6 +157,12 @@ void Dispatcher::loop() {
next_agc_reset_time = futureMillis(getAGCResetInterval());
}
// Keep an already-elapsed next_tx_time from ageing past 2^31 ms (~24.8 days)
// during long TX silence and wrapping into the future in millisHasNowPassed().
if (millisHasNowPassed(next_tx_time)) {
next_tx_time = _ms->getMillis() - 1;
}
// check inbound (delayed) queue
{
Packet* pkt = _mgr->getNextInbound(_ms->getMillis());
+18 -3
View File
@@ -120,6 +120,7 @@ void RadioLibWrapper::resetAGC() {
_nf_last_calib = 0;
#endif
doResetAGC();
resetReceivingState();
state = STATE_IDLE; // trigger a startReceive()
// Reset noise floor sampling so it reconverges from scratch.
@@ -217,7 +218,10 @@ void RadioLibWrapper::startRecv() {
int err = _radio->startReceive();
#endif
if (err == RADIOLIB_ERR_NONE) {
state = STATE_RX;
// Preserve STATE_INT_READY if a DIO1 edge fired before startReceive() returned.
noInterrupts();
state = (state & STATE_INT_READY) | STATE_RX;
interrupts();
} else {
MESH_DEBUG_PRINTLN("RadioLibWrapper: error: startReceive(%d)", err);
}
@@ -498,12 +502,23 @@ uint32_t RadioLibWrapper::getEstAirtimeFor(int len_bytes) {
bool RadioLibWrapper::startSendRaw(const uint8_t* bytes, int len) {
#ifdef WITH_RX_POWERSAVING
if (_rx_ps_armed) stopReceiveDutyCycle();
if (_rx_ps_armed) {
stopReceiveDutyCycle();
} else {
_radio->standby();
}
#else
_radio->standby();
#endif
_board->onBeforeTransmit();
// Enter STATE_TX_WAIT after standby() (so no late RX_DONE can fire) and
// before startTransmit() (so a TX_DONE arriving after SoftDevice preemption
// cannot be overwritten by a late state store).
noInterrupts();
state = STATE_TX_WAIT;
interrupts();
int err = _radio->startTransmit((uint8_t *) bytes, len);
if (err == RADIOLIB_ERR_NONE) {
state = STATE_TX_WAIT;
return true;
}
MESH_DEBUG_PRINTLN("RadioLibWrapper: error: startTransmit(%d)", err);