Giter VIP home page Giter VIP logo

lora-ttnmapper-t-beam's Introduction

Intro

This is a simple sketch demonstrating the capability of the TTGO T-Beam as a TTN Mapper Node on The Things Network LoraWAN.

Derived from sbiermann/Lora-TTNMapper-ESP32 and with some information/inspiration from cyberman54/ESP32-Paxcounter and Edzelf/LoRa.

Forked from DeuxVis/Lora-TTNMapper-T-Beam and added Deep Sleep option + a check if there is any movement. If not, updates are only sent every 5 minutes instead of every 30 seconds.

Software dependencies

Arduino IDE ESP32 extension

TinyGPS++

LMIC-Arduino : Make sure to get the last version - 1.5.0+arduino-2 currently - because the arduino IDE library updater is getting confused by the versioning scheme of that library.

Instructions

You need to connect the T-Beam DIO1 pin marked Lora1 to the pin 33 - So that the ESP32 can read that output from the Lora module. Optionally you can also connect the Lora2 output to GPIO 32, but this is not needed here.

You can program the T-Beam using the Arduino ESP32 board 'Heltec_WIFI_LoRa_32'.

On The Things Network side, the settings needed are available here.

Configure the Payload decoder with:

function Decoder(bytes, port) {
    var decoded = {};

    decoded.latitude = ((bytes[0]<<16)>>>0) + ((bytes[1]<<8)>>>0) + bytes[2];
    decoded.latitude = (decoded.latitude / 16777215.0 * 180) - 90;
  
    decoded.longitude = ((bytes[3]<<16)>>>0) + ((bytes[4]<<8)>>>0) + bytes[5];
    decoded.longitude = (decoded.longitude / 16777215.0 * 360) - 180;
  
    var altValue = ((bytes[6]<<8)>>>0) + bytes[7];
    var sign = bytes[6] & (1 << 7);
    if(sign)
    {
        decoded.altitude = 0xFFFF0000 | altValue;
    }
    else
    {
        decoded.altitude = altValue;
    }
  
    decoded.hdop = bytes[8] / 10.0;

    return decoded;
}

Let me know if more detailed instructions are needed.

Todolist

  • Stop sending data to TTN until the GPS get a fix. <== Done thanks to @Roeland54
  • Manage and document the different T-Beam revisions/versions.
  • Switch to OTAA auth method for TTN and save the 'credentials' for reboot use.

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.