Skip to content

Commit

Permalink
[LoRaWAN] Added frequency plans AS923_2, AS923_3 and AS923_4 for Asia…
Browse files Browse the repository at this point in the history
…n countries (#1116)

* Added AS923_2, AS923_3 and AS923_4
These plans are used by Asian countries such as Vietnam, Indonesia, Philippines...
  • Loading branch information
IoTThinks authored Jun 7, 2024
1 parent e42cd7e commit 38abf92
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/LoRaWAN/LoRaWAN_ABP/configABP.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const uint32_t uplinkIntervalSeconds = 5UL * 60UL; // minutes x seconds
// for the curious, the #ifndef blocks allow for automated testing &/or you can
// put your EUI & keys in to your platformio.ini - see wiki for more tips

// regional choices: EU868, US915, AU915, AS923, IN865, KR920, CN780, CN500
// regional choices: EU868, US915, AU915, AS923, AS923_2, AS923_3, AS923_4, IN865, KR920, CN780, CN500
const LoRaWANBand_t Region = EU868;
const uint8_t subBand = 0; // For US915, change this to 2, otherwise leave on 0

Expand Down
2 changes: 1 addition & 1 deletion examples/LoRaWAN/LoRaWAN_Reference/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const uint32_t uplinkIntervalSeconds = 5UL * 60UL; // minutes x seconds
// for the curious, the #ifndef blocks allow for automated testing &/or you can
// put your EUI & keys in to your platformio.ini - see wiki for more tips

// regional choices: EU868, US915, AU915, AS923, IN865, KR920, CN780, CN500
// regional choices: EU868, US915, AU915, AS923, AS923_2, AS923_3, AS923_4, IN865, KR920, CN780, CN500
const LoRaWANBand_t Region = EU868;
const uint8_t subBand = 0; // For US915, change this to 2, otherwise leave on 0

Expand Down
2 changes: 1 addition & 1 deletion examples/LoRaWAN/LoRaWAN_Starter/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const uint32_t uplinkIntervalSeconds = 5UL * 60UL; // minutes x seconds
// for the curious, the #ifndef blocks allow for automated testing &/or you can
// put your EUI & keys in to your platformio.ini - see wiki for more tips

// regional choices: EU868, US915, AU915, AS923, IN865, KR920, CN780, CN500
// regional choices: EU868, US915, AU915, AS923, AS923_2, AS923_3, AS923_4, IN865, KR920, CN780, CN500
const LoRaWANBand_t Region = EU868;
const uint8_t subBand = 0; // For US915, change this to 2, otherwise leave on 0

Expand Down
6 changes: 6 additions & 0 deletions src/protocols/LoRaWAN/LoRaWAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ extern const LoRaWANBand_t EU433;
extern const LoRaWANBand_t AU915;
extern const LoRaWANBand_t CN500;
extern const LoRaWANBand_t AS923;
extern const LoRaWANBand_t AS923_2;
extern const LoRaWANBand_t AS923_3;
extern const LoRaWANBand_t AS923_4;
extern const LoRaWANBand_t KR920;
extern const LoRaWANBand_t IN865;

Expand All @@ -456,6 +459,9 @@ enum LoRaWANBandNum_t {
BandAU915,
BandCN500,
BandAS923,
BandAS923_2,
BandAS923_3,
BandAS923_4,
BandKR920,
BandIN865,
BandLast
Expand Down
141 changes: 141 additions & 0 deletions src/protocols/LoRaWAN/LoRaWANBands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const LoRaWANBand_t* LoRaWANBands[RADIOLIB_LORAWAN_NUM_SUPPORTED_BANDS] = {
&AU915,
&CN500,
&AS923,
&AS923_2,
&AS923_3,
&AS923_4,
&KR920,
&IN865,
};
Expand Down Expand Up @@ -393,6 +396,144 @@ const LoRaWANBand_t AS923 = {
}
};

const LoRaWANBand_t AS923_2 = {
.bandNum = BandAS923_2,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 16,
.powerNumSteps = 7,
.dutyCycle = 36000,
.dwellTimeUp = RADIOLIB_LORAWAN_DWELL_TIME,
.dwellTimeDn = RADIOLIB_LORAWAN_DWELL_TIME,
.txFreqs = {
{ .enabled = true, .idx = 0, .freq = 921.400, .drMin = 0, .drMax = 5},
{ .enabled = true, .idx = 1, .freq = 921.600, .drMin = 0, .drMax = 5},
RADIOLIB_LORAWAN_CHANNEL_NONE
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 921.400, .drMin = 2, .drMax = 2 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
}
};

const LoRaWANBand_t AS923_3 = {
.bandNum = BandAS923_3,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 16,
.powerNumSteps = 7,
.dutyCycle = 36000,
.dwellTimeUp = RADIOLIB_LORAWAN_DWELL_TIME,
.dwellTimeDn = RADIOLIB_LORAWAN_DWELL_TIME,
.txFreqs = {
{ .enabled = true, .idx = 0, .freq = 916.600, .drMin = 0, .drMax = 5},
{ .enabled = true, .idx = 1, .freq = 916.800, .drMin = 0, .drMax = 5},
RADIOLIB_LORAWAN_CHANNEL_NONE
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 916.600, .drMin = 2, .drMax = 2 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
}
};

const LoRaWANBand_t AS923_4 = {
.bandNum = BandAS923_4,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 16,
.powerNumSteps = 7,
.dutyCycle = 36000,
.dwellTimeUp = RADIOLIB_LORAWAN_DWELL_TIME,
.dwellTimeDn = RADIOLIB_LORAWAN_DWELL_TIME,
.txFreqs = {
{ .enabled = true, .idx = 0, .freq = 917.300, .drMin = 0, .drMax = 5},
{ .enabled = true, .idx = 1, .freq = 917.500, .drMin = 0, .drMax = 5},
RADIOLIB_LORAWAN_CHANNEL_NONE
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 917.300, .drMin = 2, .drMax = 2 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
}
};

const LoRaWANBand_t KR920 = {
.bandNum = BandKR920,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
Expand Down

0 comments on commit 38abf92

Please sign in to comment.