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

ESP32 Example Sketch: Option for setting RTC from LoRaWAN Network Time #215

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
49d0408
Create CI.yml
matthias-bs Mar 8, 2023
edc59a1
Added option for setting RTC from LoRaWAN network time
matthias-bs Mar 8, 2023
f3987e7
Update CI.yml
matthias-bs Mar 8, 2023
be0b5d1
Update CI.yml
matthias-bs Mar 8, 2023
f2be7ba
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 8, 2023
2dddb0a
Update CI.yml
matthias-bs Mar 8, 2023
23d7abb
Update CI.yml
matthias-bs Mar 8, 2023
237cdea
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 8, 2023
c18d372
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 8, 2023
f042580
Update CI.yml
matthias-bs Mar 8, 2023
5ffb733
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 8, 2023
179d2eb
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 8, 2023
367f46a
Fixed debug output
matthias-bs Mar 9, 2023
7659680
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 9, 2023
66fdcc2
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 9, 2023
fcc0958
Update arduino_lorawan_esp32_example.ino
matthias-bs Mar 9, 2023
d2f981a
Merge branch 'mcci-catena:master' into esp32-example-networktime
matthias-bs Mar 9, 2023
a135faf
Update library.properties
matthias-bs Mar 9, 2023
cf836c8
Update library.json
matthias-bs Mar 9, 2023
2953985
Update Arduino_LoRaWAN.h
matthias-bs Mar 9, 2023
39c4430
Update README.md
matthias-bs Mar 9, 2023
656dd94
Update README.md
matthias-bs Mar 9, 2023
b4425d1
Update CI.yml
matthias-bs Mar 9, 2023
4307531
Update CI.yml
matthias-bs Mar 9, 2023
e2d6148
Update CI.yml
matthias-bs Mar 9, 2023
c42bbdc
Update CI.yml
matthias-bs Mar 9, 2023
7f70462
Update CI.yml
matthias-bs Mar 9, 2023
e481d5f
Update CI.yml
matthias-bs Mar 9, 2023
d50c6a5
Update CI.yml
matthias-bs Mar 9, 2023
60fc7f8
Update CI.yml
matthias-bs Mar 10, 2023
d729272
Improved payload size handling
matthias-bs Mar 13, 2023
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
139 changes: 139 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

jobs:

build:
strategy:
matrix:
board:
- esp32:[email protected]
- esp32:esp32:esp32:DebugLevel=none
- esp32:esp32:esp32:DebugLevel=verbose
#- esp32:esp32:firebeetle32
#- esp32:esp32:ttgo-lora32:Revision=TTGO_LoRa32_V1
#- esp32:esp32:ttgo-lora32:Revision=TTGO_LoRa32_V2
#- esp32:esp32:ttgo-lora32:Revision=TTGO_LoRa32_v21new
#- esp32:esp32:heltec_wireless_stick:PSRAM=disabled
#- esp32:esp32:featheresp32
#- esp32:esp32:adafruit_feather_esp32s2

runs-on: ubuntu-latest
name: ${{ matrix.board }}
env:
GH_TOKEN: ${{ github.token }}
run-build: ${{ contains(matrix.board, 'esp32:esp32') || contains(github.event.head_commit.message, 'CI_BUILD_ALL') || contains(github.event.head_commit.message, 'Bump version to') || contains(github.event.head_commit.message, format('{0}', matrix.board)) }}

steps:
- name: Install arduino-cli
if: ${{ env.run-build == 'true' }}
run:
|
mkdir -p ~/.local/bin
echo "~/.local/bin" >> $GITHUB_PATH
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh

- name: Get platform name
if: ${{ env.run-build == 'true' }}
uses: jungwinter/split@v2
id: split
with:
msg: ${{ matrix.board }}
separator: ':'

- name: Prepare platform-specific settings
if: ${{ env.run-build == 'true' }}
id: prep
run:
|
# common settings - no extra options, all warnings
echo "skip-pattern='simple_sensor_bme280'" >> $GITHUB_OUTPUT
echo "warnings='all'" >> $GITHUB_OUTPUT

# platform-dependent settings - extra board options, board index URLs, skip patterns etc.
if [[ "${{ contains(matrix.board, 'esp32:esp32') }}" == "true" ]]; then
# ESP32
python -m pip install pyserial
echo "index-url=--additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" >> $GITHUB_OUTPUT
fi

