Dragino-CloudStudio-Tutorial

Last modified by Mengting Qiu on 2025/08/14 19:00

     Table of Contents:

1. Introduction

This guide provides step-by-step instructions for integrating Dragino LoRaWAN devices with the Cloud Studio IoT platform using The Things Network (TTN) as the network server.Cloud Studio IoT supports other LoRaWAN network servers like ChirpStack, Loriot, AWS IoT, Actility, Helium, and Orbiwise as well.

2. Prerequisites

Before starting, ensure you have:

  • A Dragino LoRaWAN device (e.g., LHT65N, S31-LB, PS-LB, etc.).
  • An account on The Things Network (TTN).
  • An account on Cloud Studio IoT.

3. Register the Device in The Things Network (TTN)

3.1 Create an Application in TTN

You must first have an account in The Things Network (TTN). Once logged in, the first step is to create an application in TTN. This creates a space where your devices will be grouped.

Step 1: 

Log in to your TTN Console.

Navigate to Applications in the left menu and click Add application.

AD_4nXfHqy9yfnmGJMemFCARh7a1yHir9Sw9e-5dtO5SffOxRDJM2GakvAoct-OZBNDhjXy0E75nGt0nORsdUAWCJcAQ3sh6LIg0KDB9HW35qW4W5pRMopZxcl4nogb3YRxK9gsissGpbQ

Step 2: 

Fill in the required fields and click Create Application.

AD_4nXfyL_g6JiKtkY1r4xEjq_nU6PEeIYtSwcQy0wFnNx5n0dzptYnCgwSKl_FgS0EjND931clQQvaNYPx4wAVwRlD3byx0-OFozQAdqarWAi2C80SMl6-HvWS-32hS4kYaEGMYHB3yvw

3.2 Register your Dragino device

This is a virtual representation in TTN of the physical device you want to integrate.

Step 1: 

In your TTN application, go to End devices and click Register end device.

AD_4nXeJEQuEERXILO4GWROFEj7eALLLMPfzZAFiD2okV6u2v6ZoYXfjmcx6IHC4TG7mc0edCztyWO24gCiVQtT6r9Wfn5OCFIBDOBAUKMCtGYzMhxqoCL0rG5vrWSz321YewiZMe1_5jg

