|
| 1 | +name: IoT Node - LoRaWAN - Firmware build Action |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - release/v01.00.00 |
| 6 | + |
| 7 | + workflow_dispatch: |
| 8 | + branches: |
| 9 | + |
| 10 | +env: |
| 11 | + ARDUINO_RP2040_DIR: .arduino15/packages/rp2040/hardware/rp2040/4.3.1 |
| 12 | + IOT_NODE_LORAWAN_APP_KEY: ${{ secrets.IOT_NODE_LORAWAN_APP_KEY }} |
| 13 | + FLX_SPARKFUN_LORAWAN_APP_EUI: ${{ secrets.FLX_SPARKFUN_LORAWAN_APP_EUI }} |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: Build IoT Node - LoRaWAN Firmware |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout Repo and submodules |
| 22 | + uses: actions/checkout@v3 |
| 23 | + with: |
| 24 | + ref: mairelease/v01.00.00 |
| 25 | + |
| 26 | + # checkout flux-sdk |
| 27 | + - name: Checkout the flux-sdk |
| 28 | + run: | |
| 29 | + git clone --branch feature/rp2350-port https://github.com/sparkfun/flux-sdk.git |
| 30 | + echo "FLUX_SDK_PATH=`pwd`/flux-sdk" >> $GITHUB_ENV |
| 31 | +
|
| 32 | + # Run cmake - this will build a custom SparkFun_Flux library we can use with |
| 33 | + # the Arduino CLI |
| 34 | + - name: Run CMake |
| 35 | + run: | |
| 36 | + echo $FLUX_SDK_PATH |
| 37 | + mkdir -p build |
| 38 | + cd build |
| 39 | + cmake .. |
| 40 | + cd .. |
| 41 | +
|
| 42 | + # Setup Arduino command line - install esp32 and all the libs flux needs |
| 43 | + - name: Arduino - Install and setup the Arduino CLI |
| 44 | + uses: arduino/setup-arduino-cli@v1 |
| 45 | + |
| 46 | + - name: Arduino - Start config file |
| 47 | + run: arduino-cli config init --additional-urls "https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json" |
| 48 | + |
| 49 | + - name: Arduino - Update index |
| 50 | + run: arduino-cli core update-index |
| 51 | + |
| 52 | + # Install RP2040 - 4.0.3 (Nov, 2024) |
| 53 | + - name: Arduino - Install rp2040 platform |
| 54 | + run: arduino-cli core install rp2040:[email protected] |
| 55 | + |
| 56 | + - name: Patch in our IOT Node boards |
| 57 | + run: | |
| 58 | + cd patch |
| 59 | + cp boards.txt $HOME/$ARDUINO_RP2040_DIR/boards.txt |
| 60 | + cp -R sparkfun_iotnode_lorawanrp2350 $HOME/$ARDUINO_RP2040_DIR/variants/ |
| 61 | + cp sparkfun_iotnode_lorawan_rp2350.h $HOME/$ARDUINO_RP2040_DIR//pico-sdk/src/boards/include/boards/ |
| 62 | + cd .. |
| 63 | +
|
| 64 | + # install the libraries Flux uses |
| 65 | + - name: Install Flux dependant libraries |
| 66 | + run: ./flux-sdk/install-libs.sh |
| 67 | + |
| 68 | + # currently using a local copy of the library that removed some warning messages - source is here: |
| 69 | + # arduino-cli lib install --git-url "https://github.com/felixgalindo/XBeeArduino.git" |
| 70 | + - name: Install The XBee LoRaWAN library |
| 71 | + run: | |
| 72 | + arduino-cli config set library.enable_unsafe_install true |
| 73 | + arduino-cli lib install --git-url "https://github.com/sparkfun/XBeeArduino.git" |
| 74 | + arduino-cli lib install FastLED |
| 75 | +
|
| 76 | + # Compile time - build the Firmware for the data logger. |
| 77 | + # Note: |
| 78 | + # - The use of a full path to flux - this is needed or the build fails (relative paths get merged). |
| 79 | + # - ** Nov 25 - for build testing, using the pro micro board definition until new board added |
| 80 | + |
| 81 | + - name: Compile DataLogger firmware binary |
| 82 | + run: |
| 83 | + arduino-cli compile --fqbn rp2040:rp2040:sparkfun_iotnode_lorawanrp2350 ./sfeIoTNodeLoRaWAN/sfeIoTNodeLoRaWAN.ino |
| 84 | + --build-property "compiler.cpp.extra_flags=\"-DIOT_NODE_LORAWAN_APP_KEY=$IOT_NODE_LORAWAN_APP_KEY\" \"-DFLX_SPARKFUN_LORAWAN_APP_EUI=$FLX_SPARKFUN_LORAWAN_APP_EUI\" \"-DBUILD_NUMBER=$GITHUB_RUN_NUMBER\"" |
| 85 | + --export-binaries --clean --library `pwd`/SparkFun_IoTNodeLoRaWAN |
| 86 | + |
| 87 | + # Upload the build files - bootloader, paritions, firmware |
| 88 | + - uses: actions/upload-artifact@v3 |
| 89 | + with: |
| 90 | + name: Upload Build |
| 91 | + path: sfeIoTNodeLoRaWAN/build/rp2040.rp2040.sparkfun_iotnode_lorawanrp2350/sfeIoTNodeLoRaWAN.ino.uf2 |
| 92 | + |
| 93 | + |
0 commit comments