Coder Social home page Coder Social logo

spgpstrack's Introduction

spGPStrack - LoRaWAN GPS Mapping

This program is a LoRaWAN GPS Tracker for mapping purposes It is developed for Arduino Uno with Dragino Lora/GPS Shield and for ESP32 TTGO T-Beam (tested with T22_V07)

  • configured as ABP so that you can power up the device at locations where you do not have coverage
  • will transmit the location all x meters
  • you can choose the payload format between CayenneLPP and a manual Payload Decoder Function
  • the software supports confirmed uplink and the Arduino will beep
  • You can read the GPS over Hardware Serial or Software Serial, so it's easier for development if you see what is going on during real operation
  • In case of Hardware Serial usage you can enable a Software Serial for debugging

To Do

  • Timed transmission, which also executes when the tracker is not moving. For example every hour, to see if the tracker is still alive.
  • low power option
  • ESP32 support [State: in work, see branch develop. The SPI Config produces backtraces] Hardware: ESP32 Uno, branded as Wemos ESP32 already implemented fot TTGO T-Beam
  • Alternative WiFi Position for ESP32

Quick Start

  • In the TTN Console, create an Application, register a new device (as ABP)
  • Copy the LoRaWAN Device Information and Keys into the sketch
  • Stack the boards and upload the sketch to board. To upload the sketch, you need to keep the Reset button on the Dragino pressed. (If you can upload without pressing that button, then this could be a sign that you have something wrong in the Dragino Jumpers or the Serial Settings of your sketch)
  • When you see the traffic in the TTN Console, you can proceed in configuring the Payload Decoder Function.
  • (if you do not see traffic in the TTN Console although you are sure that you are in good distance to a gateway, check the Frame Counter and the Dragino Jumpers)
  • Configure the TTNMapper-Integration, specify an Experiment Name for the time of the first try outs (or you will disclose your home location with a cloud of successfull connect dots)
  • You should find your new Experiment at the end of this list.

ESP32

For T22_07 SPI Pin Setting Not Implemented in LMIC yet! -> matthijskooijman/arduino-lmic#164

-> Change the SPI Pins directly in the library

Attention!!! Don't forget to reset this, if you are using also other Hardware with LMIC

hal.cpp Line 79

 static void hal_spi_init () {
   //SPI.begin();
   SPI.begin(5,19,27);
}

Dependencies

Configuration:

  • TXdist - defines, the distance [in meters], after which the position is sent
  • SF - Define The LoRaWAN Spreading Factor (DR_SF7 - DR_SF12) 7 and 8 recommended for mapping
  • SINGLE_CHANNEL - Only Use LoRaWAN Channel 0 for Single Channel Gateways
  • CONFIRMED - enables confirmed uplinks, ONLY Enable, if you conncect a Buzzer to Pin D5! Otherwise this feature is useless
  • SOFT_SERIAL - Uncomment to use Hardware Serial, otherwise Software Serial is used. In that case connect the GPS Module to RXpin and TXpin
  • DEBUG - If you use Hardware Serial you can enable DEBUG, to get Debug output on a Software Serial. Leave disabled to not use Software Serial at all
  • CAYENNELPP - If you want to use CayenneLPP as Payload Format otherwise use following Decoder Payload Function

Payload Function

function Decoder(bytes, port) {
 var decoded = {};
 // if (port === 1) decoded.led = bytes[0];
 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;
}

spgpstrack's People

Contributors

samuel-puschacher avatar limbus avatar matmat89 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.