Wiki source code of Losant

Version 23.2 by Xiaoling on 2022/09/05 09:35

Hide last authors
Xiaoling 23.2 1 **Table of Contents:**
2
3 {{toc/}}
4
5
Xiaoling 8.2 6 = 1.  Indoor Tracking Examples base on iBeacon =
7
8
Xiaoling 23.2 9
Xiaoling 8.2 10 == Create a Losant Webhook ==
11
Xiaoling 23.2 12
Xiaoling 8.2 13 If you do not have a Losant Account, you can sign up for a free [[Losant Developer Sandbox>>url:https://www.losant.com/iot-platform/sandbox]] account. Once you have an account, [[create a new application>>url:https://docs.losant.com/applications/overview/#creating-applications]]. You can start from a blank application or from a [[Losant Application Template>>url:https://docs.losant.com/templates/overview/]], like [[The Things Network Application Template>>url:https://docs.losant.com/templates/the-things-network/]].
14
Xiaoling 23.2 15 Once you've created a new application, click **Webhooks** and then **Add Webhook**.
Xiaoling 8.2 16
17 [[image:image-20220905084626-2.png]]
18
19
20
Xiaoling 23.2 21
22 Enter a **Webhook Name** and then click **Create Webhook**. You may also enter a username and password to use Basic Auth. If you use Basic Auth, you will need to [[edit your Losant Webhook in TTS>>url:https://docs.losant.com/guides/how-to-integrate-with-the-things-stack/#editing-your-losant-webhook-in-tts]].
23
Xiaoling 8.2 24 [[image:image-20220905084724-3.png]]
25
26
Xiaoling 23.2 27
28
Xiaoling 8.2 29 Once the Webhook is created, copy the unique identifier from the URL that comes after [[https:~~/~~/triggers.losant.com/webhooks/.>>url:https://triggers.losant.com/webhooks/]]
30
Xiaoling 23.2 31
Xiaoling 8.2 32 [[image:image-20220905084736-4.png]]
33
34
35
36
37 == Configure TTS to Use the Losant Webhook ==
38
39
Xiaoling 23.2 40 In the TTS application , click on **Integrations**, then **Webhooks**, and then **Add webhook**.
Xiaoling 8.2 41
42 [[image:image-20220905084816-5.png]]
43
44
45
46
Xiaoling 23.2 47 Click on the [[Losant Webhook>>url:https://www.thethingsindustries.com/docs/integrations/cloud-integrations/losant/]] tile. If you are using Basic Auth for this Webhook or need to subscribe to more than just **uplink** messages, then please review the end of this How-To Guide in the section named [[Editing Your Losant Webhook in TTS>>url:https://docs.losant.com/guides/how-to-integrate-with-the-things-stack/#editing-your-losant-webhook-in-tts]].
48
Xiaoling 8.2 49 [[image:image-20220905084846-6.png]]
50
51
52
53 Enter the following information into the Losant Webhook configuration:
54
Xiaoling 23.2 55 * **Webhook ID:** Make up any name that you would like. This does not have to be the ID of the webhook as it is stored in Losant.
56 * **Unique ID of Losant Webhook URL:** This is the Losant Webhook unique ID that was copied to the clipboard in LOSANT Webhooks.
Xiaoling 8.2 57
Xiaoling 23.2 58 Finally, click **Create Losant webhook**. If you need to configure additional options (e.g. Basic Auth or additional messages to subscribe to), use the TTS Custom Webhook Template or add these options once the Webhook in TTS is created by following the last section of this guide, [[Editing Your Losant Webhook in TTS>>url:https://docs.losant.com/guides/how-to-integrate-with-the-things-stack/#editing-your-losant-webhook-in-tts]].
Xiaoling 8.2 59
60 [[image:image-20220905084936-7.png]]
61
62
63
64
65 == Create a Losant Application Workflow to Receive Data from the LoRaWAN Sensor and Confirm Data Flow to Losant via Uplinks ==
66
Xiaoling 22.2 67
Xiaoling 23.2 68 Since TTS is now configured to forward data to the Losant Webhook, let's create a [[Losant Application Workflow>>url:https://docs.losant.com/workflows/application-workflows/]] to receive the data from TTS.
Xiaoling 8.2 69
Xiaoling 23.2 70 Click on **Workflows** and then in the Application Workflow section, click **Add** to create a new Application Workflow.
Xiaoling 8.2 71
Xiaoling 22.2 72 [[image:image-20220905085017-8.png]]
73
Xiaoling 8.2 74
75
Xiaoling 22.2 76
Xiaoling 23.2 77 Enter a name for your Application Workflow (as well as a description if you'd like) and click **Create Workflow**.
Xiaoling 22.2 78
Xiaoling 23.2 79 [[image:image-20220905091131-22.png]]
Xiaoling 8.2 80
Xiaoling 23.2 81
82
83 Drag and drop the [[Webhook Trigger Node>>url:https://docs.losant.com/workflows/triggers/webhook/]] and the [[Debug Node>>url:https://docs.losant.com/workflows/outputs/debug/]] onto the visual workflow engine's canvas and connect them together. If you have only one webhook in this Losant application, it will be automatically selected for the Webhook Trigger. If you have multiple webhooks, select the one that was created in Webhook. Next, click **Save and Deploy**. Now that this workflow is deployed, click on the [[Debug Panel>>url:https://docs.losant.com/workflows/debugging-workflows/#debug-node-messages]].
84
Xiaoling 22.2 85 [[image:image-20220905085051-10.png]]
86
Xiaoling 8.2 87
Xiaoling 23.2 88
Xiaoling 8.2 89 When TTS receives new data from the sensor, it will send that data to Losant over the Losant Webhook and trigger this workflow. Each time this workflow runs, new data will be displayed in the Debug Panel as shown below.
90
91
Xiaoling 23.2 92 **Note:** If TTS is not automatically decoding your data as shown below in** data.body.uplink_message.decoded_payload**, then you can decode your LoRaWAN device data in this Losant Application Workflow. Check out the blog post [[How To Decode and Visualize Your LoRaWAN Sensor Data Using TTS and Losant>>url:https://www.losant.com/blog/how-to-decode-and-visualize-your-lorawan-sensor-data-using-the-things-network-and-losant]] to learn more about decoding LoRaWAN data in Losant.
93
Xiaoling 22.2 94 [[image:image-20220905085115-11.png]]
95
96
97
Xiaoling 8.2 98
99 == Create a device ==
100
Xiaoling 22.2 101
102 [[image:image-20220905085132-12.png]]
103
104
Xiaoling 8.2 105
Xiaoling 23.2 106
Xiaoling 8.2 107 Select the appropriate equipment. In this example, select a Standalone equipment
108
Xiaoling 22.2 109 [[image:image-20220905085201-13.png]]
110
Xiaoling 8.2 111
Xiaoling 23.2 112
113
Xiaoling 8.2 114 Name is required, others can be added later
115
Xiaoling 22.2 116 [[image:image-20220905085219-14.png]]
117
Xiaoling 8.2 118
Xiaoling 23.2 119
120
Xiaoling 8.2 121 Add equipment in the workflow so that data can flow to the equipment
122
Xiaoling 22.2 123 [[image:image-20220905085236-15.png]]
124
Xiaoling 8.2 125
Xiaoling 23.2 126
127
Xiaoling 22.2 128 Refer to the data in debug and add parameters to the device
Xiaoling 8.2 129
Xiaoling 23.2 130 [[image:image-20220905085253-16.png]]
Xiaoling 22.2 131
132
Xiaoling 23.2 133
Xiaoling 8.2 134 Create a new dashboard
135
Xiaoling 22.2 136 [[image:image-20220905085323-17.png]]
137
Xiaoling 8.2 138
139
Xiaoling 22.2 140
Xiaoling 23.2 141
142 [[image:image-20220905085337-18.png]]
143
144
145
Xiaoling 8.2 146 Select the appropriate template
147
Xiaoling 22.2 148 [[image:image-20220905085355-19.png]]
149
Xiaoling 8.2 150
Xiaoling 23.2 151
152
153
Xiaoling 8.2 154 Set beacon and position
155
Xiaoling 22.2 156 [[image:image-20220905085417-20.png]]
157
158
159
160 [[image:image-20220905085437-21.png]]
161
Xiaoling 8.2 162
163
Xiaoling 22.2 164