Skip to content

Conversation

@weebl2000
Copy link

@weebl2000 weebl2000 commented Dec 19, 2025

I was experiencing very bad RX with my heltec v4 so I investigated and debugged.

UPDATE 31/12/2025
After testing for a week on both companion and repeater with multiple people the overall conclusion so far is that this greatly improves the RX on Heltec v4.

UPDATE 23/12/2025, latest findings

The original implementation had incorrect understanding of the GC1109 FEM control pins. GPIO46 was incorrectly treated as a TX/RX switch, but it's actually the CPS (PA mode select) pin. The actual TX/RX path switching is handled by DIO2 → CTX directly on the PCB.

GC1109 Control Logic (from datasheet)

Mode CSD (GPIO2) CTX (DIO2) CPS (GPIO46)
Shutdown 0 X X
Receive LNA 1 0 X (don't care)
Transmit bypass 1 1 0 (~1dB loss)
Transmit PA 1 1 1 (full PA)

Pin Mapping

Define GPIO GC1109 Pin Function
P_LORA_PA_POWER 7 - VFEM_Ctrl - Powers GC1109 LDO
P_LORA_PA_EN 2 CSD (pin 4) Chip enable (HIGH=on)
P_LORA_PA_TX_EN 46 CPS (pin 5) PA mode (HIGH=full PA, LOW=bypass)
- DIO2 CTX (pin 6) TX/RX path (automatic via SX126X_DIO2_AS_RF_SWITCH)

Summary of Changes

HeltecV4Board.cpp

  • CPS toggling in callbacks: onBeforeTransmit() sets CPS=HIGH for full PA mode, onAfterTransmit() sets CPS=LOW
  • Deep sleep: Hold all three FEM pins (PA_POWER, PA_EN, PA_TX_EN) to maintain RX wake capability
  • Wake-up: Release holds with rtc_gpio_hold_dis() for all pins

platformio.ini

  • Removed SX126X_RXEN and SX126X_TXEN - these caused a conflict where both RadioLib and our callbacks tried to control GPIO46
  • Kept SX126X_DIO2_AS_RF_SWITCH=true - this is correct and handles CTX (TX/RX path) automatically

How It Works Now

  1. TX/RX path switching: Handled automatically by SX1262 DIO2 → GC1109 CTX (hardware)
  2. PA mode selection: Handled by our callbacks toggling GPIO46 (CPS)
    - HIGH before TX → full PA enabled (+30dB internal, attenuated to ~+11dB net)
    - LOW after TX → ready for RX (CPS is "don't care" in RX mode)
  3. Power sequencing: GPIO7 (LDO) → GPIO2 (CSD) → GPIO46 (CPS) per datasheet requirement

UPDATE 23/12/2025

Thoroughly reviewed against the GC1109 datasheet and WiFi_LoRa_32_V4.2.pdf. The same fix has been applied to Heltec Tracker V2 which uses the identical GC1109 FEM (CSD on GPIO4 instead of GPIO2).

Turns out everything handling the LNA/PA is completely fine, the only problem was the SX1262 boosted gain was enabled. If you disable this the RX is golden. 🥇

UPDATE 23/12/2025

Having tested this myself I see excellent results with RX. Apart from that, multiple people have tested the firmware and notice a big improvement in being able to receive signals.

UPDATE 24/12/2025
Some users reported bootloop, this was probably caused by holding pin 46. We shouldn't hold that pin so removed that.

Update 2: avoid touching CPS pin at all unless we want to TX.

firmware to test, with latest changes 24/12/2025 - should fix bootloop issues

a8463655cfa23522c5bb93f3dae69746d642034149b79b7103b9f217850e53af  heltec_tracker_v2_main+RX_fix_companion_radio_ble.bin
e50e7a9d8987802382d09d8e1ca2ca738c8ca0dbfd9e31d65b4a54254a2b302d  heltec_tracker_v2_main+RX_fix_repeater.bin
5877ecca96c036ecdf4c1e2e74b1f2c4a3b45c25a65ff05c7c9aa855719421f8  heltec_v4_main+RX_fix_companion_radio_ble.bin
f5aebe63b2159b522768c9ef590bd30ae5a511e65f4c83dfa906a9b2e8782eb1  heltec_v4_main+RX_fix_repeater.bin

@fschrempf
Copy link
Contributor

According to @jbrazio here, it depends on the antenna whether RX boosted gain is benefitial or not. So if you disable it, it might help you but make things worse for others. If that's true, then we should leave this as is an go for the solution in #1164.

@weebl2000 weebl2000 force-pushed the heltec_v4_fix_RX_sensitivity branch from 7dcc916 to d84784e Compare December 19, 2025 18:56
@weebl2000
Copy link
Author

According to @jbrazio here, it depends on the antenna whether RX boosted gain is benefitial or not. So if you disable it, it might help you but make things worse for others. If that's true, then we should leave this as is an go for the solution in #1164.

Yeah maybe, I haven't tested with a lot of antennas yet. There's definitely something funky going on with the PA/LNA and the RX gain though.

@weebl2000 weebl2000 force-pushed the heltec_v4_fix_RX_sensitivity branch from d84784e to dcfea36 Compare December 19, 2025 19:58
@weebl2000
Copy link
Author

According to @jbrazio here, it depends on the antenna whether RX boosted gain is benefitial or not. So if you disable it, it might help you but make things worse for others. If that's true, then we should leave this as is an go for the solution in #1164.

It'

According to @jbrazio here, it depends on the antenna whether RX boosted gain is benefitial or not. So if you disable it, it might help you but make things worse for others. If that's true, then we should leave this as is an go for the solution in #1164.

Yeah maybe, I haven't tested with a lot of antennas yet. There's definitely something funky going on with the PA/LNA and the RX gain though.

@fschrempf It gets more tricky. But I think we actually might just need to set SX126X_DIO2_AS_RF_SWITCH=false since we are handling the TX/RX mode on the PA/LNA. But I am getting variying results with improvements or not. I will try running tests for longer to really see a difference 👀

@weebl2000
Copy link
Author

weebl2000 commented Dec 20, 2025

Updated with latest finding. I have tested for limited time but RX is heaps better, so others please do test!

@weebl2000 weebl2000 force-pushed the heltec_v4_fix_RX_sensitivity branch 2 times, most recently from bc5e4be to 044505d Compare December 20, 2025 17:43
@weebl2000 weebl2000 changed the title Disable SX126X_RX_BOOSTED_GAIN for Heltec v4 Fix GC1109 FEM LNA being used for Heltec v4 RX Dec 20, 2025
@weebl2000
Copy link
Author

weebl2000 commented Dec 20, 2025

@dt267
Copy link

dt267 commented Dec 21, 2025

Screenshot 2025-12-21 152807

@perry99
Copy link

perry99 commented Dec 21, 2025

I was asked to build the firmware, here you go for ble companion and repeater

The repeater is also a companion firmware:-(

@weebl2000
Copy link
Author

Oops let me check

@weebl2000
Copy link
Author

I was asked to build the firmware, here you go for ble companion and repeater

The repeater is also a companion firmware:-(

Try now. Same URL.

sha256sum *bin
14f0617247fb9599d66e2f93796dbca628f82a0f0b4590b548eba18f10eac134  heltec_v4_main+RX_fix_companion_radio_ble.bin
41fa50ff5d1dd33bdd6367d6ebbcee2df464ac650717a27897caa195a7b103e3  heltec_v4_main+RX_fix_repeater.bin

@perry99
Copy link

perry99 commented Dec 21, 2025

I was asked to build the firmware, here you go for ble companion and repeater

The repeater is also a companion firmware:-(

Try now. Same URL.

sha256sum *bin
14f0617247fb9599d66e2f93796dbca628f82a0f0b4590b548eba18f10eac134  heltec_v4_main+RX_fix_companion_radio_ble.bin
41fa50ff5d1dd33bdd6367d6ebbcee2df464ac650717a27897caa195a7b103e3  heltec_v4_main+RX_fix_repeater.bin

Thank you!

@weebl2000 weebl2000 force-pushed the heltec_v4_fix_RX_sensitivity branch from 683ac76 to 2736011 Compare December 21, 2025 11:43
@Heronimonimo
Copy link

For those running the observer uplink firmware, there is a version to test compiled with this fix: https://discord.com/channels/1343693475589263471/1417491962675593296/1452383493295439903

Running that here but don't see a significant difference yet.

@weebl2000
Copy link
Author

weebl2000 commented Dec 21, 2025

For those running the observer uplink firmware, there is a version to test compiled with this fix: https://discord.com/channels/1343693475589263471/1417491962675593296/1452383493295439903

Running that here but don't see a significant difference yet.

For observer firmware, if you never enable the TX path I would guess the LNA stays properly enabled and you wouldn't see much difference.

If I kept TX low always I also saw great reception with the current firmware. Only after sending once would the RX deteriorate.

@Heronimonimo
Copy link

For those running the observer uplink firmware, there is a version to test compiled with this fix: https://discord.com/channels/1343693475589263471/1417491962675593296/1452383493295439903
Running that here but don't see a significant difference yet.

For observer firmware, if you never enable the TX path I would guess the LNA stays properly enabled and you wouldn't see much difference.

If I kept TX low always I also saw great reception with the current firmware. Only after sending once would the RX deteriorate.

Observers are repeater firmware with mqtt uplink. So they do use TX a lot. Will keep monitoring the effect on my repeater.

@weebl2000
Copy link
Author

For those running the observer uplink firmware, there is a version to test compiled with this fix: https://discord.com/channels/1343693475589263471/1417491962675593296/1452383493295439903
Running that here but don't see a significant difference yet.

For observer firmware, if you never enable the TX path I would guess the LNA stays properly enabled and you wouldn't see much difference.
If I kept TX low always I also saw great reception with the current firmware. Only after sending once would the RX deteriorate.

Observers are repeater firmware with mqtt uplink. So they do use TX a lot. Will keep monitoring the effect on my repeater.

Ah okay. Only easy way to test is having two devices next to each other or otherwise testing with nodes at the edge of your reach.

@Quency-D
Copy link
Contributor

@fschrempf It gets more tricky. But I think we actually might just need to set SX126X_DIO2_AS_RF_SWITCH=false since we are handling the TX/RX mode on the PA/LNA. But I am getting variying results with improvements or not. I will try running tests for longer to really see a difference 👀

The definition SX126X_DIO2_AS_RF_SWITCH=false seems problematic because it requires controlling the CTX pin to ensure proper transmit/receive switching. The PA_TX_EN (CPS) pin is only for controlling transmit bypass.
image

@weebl2000 weebl2000 changed the title Fix GC1109 FEM LNA being used for Heltec v4 RX 🔧 Fix GC1109 FEM LNA being used for Heltec v4 RX Dec 22, 2025
@dt267
Copy link

dt267 commented Dec 23, 2025

Screenshot 2025-12-23 080804

This is the way I fixed V4'LNA problem, bypassed it.

@Quency-D
Copy link
Contributor

Screenshot 2025-12-23 080804 This is the way I fixed V4'LNA problem, bypassed it.

Did you use a flying wire? How did the test go?

@dt267
Copy link

dt267 commented Dec 23, 2025

IMG_6925
Two weeks ago, running fine up to now, one repeater and one companion

@weebl2000
Copy link
Author

IMG_6925 Two weeks ago, running fine up to now, one repeater and one companion

Would be interesting to see if you can notice a difference with the fixed firmware and no bypass vs the bypass.

@dt267
Copy link

dt267 commented Dec 23, 2025

basically, there is no firmware fixed way

@weebl2000
Copy link
Author

basically, there is no firmware fixed way

Why not?

@dt267
Copy link

dt267 commented Dec 23, 2025

because there is no way to turn off that LNA by command

@weebl2000
Copy link
Author

weebl2000 commented Jan 6, 2026

Rather than soldering a bypass, why not try this PR first? I see a huge improvement on RX with this PR, and so do others. 🤔

@stgruenbaum-hash
Copy link

Rather than soldering a bypass, why not try this PR first? I see a huge improvement on RX with this PR, and so do others. 🤔

Tried this fix and yes, it improved RX. But it is still far away from receiving ability of V3. I think it is hard to fix a problem which is caused by hardware-architecture. Meanwhile, I reverted my V4 repeaters back to V3, because I have much better values with V3.

@weebl2000
Copy link
Author

weebl2000 commented Jan 6, 2026

Rather than soldering a bypass, why not try this PR first? I see a huge improvement on RX with this PR, and so do others. 🤔

Tried this fix and yes, it improved RX. But it is still far away from receiving ability of V3. I think it is hard to fix a problem which is caused by hardware-architecture. Meanwhile, I reverted my V4 repeaters back to V3, because I have much better values with V3.

Can you do a side-by-side comparison of v3 and v4 with actual amount of packets received with identical antenna? I think this is the only way to compare the performance. Just looking at noise floor values and such is not the proper way to test this.

@stgruenbaum-hash
Copy link

stgruenbaum-hash commented Jan 6, 2026

Can you do a side-by-side comparison of v3 and v4 with actual amount of packets received with identical antenna? I think this is the only way to compare the performance. Just looking at noise floor values and such is not the proper way to test this.

I already did (see some posts above) but I stopped my tests with V4. It is not longer installed and won't install it again.

@weebl2000
Copy link
Author

Can you do a side-by-side comparison of v3 and v4 with actual amount of packets received with identical antenna? I think this is the only way to compare the performance. Just looking at noise floor values and such is not the proper way to test this.

I already did (see some posts above) but I stopped my tests with V4. It is not longer installed and won't install it again.

Thanks for your efforts. It's still really strange you are observing these issues, the v4 hardware should be superior to v3 hardware.

@spiralshapeturtle
Copy link

@weebl2000 @stgruenbaum-hash did you read this https://wiki.heltec.org/news/v4-receive-sensitivity/v4-receive-sensitivity

Just to check if you are comparing the right values ;-)

@pon-wessel
Copy link

@weebl2000 @stgruenbaum-hash did you read this https://wiki.heltec.org/news/v4-receive-sensitivity/v4-receive-sensitivity

Just to check if you are comparing the right values ;-)

Thanks.

I've noticed signal values are hard to compare, so I compared the amount of packets received between a v3 and v4, and with this fix I can see better reception for v4 vs v3 (especially for weak signals), so I am convinced this PR fixes the issue, even though the dB values might not reflect this.

@spiralshapeturtle
Copy link

@pon-wessel thanks my v4 is still somewhere between me and the customs ;-) Would be happy to test when it got delivered. I'm just surprised this fix/correct way of using the LNA was not embedded in the original code, and its not merged yet? Did Heltec take a look into this thread?

@pon-wessel
Copy link

@pon-wessel thanks my v4 is still somewhere between me and the customs ;-) Would be happy to test when it got delivered. I'm just surprised this fix/correct way of using the LNA was not embedded in the original code, and its not merged yet? Did Heltec take a look into this thread?

I've shared the PR with them, not sure if someone technical looked at it but they replied positively.

@IoTThinks
Copy link

huge

Yes, agree. I will try to compare this PR vs. a bypass.
Of course, a software PR is always better if possible.

@spiralshapeturtle
Copy link

how do we get this PR under the correct attention of MeshCore dev's?

@stgruenbaum-hash
Copy link

Thanks.

I've noticed signal values are hard to compare, so I compared the amount of packets received between a v3 and v4, and with this fix I can see better reception for v4 vs v3 (especially for weak signals), so I am convinced this PR fixes the issue, even though the dB values might not reflect this.

I did also some range tests. Had my V3 and V4 Repeater on roof-top (same antennas) and went out with my mobile client. On a hill about 15km away, I reached both repeaters. But receiving SNR of V4 was only about -8 (V3 about 1). At next location (about 20km away) I still had a stable connection to my V3, but I did not reach my V4 anymore. Then I moved to a hill about 30km away. I still reached my V3, but not the V4. For me it looks like the LNA is poor quality and not very good tuned to the required frequency.

@weebl2000
Copy link
Author

For anyone that is interested, here is a custom build with a register patch that might affect SX1262 receive sensitivity. This was suggested by Semtech.

https://x230.weebl.me/public/v4_repeater_registerpatch.bin

