Skip to content

HarveyBates/lmic-wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lmic-wrapper

Provides the setup and handling of LoRaWAN communications when using the arduino-lmic library.

Features

  • Connect to gateway using TTN keys
  • Send message and communicate with gateway to schedule future messages
  • Get network time (unix time) over-the-air
  • Payload handling
    • Easily define new values
    • Easily add these values to the LoRa payload
  • Intergrated support for node when sleeping

Example

#include "lmic-wrapper.h"

// Keys from TTN
static const uint8_t PROGMEM APPEUI[8] = { APP_EUI };
static const uint8_t PROGMEM DEVEUI[8] = { DEV_EUI };
static const uint8_t PROGMEM APPKEY[16] = { APP_KEY };

// A payload is made up of several `Packets`
LoRa::Packet<double> temperature;

void setup() {
    Serial.begin(115200);
    while(!Serial) yield();
    LoRa::init(&Serial, APPEUI, DEVEUI, APPKEY);
}

void loop() {
    temperature.value = 20.3; // Dummy value
    LoRa::append_to_payload(temperature);
    LoRa::send_payload();
    LoRa::reset_payload();
    delay(300000);
}

Licence

This project is under the GNU LESSER GENERAL PUBLIC LICENSE as found in the LICENCE file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages