Running TTN Prometheus Exporter as systemd Service

Background In previous posts we presented a Prometheus exporter to monitor for monitoring TheThingsNetwork gateways. The exporter can directly be executed in a terminal. However, to use it productively it should run in the background as a service. This article demonstrates how this can be achieved using the system and service manager systemd on Linux systems. Preparation The first step is to prepare the environment where the Prometheus exporter is installed. Throughout this article we will use the directory /usr/local/bin/prometheus-ttn-exporter. However, any other directory in the local file system is also possible. ...

February 15, 2022 · 2 min

The Things Stack Gateway Monitoring

Background In previous posts we showed how the status of TheThingsNetwork gatways can be monitored. With the switch of the underlying infrastructure to TheThingsStack this becomes even easier, because the API allows direct access to the relevant statistics of the gateways. It is now also possible to authenticate with a (personal) API key, such that the login procedure becomes also easier to handle. API Key The first step is to create an API key with the appropriate permissions. This can be done in the console of TheThingsNetwork, by clicking on your username in the upper right corner and selecting the option Personal API Keys. You have to create a token with at least the permissions view gateway status and list gateways the user is a collaborator of. ...

February 10, 2022 · 2 min

Traceability in Simulation Studies

This article deals with a challenge of simulation studies. In particular it deals with traceability. We define what the term traceability means and what is not meant by it. Additionally we illustrate a concept how to achieve traceability with established methods from software engineering. What is traceability The term traceability describes the fact that all steps necessary to create results with simulation studies are linked with each other. Thereby traceability is the foundation of reproducible simulation results. A basic workflow when producing results out of simulation study consists of the following steps. ...

January 26, 2022 · 3 min

Scalable Setup for Simulation Studies

Introduction When executing simulations one is often facing the task to running simulation studies with varying parameters. The simulation results are then plotted as a family of curves. Especially in the case of discrete event simulations, the task of running the complete simulation study can be efficiently distributed on multiple compute nodes, as every parameter combination can be treated as an individual simulation. This article describe a scalable yet inexpensive setup to execute such simulation studies. ...

June 21, 2021 · 4 min

Adafruit Feather M0 as LoRaWAN Device

In a previous article we showed how an own TTN LoRaWAN gateway can be built using a Raspberry Pi. This article shows how a LoRaWAN device can be built. There are multiple options, however we use an Adafruit Feather. There are multiple tutorials available. For example Adafruit provides a detailed guide. Adafruit Feather The Adafruit Feathers are a family of micro-controllers. All share the same layout such that extensions in the form of so called Wings can be used. Some Feathers already contain sensors or communication modules. For example the Adafruit Feather M0 is also available with a LoRaWAN communication module. ...

December 30, 2020 · 7 min

Improved TheThingsNetwork Gateway Monitoring