@DayleDrinkwater
Copy link

I have been running this version on a new V4 for a week or so after replacing a V3, unfortunately I didn't make a note of the metrics before the change but I've not noticed any degradation compared to the V3. Great work!

@spiralshapeturtle
Copy link

For anyone that is interested, here is a custom build with a register patch that might affect SX1262 receive sensitivity. This was suggested by Semtech.

Sorry I do need some more information before loading builds to my hardware, could you elaborate a bit more? Does this count for all the SX1262's out in the field, or does it only contribute to your LNA enhancements?

Any link where we can read from the same source as you?

@weebl2000
Copy link
Author

For anyone that is interested, here is a custom build with a register patch that might affect SX1262 receive sensitivity. This was suggested by Semtech.

Sorry I do need some more information before loading builds to my hardware, could you elaborate a bit more? Does this count for all the SX1262's out in the field, or does it only contribute to your LNA enhancements?

Any link where we can read from the same source as you?

I'm not sure what it does. But all that is different is an undocumented register is set to 0x01. I have no clue what this register does, I'm guessing only Heltec/Semtech knows - I can try to find out.

@spiralshapeturtle
Copy link

@weebl2000 thanks for reporting back, if they wrote this tip to you it could be useful to ask further. Which register is changed?

@weebl2000
Copy link
Author

