mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-08 13:10:29 +00:00
remove extra radio pin
removes some ambiguity in the addition of sx126x class support.
This commit is contained in:
parent
250c7f0f7c
commit
4312583638
@ -58,7 +58,7 @@
|
||||
// LoRa Configuration -- Needed only if using LoRa
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO 26
|
||||
|
||||
//433E6 for Asia
|
||||
//866E6 for Europe
|
||||
|
@ -62,8 +62,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
||||
// LoRa Configuration -- Needed only if using LoRa
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO 26
|
||||
|
||||
//433E6 for Asia
|
||||
//866E6 for Europe
|
||||
|
@ -57,7 +57,7 @@
|
||||
// LoRa Configuration -- Needed only if using LoRa
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO 26
|
||||
|
||||
//433E6 for Asia
|
||||
//866E6 for Europe
|
||||
|
@ -17,8 +17,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -17,8 +17,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -17,8 +17,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -17,8 +17,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -18,8 +18,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -18,8 +18,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -18,8 +18,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -17,8 +17,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -15,8 +15,7 @@
|
||||
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
|
||||
#define LORA_SS 18
|
||||
#define LORA_RST 14
|
||||
#define LORA_DIO0 26
|
||||
#define LORA_DIO1 33
|
||||
#define LORA_DIO 26
|
||||
|
||||
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
||||
#define LORA_ACK // Request LoRa acknowledgment.
|
||||
|
@ -68,7 +68,7 @@
|
||||
|
||||
const uint8_t lora_size = 256 / sizeof(DataReading);
|
||||
|
||||
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO0, LORA_RST, LORA_DIO1);
|
||||
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, -1);
|
||||
bool transmitFlag = false; // flag to indicate transmission or reception state
|
||||
volatile bool enableInterrupt = true; // disable interrupt when it's not needed
|
||||
volatile bool operationDone = false; // flag to indicate that a packet was sent or received
|
||||
@ -244,7 +244,9 @@ void begin_lora()
|
||||
while (true)
|
||||
;
|
||||
}
|
||||
|
||||
radio.setDio0Action(setFlag);
|
||||
|
||||
radio.setCRC(false);
|
||||
DBG("LoRa Initialized. Frequency: " + String(FDRS_LORA_FREQUENCY) + " Bandwidth: " + String(FDRS_LORA_BANDWIDTH) + " SF: " + String(FDRS_LORA_SF) + " CR: " + String(FDRS_LORA_CR) + " SyncWord: " + String(FDRS_LORA_SYNCWORD) + " Tx Power: " + String(FDRS_LORA_TXPWR) + "dBm");
|
||||
state = radio.startReceive(); // start listening for LoRa packets
|
||||
@ -465,6 +467,7 @@ void sendLoRaNbr(uint8_t interface)
|
||||
}
|
||||
#endif // USE_LORA
|
||||
}
|
||||
#ifdef USE_LORA
|
||||
|
||||
void asyncReleaseLoRa(bool first_run)
|
||||
{
|
||||
@ -518,7 +521,6 @@ void asyncReleaseLoRa(bool first_run)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_LORA
|
||||
void handleLoRa()
|
||||
{
|
||||
if (operationDone) // the interrupt was triggered
|
||||
|
@ -112,7 +112,7 @@ uint8_t broadcast_mac[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||
uint8_t gatewayAddress[] = {MAC_PREFIX, GTWY_MAC};
|
||||
uint16_t gtwyAddress = ((gatewayAddress[4] << 8) | GTWY_MAC);
|
||||
#ifdef USE_LORA
|
||||
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO0, LORA_RST, LORA_DIO1);
|
||||
RADIOLIB_MODULE radio = new Module(LORA_SS, LORA_DIO, LORA_RST, -1);
|
||||
bool transmitFlag = false;// flag to indicate transmission or reception state
|
||||
volatile bool enableInterrupt = true;// disable interrupt when it's not needed
|
||||
volatile bool operationDone = false;// flag to indicate that a packet was sent or received
|
||||
|
Loading…
Reference in New Issue
Block a user