kopia lustrzana https://github.com/sh123/esp32_loraprs
Fixed bux #1 and other stuff to make it works (tested on 2 heltec wireless stick lite v3)
rodzic
8f4b6b294d
commit
fa170709bb
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
// Uncomment for SX126X module usage
|
// Uncomment for SX126X module usage
|
||||||
// #define USE_SX126X
|
// #define USE_SX126X
|
||||||
|
// #define WIFI_LoRa_32_V3
|
||||||
|
|
||||||
// Check your module name at https://github.com/jgromes/RadioLib/wiki/Modules
|
// Check your module name at https://github.com/jgromes/RadioLib/wiki/Modules
|
||||||
#ifdef USE_SX126X
|
#ifdef USE_SX126X
|
||||||
|
@ -30,16 +31,16 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Support for heltec_wifi_lora_32_V3 board
|
// Support for heltec_wifi_lora_32_V3 board
|
||||||
// https://github.com/espressif/arduino-esp32/blob/master/variants/heltec_wifi_lora_32_V3/pins_arduino.h
|
// https://github.com/espressif/arduino-esp32/blob/master/variants/heltec_wireless_stick_lite_v3/pins_arduino.h
|
||||||
// static const uint8_t RST_LoRa = 12;
|
//static const uint8_t RST_LoRa = 12;
|
||||||
// static const uint8_t BUSY_LoRa = 13;
|
//static const uint8_t BUSY_LoRa = 13;
|
||||||
// static const uint8_t DIO0 = 14;
|
//static const uint8_t DIO1 = 14;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIFI_LoRa_32_V3
|
#ifdef WIFI_LoRa_32_V3
|
||||||
#define LORA_RST RST_LoRa //OK
|
#define LORA_RST RST_LoRa //OK
|
||||||
#define LORA_IRQ 14 //schematic:dio1 include: dio0. Follow schematic ????
|
#define LORA_IRQ 14
|
||||||
#define LED_BUILTIN 35
|
#define LED_BUILTIN 35
|
||||||
#define BUILTIN_LED 35
|
#define BUILTIN_LED 35
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,18 +54,19 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// LoRa pinouts
|
// LoRa pinouts
|
||||||
#define CFG_LORA_PIN_SS SS
|
|
||||||
#define CFG_LORA_PIN_RST LORA_RST
|
#define CFG_LORA_PIN_RST LORA_RST
|
||||||
#define CFG_LORA_PIN_A LORA_IRQ // (sx127x - dio0, sx126x/sx128x - dio1)
|
#define CFG_LORA_PIN_A LORA_IRQ // (sx127x - dio0, sx126x/sx128x - dio1)
|
||||||
#ifdef USE_SX126X
|
#ifdef USE_SX126X
|
||||||
#ifdef WIFI_LoRa_32_V3
|
#ifdef WIFI_LoRa_32_V3
|
||||||
#define CFG_LORA_PIN_B BUSY_LoRa // (sx1262 - busy)
|
#define CFG_LORA_PIN_B BUSY_LoRa
|
||||||
#define CFG_LORA_PIN_RXEN RADIOLIB_NC // (sx1262 unused)
|
#define CFG_LORA_PIN_RXEN RADIOLIB_NC // (sx1262 unused)
|
||||||
#define CFG_LORA_PIN_TXEN RADIOLIB_NC // (sx1262 unused)
|
#define CFG_LORA_PIN_TXEN RADIOLIB_NC // (sx1262 unused)
|
||||||
|
#define CFG_LORA_PIN_SS 8 // NSS_LoRa
|
||||||
#else
|
#else
|
||||||
#define CFG_LORA_PIN_B 14 // (sx127x - dio1, sx126x/sx128x - busy)
|
#define CFG_LORA_PIN_B 14 // (sx127x - dio1, sx126x/sx128x - busy)
|
||||||
#define CFG_LORA_PIN_RXEN 32 // (sx127x - unused, sx126x - RXEN pin number)
|
#define CFG_LORA_PIN_RXEN 32 // (sx127x - unused, sx126x - RXEN pin number)
|
||||||
#define CFG_LORA_PIN_TXEN 33 // (sx127x - unused, sx126x - TXEN pin number)
|
#define CFG_LORA_PIN_TXEN 33 // (sx127x - unused, sx126x - TXEN pin number)
|
||||||
|
#define CFG_LORA_PIN_SS SS
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#define CFG_LORA_PIN_B RADIOLIB_NC
|
#define CFG_LORA_PIN_B RADIOLIB_NC
|
||||||
|
@ -122,7 +124,7 @@
|
||||||
#define CFG_USB_SERIAL_ENABLE false // true - enable KISS communication over USB Serial (e.g. with APRSDroid over USB-OTG), disables USB logging
|
#define CFG_USB_SERIAL_ENABLE false // true - enable KISS communication over USB Serial (e.g. with APRSDroid over USB-OTG), disables USB logging
|
||||||
|
|
||||||
// KISS protocol options
|
// KISS protocol options
|
||||||
#define CFG_KISS_EXTENSIONS false // true - enable modem control from application with KISS commands and signal reports
|
#define CFG_KISS_EXTENSIONS true // true - enable modem control from application with KISS commands and signal reports
|
||||||
#define CFG_KISS_TCP_IP false // true - run as KISS TCP/IP server, no bluetooth operations performed
|
#define CFG_KISS_TCP_IP false // true - run as KISS TCP/IP server, no bluetooth operations performed
|
||||||
|
|
||||||
// APRS-IS options, valid in when CFG_IS_CLIENT_MODE = false
|
// APRS-IS options, valid in when CFG_IS_CLIENT_MODE = false
|
||||||
|
|
|
@ -15,7 +15,6 @@ lib_deps =
|
||||||
jgromes/RadioLib @ 6.2.0
|
jgromes/RadioLib @ 6.2.0
|
||||||
rlogiacco/CircularBuffer @ 1.3.3
|
rlogiacco/CircularBuffer @ 1.3.3
|
||||||
h2zero/NimBLE-Arduino @1.4.1
|
h2zero/NimBLE-Arduino @1.4.1
|
||||||
# afpineda/NuS-NimBLE-Serial @ 3.0.1
|
|
||||||
|
|
||||||
check_tool = cppcheck
|
check_tool = cppcheck
|
||||||
check_flags =
|
check_flags =
|
||||||
|
@ -80,6 +79,7 @@ build_flags =
|
||||||
-D USE_SX126X
|
-D USE_SX126X
|
||||||
-D CFG_BT_USE_BLE=true
|
-D CFG_BT_USE_BLE=true
|
||||||
-D USE_NIMBLE
|
-D USE_NIMBLE
|
||||||
|
-D WIFI_LoRa_32_V3
|
||||||
|
|
||||||
[env:heltec-lora32-v3_igate]
|
[env:heltec-lora32-v3_igate]
|
||||||
lib_ignore =
|
lib_ignore =
|
||||||
|
@ -92,4 +92,5 @@ build_flags =
|
||||||
-D CFG_IS_CLIENT_MODE=false
|
-D CFG_IS_CLIENT_MODE=false
|
||||||
-D USE_SX126X
|
-D USE_SX126X
|
||||||
-D CFG_BT_USE_BLE=true
|
-D CFG_BT_USE_BLE=true
|
||||||
-D USE_NIMBLE
|
-D USE_NIMBLE
|
||||||
|
-D WIFI_LoRa_32_V3
|
|
@ -247,8 +247,13 @@ void Service::setupRig(long loraFreq, long bw, int sf, int cr, int pwr, int sync
|
||||||
}
|
}
|
||||||
rig_->setCRC(crcBytes);
|
rig_->setCRC(crcBytes);
|
||||||
rig_->setPreambleLength(config_.LoraPreamble);
|
rig_->setPreambleLength(config_.LoraPreamble);
|
||||||
#ifdef USE_SX126X
|
#if defined(USE_SX126X) && MODULE_NAME == SX1262
|
||||||
#pragma message("Using SX126X")
|
#pragma message("Using SX1262")
|
||||||
|
LOG_INFO("Using SX1262 module");
|
||||||
|
if (isIsrInstalled_) rig_->clearDio1Action();
|
||||||
|
rig_->setDio1Action(onRigIsrRxPacket);
|
||||||
|
isIsrInstalled_ = true;
|
||||||
|
#elif defined(USE_SX126X)
|
||||||
LOG_INFO("Using SX126X module");
|
LOG_INFO("Using SX126X module");
|
||||||
rig_->setRfSwitchPins(config_.LoraPinSwitchRx, config_.LoraPinSwitchTx);
|
rig_->setRfSwitchPins(config_.LoraPinSwitchRx, config_.LoraPinSwitchTx);
|
||||||
if (isIsrInstalled_) rig_->clearDio1Action();
|
if (isIsrInstalled_) rig_->clearDio1Action();
|
||||||
|
@ -290,13 +295,22 @@ void Service::setupRigFsk(long freq, float bitRate, float freqDev, float rxBw, i
|
||||||
LOG_ERROR("Radio start error:", state);
|
LOG_ERROR("Radio start error:", state);
|
||||||
}
|
}
|
||||||
rig_->disableAddressFiltering();
|
rig_->disableAddressFiltering();
|
||||||
#ifdef USE_SX126X
|
|
||||||
|
#if defined(USE_SX126X) && MODULE_NAME == SX1262
|
||||||
|
#pragma message("Using SX1262")
|
||||||
|
LOG_INFO("Using SX1262 module");
|
||||||
|
if (isIsrInstalled_) rig_->clearDio1Action();
|
||||||
|
rig_->setDio1Action(onRigIsrRxPacket);
|
||||||
|
isIsrInstalled_ = true;
|
||||||
|
|
||||||
|
#elif defined(USE_SX126X)
|
||||||
#pragma message("Using SX126X")
|
#pragma message("Using SX126X")
|
||||||
LOG_INFO("Using SX126X module");
|
LOG_INFO("Using SX126X module");
|
||||||
rig_->setRfSwitchPins(config_.LoraPinSwitchRx, config_.LoraPinSwitchTx);
|
rig_->setRfSwitchPins(config_.LoraPinSwitchRx, config_.LoraPinSwitchTx);
|
||||||
if (isIsrInstalled_) rig_->clearDio1Action();
|
if (isIsrInstalled_) rig_->clearDio1Action();
|
||||||
rig_->setDio1Action(onRigIsrRxPacket);
|
rig_->setDio1Action(onRigIsrRxPacket);
|
||||||
isIsrInstalled_ = true;
|
isIsrInstalled_ = true;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#pragma message("Using SX127X")
|
#pragma message("Using SX127X")
|
||||||
LOG_INFO("Using SX127X module");
|
LOG_INFO("Using SX127X module");
|
||||||
|
|
Ładowanie…
Reference in New Issue