@weebl2000 thanks for reporting back, if they wrote this tip to you it could be useful to ask further. Which register is changed?

I reverse engineered it so I'm not 100% sure but I think it's 0x08B5

@spiralshapeturtle
Copy link

image https://m5stack-doc.oss-cn-shenzhen.aliyuncs.com/1198/DS_SX1261_2_V2-2.pdf

Could it be 0x08AC?

@weebl2000
Copy link
Author

PXL_20260106_115903890 MP
Comparing v3 and v4. Will report back findings.

@Uroboros67
Copy link

Uroboros67 commented Jan 6, 2026

This is the way I fixed V4'LNA problem, bypassed it.

Hi ! I did such a bypass, it's amazing preset 869.618, 62.5kHz, SF6, CR8, distance 50km reception before processing - -3dB noise -89dB after processing +3dB and noise -112dB software correction didn't help much... Unfortunately, soldering it is a disaster...

Could you please show physically how you wire it? I may follow you to solder a bypass for v4.

So with solder a bypass, Heltec v4 is basically v3 with solar input only? Thanks a lot.

just like dt267

I know it's not very effective, but it works...

yes V4 power and SX1262 reception

IMG_20260105_104927

@Uroboros67
Copy link

Rather than soldering a bypass, why not try this PR first? I see a huge improvement on RX with this PR, and so do others. 🤔

