Skip to content

MichaelEFlip/Lora-TTNMapper-T-Beam

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro

This Fork from Bjoerns-TB, forked from DeuxVis, supports OLED display on the I²C interface on GPIO22 and GPI21. This repo contains a patched SSD1306 library from smartnick, enabling individual I²C pins and to set I²C Clock to 800kHz.

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. The forked repo from hottimuc was converted to a PlatformIO project (currently only for hardware revision >= 0.8).

New features

  • GPS scan relaxed and done more "nonblocking"
  • more informations shown on status screen
  • animated GPS-fix-screen with satelite gfx
  • selectable datarate and power (button short press)
  • selectable transmit interval (button longer press)
  • selectable ADR-Mode (button even longer press)
  • selectable send-port to enable "on device" switch to experimental mapping (button even loooonger press)
  • support for newer HW-revisions (V08 / V0.8, V09 / V0.9, V10 / V1.0, with soft-power-button and powermanagement chip) (short press = power-on / dimm-mode; long press = power-off)

Start screenGPS fix screenStatus screen

Software dependencies

PlatformIO

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 can program the T-Beam using the Arduino ESP32 board 't-beam'.

You also need this library from Lewis He.

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

Configure the Payload decoder with:

function decodeUplink(input) {
	var bytes = input.bytes;
	var decoded = {};

	var latitude = ((bytes[0]<<16)>>>0) + ((bytes[1]<<8)>>>0) + bytes[2];
	latitude = (latitude / 16777215.0 * 180) - 90;

	var longitude = ((bytes[3]<<16)>>>0) + ((bytes[4]<<8)>>>0) + bytes[5];
	longitude = (longitude / 16777215.0 * 360) - 180;

	var altValue = ((bytes[6]<<8)>>>0) + bytes[7];
	var sign = bytes[6] & (1 << 7);
	var altitude;
	if(sign)
	{
		altitude = 0xFFFF0000 | altValue;
	}
	else
	{
		altitude = altValue;
	}

	var hdop = bytes[8] / 10.0;

  return {
    data: {
      latitude:latitude,
      longitude:longitude, 
      altitude:altitude, 
      hdop:hdop 
    },
    warnings: [],
    errors: []
  };
}

About

TTNMapper on the TTGO T-Beam

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.4%
  • C 7.6%