- name: Install libraries
if: ${{ env.run-build == 'true' }}
run:
|
declare -a required_libs=(
"MCCI LoRaWAN LMIC [email protected]"
"MCCI Arduino LoRaWAN [email protected]"
"MCCI Arduino Development Kit [email protected]"
"LoRa [email protected]"
"[email protected]")
for i in "${required_libs[@]}"
do
arduino-cli lib install "$i"
done
# Clone mcci-catena's fork of Adafruit_BME280_Library used in the example simple_sensor_bme280
#git clone https://github.com/mcci-catena/Adafruit_BME280_Library.git
#cp -r Adafruit_BME280_Library /home/runner/Arduino/libraries/

- name: Install platform
if: ${{ env.run-build == 'true' }}
run:
|
arduino-cli core update-index ${{ format('{0}', steps.prep.outputs.index-url) }}
arduino-cli core install ${{ format('{0}:{1} {2}', steps.split.outputs._0, steps.split.outputs._1, steps.prep.outputs.index-url) }}

- name: Checkout repository
if: ${{ env.run-build == 'true' }}
uses: actions/checkout@v3

- name: Customizing lmic_project_config.h (LMIC_ENABLE_DeviceTimeReq)
if: ${{ env.run-build == 'true' }}
run:
|
echo "#define LMIC_ENABLE_DeviceTimeReq 1" >> /home/runner/Arduino/libraries/MCCI_LoRaWAN_LMIC_library/project_config/lmic_project_config.h
# Fix for linker error with Arduino core for ESP32 v2.0.x as suggested in https://github.com/mcci-catena/arduino-lmic/issues/714#issuecomment-822051171
echo "#define hal_init LMICHAL_init" >> /home/runner/Arduino/libraries/MCCI_LoRaWAN_LMIC_library/project_config/lmic_project_config.h

- name: Copy secrets.h from secrets.h.template
if: ${{ env.run-build == 'true' }}
run:
|
pwd
ls
cp examples/arduino_lorawan_esp32_example/secrets.h.template examples/arduino_lorawan_esp32_example/secrets.h

- name: Build sketch
if: ${{ env.run-build == 'true' }}
run:
|
#for example in $(find $PWD/examples -name '*.ino' | sort); do
# modified to compile a singe sketch (instead of a library's examples)
for example in $(find $PWD -name '*.ino' | sort); do
# check whether to skip this sketch
if [ ! -z '${{ steps.prep.outputs.skip-pattern }}' ] && [[ ${example} =~ ${{ steps.prep.outputs.skip-pattern }} ]]; then
# skip sketch
echo -e "\n\033[1;33mSkipped ${example##*/} (matched with ${{ steps.prep.outputs.skip-pattern }})\033[0m";
else
# build sketch
echo -e "\n\033[1;33mBuilding ${example##*/} ... \033[0m";
if [[ "${{ contains(matrix.board, '@1.0.6') }}" == "true" ]]; then
# hardcoded fqbn, because 'esp32:[email protected]' did not work
arduino-cli compile --libraries /home/runner/work/arduino-lorawan --fqbn esp32:esp32:esp32${{ steps.prep.outputs.options }} $example --warnings=${{ steps.prep.outputs.warnings }}
else
arduino-cli compile --libraries /home/runner/work/arduino-lorawan --fqbn ${{ matrix.board }}${{ steps.prep.outputs.options }} $example --warnings=${{ steps.prep.outputs.warnings }}
fi

if [ $? -ne 0 ]; then
echo -e "\033[1;31m${example##*/} build FAILED\033[0m\n";
exit 1;
else
echo -e "\033[1;32m${example##*/} build PASSED\033[0m\n";
fi
fi
done
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,13 @@ Much more elaborate uses can be found in the MCCI [Catena-Arduino-Platform](http

## Release History

- v0.10.0-pre2 includes the following changes.

- examples/arduino_lorawan_esp32_example: [@matthias-bs](https://github.com/matthias-bs) Added option for setting ESP32 internal RTC from LoRaWAN network time

- v0.10.0-pre1 includes the following changes.

- examples/arduino_lorawan_esp32_example: @matthias-bs Added pin mappings for some common ESP32 LoRaWAN boards
- examples/arduino_lorawan_esp32_example: [@matthias-bs](https://github.com/matthias-bs) Added pin mappings for some common ESP32 LoRaWAN boards

- v0.9.2 includes the following changes.

Expand Down
Loading