GithubHelp home page GithubHelp logo

arduino's Introduction

Arduino

Arduino and LoRa related stuff

Adaptation of the ATT LoRa kit libraries.

  • Created classes for the different Sensor types for easier manipulation.
  • Added features to help a developer adhere better to the LoRa specifications (Sending speed, packet size, ...)
  • Added support for mDot modem

Basic usage : (.ino file has a lot of samples in there, but ...)

All available modem implementations rely on serial communications, so let's start with that.

(for the ATT kits we can use the Serial1 on an Arduino nano we can opt to use SoftSerial)

#define MODEM_SERIAL Serial1
#define debugSerial Serial
// Let's also define a serial port on which the modem may put debug information
// I tried to make the code as generic as possible ans as such make some use of these #define 
// and #if defined compiler directives for conditional compilation

With the serial definition, select a modem implementation and create an object.

#include "LoRaModemMDot.h"
LoRaModemMDot modem(&MODEM_SERIAL, &debugSerial);

With these, we can create an instance of 'Device' representing our sensing device :

#include "device.h"
Device mySensingDevice(&modem, &debugSerial);

Now we'll make a function to read out the physical sensor value and send it onto the LoRa network:

#include "sensor.h"

float readTemperatureValue(){
    // MOCK ...  gonna leave it as an exercise to read out a real sensor
    return 18.5;
}

void readAndSend(){
    TemperatureSensor fSens(readTemperatureValue());
    mySensingDevice.sendSafe(fSens);
}

The 'sendSafe' convenience method will help in adhering to LoRaWAN specifications with regards to the delay between sends, the size of messages which all depend on the quality of the connection.

Please feel free to comment, improve, suggest .......

The EnCo team.

#09/12/2016 Changes :

  • removed .ino script from library folder
  • added separate folders with samples and support libraries

arduino's People

Contributors

legrandchef avatar

Stargazers

 avatar Francis De Brabandere avatar

Watchers

James Cloos avatar Hans Van Herreweghe avatar Svenson avatar  avatar  avatar Mathias De Belder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.