Skip to content

Commit

Permalink
Merge pull request #13 from ElectronicCats/fix_actions
Browse files Browse the repository at this point in the history
Fix  Testing with  Github Actions
  • Loading branch information
sabas1080 authored Mar 25, 2020
2 parents e77d97d + 91a9a56 commit d592bcb
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 646 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/BuildLibrary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Space separated list without double quotes around the list.
# If you need a library with a space in its name, like Adafruit NeoPixel or Adafruit INA219, you must use double quotes
# around the name and have at least 2 entries, where the first must be without double quotes! You may use Servo as dummy entry.
REQUIRED_LIBRARIES: TheThingsNetwork "SparkFun MPL3115A2 Altitude and Pressure Sensor Breakout" "SparkFun HTU21D Humidity and Temperature Sensor Breakout" ArduinoJson
REQUIRED_LIBRARIES: ArduinoJson "Beelan LoRaWAN" "SparkFun MPL3115A2 Altitude and Pressure Sensor Breakout" "SparkFun HTU21D Humidity and Temperature Sensor Breakout"

strategy:
matrix:
Expand All @@ -39,6 +39,7 @@ jobs:
- arduino:samd:nano_33_iot
- arduino:mbed:nano33ble
- esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
- esp32:esp32:featheresp32:FlashFreq=80
- STM32:stm32:GenF1:pnum=BLUEPILL_F103C8

# Specify parameters for each board.
Expand All @@ -57,6 +58,10 @@ jobs:
- arduino-boards-fqbn: esp8266:esp8266:huzzah:eesz=4M3M,xtal=80
platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json

- arduino-boards-fqbn: esp32:esp32:featheresp32:FlashFreq=80
platform-url: https://dl.espressif.com/dl/package_esp32_index.json
examples-exclude: Basic_LoRaWAN_Beelan

- arduino-boards-fqbn: STM32:stm32:GenF1:pnum=BLUEPILL_F103C8
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/dev/STM32/package_stm_index.json

Expand All @@ -76,4 +81,4 @@ jobs:
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
platform-url: ${{ matrix.platform-url }}
libraries: ${{ env.REQUIRED_LIBRARIES }}
examples-exclude: DetectingReaders
examples-exclude: ${{ matrix.examples-exclude }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![LibraryBuild](https://github.com/ElectronicCats/CayenneLPP/workflows/LibraryBuild/badge.svg?branch=master)

# CayenneLPP

This is an Arduino Library for Arduino Compatible with Cayenne Low Power Payload with Extended Data Types.
Expand Down
83 changes: 83 additions & 0 deletions examples/Basic_LoRaWAN_Beelan/Basic_LoRaWAN_Beelan.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/**
* Example of ABP device
* Authors:
* Ivan Moreno
* Eduardo Contreras
* June 2019
*
* This code is beerware; if you see me (or any other collaborator
* member) at the local, and you've found our code helpful,
* please buy us a round!
* Distributed as-is; no warranty is given.
*/
#include <lorawan.h>

//ABP Credentials
const char *devAddr = "00000000";
const char *nwkSKey = "00000000000000000000000000000000";
const char *appSKey = "00000000000000000000000000000000";

const unsigned long interval = 10000; // 10 s interval to send message
unsigned long previousMillis = 0; // will store last time message sent
unsigned int counter = 0; // message counter

char myStr[50];
char outStr[255];
byte recvStatus = 0;

const sRFM_pins RFM_pins = {
.CS = 20,
.RST = 9,
.DIO0 = 0,
.DIO1 = 1,
.DIO2 = 2,
.DIO5 = 15,
};

void setup() {
// Setup loraid access
Serial.begin(115200);
delay(2000);
if(!lora.init()){
Serial.println("RFM95 not detected");
delay(5000);
return;
}

// Set LoRaWAN Class change CLASS_A or CLASS_C
lora.setDeviceClass(CLASS_A);

// Set Data Rate
lora.setDataRate(SF8BW125);

// set channel to random
lora.setChannel(MULTI);

// Put ABP Key and DevAddress here
lora.setNwkSKey(nwkSKey);
lora.setAppSKey(appSKey);
lora.setDevAddr(devAddr);
}

void loop() {
// Check interval overflow
if(millis() - previousMillis > interval) {
previousMillis = millis();

sprintf(myStr, "Counter-%d", counter);

Serial.print("Sending: ");
Serial.println(myStr);

lora.sendUplink(myStr, strlen(myStr), 0);
counter++;
}

recvStatus = lora.readData(outStr);
if(recvStatus) {
Serial.println(outStr);
}

// Check Lora RX
lora.update();
}
46 changes: 0 additions & 46 deletions examples/Basic_library_TTN/Basic_library_TTN.ino

This file was deleted.

Loading

0 comments on commit d592bcb

Please sign in to comment.