Skip to content

Add CLI control to LoRa's fem LNA.#2140

Open
Quency-D wants to merge 4 commits intomeshcore-dev:devfrom
Quency-D:cli-lna-command
Open

Add CLI control to LoRa's fem LNA.#2140
Quency-D wants to merge 4 commits intomeshcore-dev:devfrom
Quency-D:cli-lna-command

Conversation

@Quency-D
Copy link
Contributor

It is currently being tested in heltec-v4.3 and can be configured remotely.
The Python script used is https://github.com/Quency-D/meshcore-cli/tree/lora-lna-cli, which will be further improved later.

A416A94E|*> /9791b78edd4a/get radio.fem.rxgain
Heltec Repeater (D): > on
A416A94E|*> /9791b78edd4a/set radio.fem.rxgain on
Heltec Repeater (D): OK - LoRa FEM RX gain on
A416A94E|*> /9791b78edd4a/set radio.fem.rxgain off
Heltec Repeater (D): OK - LoRa FEM RX gain off

@Quency-D
Copy link
Contributor Author

Solve this problem #2128.

@towerviewcams
Copy link

towerviewcams commented Mar 24, 2026

@Quency-D @IoTThinks I flashed the firmware from the pre compiled firmware.

I'm not sure why Quency was telling me to run a python script? anyways, yes, thank you @IoTThinks, the cli commands work! I was going to try this first for sure.

Powered on 4.3 board, LNA on and repeater working normal. noise floor -103, transmit power +28.3 dbm.....working normally.

here we go-

"set radio.fem.rxgain off" give me a reply "OK - LoRa FEM RX gain off"
I can confirm that the LNA is OFF, noise floor dropped to -118
power draw dropped from 12.3mA down to 5.8mA (this is with powersaving on of course, its older version as we all know)
Transmit power remained at +28.3 :) very very nice Quency!!

now to turn back on LNA-

"set radio.fem.rxgain on" give me a reply "OK LoRa FEM RX gain on"
LNA is now on, power draw increase back to 12.3mA
Noise floor clamped instantly -120......tried agc rest command at 4, 8, 16.....no luck
So then I try reboot and success! noise floor -102

Conclusion-
This works!
Reboot is needed when turning the LNA back on, otherwise clamps to -120 even with agc at 4,8,16
Transmit power remains +28 both with LNA on and off
@weebl2000 @AI7NC

Update
I've also learned that you can turn off the LNA, then, flash Powersaving 14 back into the 4.3 board and the LNA remains OFF. I have rebooted and removed power. Still holds true - LNA off. This is huge progress forward!

@Quency-D
Copy link
Contributor Author

I'm not sure why Quency was telling me to run a python script? anyways, yes, thank you @IoTThinks, the cli commands work! I was going to try this first for sure.

Python scripts can be used for remote control, but it's also fine to control it directly like this.

@towerviewcams
Copy link

I'm not sure why Quency was telling me to run a python script? anyways, yes, thank you @IoTThinks, the cli commands work! I was going to try this first for sure.

Python scripts can be used for remote control, but it's also fine to control it directly like this.

It worked great @Quency-D and thats what 99% of people will do. Things are coming along nicely.

UPDATE I also found out that the LNA will stay in bypass even if I flash Powersaving 14 (no erase) after loading your test firmware. This way sleep is instant. I've been testing this all day since this morning when you contacted me on the other issue that was closed for this PR. Thank you for all your work on this sir!

@IoTThinks
Copy link
Contributor

@towerviewcams So it will best fit you to have LNA on or off?
I am thinking if LNA off benefits more then LNA should be off by default.

@towerviewcams
Copy link

towerviewcams commented Mar 25, 2026

@towerviewcams So it will best fit you to have LNA on or off? I am thinking if LNA off benefits more then LNA should be off by default.

@IoTThinks that depends on the repeater site. Most sites you can have it on, "IF" you have proper filtering and shielding. Having the ability to turn this on or off is SO PERFECT i cannot tell you how this will change everything deploying this board.

I'm 60/40 that the LNA should be off. This will pretty much setup people to have a nice working repeater. Then, if they have the expertees on how to check for noise, have the proper equipment or just want to try it, then yes, turn it on.

I understanding more of what your saying Kevin, I am. More people will benefit initially with it off, then on for a turn key build default.

@IoTThinks
Copy link
Contributor

@towerviewcams Most of repeaters do not have proper filtering and shielding I guess.
Nevermind, enjoy.

@towerviewcams
Copy link

towerviewcams commented Mar 25, 2026

@towerviewcams Most of repeaters do not have proper filtering and shielding I guess. Nevermind, enjoy.

@IoTThinks I agree with you. I do, look up ^. I just really needed to think about what your saying on a more simplified safe scale for users. This would force more learning for those that don't understand what a LNA can truly do.

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