Xinyuan-LilyGO / LilyGo-LoRa-Series

LILYGO LoRa Series examples
603 stars 169 forks source link

Can I change LoRa Spreading Factor, Coding Rate, Tx Power etc. #34

Closed nickfrost73 closed 3 years ago

nickfrost73 commented 3 years ago

We can change only LoRa Band in the script, but how about the next parameters:

define Power 20 // Set Power Tx Power

define SF 12 // Set Spreading Factor

define BW 125000 // Set Bandwidth

define CR 5 // Set Coding Rate

define Preamble 6 // Set Preamble

define SyncWd 0x12 // Set Sync Word

I change them all time in my LILYGO®TTGO ESP32 LoRa OLED 0,96 but I don't even know them in my LilyGO-T-Beam and they cant communicate. I'm desperate to connect them. Help me, please.

nickfrost73 commented 3 years ago

I found an answer inside SX1262.h. Here it is: //SX1262(Module mod); // basic methods /! \brief Initialization method for LoRa modem. \param freq Carrier frequency in MHz. Defaults to 434.0 MHz. \param bw LoRa bandwidth in kHz. Defaults to 125.0 kHz. \param sf LoRa spreading factor. Defaults to 9. \param cr LoRa coding rate denominator. Defaults to 7 (coding rate 4/7). \param syncWord 2-byte LoRa sync word. Defaults to SX126X_SYNC_WORD_PRIVATE (0x12). \param power Output power in dBm. Defaults to 10 dBm. \param preambleLength LoRa preamble length in symbols. Defaults to 8 symbols. \param tcxoVoltage TCXO reference voltage to be set on DIO3. Defaults to 1.6 V, set to 0 to skip. \returns \ref status_codes */