Coder Social home page Coder Social logo

ttn-mapper's Introduction

TTN Mapper node

Introduction

Small sketch to run a TTN Mapper node on an Adafruit Feather M0 Radio with LoRa Radio Module with an OLED FeatherWing.

Node 1 Node 2

See https://ttnmapper.org/ for more information about the TTN Mapper project.

Hardware requirements

To expose the RFM95 DIO1 to the M0, solder a bridge from the IO1 to Digital #11 (or any other free port).
The easiest is to solder this bridge on the FeatherWing.

Software requirements

Aside the Adafruit SAMD support you will need the following libraries:

Running the script

Copy ttn_secrets_template.h to ttn_secrets.h and set your Application Key and App EUI.
You also need to define a unique Device EUI -- as the Adafruit Feather does not have a serial number, take the one automatically generated in the TTN console.

By default, the node sends a message with * as payload every minute.

  • You can change the send_packet_interval in ttn_mapper.cpp (Respect duty cycle!)
  • To send battery voltage as Cayenne LPP instead of *, uncomment #define CAYENNE_LPP in ttn_mapper.cpp

Compile, upload and you should be good to go!

GPS Tracker and TTN Mapper Integration

To directly send the tracker location to the TTN Mapper integration you can add a GPS module and use the ttn-mapper-gps script.
You will need:

And the following libraries:

Add the TTN Mapper integration to your application in the TTN Console and configure the Payload decoder with:

function Decoder(bytes, port) {
  // Decode an uplink message from a buffer
  // (array) of bytes to an object of fields.
  var decoded = {};
  if (port === 2) {
    // The port should match the port configured in `ttn_mapper.cpp`
    var i = 0;
    decoded.latitude = (bytes[i++]<<24) + (bytes[i++]<<16) + (bytes[i++]<<8) + bytes[i++];
    decoded.latitude = (decoded.latitude / 1e7) - 90;
    decoded.longitude = (bytes[i++]<<24) + (bytes[i++]<<16) + (bytes[i++]<<8) + bytes[i++];
    decoded.longitude = (decoded.longitude / 1e7) - 180;
    decoded.altitude = (bytes[i++]<<8) + bytes[i++];
    decoded.altitude = decoded.altitude - 0x7fff;
    decoded.hdop = (bytes[i++]<<8) + bytes[i++];
    decoded.hdop = decoded.hdop /10.0;
    if (bytes.length >= 14){
      decoded.voltage = ((bytes[i++]<<8)>>>0) + bytes[i++];
      decoded.voltage /= 100.0;
    }
  }
  return decoded;
}

ttn-mapper's People

Contributors

amedeebulle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ttn-mapper's Issues

Update for TTN v3

Hey @AmedeeBulle ! Great write up!

We’ve released a new version of our network server, called The Things Stack. We’re in the process of migrating our user base to the new platform and we will sunset the old environment later this year.

Can I support you updating the documentation to use The Things Stack (i.e. The Things Network v3)? You can start using The Things Stack free of charge by using the Community Edition: https://console.cloud.thethings.network/

Looking forward to hearing from you

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.