Skip to content

Commit 8bcc249

Browse files
authored
Merge pull request #54 from arduino/karlsoderby/ttn-guide-fix-feb-16
[MKC-337] Update TTN tutorial
2 parents d1b5724 + 6731a51 commit 8bcc249

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

content/hardware/01.mkr/01.boards/mkr-wan-1310/tutorials/the-things-network/the-things-network.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ The aim with this tutorial is to achieve a connection between a MKR WAN 1310 boa
7979

8080
**2.** Now, we need to install the library needed. If we are using the Web Editor, there is no need to install anything. If we are using an offline editor, simply go to **Tools > Manage libraries..**, and search for **MKRWAN** and install it.
8181

82+
***Note that there is also a library named MKRWAN_v2 from Arduino. We used the MKRWAN library for this tutorial, but both libraries work. As the two libraries rely on two separate firmware, it is important that your device has the correct firmware installed. Updating it is done by running the File > Examples > MKRWAN / MKRWAN_v2 > MKRWANFWUpdate_standalone example from the corresponding library. This note was last updated 2022/02/16.***
83+
8284
**3.** Once we have downloaded the library, we will need to upload an example from the **MKRWAN** library, called **FirstConfiguration**. We will find this in **File > Examples > MKRWAN > FirstConfiguration**. You can also find the code in the snippet below:
8385

8486
Copy and paste the code into the editor, and upload it to the board. Once we have uploaded the code successfully, open the Serial Monitor and an interface will appear in it. Here we will find the unique Device EUI as displayed in the picture below:
@@ -159,9 +161,9 @@ The payload contains a very simple message: `HelLora world!`, coded in HEX. This
159161

160162
![Payload tab in The Things Network console.](assets/WAN1310_T6_IMG13.png)
161163

162-
As the payload comes in a HEX format, we will need to decode it. This can be done by using a Hex code translator, such as [this one](https://www.qbit.it/lab/hextext.php). We can also automate it directly in the TTN console, by navigating to our application overview, and to the **"Payload Formats"** tab.
164+
As the payload comes in a HEX format, we will need to decode it. This can be done by using a Hex code translator, such as [this one](https://www.qbit.it/lab/hextext.php). We can also automate it directly in the TTC console, by navigating to our application overview, and to the **Payload formatters > Uplink**.
163165

164-
Here, we can enter a custom code, that will convert the incoming data in HEX format to a simple text format. Select Javascript as **Formatter type**, then use the code below as **Formatter parameter**.
166+
Here, we can enter a custom code, that will convert the incoming data in HEX format to a simple text format. Below is an example written in `JavaScript`.
165167

166168
```javascript
167169
function Decoder(bytes, port) {
@@ -173,6 +175,8 @@ function Decoder(bytes, port) {
173175
}
174176
```
175177

178+
***For further instructions on how to use formatters, please refer to [The Things Stack's documentation on formatters](https://www.thethingsindustries.com/docs/integrations/payload-formatters/).***
179+
176180
This will decode the incoming message and add the text "payload: yourmessage" at the end of the incoming payloads. That way, we do not need to manually translate it each time we get a new message.
177181

178182
## Conclusion

0 commit comments

Comments
 (0)