of course I used it, but the noise floor was never lower than -90dB... and the sensitivity did not exceed 0dB
now -112dB and +3dB...

@Uroboros67
Copy link

Uroboros67 commented Jan 6, 2026

Dla każdego, kto jest zainteresowany, oto niestandardowa kompilacja z łatką rejestrową, która może mieć wpływ na czułość odbioru SX1262. Zostało to zaproponowane przez Semtech.

https://x230.weebl.me/public/v4_repeater_registerpatch.bin

In what file are these changes?

@spiralshapeturtle
Copy link

This is the way I fixed V4'LNA problem, bypassed it.

Hi ! I did such a bypass, it's amazing preset 869.618, 62.5kHz, SF6, CR8, distance 50km reception before processing - -3dB noise -89dB after processing +3dB and noise -112dB software correction didn't help much... Unfortunately, soldering it is a disaster...

Could you please show physically how you wire it? I may follow you to solder a bypass for v4.
So with solder a bypass, Heltec v4 is basically v3 with solar input only? Thanks a lot.

just like dt267

I know it's not very effective, but it works...

yes V4 power and SX1262 reception

IMG_20260105_104927

You wrote "V4 power"But... the CG1109 is boosting TX as well if I read well on Reddit, does that still work? The SX1262 is only capable of 20dBm if I recall well so who is pumpingup to 27dBm?

@weebl2000
Copy link
Author

Dla każdego, kto jest zainteresowany, oto niestandardowa kompilacja z łatką rejestrową, która może mieć wpływ na czułość odbioru SX1262. Zostało to zaproponowane przez Semtech.
https://x230.weebl.me/public/v4_repeater_registerpatch.bin

In what file are these changes?

CustomSX1262.h

uint8_t regValue = 0x01;
int16_t regStatus = writeRegister(0x08B5, &regValue, 1);

@Uroboros67
Copy link

This is the way I fixed V4'LNA problem, bypassed it.

Hi ! I did such a bypass, it's amazing preset 869.618, 62.5kHz, SF6, CR8, distance 50km reception before processing - -3dB noise -89dB after processing +3dB and noise -112dB software correction didn't help much... Unfortunately, soldering it is a disaster...

Could you please show physically how you wire it? I may follow you to solder a bypass for v4.
So with solder a bypass, Heltec v4 is basically v3 with solar input only? Thanks a lot.

just like dt267
I know it's not very effective, but it works...
yes V4 power and SX1262 reception
IMG_20260105_104927

You wrote "V4 power"But... the CG1109 is boosting TX as well if I read well on Reddit, does that still work? The SX1262 is only capable of 20dBm if I recall well so who is pumpingup to 27dBm?

bypass only bypasses the receiving LNA

@Uroboros67
Copy link

Uroboros67 commented Jan 6, 2026

Dla każdego, kto jest zainteresowany, oto niestandardowa kompilacja z łatką rejestrową, która może mieć wpływ na czułość odbioru SX1262. Zostało to zaproponowane przez Semtech.
https://x230.weebl.me/public/v4_repeater_registerpatch.bin

In what file are these changes?

CustomSX1262.h

uint8_t regValue = 0x01;
int16_t regStatus = writeRegister(0x08B5, &regValue, 1);

