Bridge between TheThingsNetwork/Helium and the habitat network, to receive telemetry from amateur balloons using LoRaWAN
 
 
Go to file
Bertrik Sikken 858aa956ab
Merge pull request #7 from MedadRufus/patch-1
Update documentation for integrating with Helium
2022-09-10 20:38:32 +02:00
.github/workflows Create gradle.yml 2021-08-01 14:09:14 +02:00
cayenne Fix javadoc issues. 2020-06-14 14:04:05 +02:00
docker Add docker files. 2022-04-10 21:41:52 +02:00
gradle/wrapper Update gradle + dependencies 2022-04-10 00:05:47 +02:00
tools Add tools directory. 2017-08-13 15:07:54 +02:00
ttnhabbridge Remove unused fields from Ttnv3UplinkMessage 2021-09-16 01:08:11 +02:00
workspace Move files out of workspace directory 2019-04-22 15:53:52 +02:00
.gitignore Add gitignore 2019-05-03 14:19:04 +02:00
.travis.yml Use jdk 11 on travis. 2019-04-22 15:57:15 +02:00
Dockerfile Add docker files. 2022-04-10 21:41:52 +02:00
LICENSE Add MIT license 2017-08-29 17:05:29 +02:00
README.md Update with log output example 2022-05-03 18:22:32 +01:00
build.gradle Update gradle + dependencies 2022-04-10 00:05:47 +02:00
dependencies.gradle Update gradle + dependencies 2022-04-10 00:05:47 +02:00
gradlew Update gradle to version 7.3 2021-11-10 09:32:15 +01:00
gradlew.bat Update gradle to version 7.2 and update dependencies. 2021-08-28 21:01:33 +02:00
settings.gradle Update gradle project structure (move contents of 'gradle' directory up) and upgrade gradle to 7.1.1 2021-07-31 18:06:27 +02:00

README.md

ttnhabbridge

Bridge between TheThingsNetwork/Helium and the habitat network, to receive telemetry from amateur balloons using LoRaWAN

See https://revspace.nl/TTNHABBridge for a more detailed description of this project. See https://travis-ci.org/bertrik/ttnhabbridge for the Travis CI status

Development environment

I develop this on in Java 11 in Eclipse.

Steps to install everything:

  • download a Java 11 JDK and put it in tools/jdk
  • download Eclipse and put in in the tools/eclipse directory (for example)

Steps to prepare the Eclipse environment:

  • open a command line to the checked out project, enter the 'ttnhabbridge' directory
  • type 'env.bat' to initialise the tool paths etc
  • type 'gradlew eclipse' and watch dependencies being downloaded from the internet
  • start Eclipse, using the 'workspace' directory as workspace
  • import sub-projects (ttnhabbridge, cayenne) into the workspace

Steps to update source code from github:

  • in the top-level 'ttnhabbridge' directory, enter 'git pull'

Steps to create the executable package:

  • in the root directory of the project, type './gradlew assemble' (or just 'gradlew assemble' on Windows)
  • the .tar (for Linux) and .zip (for Windows) file can be found under ttnhabbridge/build/distributions

Deployment

Steps to deploy the application:

  • unzip the .zip or .tar file
  • cd into the application directory
  • start the .bat or .sh file, if no .yaml configuration file exists, a default one is generated
  • edit and install the systemd service file, if desired (instructions inside the .service file)

Usage with Helium Network

The key difference between using The Things Network and the Helium Network MQTT integration is The Things Network hosts their packet broker, while the helium network does not. Therefore, we have to setup our own packet broker, and get Helium to and TTNhabbridge to connect to it. Here are a few steps on how to do it.

  1. Setup a MQTT packet broker on machine with port 1883 open to the internet. Docker is the simplest way to do it. Run the following command, changing the <username> and <secret_password> password fields to something secret :
docker run \
    --name mosquitto \
    -d \
    -p 1883:1883 \
    -p 9883:9883 \
    -e MQTT_USERNAME=<username> \
    -e MQTT_PASSWORD=<secret_password> \
    cburki/mosquitto:latest
  1. Now make Helium to speak with the MQTT broker in the earlier step. To do that, first add a label to your tracker device registration. In this case, it has been labeled icspace26 image

  2. Next in your integrations tab, make a new MQTT integration. Your endpoint address should be in the format mqtt://<username>:<secret_password>@your-ip-or-domain.com:1883. Your <username> and <secret_password> fields should be the same as the ones your set in step 1. image

  3. Next, head over to the flows tab and connect the label box with the mqtt integrations box. You should immediately see some data appearing on your MQTT packet broker log. This will be log data from Helium servers connecting with your packet broker. The log entries would look like this:

mosquitto_1     | 1650374268: New connection from 52.8.80.146 on port 1883.
mosquitto_1     | 1650374268: New client connected from 52.8.80.146 as 8fda71a3-be09-44b0-b3b0-611fb5a54de2 (p2, c0, k30, u'medad').

image

  1. Finally, update the ttnhabbridge.yaml with your MQTT packet broker's address and credentials. Helium will publish incoming messages to your MQTT broker. TTNhabbridge will subscribe to your broker, repackage messages and post it on Habhub. An example ttnhabridge.yaml file looks like this:
---
thethingsnetwork:
  url: "tcp://eu1.cloud.thethings.network"
  user: "icss-lora-tracker@ttn"
  pass: "NNSXS.JDUJCMUYUNDVPIOZ53TN6GBTT2P74NBH5FZXYXQ.OCWSRRQ4E46M5OMNATY35GJ6lkaBH6MOWZ5QFP32DMLP823S6M2A"
  topic: "v3/+/devices/+/up"
helium:
  url: "tcp://beta.medadnewman.co.uk:1887"
  user: "medad"
  pass: "secret_password"
  topic: "helium/+/rx"
habitat:
  url: "http://habitat.habhub.org"
  timeout: 60
gwCacheExpirationTime: 600
payloadEncoding: "cayenne"