Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct ABP build #38

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ jobs:
run: platformio ci --lib="." --board=ATmega328P --project-option="lib_deps=https://github.com/ngraziano/avr_stl.git" examples/simple_sx1262
- name: Build esp32 exemple
run: platformio ci --lib="." examples/esp32 --project-conf examples/esp32/platformio-ci.ini
- name: Build esp32 abp
run: platformio ci --lib="." examples/esp32-deepsleep-abp --project-conf examples/esp32-deepsleep-abp/platformio-ci.ini
# - name: Build rak811 exemple
# run: platformio ci --lib="." examples/rak811_gps --project-conf examples/rak811_gps/platformio-ci.ini
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"
]
}
21 changes: 21 additions & 0 deletions examples/esp32-deepsleep-abp/platformio-ci.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:esp32]
platform = espressif32
board = heltec_wifi_lora_32
framework = arduino
upload_port = COM9

monitor_port = COM9
monitor_speed = 19200

build_flags = -std=gnu++17 -Wall -Wextra -O3 -DENABLE_SAVE_RESTORE
build_unflags = -std=gnu++11
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
3 changes: 3 additions & 0 deletions examples/simple/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}