Skip to content

Commit

Permalink
Merge pull request #51 from TheThingsIndustries/docs/production-app
Browse files Browse the repository at this point in the history
doc: Add production app documentation
  • Loading branch information
nejraselimovic authored Feb 23, 2022
2 parents 1192d2d + 374cb4c commit 376a332
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 21 deletions.
79 changes: 79 additions & 0 deletions doc/content/applications/se-vanilla/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: "Sensor Edition: vanilla application"
description: ""
weight: -2
distributions: null
---

{{% gnse %}} comes pre-programmed with a vanilla application that showcases the device functionality and capabilities.

The application leverages a combination of the on-board components such as LEDs, button, buzzer, accelerometer, secure element, temperature and humidity sensor.

<!--more-->

## Claiming your device

The vanilla application uses the on-board secure element to join the LoRaWAN network using over the air activation (OTAA) method.

You can claim your device on the The Things Stack cloud by following this [guide](https://www.thethingsindustries.com/docs/devices/device-claiming/claim-devices/).

## Powering up your device

After claiming, you can power up the device using two standard AA batteries.

If the device powers up correctly, you will see the red, green and blue LEDs blinking thus indicating successful boot-up.

## Joining the network

The device will attempt to join LoRaWAN network using OTAA indicated by the blinking red led.

When the device joins successfully, the buzzer will ring briefly the red LED will stop blinking.

## Default uplinks and events

After a successful join, the device will periodically transmit two types of messages.

1. A heartbeat message on FPort 1 every 25 seconds
2. A Temperature and Humidity reading on FPort 2 every 1 minute

You can also press the button to transmit an uplink with the heartbeat message.

The device will blink the green LED with each successful uplink.

## Heartbeat

The heartbeat uplink message sent by the device on FPort 1 contains the device battery voltage and the firmware version.

## Temperature and Humidity

The temperature and humidity uplink message sent on FPort 2 contains the temperature in Celsius and the humidity in percentage.

## Accelerometer

The accelerometer is disabled by default and can be enabled via a downlink on FPort 3 to detect shake and free-fall events.
When an accelerometer event occurs (shake or free-fall), the device will transmit an uplink with the temperature and humidity readings.

{{< note "The accelerometer should be disabled when it's not used to conserve energy" />}}

## Button

The button is enabled by default and can be disabled or enabled via a downlink on FPort 4.
When the button is enabled, pressing the button will send a heartbeat uplink message.

## Buzzer

The buzzer is disabled by default can be enabled via a downlink on FPort 5.
The buzzer can ring briefly in two tones, warning and danger.

## Blue LED

The blue LED is disabled by default and can be enabled via a downlink on FPort 6.
This feature can be used to indicate that the device requires attention (battery change, reset, re-positioning, etc)

## Adjusting the device behavior

The vanilla application attempts to be as generic as possible to facilitate exploring the device functionality.

Use the [uplinks guide]({{< ref "/applications/se-vanilla/uplinks" >}}) to decode the uplink messages.

Follow the [downlinks guide]({{< ref "/applications/se-vanilla/downlinks" >}}) to adjust the device functionality according to your needs.
107 changes: 107 additions & 0 deletions doc/content/applications/se-vanilla/downlinks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: "downlinks"
description: ""
weight: 2
---

The vanilla app can be configured using downlinks to control the device functionality and effectively unlock new features.

Each device component is controlled on a separate FPort, but please remember that LoRaWAN class A devices can only receive a downlink when they transmit and uplink.

So make sure you trigger an uplink via the button or wait for a periodic uplink message in order for the device to receive your downlink.

## Heartbeat

- Disable periodic heartbeat uplink:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x01 | 0x00 |

- Enable periodic heartbeat uplink every 10 minutes:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x01 | 0x0A |

The periodicity can range from 0x01 (every 1 minute) to 0xC8 (every 200 minutes).


## Temperature and Humidity

- Disable periodic temperature and humidity uplink:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x02 | 0x00 |

- Enable periodic temperature and humidity uplink every 25 minutes:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x02 | 0x19 |

The periodicity can range from 0x01 (every 1 minute) to 0xC8 (every 200 minutes).

## Accelerometer

- Disable accelerometer events:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x03 | 0x00 |

- Enable accelerometer shake event detection:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x03 | 0x01 |

- Enable accelerometer free-fall event detection:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x03 | 0x02 |

## Button

- Disable button events:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x04 | 0x00 |

- Enable button events:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x04 | 0x01 |

## Buzzer

- Briefly ring buzzer with warning tone:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x05 | 0x01 |

- Briefly ring buzzer with danger tone:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x05 | 0x02 |


## Blue LED

- Disable the blue LED:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x06 | 0x00 |

- Turn on the blue LED:

| FPort | Command (first byte) |
|-------|-----------------------------|
| 0x06 | 0x01 |
45 changes: 45 additions & 0 deletions doc/content/applications/se-vanilla/uplinks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: "uplinks"
description: ""
weight: 1
---

The vanilla app uplinks are compromised of two simple messages (heartbeat and temperature/humidity) to reduce the complexity and show a simple example of the device functionality.

## Payload formatters

Please see [The Things Stack Javascript payload formatter documentation](https://www.thethingsindustries.com/docs/integrations/payload-formatters/javascript/) for information on how to use payload formatters.

The javascript payload formatter below can be used to decode the vanilla app.

```javascript
function decodeUplink(input) {
var data = {};
if (input.fPort == 1)
{
data.BATTERY_VOLTAGE = (input.bytes[0]/10);
data.GNSE_FW_VERSION = input.bytes[1] + (input.bytes[2]/10);
}

if (input.fPort == 2)
{
data.TEMPERATURE = ((input.bytes[0] << 8) + input.bytes[1])/10;
data.HUMIDITY = ((input.bytes[2] << 8) + input.bytes[3])/10;
}
return {
data: data,
};
}
```

## Heartbeat

The heartbeat uplink message on FPort 1 contains:
- The device battery voltage (useful for replacing the batteries)
- The firmware version (useful for checking which commands to send)


## Temperature and Humidity
The temperature and humidity uplink message on FPort 2 contains:
- The temperature in Celsius
- The humidity in percentage (between 0% to 100%)
2 changes: 1 addition & 1 deletion doc/content/getting-started/platform-guide/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For example, if you are planning to use the {{% gnse %}}, you need:

## Get a device

{{% gnse %}} is currently in Beta phase. Join the early access program and become one of the first to access the node at [genericnode.com](https://www.genericnode.com/)!
{{% gnse %}} is currently in the production phase. Order one at [genericnode.com](https://www.genericnode.com/)!

## Explore your node's features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,26 @@ The {{% gnse %}} is a unique device for several reasons:
- It is a reference design hardware
- It has a source available firmware

## Developer's Beta rollout
## Production rollout

The {{% gnse %}} is currently in Beta phase.
We started with shipping 100 devices to developers and community members as part of a beta rollout.

This means:
1. You are one of the few people who can actually experience the device hardware and firmware
2. You can contribute to the development of the device

So, as part of the Beta phase we expect you to:
- Be able to flash, debug and interact with the device
- Be able to connect external serial loggers, debuggers and sensors
- Contribute to the development of the device by raising issues
- Develop and try different applications

And you can expect us to:
- Prioritize any issue that you face
- Analyze and incorporate your feedback
Now that this phase is completed, the {{% gnse %}} is currently being produced at scale.
We started with producing and shipping 500 devices and we are ramping up to reach 10,000 devices.

## Where to start?

Check out {{% gnse %}} [Hardware]({{< ref "/sensor-edition/hardware" >}}) and [Software]({{< ref "/sensor-edition/software" >}}) sections to get familiar with the device.

Read [Hardware Setup]({{< ref "/getting-started/se-hw" >}}) and [Software Setup]({{< ref "/getting-started/se-sw" >}}) sections for instructions on how to install all the necessary tools and prepare yourself for hardware and software development.
## Using the vanilla application

Each device comes pre-programmed with an example application that lets you experience some of the {{% gnse %}} capabilities and functionalities.

Check out this [guide]({{< ref "/applications/se-vanilla" >}}) on how to get started using the vanilla application.

## Are you a developer?

If you are a developer, please read [Hardware Setup]({{< ref "/getting-started/se-hw" >}}) and [Software Setup]({{< ref "/getting-started/se-sw" >}}) sections for instructions on how to install all the necessary tools and prepare yourself for hardware and software development.

Visit [Sensor Edition Tutorials]({{< ref "/getting-started/se-hands-on-guide" >}}) page for some great, easy-to-follow video guides. Also, check out the [Applications]({{< ref "/applications" >}}) section for many application examples.

Expand All @@ -47,16 +44,14 @@ Visit [Sensor Edition Tutorials]({{< ref "/getting-started/se-hands-on-guide" >}
We use the [Generic Node Sensor Edition Github repository](https://github.com/TheThingsIndustries/generic-node-se) in our development. You can [file an issue](https://github.com/TheThingsIndustries/generic-node-se/issues/new/choose) to request a feature or report a bug.

The [Generic Node Forum](https://www.thethingsnetwork.org/forum/c/nodes/generic-node) is where we have discussions and where you can provide feedback.
You will be added to a private group with other Beta developers.

## Have fun!

You will recieve a couple of emails to assist you with trying out some cool features that are only possible with the {{% gnse %}}, like:
You can try out some cool features that are only possible with the {{% gnse %}}, like:
- [QR code claiming](https://www.thethingsindustries.com/docs/devices/device-claiming/claim-devices/)
- [Secure element claiming](https://www.thethingsindustries.com/docs/devices/claim-atecc608a/)
- Adding external sensors
- Using FreeRTOS with LoRaWAN
- Using TinyML with LoRaWAN
- LoRaWAN FUOTA

We look forward to seeing awesome projects being built with the {{% gnse %}}! We will share with you all the cool things developed within the community.
We look forward to seeing all the awesome projects built with the {{% gnse %}}! We will share with you all the cool things developed within the community.

0 comments on commit 376a332

Please sign in to comment.