Skip to content

Bridge between the-things-network and the habitat network, to receive amateur balloons using LoRaWAN

License

Notifications You must be signed in to change notification settings

ImperialSpaceSociety/ttnhabbridge

 
 

Repository files navigation

ttnhabbridge

Bridge between the-things-network, Helium and the habitat network, to receive telemetry from amateur balloons using LoRaWAN.

There are 3 parts to the bridge:

  1. Subscription to TTN and Helium(can be either).
  2. Parsing and then formatting messages in Habhub format
  3. Sending messages to Habhub.

TTNhabbridge subscribes to TTN's hosted MQTT broker, but Helium requires an external MQTT broker to be hosted(which it will publish to). Use the docker instructions under the [Docker](#Use docker to deploy) to both host the MQTT broker and TTNhabbridge.

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 Windows 7, in Java 8 in Eclipse.

Steps to install everything:

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
  • enter directory gradle
  • 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:

  • enter the 'gradle' directory, then type './gradlew assemble' (or just 'gradlew assemble' on Windows)
  • the .tar (for Linux) or .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
  • edit and install the systemd service file, if desired (instructions inside the .service file)

Use docker to deploy

Its a lot easier to deploy with docker.

First, you will have to generate a password and username file, which will then be copied over to the docker image. Do so by running(change the username field to your own):

mosquitto_passwd -c passwdfile <username>

You will be promped to key in a password for this user name. An example command could be:

mosquitto_passwd -c passwdfile medad

Copy the passwdfile to docker_configs/. You will need to add the username and password to the ttnhabbridge.yaml file at the root of the repo. Add it under the Helium yaml section, as well as on your Helium dashboard.

---
thethingsnetwork:
  url: "tcp://eu1.cloud.thethings.network"
  user: "icss-lora-tracker@ttn"
  pass: "NNSXS.JDUJCMUYUN90AIOZ53TN6GBTT2P74NBH5FZXYXQ.OCWSRRQ4E46M5LLSATY35GJ6OGYBH6MOWZ5QFP32DMLKSNPS6M2A"
  topic: "v3/+/devices/+/up"
helium:
  url: "tcp://mosquitto:1883"
  user: "medad"
  pass: "secret_password"
  topic: "helium/+/rx"
habitat:
  url: "http://habitat.habhub.org"
  timeout: 60
gwCacheExpirationTime: 600
payloadEncoding: "cayenne"

Just run the following command to fire up both TTNhabbridge and the MQTT broker for Helium. This should download all dependencies, compile code and run it.

docker-compose up -d

To see the logs, run:

docker-compose logs

About

Bridge between the-things-network and the habitat network, to receive amateur balloons using LoRaWAN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.6%
  • Dockerfile 0.4%