tnx, I'll try it on the second v4

ps. and this doesn't sometimes turn off rx boost sx1262?

I tried with a software fix:
1.excluding RX Boost
2. using changes to registry 0x08B5

I didn't notice any improvement apart from a statistical error...

for me only ByPass... what will I do in the second V4

best regards

@weebl2000
Copy link
Author

tnx, I'll try it on the second v4

ps. and this doesn't sometimes turn off rx boost sx1262?

I'm not sure what it does exactly, the register is undocumented. I will try to find out.

@weebl2000
Copy link
Author

weebl2000 commented Jan 6, 2026

After a lot of tinkering the results are starting to look promising:

==> v3.log <==
2026-01-06 22:35:56,745 - INFO - [SERVICE] Uptime: 23m | RX/TX: 453/9 (5m: 24.6/min) | RX bytes: 29.2KB | MQTT: 2/2 | Reconnects/24h: none | Failures: 0
2026-01-06 22:35:56,747 - INFO - [DEVICE] Noise: -110dB | Air (5m): Tx 4.0s (3.28%), Rx 37.0s (30.33%) | Battery: 4785mV | Uptime: 23m | Errors: 0 | Queue: 0

==> v4.log <==
2026-01-06 22:35:56,825 - INFO - [SERVICE] Uptime: 23m | RX/TX: 458/4 (5m: 25.6/min) | RX bytes: 29.3KB | MQTT: 2/2 | Reconnects/24h: none | Failures: 0
2026-01-06 22:35:56,826 - INFO - [DEVICE] Noise: -95dB | Air (5m): Tx 0.0s (0.00%), Rx 20.0s (32.79%) | Battery: 4364mV | Uptime: 23m | Errors: 0 | Queue: 0

5 packets more received on the V4.

But I will observe for longer.

If anyone wants to test, I've just updated the link with the firmwarew I'm now running:
https://x230.weebl.me/public/v4_repeater_registerpatch.bin

PXL_20260106_214728217

Test setup:

  • Heltec v3 left, Heltec v4 right
  • Identical antenna setup (also tried swapping them to make sure)
  • Both running with debug and MQTT enabled to observe RX packet amounts.
  • stats v3 / stats v4 here

@Quency-D
Copy link
Contributor

Quency-D commented Jan 7, 2026

Dla każdego, kto jest zainteresowany, oto niestandardowa kompilacja z łatką rejestrową, która może mieć wpływ na czułość odbioru SX1262. Zostało to zaproponowane przez Semtech.
https://x230.weebl.me/public/v4_repeater_registerpatch.bin

In what file are these changes?

CustomSX1262.h

uint8_t regValue = 0x01;
int16_t regStatus = writeRegister(0x08B5, &regValue, 1);

In fact, it reads, modifies, and writes. Below is the location of the modification. It can be placed directly during initialization, or it can be placed before each reception cycle begins.

  uint8_t r_data = 0;
  readRegister(0x8B5, &r_data, 1);
  r_data |= 0x01;
  writeRegister(0x8B5, &r_data, 1);
int16_t SX126x::begin(uint8_t cr, uint8_t syncWord, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) {
  // BW in kHz and SF are required in order to calculate LDRO for setModulationParams
  // set the defaults, this will get overwritten later anyway
  this->bandwidthKhz = 500.0;
  this->spreadingFactor = 9;

  // initialize configuration variables (will be overwritten during public settings configuration)
  this->bandwidth = RADIOLIB_SX126X_LORA_BW_500_0;  // initialized to 500 kHz, since lower values will interfere with LLCC68
  this->codingRate = RADIOLIB_SX126X_LORA_CR_4_7;
  this->ldrOptimize = 0x00;
  this->crcTypeLoRa = RADIOLIB_SX126X_LORA_CRC_ON;
  this->preambleLengthLoRa = preambleLength;
  this->tcxoDelay = 0;
  this->headerType = RADIOLIB_SX126X_LORA_HEADER_EXPLICIT;
  this->implicitLen = 0xFF;

  // set module properties and perform initial setup
  int16_t state = this->modSetup(tcxoVoltage, useRegulatorLDO, RADIOLIB_SX126X_PACKET_TYPE_LORA);
  RADIOLIB_ASSERT(state);

  uint8_t r_data = 0;
  readRegister(0x8B5, &r_data, 1);
  r_data |= 0x01;
  writeRegister(0x8B5, &r_data, 1);
  
  Serial.println("SX126x begin 0X8B5 enabled");

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.