You can add your device in two ways:

  • Selecting it from the repository (brand, model, hardware version, firmware version, and profile region)
  • Adding it manually (If your device is not listed, enter the details manually (requires correct frequency plan and LoRaWAN version).

For this example, we will select it from the repository.

Step 2: 

Each Dragino device is shipped with a sticker, and all required credentials are printed on it.

1755162968187-879.png

Further down, you'll need to enter the JoinEUI — a unique identifier provided by the manufacturer, used for OTAA (over-the-air activation), the process by which the device joins the LoRaWAN network.

AD_4nXfMnziRfzaI4Ynw2z7cntE13mPEe5Lh7Qq1FPbrktzqbw2mY_NJMo0fqfwvq0EuvE38z4SqZ9UFKUXTFpftggS6a1y5bFl255TGrT0L5p-o2n9LDTcEa4FozCbKNjzEfGkHvVtWbQ

Step 3: 

When you click Confirm, you will see additional fields to complete:

JoinEUI: AppEUI on the sticker.

AppKey: Used for OTAA activation.

End device ID: Created by you to identify the device in the application.

Label: Optional; for grouping devices by tags.

Click Register end device.

AD_4nXfK8MDKf1sDac6wvjwwIhWWUTUop64icr1iwu-wv3e4QKLk-M0fv_LduKu8tuCKISKD6yTfYflcJhPKmrNzvn0JNEYORK_567Lul9QPy62grCUT0Rgj0LzPZTqmVnn1yzFG3mro

Step 4: Power on the device and verify that it sends data by checking Live Data in TTN.

Once created, you can power on the device and check if it's sending LoRaWAN data. TTN should display the received packets under Live Data.

AD_4nXfT4Vt1IXk4znjHjfbzG84fqd1r1G5Vz4JvyVgmUSzMBLj5DJeamkipnMoN1AAdOljjG3EaNMc8hAY9OIFb09VJ4ViHfyIap9ALSewcUIkNwvKxU80MSSNBnjkNGrXpfrPIf9FCFw

AD_4nXeLxVFDP93c-2Gs3elsHdSm_mntfJJq5RT_GO2ibC21U0cPEtXJFyVFX5iNQuFxqakUqD3xyxE0z6IaQyCAQNfovnVZhlOHiddrRd14k1zyR8soTxvmSL-CKVxsfV8oVALr_yUqUg

4. Create the integration between TTN and Cloud Studio IoT

This step allows TTN to forward the received data to Cloud Studio IoT.

4.1 Set Up a Webhook in TTN

Step 1: In your TTN application, go to Webhooks and click "Add webhook".

AD_4nXeg_LbwZkwREu_ZHdsBdOuRQJeNyjSGaRQB4RYeMxJjYZ2QuA1rpcLJ3xQgzeRg5aPYMLoY4wRuVpzZssEyBjSpgy1lRtw8Zu4ukxx6MAbYOQe5ZpMJ-C1S7X3HncySJFSsZULRbA

Select Cloud Studio IoT from the list of available webhooks.

AD_4nXdo4RFJxKn4xqcpKdEx_pr1d0XWAfWfjXhDTjlgeR-Fwcih7Tb6JUJyFUTsot34LLbt6XqlLq8oBR6SZdqA5g35syZN1wiaNGUATtznI4xV5iZTAPIJwv-26UR6UYkBgNhC2xm3

Step 2: Enter the Access Token (generated in Cloud Studio IoT) to authorize data forwarding.

You will then need to enter the Access token — provided by Cloud Studio IoT — which authorizes TTN to send data to your Cloud Studio account.

AD_4nXe2OoVuhYjkHournyI5R_nJUGxnRyqMxMMK96FTXzNl0l5bvEUACHmug4nAVFBDDPk29mwANWIg2rr3ZtU6TywyN6LS4aolNDbZdCuhyT_tE3PBXzLzSb-mShA-Uwn-i-ktzn0j

After generating the token in Cloud Studio IoT, paste it into the corresponding field in TTN when creating the webhook.

AD_4nXfalXIosRpqOOko2Cb8q1Y8SjOCMrr-k8uEyyLw7yOCBoANr6DxhdHdph2ZwOTZyALElh2ErNeb5E9C1yWMZH0G05IQD4b86zU9dVRRDAhMFUDb0gjLr3csWpg4DkBJCuGZczF8RA

Click Create Cloud Studio webhook.

AD_4nXeE63TPfG-VwlrSOkwWvxDlqkh9xQbyeF4Mc31kNypRn5PRTDl57DW9amFTBX5wYSTyfqxme1mg_MKTBU397l4AoLo79nOK0vuG0z341GEiP8fCXiUleQGCACGXrqO9c5Ts0iKvqw

4.2  Add the Device in Cloud Studio IoT

Step 1: Navigate to Manager and add the device.

In the Cloud Studio IoT application (Gear), under Manager, add the device:

  • Enter the DevEUI you registered in TTN.
  • Fill in Latitude and Longitude to visualize the device on the Cloud Studio IoT map.

AD_4nXeVmw9r-ApdwDx398NG-ohKscIBY734ZEahlPNgf4kI_FmLwZMzkpHsFwsQX49KFYVyhZX1JSOfSAEpjtseHa952Cs-_MKnNUAOUs2Pa17oUxBMbef88c1O9d9bU75fxmkqwEBt0A

AD_4nXc5RC0Z3FQBLajbSqQ31hJtYXwCWsK_szldtZz3wwG_s5gEMEbyUI9e0RaAVOs6u3qptzbzV8s15RZtwRLQiO5NdAic0h5GdnaKtKwJ1GgIR8XCIp4AW-GGgAfQdUruu2HW7J3CIg

Step 2: 

You can now verify that:

  • The LoRaWAN device is sending uplink data to TTN (uplink_message events under Live Data).
  • TTN is forwarding data to Cloud Studio IoT via the webhook.

In Cloud Studio IoT, go to Devices → Real-time log to see messages received from TTN.

AD_4nXdMBEPPw1jRk1XMIp8x-pQjaQAREIHnjbqOhrcXyNtyY0sSl9FcpQoxPsZcIbqoPijyyw9YBv8uwnv5dwzewZvYNV-trG_XWhA8vevCXRkXKDmRyYwEzewJjIXl0U_2dTrcVGL_eQ

AD_4nXdN6ymB6PhlyoUwy3yj9kPXJ2_IN3zRrEychXCQ6xgihuJwwHzmMynRc1nHkV8WwWuabSbYS30nVruNIEAdlpnfliYzgk2RU16QJlbNgQz35s8si2ELKE2cBAIdLii6QzS3uCDD

Another situation

If your device model is not already registered in Cloud Studio IoT, you can add it by:

  • Clicking Add, entering the brand, model, and optionally attaching an image.
  • Choosing an icon and clicking Save.

AD_4nXe1f-rm_kT1YF6ymiaV7ki_3Kmdj9ef58c5zaH7-FiBrSIaIEmA3k6V2Zgkf3OasVAnn5YO8xHDlEFzYIEH_flLlRfwHFBuPUEM5UZhD69wqlmPZ_NdVD036smVX7leQNNuPxV0Vg

AD_4nXfcoPEQwiPJNvJGwxv2rsZkgpaPcCAVUqNvbxe2vzZiXOPCdJYpzpjoORDoucGnP2QlYoFzlAz0MadTA85bMOykUrE1-vIVVMZ-UF64aWyodeiWR2tghc9xmcJmFXSVVctqkC5KNw

5. Configure Payload Decoding

Next, configure the configuration script and payload converter script:

  • Edit the device
  • Go to Scripts
  • Under each script type, click View more to enter the corresponding JavaScript code.

AD_4nXdBmlRB1kJHR_TRGbB2LTUK6dbbVPxn4Xkh53wCr1dgTt78ChkL52crfabgXw5IRuW8C8QXKem_cRaay2c9BnIVmchesxJ8B7uAKp63eQq8L747UtRgx2r39Aw67KoR3DpqrDaMBw

AD_4nXcKri-yTs37xi-q5i495EwnQz7cT1-LBbL03R6iiGkY2A-8Iw6HsyGeThHIDE3myvOpciRkNpRWqFWyVpwu0Ob_yigD45iOwELSFqt6s_PSNrrVCQ_aMsi__4SEdcCnqbW4L4UBBQ

AD_4nXcuW3TbeJcNFxhfjCWkxf8jPSrk2gvtnCirf5YMQlOqX9xIjkeZRm2k5ePI8wkTwUxTC9mZdyv3rL7DXJ3Pi_ETZoq8dX8ytMc4Zc80vVJS0bMUCs7L4GD5LcpltBqR-YygldYKAQ

AD_4nXccW7o_9wZKfsbesyLGjnGqVCuS_6Q7F40TjttX3HPAx4rKB7HsFAD45qH0s8ciq0aUw-2R1Fh0kWB-i_bLg7PsU_9D7o1uKSxj8K0DRHlhfXROwvqLRatkyvQYQcoLt70yFA1LdQ

6. Create a Dashboard

Cloud Studio IoT offers many widget styles for data visualization.

To create a dashboard:

  • Go to Dashboards → Add dashboard
  • Fill in the required fields
  • Add widgets of your choice from the catalog

Example: A basic visualization of a Dragino LHT65.

AD_4nXf81m_KX2GfeABDvbUkvXJaJfdWCe4buihmJSLNMdaSwHMnE0at7tFfr9_nxkq7fvwl-6UO9GVb7kEg1bs1VL90BAnk15OO0ntd-UaMG9KstFBOD5S_f1SSBZTPS3juXP2TtdHETw

AD_4nXdzYycUKheK_iJgbU5UaHlipMO02gzM5Nu9bBqZ4zN5Evwhgna4_6Py3M1_cvAHHwjP5poqkuZhIIVfNwpiZYKIq08Z5FskOcpKq7B_cxiY-WtmqWSdAz1oZ86meCHIOMSAyausjA

AD_4nXfceQdP0ZVEO9-2psqvuvPo0dPUZfiv0G8DofvzAncTil3tXSdiXNu4eG2WxK8CdbyUVCLaghEWQi-siWp6AGjbeGmQa_i0D_bjGF27rGeMHoeYMV0xwEUA59JfC3vbqMSxG62xQQ

7. Send downlink messages

To send manual downlinks from Cloud Studio IoT to your Dragino:

Go to Devices, select your Dragino, click the three vertical dots, then Edit.
AD_4nXfTYTRQbeXh1cbJX3DSsgM5Nq-DB1QpYNnaxg_DGaJzx_Fq7g3aZdYJ9WLr4P-8Y_cGWcU1_cFs8_2hbLGCJVjxcs5pmP7gRjT8OqyMACP9AgS9pmVG1gN8JKLLqkccG7wv8LrIPA

In the Commands tab:

Command ID: Logical port where your device listens (usually in the datasheet or payload decoder, as f_port).

Note: Dragino devices support receiving downlinks on any port, but in principle should avoid using the same ports reserved for uplink data transmission - check device manual for uplink port assignments.

CommandData: Payload to send (typically in hexadecimal format; refer to the Dragino device manual for supported downlink commands).

AD_4nXcIu36Vk-Ld7r5BRNRYL9RG-_9RqN-fwKg7Ilp3dOGCokjP-bVb2X2Snq3WyIWl5Xjzq2GSuHMEt_CWNXDE71s65fha1UOd1tLIWwbgKhIooI0o9D422yTwV90-B7dcVTP7qG997w

8. Verification

Ensure successful integration by checking:

  • TTN Live Data: Confirm uplink messages from the Dragino device.
  • Cloud Studio IoT Real-time Log: Verify received data under Devices → Real-time log.
  • Dashboard: Confirm widgets display correct sensor readings.

9. Troubleshooting