diff --git a/eastmesh-tools/web-heap-check.sh b/eastmesh-tools/web-heap-check.sh index d16a3f59..4e28c7bf 100755 --- a/eastmesh-tools/web-heap-check.sh +++ b/eastmesh-tools/web-heap-check.sh @@ -22,7 +22,7 @@ # for the password. Tokens are never written to disk. # # Example: -# REPEATER_PASSWORD=... eastmesh-tools/web-heap-check.sh 10.33.135.208 --stress +# REPEATER_PASSWORD=... eastmesh-tools/web-heap-check.sh 192.168.1.50 --stress set -euo pipefail host="${1:-}" diff --git a/src/helpers/radiolib/CustomSX1262Wrapper.h b/src/helpers/radiolib/CustomSX1262Wrapper.h index be314471..9020d8fe 100644 --- a/src/helpers/radiolib/CustomSX1262Wrapper.h +++ b/src/helpers/radiolib/CustomSX1262Wrapper.h @@ -23,7 +23,16 @@ public: ((CustomSX1262 *)_radio)->setMaxPayloadMillis(pm.payloadMillis); } - bool isReceivingPacket() override { +#ifdef SX126X_PA_RAMP_TIME + void setTxPower(int8_t dbm) override { + RadioLibWrapper::setTxPower(dbm); + // SX126x::setOutputPower() hardcodes a 200us PA ramp; boards with an + // external PA need a longer ramp, so re-apply it after every power change. + ((CustomSX1262 *)_radio)->setPaRampTime(SX126X_PA_RAMP_TIME); + } +#endif + + bool isReceivingPacket() override { return ((CustomSX1262 *)_radio)->isReceiving(); } float getCurrentRSSI() override { diff --git a/src/helpers/radiolib/RadioLibWrappers.h b/src/helpers/radiolib/RadioLibWrappers.h index 77dd9311..cfb29b8e 100644 --- a/src/helpers/radiolib/RadioLibWrappers.h +++ b/src/helpers/radiolib/RadioLibWrappers.h @@ -49,7 +49,7 @@ public: virtual void setParams(float freq, float bw, uint8_t sf, uint8_t cr) = 0; uint32_t getRngSeed(); - void setTxPower(int8_t dbm); + virtual void setTxPower(int8_t dbm); virtual float getCurrentRSSI() =0; virtual uint8_t getSpreadingFactor() const { return LORA_SF; } diff --git a/variants/lilygo_tbeam_1w/platformio.ini b/variants/lilygo_tbeam_1w/platformio.ini index 0cd5f0cc..b8c5f604 100644 --- a/variants/lilygo_tbeam_1w/platformio.ini +++ b/variants/lilygo_tbeam_1w/platformio.ini @@ -35,6 +35,10 @@ build_flags = ; TX power: 22dBm to SX1262, PA module adds ~10dB for 32dBm total -D LORA_TX_POWER=22 + ; External PA needs a longer ramp; keep 800us across setTxPower() calls, + ; since SX126x::setOutputPower() would otherwise reset it to 200us + -D SX126X_PA_RAMP_TIME=RADIOLIB_SX126X_PA_RAMP_800U + ; Battery - 2S 7.4V LiPo (6.0V min, 8.4V max) -D BATT_MIN_MILLIVOLTS=6000 -D BATT_MAX_MILLIVOLTS=8400