<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ttn on CeMoCom</title><link>https://www.cemocom.de/tags/ttn/</link><description>Recent content in Ttn on CeMoCom</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 15 Feb 2022 21:00:16 +0000</lastBuildDate><atom:link href="https://www.cemocom.de/tags/ttn/feed.xml" rel="self" type="application/rss+xml"/><item><title>Running TTN Prometheus Exporter as systemd Service</title><link>https://www.cemocom.de/2022/02/15/running-ttn-prometheus-exporter-as-systemd-service/</link><pubDate>Tue, 15 Feb 2022 21:00:16 +0000</pubDate><guid>https://www.cemocom.de/2022/02/15/running-ttn-prometheus-exporter-as-systemd-service/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;h2 id="preparation"&gt;Preparation&lt;/h2&gt;
&lt;p&gt;The first step is to prepare the environment where the Prometheus exporter is installed. Throughout this article we will use the directory &lt;code&gt;/usr/local/bin/prometheus-ttn-exporter&lt;/code&gt;. However, any other directory in the local file system is also possible.&lt;/p&gt;</description></item><item><title>The Things Stack Gateway Monitoring</title><link>https://www.cemocom.de/2022/02/10/the-things-stack-gateway-monitoring/</link><pubDate>Thu, 10 Feb 2022 21:50:25 +0000</pubDate><guid>https://www.cemocom.de/2022/02/10/the-things-stack-gateway-monitoring/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;h2 id="api-key"&gt;API Key&lt;/h2&gt;
&lt;p&gt;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 &lt;em&gt;Personal API Keys&lt;/em&gt;. You have to create a token with at least the permissions &lt;em&gt;view gateway status&lt;/em&gt; and &lt;em&gt;list gateways the user is a collaborator of&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>Adafruit Feather M0 as LoRaWAN Device</title><link>https://www.cemocom.de/2020/12/30/adafruit-feather-m0-as-lorawan-device/</link><pubDate>Wed, 30 Dec 2020 21:41:17 +0000</pubDate><guid>https://www.cemocom.de/2020/12/30/adafruit-feather-m0-as-lorawan-device/</guid><description>&lt;p&gt;In a &lt;a href="https://www.cemocom.de/2020/12/12/building-a-lorawan-gateway/"&gt;previous article&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;There are multiple tutorials available. For example Adafruit provides a &lt;a href="https://learn.adafruit.com/the-things-network-for-feather"&gt;detailed guide&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="adafruit-feather"&gt;Adafruit Feather&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://www.adafruit.com/feather"&gt;Adafruit Feathers&lt;/a&gt; are a family of micro-controllers. All share the same layout such that extensions in the form of so called &lt;a href="https://www.adafruit.com/category/814"&gt;Wings&lt;/a&gt; can be used. Some Feathers already contain sensors or communication modules. For example the &lt;a href="https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module"&gt;Adafruit Feather M0&lt;/a&gt; is also available with a LoRaWAN communication module.&lt;/p&gt;</description></item><item><title>Improved TheThingsNetwork Gateway Monitoring</title><link>https://www.cemocom.de/2020/12/28/improved-thethingsnetwork-monitoring/</link><pubDate>Mon, 28 Dec 2020 17:50:32 +0000</pubDate><guid>https://www.cemocom.de/2020/12/28/improved-thethingsnetwork-monitoring/</guid><description>&lt;p&gt;In a &lt;a href="https://www.cemocom.de/2020/12/16/thethingsnetwork-gateway-monitoring/"&gt;previous post&lt;/a&gt; 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 &lt;a href="https://github.com/sebassz/prometheus-ttn-gateway-exporter"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To support multiple gateways the output format has slightly be changed. The metrics for the different gateways can now be filtered by the label &lt;em&gt;gateway_id&lt;/em&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP python_gc_objects_collected_total Objects collected during gc
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE python_gc_objects_collected_total counter
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_objects_collected_total{generation=&amp;#34;0&amp;#34;} 48.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_objects_collected_total{generation=&amp;#34;1&amp;#34;} 344.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_objects_collected_total{generation=&amp;#34;2&amp;#34;} 0.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE python_gc_objects_uncollectable_total counter
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_objects_uncollectable_total{generation=&amp;#34;0&amp;#34;} 0.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_objects_uncollectable_total{generation=&amp;#34;1&amp;#34;} 0.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_objects_uncollectable_total{generation=&amp;#34;2&amp;#34;} 0.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP python_gc_collections_total Number of times this generation was collected
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE python_gc_collections_total counter
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_collections_total{generation=&amp;#34;0&amp;#34;} 59.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_collections_total{generation=&amp;#34;1&amp;#34;} 5.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_gc_collections_total{generation=&amp;#34;2&amp;#34;} 0.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP python_info Python platform information
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE python_info gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;python_info{implementation=&amp;#34;CPython&amp;#34;,major=&amp;#34;3&amp;#34;,minor=&amp;#34;9&amp;#34;,patchlevel=&amp;#34;1&amp;#34;,version=&amp;#34;3.9.1&amp;#34;} 1.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP process_virtual_memory_bytes Virtual memory size in bytes.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE process_virtual_memory_bytes gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;process_virtual_memory_bytes 1.87236352e+08
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP process_resident_memory_bytes Resident memory size in bytes.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE process_resident_memory_bytes gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;process_resident_memory_bytes 3.1379456e+07
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE process_start_time_seconds gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;process_start_time_seconds 1.60917394427e+09
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE process_cpu_seconds_total counter
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;process_cpu_seconds_total 0.13999999999999999
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP process_open_fds Number of open file descriptors.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE process_open_fds gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;process_open_fds 8.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP process_max_fds Maximum number of open file descriptors.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE process_max_fds gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;process_max_fds 1024.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP ttn_gateway_messages_uplink Number of uplink messages
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE ttn_gateway_messages_uplink gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_uplink{gateway_id=&amp;#34;eui-1&amp;#34;} 10.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_uplink{gateway_id=&amp;#34;eui-2&amp;#34;} 20.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP ttn_gateway_messages_downlink Number of downlink messages
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE ttn_gateway_messages_downlink gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_downlink{gateway_id=&amp;#34;eui-1&amp;#34;} 1.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_downlink{gateway_id=&amp;#34;eui-2&amp;#34;} 2.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP ttn_gateway_messages_rx_ok Number of rx_ok messages
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE ttn_gateway_messages_rx_ok gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_rx_ok{gateway_id=&amp;#34;eui-1&amp;#34;} 10.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_rx_ok{gateway_id=&amp;#34;eui-2&amp;#34;} 20.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# HELP ttn_gateway_messages_tx_in Number of tx_in messages
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;# TYPE ttn_gateway_messages_tx_in gauge
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_tx_in{gateway_id=&amp;#34;eui-1&amp;#34;} 1.0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ttn_gateway_messages_tx_in{gateway_id=&amp;#34;eui-02c10afffe41d2a3&amp;#34;} 2.0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>TheThingsNetwork Gateway Monitoring</title><link>https://www.cemocom.de/2020/12/16/thethingsnetwork-gateway-monitoring/</link><pubDate>Wed, 16 Dec 2020 19:49:05 +0000</pubDate><guid>https://www.cemocom.de/2020/12/16/thethingsnetwork-gateway-monitoring/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;In a &lt;a href="https://www.cemocom.de/2020/12/12/building-a-lorawan-gateway/"&gt;previous post&lt;/a&gt; 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 &lt;a href="https://console.thethingsnetwork.org/gateways/"&gt;TheThingsNetwork Console&lt;/a&gt;, 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 &lt;a href="https://www.thethingsnetwork.org/docs/network/account/api.html"&gt;public API&lt;/a&gt;, but there the interesting information is not included.&lt;/p&gt;</description></item><item><title>Building a LoRaWAN Gateway</title><link>https://www.cemocom.de/2020/12/12/building-a-lorawan-gateway/</link><pubDate>Sat, 12 Dec 2020 17:04:36 +0000</pubDate><guid>https://www.cemocom.de/2020/12/12/building-a-lorawan-gateway/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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 &lt;a href="https://www.thethingsnetwork.org/"&gt;The Things Network&lt;/a&gt; (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.&lt;/p&gt;</description></item></channel></rss>