diff --git a/doc/content/cloud/_index.md b/doc/content/cloud/_index.md index a7b5b0ff5d..d0e9bb45c1 100644 --- a/doc/content/cloud/_index.md +++ b/doc/content/cloud/_index.md @@ -17,7 +17,7 @@ aliases: {{% tts %}} Cloud includes a [service level agreement](https://www.thethingsindustries.com/document/sla/) which offers an uptime commitment so that you can be assured of the availability of the service. -We offer multiple plans based on your needs including a [free discovery tier](https://www.thethingsindustries.com/stack/plans/) for users to evaluate the product. Signing up to {{% tts %}} Cloud is very easy and within a few minutes, you can [get started]({{< ref "/getting-started/setup-first-network/" >}}) with a production-grade LoRaWAN network. +We offer multiple plans based on your needs including a [free discovery tier](https://www.thethingsindustries.com/stack/plans/) for users to evaluate the product. Signing up to {{% tts %}} Cloud is very easy and within a few minutes, you can [get started]({{< ref "/getting-started/2-prerequisites/" >}}) with a production-grade LoRaWAN network. #### Multi-tenancy diff --git a/doc/content/concepts/_index.md b/doc/content/concepts/_index.md index e725c851b0..4515c8a19a 100644 --- a/doc/content/concepts/_index.md +++ b/doc/content/concepts/_index.md @@ -9,6 +9,7 @@ aliases: /reference/spec-regional-parameters, doc/content/the-things-stack/concepts, /the-things-stack, + /getting-started/the-things-stack-basics, ] --- @@ -17,3 +18,20 @@ This section introduces basic concepts of working with {{% tts %}}. We start with a general technical discussion of {{% tts %}} architecture and progress to other more detailed topics. + +{{% tts %}} is an enterprise grade LoRaWAN server (that includes both the Network Server and Application Server functions mentioned in the LoRaWAN Reference architecture). In addition, {{% tts %}} contains services and tools to securely manage millions of LoRaWAN devices in production. + +{{% tts %}} offers the following options for LoRaWAN deployments in production. + +- {{< distributions "Cloud" >}} [{{% tts %}} Cloud]({{< relref "cloud" >}}): Our flagship, fully-managed, SLA-backed cloud subscription helping hundreds of companies around the world. + By using {{% tts %}} Cloud, you can focus on providing value to your customers, while leaving the complexity of managing a production LoRaWAN Network Server to us. You can start evaluating {{% tts %}} Cloud by [signing up for the free discovery tier]({{< relref "2-prerequisites" >}}) to get started. + +- {{< distributions "Enterprise" >}}[{{% tts %}} Enterprise]({{< relref "enterprise" >}}): Alternatively, if you prefer to take on the responsibility of installing and maintaining {{% tts %}} in addition to managing your LoRaWAN device fleet, {{% tts %}} is available to be installed on your own hardware or cloud infrastructure. + +For simple non-commercial projects and local testing, there are a few options. + +- {{< distributions "Sandbox" >}}[{{% ttss %}}]({{< relref "ttn" >}}): A free and limited version of {{% tts %}} _without any guarantees or SLA_ available to The Things Network community for non-commercial, small scale testing and experimentation. + +- {{< distributions "Open Source" >}}[{{% tts %}} Open Source](https://github.com/thethingsnetwork/lorawan-stack): For the DIY’ers, the core features of The Things Stack are open source. This is limited in features and is not suitable for production. + +{{% tts %}} is developed and maintained by [The Things Industries](https://thethingsindustries.com/). diff --git a/doc/content/getting-started/1-understand-lorawan/_index.md b/doc/content/getting-started/1-understand-lorawan/_index.md new file mode 100644 index 0000000000..61aa8c2d8e --- /dev/null +++ b/doc/content/getting-started/1-understand-lorawan/_index.md @@ -0,0 +1,113 @@ +--- +title: "Step 1: Understanding LoRaWAN Fundamentals" +description: "Learn basic concepts of LoRaWAN" +weight: 1 +aliases: ["/getting-started/lorawan-basics"] +--- + +This guide briefly explains the architecture and key concepts of a LoRaWAN® network. + + + +LoRaWAN is a Low Power Wide Area Network (LPWAN) protocol designed for low power, long range use cases. + +### Key Characteristics + +The key characteristics of a LoRaWAN + +- **Long Range**: LoRaWAN networks can provide coverage of up to 10+ km in rural areas and 2-5 km in urban environments +- **Low Power Consumption**: Devices can operate for 5-10+ years on a single battery +- **Secure Communication**: End-to-end encryption with AES. +- **Bidirectional Communication**: Supports both upstream and downstream messages. + +#### Data Size and Rates + +LoRaWAN is optimized for low data rate communications: + +- **Payload Size**: 51-242 bytes per message\* +- **Data Rate**: 0.3-50 kbps\* +- **Daily Messages**: Typically designed for 1-100 messages per day +- **Duty Cycle**: Subject to regional regulations (e.g., 1% in Europe) + +\*Depends on the regional regulations and the spreading factor. Spreading factor is a transmission parameter that balances transmission range against data rate - higher spreading factors reach longer distances but transmit data more slowly. + +#### Typical Use Cases + +LoRaWAN excels in applications requiring: + +- Long battery life +- Long-range coverage +- Low cost +- Small, infrequent data transmissions + +Typical use cases are + +- Smart cities (ex: Street lighting control, Traffic monitoring etc) +- Agriculture (ex: Soil moisture monitoring, Irrigation control etc) +- Supply Chain & Logistics (ex: Asset tracking, Cold chain monitoring etc) +- Utilities (ex: Leak detection, Smart metering etc) +- Industrial IoT (ex: Predictive maintenance) + +### LoRa and LoRaWAN + +LoRa is a wireless modulation technique derived from Chirp Spread Spectrum (CSS) technology. It encodes information on radio waves using chirp pulses - similar to the way dolphins and bats communicate! LoRa modulated transmission is robust against disturbances and can be received across great distances. + +LoRaWAN is a Media Access Control (MAC) layer protocol built on top of LoRa modulation. It is a _software layer_ which defines how devices use the LoRa hardware, for example when they transmit, and the format of messages. + +The LoRaWAN protocol is developed and maintained by the [LoRa Alliance](https://lora-alliance.org/). The first [LoRaWAN specification](https://resources.lora-alliance.org/technical-specifications) was released in January 2015. At the time of this writing the latest specifications are 1.0.4 (in 1.0 series) and 1.1 (1.1 series). + +### Architecture + +{{< figure src="./tts-architecture-simplified.png" alt="The Things Stack Architecture" width="75%">}} + +A typical LoRaWAN network consists of the following basic elements. + +- **End Devices**: Sensors or actuators send LoRa modulated wireless messages to the gateways or receive messages wirelessly back from the gateways. + +- **Gateways**: Specialized devices that receive messages from end devices and forward them to the Network Server, as well as forward messages from the Network Server to the end devices. + +- **Network Server**: Software running on a server that manages the entire network. Also referred to as LoRaWAN Network Server/LNS or simply Network software. + +- **Application**: Software running on a server that is responsible for securely processing application data. + +### Simple message flow + +#### Uplinks + +The messages that originates from an end device and are sent to the server via gateways are called an Uplinks. + +End devices communicate with nearby gateways and each gateway is connected to the Network Server. + +LoRaWAN networks use an ALOHA based protocol, so end devices don’t need to pair with specific gateways. Messages sent from end devices travel through all gateways within range. + +These messages are received by the Network Server. If the Network Server has received multiple copies of the same message, it keeps a single copy of the message and discards others. This is known as message deduplication. + +The Network Server separates the network settings related data from the separately-encrypted application (sensor) data and forwards the latter to the application server. + +The Application Server decrypts the application data and makes is available to the user via a multitude of options. + +#### Downlinks + +Messages that originate in the server (Network Server or Application) and are sent to the end device via gateways are called downlinks. + +### Security + +All LoRaWAN data is encrypted using symmetric keys. All devices have one or two unique keys called the “root keys” associated with them, depending on the version of LoRaWAN they use. + +These root keys are used to derive separate keys for the application data and network data. + +Application data is encrypted using one of these derived keys. This key is known only to the Application Server and the End Device. + +Network (settings) data is encrypted using different key(s). These keys are known only to the Network Server and the End Device. + +> These keys are called Session Keys since they are rotated when a device session changes. Device sessions are a much deeper topic and is omitted from this basic guide in the interest of simplicity. + +## The Things Stack + +{{% tts %}} is a LoRaWAN® Network Server stack which is the critical component for any LoRaWAN solution. This guide quickly gets the reader up to speed with the basics of The Things Stack. + +{{< figure src="./tts-architecture.jpeg" alt="The Things Stack Architecture" width="75%">}} + +{{% tts %}} is an enterprise grade LoRaWAN server (that includes both the Network Server and Application Server functions mentioned in the LoRaWAN Reference architecture). In addition, {{% tts %}} contains services and tools to securely manage millions of LoRaWAN devices in production. + +Now that you are up to speed with the basic concepts and terminology, let's move on to the hands-on part by getting your starter kit and (optionally) creating a {{% tts %}} account. diff --git a/doc/content/getting-started/1-understand-lorawan/tts-architecture-simplified.png b/doc/content/getting-started/1-understand-lorawan/tts-architecture-simplified.png new file mode 100644 index 0000000000..dcb1a47d79 Binary files /dev/null and b/doc/content/getting-started/1-understand-lorawan/tts-architecture-simplified.png differ diff --git a/doc/content/getting-started/1-understand-lorawan/tts-architecture.jpeg b/doc/content/getting-started/1-understand-lorawan/tts-architecture.jpeg new file mode 100644 index 0000000000..d83c8d0f83 Binary files /dev/null and b/doc/content/getting-started/1-understand-lorawan/tts-architecture.jpeg differ diff --git a/doc/content/getting-started/setup-first-network/_index.md b/doc/content/getting-started/2-prerequisites/_index.md similarity index 85% rename from doc/content/getting-started/setup-first-network/_index.md rename to doc/content/getting-started/2-prerequisites/_index.md index ba4d24dca3..fd99532adb 100644 --- a/doc/content/getting-started/setup-first-network/_index.md +++ b/doc/content/getting-started/2-prerequisites/_index.md @@ -1,10 +1,11 @@ --- -title: "Setup Your First LoRaWAN Network" -description: "" -weight: 3 +title: "Step 2: Setup your first LoRaWAN® Network" +description: "Setup your first LoRaWAN® Network with The Things Stack Cloud" +weight: 2 +aliases: ["/getting-started/setup-first-network"] --- -Now that you are familiar with LoRaWAN® and {{% tts %}}, let us set up your first LoRaWAN Network. +In this guide, we will walk through the steps to setup a The Things Stack account. If you already have a The Things Stack Account, you can skip this step. @@ -15,11 +16,11 @@ Now that you are familiar with LoRaWAN® and {{% tts %}}, let us set up your fir ## Setup -Go to the [plans](https://www.thethingsindustries.com/stack/plans/) page which lists the different plans supported by {{% tts %}} Cloud. +Go to [the plans page](https://www.thethingsindustries.com/stack/plans/) which lists the different plans supported by {{% tts %}} Cloud. -For this example, we will choose the **Discovery** plan. +For this example, we will choose the _free_ **Discovery** plan. -{{< note "At the time of writing this documentation, this plan allows you free access to use 10 devices and 10 gateways on The Things Stack Cloud. For updates on these limits, check the plans page." />}} +{{< note "At the time of writing this documentation, this plan allows you free access to use 10 devices and 10 gateways on The Things Stack Cloud. For the latest on these limits, check [the plans page](https://www.thethingsindustries.com/stack/plans/)." />}} Click on the **Get Started for Free** button. @@ -72,6 +73,7 @@ In the subsequent window, select the details of the admin user. This user has fu Click on **Launch The Things Stack Cloud**. Now before proceeding, please make sure to check the admin email for two emails that you received from {{% tts %}} Cloud. + - The first one is used to validate the admin email address. Follow the instructions in the email to validate it. - The second email contains a link to create the password for the admin user. Make sure to choose a strong password. diff --git a/doc/content/getting-started/setup-first-network/ttsc-admin-user.png b/doc/content/getting-started/2-prerequisites/ttsc-admin-user.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-admin-user.png rename to doc/content/getting-started/2-prerequisites/ttsc-admin-user.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-complete.png b/doc/content/getting-started/2-prerequisites/ttsc-complete.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-complete.png rename to doc/content/getting-started/2-prerequisites/ttsc-complete.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-console.png b/doc/content/getting-started/2-prerequisites/ttsc-console.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-console.png rename to doc/content/getting-started/2-prerequisites/ttsc-console.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-create-account.png b/doc/content/getting-started/2-prerequisites/ttsc-create-account.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-create-account.png rename to doc/content/getting-started/2-prerequisites/ttsc-create-account.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-create-cluster.png b/doc/content/getting-started/2-prerequisites/ttsc-create-cluster.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-create-cluster.png rename to doc/content/getting-started/2-prerequisites/ttsc-create-cluster.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-setup-1.png b/doc/content/getting-started/2-prerequisites/ttsc-setup-1.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-setup-1.png rename to doc/content/getting-started/2-prerequisites/ttsc-setup-1.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-signup-card.png b/doc/content/getting-started/2-prerequisites/ttsc-signup-card.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-signup-card.png rename to doc/content/getting-started/2-prerequisites/ttsc-signup-card.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-signup-tenant-id.png b/doc/content/getting-started/2-prerequisites/ttsc-signup-tenant-id.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-signup-tenant-id.png rename to doc/content/getting-started/2-prerequisites/ttsc-signup-tenant-id.png diff --git a/doc/content/getting-started/setup-first-network/ttsc-signup.png b/doc/content/getting-started/2-prerequisites/ttsc-signup.png similarity index 100% rename from doc/content/getting-started/setup-first-network/ttsc-signup.png rename to doc/content/getting-started/2-prerequisites/ttsc-signup.png diff --git a/doc/content/getting-started/3-try-starter-kit/_index.md b/doc/content/getting-started/3-try-starter-kit/_index.md new file mode 100644 index 0000000000..ffbc11d701 --- /dev/null +++ b/doc/content/getting-started/3-try-starter-kit/_index.md @@ -0,0 +1,21 @@ +--- +title: "Step 3: Try the Starter Kit for LoRaWAN®" +description: "" +weight: 3 +--- + +LoRaWAN® is a complex topic with many technical components and considerations. The easiest way to get started and to understand the essentials of LoRaWAN is to see it in action. + + + +The Starter Kit for LoRaWAN contains + +1. **{{% ttigpro %}}**: A state-of-the-art fully cloud-managed 8 channel LoRaWAN gateway. It support true Zero-Touch Provisioning(ZTP) and is fully remotely managed via {{% tts %}}. In addition, it also has three options to connect to {{% tts %}}; Ethernet, WiFi and a built-in SIM card. +2. **mClimate Multipurpose Button**: A versatile LoRaWAN end device designed for a variety of applications. Supporting three click types (single, double, and triple), it enables users to trigger pre-set actions. The Multipurpose Button is equipped with a temperature sensor and has ultra-low power consumption. + +This guide will walk you through the complete journey from unboxing to data visualization. You'll learn how to activate both devices using simple QR code scanning, establish secure LoRaWAN communication, and explore different options for collecting and visualizing your sensor data. Whether you're new to LoRaWAN or an experienced developer, this starter kit eliminates the complexity typically associated with setting up IoT networks, allowing you to focus on building your application rather than wrestling with infrastructure. + +Get your Starter Kit for LoRaWAN from The Things Shop using the following links + +- [EU868 variant](https://thethingsshop.com/products/starter-kit-for-lorawan) +- [US915 variant](https://thethingsshop.com/products/starter-kit-for-lorawan-us915-edition) diff --git a/doc/content/getting-started/3-try-starter-kit/activate/_index.md b/doc/content/getting-started/3-try-starter-kit/activate/_index.md new file mode 100644 index 0000000000..18ef005915 --- /dev/null +++ b/doc/content/getting-started/3-try-starter-kit/activate/_index.md @@ -0,0 +1,136 @@ +--- +title: "Step 1: Activate your Starter kit for LoRaWAN" +description: "Activate your Starter kit for LoRaWAN" +weight: 1 +--- + +This guide shows you how to activate your Starter Kit’s LoRaWAN® gateway and end device. + + + +First, set up the gateway. It receives messages from the end device and forwards them to {{% tts %}}, and the other way around. Once the gateway is online, you can activate your end device to start sending and receiving data. + +### 1. {{% ttigpro %}} + +To get started, we’ll use the built-in 4G LTE SIM in The Things Indoor Gateway Pro to connect to The Things Stack. You can switch to WiFi or Ethernet later if neede + +If you prefer a visual guide to connecting {{% ttigpro %}} you can use the video below. + +
Show video +{{< youtube "vEYlTZ4XS-k" >}} +
+ +There are **only two steps** to connecting {{% ttigpro %}} to {{% tts %}}. + +##### Step 1: Register in {{% tts %}} + +1. Open the back panel of the gateway. This can be done by clicking the slot provided on the back side of the gateway counter clockwise. If you're unsure, check out how to do this on [Youtube](https://youtu.be/vEYlTZ4XS-k?t=109) + +Here, you will find a QR Code and some information about the gateway. + +{{< figure src="ttigpro-qrcode.jpg" alt="TTIG Pro QR Code" width="35%" >}} + +1. In {{% tts %}} Console, go to **Gateways**. +2. Click **Register Gateway**. +3. Click **Scan gateway QR code** and scan the QR code back of the gateway. A few things to note + +- You can use any camera connected to your machine, even the built-in one. +- Make sure to center the QR Code in the camera's view port. +- In some older browsers/operating systems, the camera may not be able to detect the QR code. + - In this case, instead of pressing **Scan gateway QR code**, manually enter the **Gateway EUI** field, which is printed on the back of the gateway (looks like `EC656EFFFEXXXXXX`). + - {{% tts %}} automatically detects this gateway and asks you to enter an **Owner Token**. This is printed on the back panel of the gateway _below_ the **Power Input** field. + +4. Enter a **Gateway ID**, which is a unique identifier used by {{% tts %}} + +5. Select the **Frequency plan** to use.The frequency plan configures certain radio parameters for the gateway. If you're unsure of this at this point, select + +- For Europe and UK, choose `Europe 863-870 MHz (SF9 for RX2 - recommended)` +- For North America (US, EU, Mexico) choose `United States 902-928 MHz, FSB 2 (used by TTN)` +- You can always change the value later. + +5. Click **Claim gateway**. + +##### Step 2: Connect a power supply cable + +Connect the USB-C cable to the power supply slot. +{{< figure src="ttigpro-power-cable.jpg" alt="Connect power" width="35%">}} + +{{< warning >}}Only use the power adapter that comes with {{% ttigpro %}}.{{< /warning >}} + +It may take several minutes to activate the SIM card and attach to a mobile network. + +After a few minutes, {{% ttigpro %}} should be connected to {{% tts %}}. You can see this in the `Connections` section on the right hand side of the **Connection Settings** page. + +{{< figure src="post-claim.png" alt="Post claim">}} + +If you would like to learn more about {{% ttigpro %}} or setup WiFi or Ethernet connectivity, you can check the dedicated [{{% ttigpro %}}]({{< ref "/hardware/gateways/models/thethingsindoorgatewaypro/" >}}) page. + +Let's now register and activate the end device to send and receive data. + +### 2. mClimate Multipurpose Button + +##### Step 1: Register in {{% tts %}} + +1. First create an application in {{% tts %}}. An application is a collection of end devices. + +{{< figure src="create-application.png" alt="Create an application">}} + +2. Now within the application, select **Register end device**. +3. Select **Scan end device QR code**. + +4. Use the QR code that's part of a _separate piece of paper included in the box_. This will prefill important information required to claim the end device. + +{{< figure src="scan-end-device-qrcode.png" alt="Scan end device QR code">}} + +5. From the model dropdown, select **Multipurpose button**. The rest of the information about the end device is automatically fetched and prefilled. + +6. For the **Frequency plan**, select the _exact same value_ that you selected for the {{% ttigpro %}}. + +{{< figure src="select-frequency-plan.png" alt="Select frequency plan">}} + +7. The rest of the information is already setup for you. You can at this point choose to customize the **End Device ID** field or leave the pre-generated value. + +8. Click the **Register end device** button. You device should now be successfully registered. + +{{< figure src="register-end-device.png" alt="Register end device">}} + +You will now be redirected to the end device. + +{{< figure src="post-registration.png" alt="Registered end device">}} + +##### Step 2: Activate + +1. Open the **Live Data** tab of the end device. + +{{< figure src="live-data-tab.png" alt="Live data tab">}} + +2. Make sure that {{% ttigpro %}} is connected to {{% tts %}} and is **1-2 meters away** from the end device. +3. Pull the plastic strip at the back of the gateway. This allows the battery to touch the contact point and the device now starts a _join request_. + +- A join request is a special uplink message used by the end device to "join" a network ({{% tts %}} in this case). +- If the device is registered properly, {{% tts %}} returns a join accept message, with a few configuration parameters to the end device. + +The device is now successfully configured and sends the first data message. Since a LoRaWAN message consists of bytes, {{% tts %}} decodes these bytes into human readable information, which is seen in the payload field on the live data page. The following is an example. + +{{< figure src="join.png" alt="Join procedure">}} + +The following are sample values. + +```json +{ + "batteryVoltage": 3.4, + "pressEvent": 0, + "sensorTemperature": 22.2, + "singlePressEventCounter": 0, + "thermistorProperlyConnected": true +} +``` + +5. Now you can _press the button_ and you will see it's surrounding LED blink green, which is a signal that an uplink was sent to the {{% tts %}}. If you now check the live data tab, you'll see the newest data message at the top. + +{{< figure src="second-uplink.png" alt="Button press">}} + +If you have any issues in this process, don't worry and check out the +[troubleshooting guide]({{< ref "/getting-started/3-try-starter-kit/troubleshooting" >}}) + +Now that you've successfully setup the LoRaWAN gateway and end device, let's go ahead and collect and visualize this data. diff --git a/doc/content/getting-started/3-try-starter-kit/activate/create-application.png b/doc/content/getting-started/3-try-starter-kit/activate/create-application.png new file mode 100644 index 0000000000..014c935e7b Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/create-application.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/join.png b/doc/content/getting-started/3-try-starter-kit/activate/join.png new file mode 100644 index 0000000000..a6d1ce3009 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/join.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/live-data-tab.png b/doc/content/getting-started/3-try-starter-kit/activate/live-data-tab.png new file mode 100644 index 0000000000..7339ce323b Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/live-data-tab.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/post-claim.png b/doc/content/getting-started/3-try-starter-kit/activate/post-claim.png new file mode 100644 index 0000000000..b2d036a0ef Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/post-claim.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/post-registration.png b/doc/content/getting-started/3-try-starter-kit/activate/post-registration.png new file mode 100644 index 0000000000..8d615146aa Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/post-registration.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/register-end-device.png b/doc/content/getting-started/3-try-starter-kit/activate/register-end-device.png new file mode 100644 index 0000000000..bf22514881 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/register-end-device.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/scan-end-device-qrcode.png b/doc/content/getting-started/3-try-starter-kit/activate/scan-end-device-qrcode.png new file mode 100644 index 0000000000..6aeafd5dd3 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/scan-end-device-qrcode.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/second-uplink.png b/doc/content/getting-started/3-try-starter-kit/activate/second-uplink.png new file mode 100644 index 0000000000..72d964149b Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/second-uplink.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/select-frequency-plan.png b/doc/content/getting-started/3-try-starter-kit/activate/select-frequency-plan.png new file mode 100644 index 0000000000..2830487d54 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/select-frequency-plan.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/ttigpro-power-cable.jpg b/doc/content/getting-started/3-try-starter-kit/activate/ttigpro-power-cable.jpg new file mode 100644 index 0000000000..ca39e2f224 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/ttigpro-power-cable.jpg differ diff --git a/doc/content/getting-started/3-try-starter-kit/activate/ttigpro-qrcode.jpg b/doc/content/getting-started/3-try-starter-kit/activate/ttigpro-qrcode.jpg new file mode 100644 index 0000000000..a57b5674b9 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/activate/ttigpro-qrcode.jpg differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/_index.md b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/_index.md new file mode 100644 index 0000000000..9ad966dea3 --- /dev/null +++ b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/_index.md @@ -0,0 +1,470 @@ +--- +title: "Step 2: Collect and visualize data" +description: "Use a variety of options to collect and visualize LoRaWAN data" +weight: 2 +--- + +This Section covers your options for collecting and visualizing LoRaWAN data from your mClimate Multipurpose button. + + + +The Live Data view in {{% tts %}} Console gives you a real-time look at messages from your end device. This view is very useful to get a quick look at the contents of the message and also for debugging. However, if you want to truly visualize data, you can process the data and visualize it in a dashboard. + +At this point, this guide offers two mutually exclusive options to further collect/visualize this data. + +1. Create a dashboard using an external IoT platform. +2. (Advanced) Retrieve data on your local machine using ngrok. + +{{< tabs/container "Create a dashboard" "Retrieve data locally (Advanced)" >}} + +{{< tabs/tab "Create a dashboard" >}} + +{{% tts %}} does not support building dashboards as they are very specific to the use case and are meant to be very customizable. + +Instead, there are many IoT platforms out there on the market which provide various dashboard options. For this example, we are going to use one such platform called [Datacake](https://app.datacake.de/login). + +#### Datacake + +1. Create an account on the [Datacake](https://app.datacake.de/login) platform and login. +2. Select **Add Device** and choose the **LoRaWAN** option. + +{{< figure src="lorawan-device.png" alt="LoRaWAN Device" >}} + +3. In the search bar after **Device Template**, search for `mClimate Multipurpose Button`. Select **Next**. + +{{< figure src="mclimate-button.png" alt="mClimate button" >}} + +4. In the **Network Server** tab select, `The Things Stack v3` and click **Next**. + +{{< figure src="tts.png" alt="The Things Stack" >}} + +5. In the **Add Devices** section, choose **Manual** and enter the Device EUI of the end device. You can find this **Applications** -> `Your Application` -> **End Devices** page {{% tts %}} console + +{{< figure src="device-details.png" alt="Device Details" >}} + +6. Choose the free plan to proceed. + +7. Get an API token + +- Head to **Account Settings** from the navigation panel on the left. +- Select the **API Token** tab. +- Copy the token + +{{< figure src="datacake-api-token.png" alt="Datacake API Token" >}} + +#### {{% tts %}} + +Now head back to {{% tts %}} console and go to your application. + +1. Click on the **Webhooks** option from the side panel. + +2. Click **Add webhook**. Choose **Datacake**. + +3. Enter the webhook details + +- **Wehbook ID**: An identifier for your Webhook. This cannot be changed later. +- **Token**: API Key from Datacake. + +{{< figure src="datacake-webhook.png" alt="Datacake" >}} + +4. Select **Create Datacake webhook** + +5. The newly created webhook will have the `pending` status. + +{{< figure src="wh-created.png" alt="Webhook created" >}} + +6. Click the button on your end device. The uplink message should now be successfully transmitted to the {{% tts %}} and it will be sent to Datacake. If you now refresh the webhooks page, the webhook will be marked as `healthy`. + +{{< figure src="wh-healthy.png" alt="Webhook healthy" >}} + +7. Once you send a few uplinks, the Datacake dashboard for the device will get filled with that data. + +{{< figure src="datacake-data.png" alt="Datacake data" >}} + +{{< /tabs/tab >}} + +{{< tabs/tab "Retrieve data locally (Advanced)" >}} + +In this guide, we will use [ngrok](https://ngrok.com/) and some Python code to pipe the data to our local terminal. This guide is meant for users who are already comfortable with using a terminal. + +#### Prerequisites + +1. [ngrok](https://ngrok.com/) free tier account. +2. [ngrok agent command line tool](https://dashboard.ngrok.com/get-started/setup) +3. [Python](https://www.python.org/) +4. [Pip](https://pypi.org/project/pip/) package manager. + +#### Build a Simple HTTP Server Using Python + +##### Setup + +1. Create Project Structure + +First, create a new directory for your project and set up the required files: + +```bash +mkdir python-http-server +cd python-http-server +touch server.py requirements.txt .env +``` + +2. Install Dependencies + +Add the following to your `requirements.txt` file: + +``` +flask==2.3.3 +python-dotenv==1.0.0 +``` + +Then install the dependencies: + +```bash +pip install -r requirements.txt +``` + +3. Generate a random authentication token. One option is to use `openssl`. + +```bash +$ openssl rand -hex 16 +33f9bf794b0aed47bb04f0a1832159db +``` + +4. Configure Environment Variables + +Create a `.env` file with the following configuration. + +The following example sets the server port to 3000 and provides an authentication token. Adapt it for your case. + +``` +export SERVER_PORT=3000 +export AUTH_TOKEN= +``` + +##### Server Implementation + +1. Import Libraries and Setup + +Create the `server.py` file and add the necessary imports: + +```python +import os +import json +import logging +from functools import wraps +from flask import Flask, request, jsonify +from dotenv import load_dotenv +``` + +These imports provide: + +- Access to environment variables and file system +- JSON handling capabilities +- Logging functionality +- Decorator utilities +- Flask web framework components +- Environment variable loading from .env files + +2. Initialize Environment and Logging + +Add the following code to set up logging and load environment variables: + +```python +# Load environment variables from .env file +load_dotenv() + +# Configure basic logging +logging.basicConfig( + level=logging.INFO, + format='%(levelname)s : %(message)s' +) +logger = logging.getLogger(__name__) + +# Read configuration from environment variables +PORT = int(os.environ.get("SERVER_PORT", 3000)) +AUTH_TOKEN = os.environ.get("AUTH_TOKEN") + +# Validate required environment variables +if not AUTH_TOKEN: + logger.error("ERROR: AUTH_TOKEN environment variable is required") + exit(1) +``` + +This section: + +- Loads variables from the `.env` file +- Sets up logging with INFO level +- Retrieves environment variables with fallback values +- Validates that required authentication token exists + +3. Create the Flask Application + +Initialize the Flask application: + +```python +app = Flask(__name__) +``` + +4. Implement Authentication. Since we are exposing the server to the internet, this adds some basic security. + +Add a decorator function to handle token-based authentication: + +```python +def require_bearer_token(f): + """Decorator to validate bearer token from Authorization header""" + @wraps(f) + def decorated(*args, **kwargs): + auth_header = request.headers.get('Authorization') + + # Check if Authorization header exists and has correct format + if not auth_header or not auth_header.startswith('Bearer '): + return jsonify({"error": "Unauthorized. Bearer token required"}), 401 + + # Extract and validate token + token = auth_header.split(' ')[1] + if token != AUTH_TOKEN: + return jsonify({"error": "Forbidden. Invalid token"}), 403 + + return f(*args, **kwargs) + return decorated +``` + +This decorator: + +- Checks if the Authorization header is present and properly formatted +- Extracts the token from the header +- Compares the token against the expected value +- Returns appropriate error responses for invalid tokens + +5. Implement JSON Validation since {{% tts %}} sends JSON webhooks. + +Add a helper function to validate JSON requests: + +```python +def validate_json(): + """Validate that the request has the correct content type header and a valid JSON body""" + if not request.is_json: + return jsonify({"error": "Unsupported Media Type. Expected application/json"}), 415 + + try: + # This will raise an exception if the body is not valid JSON + request.get_json() + return None + except Exception: + return jsonify({"error": "Bad Request. Invalid JSON format"}), 400 +``` + +This function: + +- Checks if the Content-Type header indicates JSON +- Validates that the body contains properly formatted JSON +- Returns appropriate error responses for invalid requests + +6. Define the root endpoint. This is where `ngrok` will forward the webhook. + +Create the routes for handling HTTP requests: + +```python +@app.route('/', methods=['POST']) +@require_bearer_token +def handle_post(): + # Validate JSON content type and format + error_response = validate_json() + if error_response: + return error_response + + # Get and print the JSON data + json_data = request.get_json() + logger.info("Received device data") + logger.info(json.dumps(json_data, indent=2)) + + # Return success response + return jsonify({ + "message": "data received successfully", + }), 200 +``` + +This route: + +- Accepts only POST requests to the root URL +- Requires valid authentication via the decorator +- Validates the request contains proper JSON +- Logs the received data +- Returns a success message + +7. Define Error Handling for Other Methods + +Add a catch-all route for unsupported HTTP methods: + +```python +@app.route('/', methods=['GET', 'PUT', 'DELETE', 'PATCH']) +def method_not_allowed(): + return jsonify({"error": "Method Not Allowed"}), 405 +``` + +This explicitly returns a 405 error for all HTTP methods except POST. + +8. Start the Server + +Finally, add the code to run the server: + +```python +if __name__ == "__main__": + # Log server startup information + token_preview = AUTH_TOKEN[:3] + "..." + AUTH_TOKEN[-3:] + logger.info(f"Server running at http://localhost:{PORT}/") + logger.info(f"Using auth token: {token_preview}") + + # Start the server + app.run(host='localhost', port=PORT) +``` + +This server now runs on `http://localhost:` + +#### Expose the Server using ngrok + +1. On the [ngrok dashboard](https://dashboard.ngrok.com), scroll down to the **Deploy your app online** and claim a free **Static Domain**. This is the end point that {{% tts %}} will send the webhooks to. +2. On your local machine, configure the auth token for ngrok agent. This token will be available on the `ngrok` dashboard. + +```bash +$ ngrok config add-authtoken +``` + +3. Start the `ngrok` agent and set it to forward traffic to the local HTTP Server. + +```bash +$ ngrok http --url= +``` + +#### Testing + +Send an HTTP POST request to your static domain to check if the request gets forwarded to your local webserver. + +```bash +curl -H "Authorization: Bearer " -H "Content-Type: application/json" https:// -d '{"test":"value"}' +{"message":"data received successfully"} +``` + +This request should be successful and the local server should log the JSON. + +```bash + * Running on http://localhost:3000 +INFO : Press CTRL+C to quit +INFO : Received device data +INFO : { + "test": "value" +} +``` + +#### Configure a Webhook on {{% tts %}} + +1. In the {{% tts %}} Console, click on your application and navigate to the webhooks section. +2. Select **Add Webhook** and select `Custom webhook`. +3. Enter the webhook details. + +- **Wehbook ID**: An identifier for your Webhook (ex: `my-server-ngrok`). This cannot be changed later. +- **Webhook format**: Keep this as `JSON`. +- **Base URL**: Enter your static domain URL from `ngrok`. + +4. Select **Add header entry** in the additional header section. + +- Key: `Authorization` +- Value: `Bearer ` + +{{< figure src="ngrok-webhook.png" alt="Webhook settings for ngrok" >}} + +5. In **Enabled event types** select `Uplink message` and `Join request`. You can also select all message types. + +6. Click **Add webhook**. + +#### Sending Uplinks + +If all the previous steps were successful, you now have a local HTTP server to which {{% tts %}} will forward uplink data via Webhooks. To test this, press the button on your end device. The HTTP Server will log this uplink JSON. An example is shown below. + +```bash +INFO : Received device data +INFO : { + "end_device_ids": { + "device_id": "eui-70b3d52dd600035a", + "application_ids": { + "application_id": "starter-kit" + }, + "dev_eui": "70B3D52DD600035A", + "join_eui": "EC656E0000000001", + "dev_addr": "27FE87F6" + }, + "correlation_ids": [ + "gs:uplink:01JRZ767CVCHBZW1Y8YG9PZ3TS" + ], + "received_at": "2025-04-16T11:54:13.995136483Z", + "uplink_message": { + "session_key_id": "aAixKtmNZUKQXd4GqpHDsw==", + "f_port": 2, + "f_cnt": 14, + "frm_payload": "sQAAEAHlANcB", + "decoded_payload": { + "batteryVoltage": 3.4, + "pressEvent": 1, + "sensorTemperature": 21.5, + "singlePressEventCounter": 16, + "thermistorProperlyConnected": true + }, + "rx_metadata": [ + { + "gateway_ids": { + "gateway_id": "ttig-52ec", + "eui": "58A0CBFFFE8052EC" + }, + "time": "2025-04-16T11:54:13.697237014Z", + "timestamp": 1276394164, + "rssi": -31, + "channel_rssi": -31, + "snr": 9.5, + "uplink_token": "ChcKFQoJdHRpZy01MmVjEghYoMv//oBS7BC09dDgBBoMCOW0/r8GEO6mnPcCIKCelfiSJQ==", + "received_at": "2025-04-16T11:54:13.758247461Z" + } + ], + "settings": { + "data_rate": { + "lora": { + "bandwidth": 125000, + "spreading_factor": 7, + "coding_rate": "4/5" + } + }, + "frequency": "867700000", + "timestamp": 1276394164, + "time": "2025-04-16T11:54:13.697237014Z" + }, + "received_at": "2025-04-16T11:54:13.787593298Z", + "confirmed": true, + "consumed_airtime": "0.061696s", + "version_ids": { + "brand_id": "mclimate", + "model_id": "mc-button", + "hardware_version": "1.2", + "firmware_version": "1.2", + "band_id": "EU_863_870" + }, + "network_ids": { + "net_id": "000013", + "ns_id": "EC656E000010181D", + "tenant_id": "docs-test-account", + "cluster_id": "eu1", + "cluster_address": "eu1.cloud.thethings.industries", + "tenant_address": "docs-test-account.eu1.cloud.thethings.industries" + }, + "last_battery_percentage": { + "f_cnt": 14, + "value": 90.118576, + "received_at": "2025-04-16T11:54:13.787593298Z" + } + } +} +``` + +{{< /tabs/tab >}} + +{{< /tabs/container >}} + +Now that we have experimented with different methods of collecting uplinks, let's use {{% tts %}} to send downlink messages to the end device. diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/config.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/config.png new file mode 100644 index 0000000000..04712af698 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/config.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-api-token.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-api-token.png new file mode 100644 index 0000000000..19f9933cf9 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-api-token.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-data.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-data.png new file mode 100644 index 0000000000..36116ab18c Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-data.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-webhook.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-webhook.png new file mode 100644 index 0000000000..e0ee47ec03 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/datacake-webhook.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/device-details.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/device-details.png new file mode 100644 index 0000000000..7cbd8ec864 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/device-details.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/lorawan-device.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/lorawan-device.png new file mode 100644 index 0000000000..6b40173352 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/lorawan-device.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/mclimate-button.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/mclimate-button.png new file mode 100644 index 0000000000..f165848027 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/mclimate-button.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/ngrok-webhook.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/ngrok-webhook.png new file mode 100644 index 0000000000..9fa4bf69a6 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/ngrok-webhook.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-disabled.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-disabled.png new file mode 100644 index 0000000000..490564436d Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-disabled.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-enabled.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-enabled.png new file mode 100644 index 0000000000..189024c132 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-enabled.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-filled.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-filled.png new file mode 100644 index 0000000000..4f6a4c6516 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/storage-filled.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/tts.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/tts.png new file mode 100644 index 0000000000..404836acb2 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/tts.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/url.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/url.png new file mode 100644 index 0000000000..077c62b94a Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/url.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-created.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-created.png new file mode 100644 index 0000000000..6f2bcf0a83 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-created.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-event-types.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-event-types.png new file mode 100644 index 0000000000..586b90e5a0 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-event-types.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-general-settings.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-general-settings.png new file mode 100644 index 0000000000..4f94d9ca6c Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-general-settings.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-healthy.png b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-healthy.png new file mode 100644 index 0000000000..dddba1c04d Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/collect-visualize-data/wh-healthy.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/control-remotely/_index.md b/doc/content/getting-started/3-try-starter-kit/control-remotely/_index.md new file mode 100644 index 0000000000..7f8cbe7b69 --- /dev/null +++ b/doc/content/getting-started/3-try-starter-kit/control-remotely/_index.md @@ -0,0 +1,78 @@ +--- +title: "Step 3: Remotely control the end device behavior" +description: "" +weight: 3 +--- + +LoRaWAN® is a full-duplex protocol, which means that we can both receive data from and send data to the end device. So far, we've only worked with uplink data from the end device. In this guide, let's look at interacting with the end device using downlinks. + + + +The mClimate Multipurpose button is a Class A device. This is a special mode of operation where the end device listens for downlinks only after sending an uplink. This allows the end device to control when the radio is turned on, which helps preserve battery. + +This means, when you schedule a downlink via {{% tts %}}, it's not immediately sent, but queued until the device sends an uplink. + +In {{% tts %}} Console, select your application and navigate to the end device overview page. + +Select the **Messaging** tab. The default option here is **Schedule Downlink** and that's what we are going to use. + +In {{% tts %}} Console, select your application and go to the end device overview. + +Click the **Messaging** tab. The default option is **Schedule Downlink**. We’ll use that to send a message to the device. + +{{< figure src="downlink-view.png" alt="Downlink view" >}} + +This view has a few options. For the sake of this example, we can leave the following defaults in place. + +- **Insert mode**: `Replace downlink queue` +- **FPort**: `1` +- **Payload type**: `Bytes` + +We will only be adding different values to the **Payload** field for different types of downlinks. + +#### Activate LEDs + +In this example, we will make the **Green** LED blink fast for 20 seconds remotely. + +1. Enter the value `05 02 02` in the **Payload** field and press **Schedule Downlink** and this downlink will be queued. + +{{< figure src="blink-green.png" alt="Blink Green LED" >}} + +2. Now, press the button on the end device. This will trigger an uplink to the {{% tts %}} and {{% tts %}} in turn will send this downlink to the device via the gateway. + +3. The Green LED button should now blink for 20s and then turn off. You can experiment with different button configurations from the table above. + +#### Request Hardware and Software Version + +Now, let's move on to more practical use cases for sending downlinks to end devices. We are now going to request the hardware and software version of the end device. + +1. Enter the value `04` in the **Payload** field and press **Schedule Downlink**. +2. Press the button. The device will send an uplink and receive the downlink command. +3. The device will now send another uplink with the device version in the payload. You can see these values in the decoded payload. + +{{< figure src="hardware-version.png" alt="Hardware Version" >}} + +#### Fetch Stored Button Press Counters + +The mClimate Multipurpose button for LoRaWAN stores button press event counters; i.e., how many times the button was single pressed, double pressed and triple pressed. + +
+ +| Payload value | Counter type | +| ------------- | -------------------- | +| 0xB1 | Single press counter | +| 0xB2 | Double press counter | +| 0xB3 | Triple press counter | + +
+
+ +1. Let's first fetch the single press counter. Enter the value `b1` in the **Payload** field and press **Schedule Downlink**. +2. Press the button. The device will send an uplink and receive the downlink command. +3. The device will now send another uplink with the counter value in the payload. You can see the counter value in the decoded payload. + +{{< figure src="single-press-counter.png" alt="Single press counter" >}} + +You can explore this further by double pressing and triple pressing the button and fetching the corresponding counter. + +Now that you're familiar with LoRaWAN and have seen it in action, check out what the [next steps]({{< ref "/getting-started/4-next-steps" >}}) are. diff --git a/doc/content/getting-started/3-try-starter-kit/control-remotely/blink-green.png b/doc/content/getting-started/3-try-starter-kit/control-remotely/blink-green.png new file mode 100644 index 0000000000..7f4270e1d5 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/control-remotely/blink-green.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/control-remotely/downlink-view.png b/doc/content/getting-started/3-try-starter-kit/control-remotely/downlink-view.png new file mode 100644 index 0000000000..5a70d634dc Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/control-remotely/downlink-view.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/control-remotely/hardware-version.png b/doc/content/getting-started/3-try-starter-kit/control-remotely/hardware-version.png new file mode 100644 index 0000000000..bd50e7ed78 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/control-remotely/hardware-version.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/control-remotely/single-press-counter.png b/doc/content/getting-started/3-try-starter-kit/control-remotely/single-press-counter.png new file mode 100644 index 0000000000..534e4c6f74 Binary files /dev/null and b/doc/content/getting-started/3-try-starter-kit/control-remotely/single-press-counter.png differ diff --git a/doc/content/getting-started/3-try-starter-kit/troubleshooting/_index.md b/doc/content/getting-started/3-try-starter-kit/troubleshooting/_index.md new file mode 100644 index 0000000000..02c416ff9d --- /dev/null +++ b/doc/content/getting-started/3-try-starter-kit/troubleshooting/_index.md @@ -0,0 +1,33 @@ +--- +title: "Troubleshooting" +description: "" +--- + +This page lists solutions to common issues. + + + +#### The end device does not join. What do I do now? + +1. Make sure the gateway is connected and online. You can check this in the Gateway overview page in the {{% tts %}} console. +2. Check that the end device is at least 1-2 meters away from the gateway. +3. Wait for a few minutes before pressing the button. + +#### What else can I do with end device downlinks? + +The following table explains the available options for different types of downlinks + +##### Controlling LED Behavoir + +
+ +| Byte Number | Value and Meaning | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0 | 0x05 | +| 1 | 0x01 - Turn the LED ON;
02 - Blink fast (100ms on, 100ms off);
03 - Blink slow (100ms on, 1000ms off);
04 - Turn the LED OFF. | +| 2 | XX - Duration for the LED behavior.
Duration, [seconds] = XX \* 10.
If zero, do it until next LED related command is received
or the verify button is pressed. | + +
+
+ +The mClimate Multipurpose button has a few other downlink options that you can explore. The full downlink reference can be found on [mClimate's documentation page](https://docs.mclimate.eu/mclimate-lorawan-devices/devices/mclimate-multipurpose-button-lorawan/mclimate-button-lorawan-device-communication-protocol). diff --git a/doc/content/getting-started/next-steps/_index.md b/doc/content/getting-started/4-next-steps/_index.md similarity index 72% rename from doc/content/getting-started/next-steps/_index.md rename to doc/content/getting-started/4-next-steps/_index.md index d8d57256fb..fb30d3f076 100644 --- a/doc/content/getting-started/next-steps/_index.md +++ b/doc/content/getting-started/4-next-steps/_index.md @@ -1,19 +1,17 @@ --- -title: "Next steps" +title: "Step 4: Next steps" description: "" weight: 4 +aliases: [/getting-started/next-steps] --- -Once you have your first LoRaWAN® Network setup, here are the next steps. +Now that you are familiar with the basics of LoRaWAN and you've setup your first network and experimented with an end device and a gateway, this guide gives you some options on what to do next. -1. Get {{% ttigpro %}} or any other LoRa® gateway -2. [Connect the gateway]({{< ref "/hardware/gateways/concepts/adding-gateways" >}}) to your netowrk. -3. [Add LoRaWAN end devices]({{< ref "/hardware/devices/adding-devices" >}}) to send LoRaWAN traffic to your network. -4. [Create an integration]({{< ref "integrations" >}}) to send your LoRaWAN sensor data to external integrations or to your own private server. -5. Learn how to get the most out of [{{% tts %}}]({{< ref "/enterprise/" >}}). -6. Check out the [Glossary]({{< ref "/getting-started/glossary" >}}) for a disambiguation of some of these terms and [FAQ]({{< ref "/getting-started/faq" >}}). +1. [Add other LoRaWAN end devices]({{< ref "/hardware/devices/adding-devices" >}}) to send LoRaWAN traffic to your network. +2. Learn how to get the most out of [{{% tts %}}]({{< ref "/enterprise/" >}}). +3. Check out the [Glossary]({{< ref "/getting-started/glossary" >}}) for a disambiguation of some of these terms and [FAQ]({{< ref "/getting-started/faq" >}}). ## Learn more diff --git a/doc/content/getting-started/_index.md b/doc/content/getting-started/_index.md index e4289d4185..3e2df87da3 100644 --- a/doc/content/getting-started/_index.md +++ b/doc/content/getting-started/_index.md @@ -1,6 +1,6 @@ --- title: "Getting Started" -description: "Learn how to quickly get started with The Things Stack" +description: "Learn how to quickly get started with LoRaWAN®" menu: main: weight: 1 @@ -10,18 +10,19 @@ aliases: /guides/getting-started/running-the-stack, /guides/getting-started/quick-start, /getting-started/quick-start/, - /getting-started/what-is-tts/ + /getting-started/what-is-tts/, ] --- -{{% tts %}} is an enterprise-grade LoRaWAN® Network Server that provides services and tools to securely install and manage millions of LoRaWAN devices in production. +Welcome to {{% tts %}} documentation! {{% tts %}} is enterprise-grade LoRaWAN® network software that provides services and tools to securely install and manage millions of LoRaWAN devices in production. -This getting started section is divided into the following parts. You can either read these sequentially or skip ahead to the specific guide that you are looking for. +This guide is structured in four steps. -We first introduce basic [LoRaWAN]({{< relref "lorawan-basics" >}}) concepts. If you are very new to LoRaWAN, this is the place to start. +1. [Step 1: Learn basic concepts of LoRaWAN]({{< ref "/getting-started/1-understand-lorawan" >}}) +2. [Step 2: Setup prerequisites]({{< ref "/getting-started/2-prerequisites" >}}) +3. [Step 3: Try the Starter Kit for LoRaWAN]({{< ref "/getting-started/3-try-starter-kit" >}}) +4. [Step 4: Next steps]({{< ref "/getting-started/4-next-steps" >}}) -We then introduce [{{% tts %}}]({{< relref "the-things-stack-basics" >}}) and its numerous features. +This guide additionally contains an [FAQ]({{< ref "/getting-started/faq" >}}) and a [glossary]({{< ref "/getting-started/glossary" >}}) to provide quick answers to frequently asked questions and definitions of key LoRaWAN terms. -With these basics covered, we can now [setup your first LoRaWAN network]({{< relref "setup-first-network" >}}). - -Finally, since LoRaWAN and {{% tts %}} are deep topics, we provide suggestions on the [next steps]({{< relref "next-steps" >}}). +Let's get started with [Step 1]({{< ref "/getting-started/1-understand-lorawan" >}}). diff --git a/doc/content/getting-started/faq/_index.md b/doc/content/getting-started/faq/_index.md index c7b6769c55..941f3f28b3 100644 --- a/doc/content/getting-started/faq/_index.md +++ b/doc/content/getting-started/faq/_index.md @@ -1,7 +1,7 @@ --- title: "FAQ" -description: "" -weight: 5 +description: "Frequently asked questions about LoRaWAN® and The Things Stack" +weight: 8 --- Check out frequently asked question about {{% tts %}} and learn how to get the most out of your deployment. diff --git a/doc/content/getting-started/glossary/_index.md b/doc/content/getting-started/glossary/_index.md index bf1831323b..4093ecf435 100644 --- a/doc/content/getting-started/glossary/_index.md +++ b/doc/content/getting-started/glossary/_index.md @@ -2,6 +2,7 @@ title: "Glossary" description: "Common terms and definitions" aliases: [/reference/glossary] +weight: 9 --- This reference contains common terms and definitions to help you find your way around {{% tts %}}. diff --git a/doc/content/getting-started/lorawan-basics/_index.md b/doc/content/getting-started/lorawan-basics/_index.md deleted file mode 100644 index db2299210a..0000000000 --- a/doc/content/getting-started/lorawan-basics/_index.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: "LoRaWAN" -description: "" -weight: 1 ---- - -This guide briefly explains the architecture and key concepts of a LoRaWAN® network. - - - -LoRa is a wireless modulation technique derived from Chirp Spread Spectrum (CSS) technology. It encodes information on radio waves using chirp pulses - similar to the way dolphins and bats communicate! LoRa modulated transmission is robust against disturbances and can be received across great distances. - -LoRaWAN is a Media Access Control (MAC) layer protocol built on top of LoRa modulation. It is a software layer which defines how devices use the LoRa hardware, for example when they transmit, and the format of messages. - -The LoRaWAN protocol is developed and maintained by the LoRa Alliance. The first LoRaWAN specification was released in January 2015. At the time of this writing the latest specifications are 1.0.4 (in 1.0 series) and 1.1 (1.1 series). - -### Architecture - -{{< figure src="architecture.png" alt="LoRaWAN architecture" >}} - -A typical LoRaWAN network consists of the following basic elements. - -**End Devices** - - Sensors or actuators send LoRa modulated wireless messages to the gateways or receive messages wirelessly back from the gateways. - -**Gateways** - - Specialized devices that receive messages from end devices and forward them to the Network Server, as well as forward messages from the Network Server to the end devices. - -**Network Server** - - A piece of software running on a server that manages the entire network. - - Also referred to as LoRaWAN Network Server/LNS or simply Network software. - -**Application servers** - - A piece of software running on a server that is responsible for securely processing application data. - -### Message Flow - -End devices communicate with nearby gateways and each gateway is connected to the Network Server. - -LoRaWAN networks use an ALOHA based protocol, so end devices don’t need to pair with specific gateways. Messages sent from end devices travel through all gateways within range. - -These messages are received by the Network Server. If the Network Server has received multiple copies of the same message, it keeps a single copy of the message and discards others. This is known as message deduplication. - -The Network Server separates the network settings related data from the separately-encrypted application (sensor) data and forwards the latter to the application server. - -The Application Server decrypts the application data and makes is available to the user via a multitude of options. - -The messages that originates from an end device are called an Uplinks. - -Messages flowing in the opposite direction (originating from the Network Server and/or Application Server and sent to end devices) are called Downlinks. - -{{< note "Sensor networks in LoRaWAN are deployed in a star-of-stars topology." />}} - -### Security - -All LoRaWAN data is encrypted using AES-128 symmetric keys. All devices have one or two unique AES-128 keys called the "root keys" associated with them, depending on the version of LoRaWAN they use. - -These root keys are used to derive separate keys for the application data and network data. - -Application data is encrypted using one of these derived keys. This key is known only to the Application Server and the End Device. - -Network (settings) data is encrypted using different key(s). These keys are known only to the Network Server and the End Device. - -{{< note "These keys are called Session Keys since they are rotated when a device session changes. Device sessions are a much deeper topic and is omitted from this basic guide in the interest of simplicity. See [LoRaWAN Security](https://www.thethingsnetwork.org/docs/lorawan/security/) for more information." />}} - diff --git a/doc/content/getting-started/lorawan-basics/architecture.png b/doc/content/getting-started/lorawan-basics/architecture.png deleted file mode 100644 index 5ebeab01fc..0000000000 Binary files a/doc/content/getting-started/lorawan-basics/architecture.png and /dev/null differ diff --git a/doc/content/getting-started/the-things-stack-basics/_index.md b/doc/content/getting-started/the-things-stack-basics/_index.md deleted file mode 100644 index a5cebd5e20..0000000000 --- a/doc/content/getting-started/the-things-stack-basics/_index.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "The Things Stack" -description: "" -weight: 2 -aliases: [/getting-started/what-is-tts/] ---- - -{{% tts %}} is a LoRaWAN® Network Server stack which is the critical component for any LoRaWAN solution. This guide quickly gets the reader up to speed with the basics of {{% tts %}}. - - - -{{% tts %}} is an enterprise grade LoRaWAN server (that includes both the Network Server and Application Server functions mentioned in the LoRaWAN Reference architecture). In addition, {{% tts %}} contains services and tools to securely manage millions of LoRaWAN devices in production. - -{{% tts %}} offers the following options for LoRaWAN deployments in production. - -- {{< distributions "Cloud" >}} [{{% tts %}} Cloud]({{< relref "cloud" >}}): Our flagship, fully-managed, SLA-backed cloud subscription helping hundreds of companies around the world. - By using {{% tts %}} Cloud, you can focus on providing value to your customers, while leaving the complexity of managing a production LoRaWAN Network Server to us. You can start evaluating {{% tts %}} Cloud by [signing up for the free discovery tier]({{< relref "setup-first-network" >}}) to get started. - -- {{< distributions "Enterprise" >}}[{{% tts %}} Enterprise]({{< relref "enterprise" >}}): Alternatively, if you prefer to take on the responsibility of installing and maintaining {{% tts %}} in addition to managing your LoRaWAN device fleet, {{% tts %}} is available to be installed on your own hardware or cloud infrastructure. - -For simple non-commercial projects and local testing, there are a few options. - -- {{< distributions "Sandbox" >}}[{{% ttss %}}]({{< relref "ttn" >}}): A free and limited version of {{% tts %}} _without any guarantees or SLA_ available to The Things Network community for non-commercial, small scale testing and experimentation. - -- {{< distributions "Open Source" >}}[{{% tts %}} Open Source](https://github.com/thethingsnetwork/lorawan-stack): For the DIY’ers, the core features of The Things Stack are open source. This is limited in features and is not suitable for production. - -{{% tts %}} is developed and maintained by [The Things Industries](https://thethingsindustries.com/). - -Now that we've covered some basics, let's go ahead and setup your first LoRaWAN network. diff --git a/doc/themes/the-things-stack/layouts/index.html b/doc/themes/the-things-stack/layouts/index.html index 9a6a65c8b7..59db8f840c 100644 --- a/doc/themes/the-things-stack/layouts/index.html +++ b/doc/themes/the-things-stack/layouts/index.html @@ -11,7 +11,7 @@

The Things Stack Documentation

The Things Stack is a robust, yet flexible LoRaWAN® Network Server that caters to the needs of demanding LoRaWAN deployments, from covering the essentials to advanced security configurations and device life cycle management.

{{ $lorawanbasics := dict "link" "Get to know LoRaWAN®" "url" (.Site.GetPage "/getting-started/lorawan-basics").RelPermalink}} - {{ $lorawannetwork := dict "link" "Set up your first LoRaWAN® network" "url" (.Site.GetPage "/getting-started/setup-first-network").RelPermalink}} + {{ $lorawannetwork := dict "link" "Set up your first LoRaWAN® network" "url" (.Site.GetPage "/getting-started/2-prerequisites").RelPermalink}} {{ $addgateways := dict "link" "Connect your first gateway" "url" (.Site.GetPage "/hardware/gateways/concepts/adding-gateways").RelPermalink}} {{ $adddevice := dict "link" "Add your first device" "url" (.Site.GetPage "/hardware/devices/adding-devices").RelPermalink}} {{ $certified := dict "link" "Get certified" "url" "https://www.thethingsnetwork.org/achievements"}}