Skip to content

Commit

Permalink
ABP not building correctly
Browse files Browse the repository at this point in the history
Changes example to use directly channel params.
  • Loading branch information
ngraziano committed Nov 8, 2023
1 parent 40e331d commit 59face0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
4 changes: 4 additions & 0 deletions examples/esp32-deepsleep-abp/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.pio/

# Autogenerated by PlatformIO
.vscode/c_cpp_properties.json
.vscode/launch.json
10 changes: 10 additions & 0 deletions examples/esp32-deepsleep-abp/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
2 changes: 1 addition & 1 deletion examples/esp32-deepsleep-abp/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ build_unflags = -std=gnu++11


lib_deps =
https://github.com/ngraziano/LMICPP-Arduino.git
ngraziano/LMICPP-Arduino

22 changes: 13 additions & 9 deletions examples/esp32-deepsleep-abp/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ constexpr lmic_pinmap lmic_pins = {
.dio = {26, 33},
};
RadioSx1276 radio{lmic_pins};
LmicEu868 LMIC{radio};
Aes aes;
LmicRand lmicrand{aes};
Eu868RegionalChannelParams channelParams{lmicrand};

Lmic LMIC{radio, aes, lmicrand, channelParams};

OsTime nextSend;

Expand Down Expand Up @@ -118,14 +122,14 @@ void setup() {
LMIC.setRx2Parameter(869525000, 3);

// Channel 0,1,2 : default channel for EU868
// LMIC.setupChannel(0, 868100000, dr_range_map(0, 5));
// LMIC.setupChannel(1, 868300000, dr_range_map(0, 5));
// LMIC.setupChannel(2, 868500000, dr_range_map(0, 5));
LMIC.setupChannel(3, 867100000, dr_range_map(0, 5));
LMIC.setupChannel(4, 867300000, dr_range_map(0, 5));
LMIC.setupChannel(5, 867500000, dr_range_map(0, 5));
LMIC.setupChannel(6, 867700000, dr_range_map(0, 5));
LMIC.setupChannel(7, 867900000, dr_range_map(0, 5));
// channelParams.setupChannel(0, 868100000, dr_range_map(0, 5));
// channelParams.setupChannel(1, 868300000, dr_range_map(0, 5));
// channelParams.setupChannel(2, 868500000, dr_range_map(0, 5));
channelParams.setupChannel(3, 867100000, dr_range_map(0, 5));
channelParams.setupChannel(4, 867300000, dr_range_map(0, 5));
channelParams.setupChannel(5, 867500000, dr_range_map(0, 5));
channelParams.setupChannel(6, 867700000, dr_range_map(0, 5));
channelParams.setupChannel(7, 867900000, dr_range_map(0, 5));

// Tx Datarate for EU868 0 => SF12 ... 5 => SF7
LMIC.setDrTx(5);
Expand Down

0 comments on commit 59face0

Please sign in to comment.