In a previous post we showed how TTN gateways can be monitored using Prometheus. However, the presented solution had some limitations. For example it was only possible to monitor a single gateway. Also the code is now available on GitHub. To support multiple gateways the output format has slightly be changed. The metrics for the different gateways can now be filtered by the label gateway_id. # HELP python_gc_objects_collected_total Objects collected during gc # TYPE python_gc_objects_collected_total counter python_gc_objects_collected_total{generation="0"} 48.0 python_gc_objects_collected_total{generation="1"} 344.0 python_gc_objects_collected_total{generation="2"} 0.0 # HELP python_gc_objects_uncollectable_total Uncollectable object found during GC # TYPE python_gc_objects_uncollectable_total counter python_gc_objects_uncollectable_total{generation="0"} 0.0 python_gc_objects_uncollectable_total{generation="1"} 0.0 python_gc_objects_uncollectable_total{generation="2"} 0.0 # HELP python_gc_collections_total Number of times this generation was collected # TYPE python_gc_collections_total counter python_gc_collections_total{generation="0"} 59.0 python_gc_collections_total{generation="1"} 5.0 python_gc_collections_total{generation="2"} 0.0 # HELP python_info Python platform information # TYPE python_info gauge python_info{implementation="CPython",major="3",minor="9",patchlevel="1",version="3.9.1"} 1.0 # HELP process_virtual_memory_bytes Virtual memory size in bytes. # TYPE process_virtual_memory_bytes gauge process_virtual_memory_bytes 1.87236352e+08 # HELP process_resident_memory_bytes Resident memory size in bytes. # TYPE process_resident_memory_bytes gauge process_resident_memory_bytes 3.1379456e+07 # HELP process_start_time_seconds Start time of the process since unix epoch in seconds. # TYPE process_start_time_seconds gauge process_start_time_seconds 1.60917394427e+09 # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. # TYPE process_cpu_seconds_total counter process_cpu_seconds_total 0.13999999999999999 # HELP process_open_fds Number of open file descriptors. # TYPE process_open_fds gauge process_open_fds 8.0 # HELP process_max_fds Maximum number of open file descriptors. # TYPE process_max_fds gauge process_max_fds 1024.0 # HELP ttn_gateway_messages_uplink Number of uplink messages # TYPE ttn_gateway_messages_uplink gauge ttn_gateway_messages_uplink{gateway_id="eui-1"} 10.0 ttn_gateway_messages_uplink{gateway_id="eui-2"} 20.0 # HELP ttn_gateway_messages_downlink Number of downlink messages # TYPE ttn_gateway_messages_downlink gauge ttn_gateway_messages_downlink{gateway_id="eui-1"} 1.0 ttn_gateway_messages_downlink{gateway_id="eui-2"} 2.0 # HELP ttn_gateway_messages_rx_ok Number of rx_ok messages # TYPE ttn_gateway_messages_rx_ok gauge ttn_gateway_messages_rx_ok{gateway_id="eui-1"} 10.0 ttn_gateway_messages_rx_ok{gateway_id="eui-2"} 20.0 # HELP ttn_gateway_messages_tx_in Number of tx_in messages # TYPE ttn_gateway_messages_tx_in gauge ttn_gateway_messages_tx_in{gateway_id="eui-1"} 1.0 ttn_gateway_messages_tx_in{gateway_id="eui-02c10afffe41d2a3"} 2.0

December 28, 2020 · 2 min

Monitoring POCSAG Networks using a SDR

This article demonstrates how the POCSAG pager network can be monitored and the transmitted messages can be read. Background The POCSAG protocol used to operate pager networks is already several decades old but still in use. There are multiple networks available world wide operated by commercial network operators. The communication is by default unencrypted so it can be received and understood by anyone. This article shows how a SDR and open source software can be used to receive and display POCSAG messages. ...

December 22, 2020 · 3 min

TheThingsNetwork Gateway Monitoring

Background In a previous post we showed how to setup a new TheThingsNetwork gateway. After successfully building a gateway and connecting it to TTN, probably one of the most interesting information for gateway operators is how frequently the gateway is used. This information is available on the TheThingsNetwork Console, but of course we want to access this data via API so that we can use it in multiple ways. One option would be to create a Grafana dashboard and display the transmitted and received messages. TTN provides a public API, but there the interesting information is not included. ...

December 16, 2020 · 5 min

Building a LoRaWAN Gateway

Background Long Range Wide Area Network (LoRaWAN) is a proprietary wireless communication protocol. While the achievable data rates are by design comparatively low, it offers long communication ranges with low power consumption. In Europe the unlicensed 868MHz frequency band is used, such that anyone use LoRaWAN without the need to apply for dedicated spectrum. So LoRaWAN is a good choice for IoT applications. Around the globe there are several commercial network operators that operate LoRaWAN networks. These networks consist of gateways which provide coverage to connect nodes with the LoRaWAN network and a backend. The gateways forward messages to and from the nodes to the network operator backend via the Internet. In the backend messages received from the nodes can be accessed and data can be send to the nodes. Besides the commercial networks also the community driven The Things Network (TTN) provides a freely accessible LoRaWAN network in many locations worldwide. Here the gateways are provided and operated by individuals. Also the backend can be used by anyone free of charge. ...

December 12, 2020 · 2 min

Open LUKS encrypted device via key on USB stick

Background If you want to encrypt the root file system of a computer running Linux with LUKS, you usually have to entere the encryption password at every system boot. Especially in the case of a headless computer acting as a server this is not suitable. To overcome this problem LUKS offers the possibility to store the encryption key as a keyfile and use it to open the encrypted disk. There also exist several guides how the keyfile can be stored on a USB stick. Examples include here, here or here (the second and third guides are only available in German). ...

April 15, 2020 · 2 min