Connect Devices to ThingsEye

Last modified by Hera Guo on 2024/10/30 10:45

 

Table of Contents:

1. Overview

2. UDP Procotol  -- Directly Connection

2.1 UDP Interface

  • Server Address: server1.thingseye.io
  • Port: 11562

The data sent to above UDP interface will not go directly to client's database.

Please contact ThingsEye team for detail how to forward data to client.

2.2 Test UDP Interface via Socket Tool

Download the UDP Test Tool from:  https://sourceforge.net/projects/sockettest/ . Run this tool, and input the server address and UDP port  as below and click send.

1728566363151-470.png

In server side, Tenant Administrator can check this in Tenant UDP Server location.

1728362834430-749.png

Click and see the debug info as below:

1728363020699-203.png

We can see the message arrives, but it shows ERROR because the message doesn't follow with the UDP Server format.

2.3 Test with Dragino NB device

2.3.1 Configure NB-IoT End Node

Device here is S31-NB : and have been configure below

  • Set to use ThingsEye UDP server: AT+SERVADDR=server1.thingseye.io,11562
  • Use UDP Uplink & Json protocol: AT+PRO=2,5
  • Equip with a NB-IoT SIM Card to access to NB-IoT Network.

The S31-NB's cellular module has the IMEI: 863663062789483

2.3.2 Check Uplink Data

Re-activate the S31-NB, and we can see it in the debug window:

1728378218744-800.png

2.3.3 Auto-Create Device

The default Tenant UDP Server has already been configured to decode the Dragino -NB / -CB NB-IoT node. So once each end node sends a data to server. Tenant will auto create the device in the server.

1728378968101-683.png

1728379050044-764.png

So we have this device in the Tenant Device List. The next step will be how to use these value to make a nice dashboard for user's application.

3.  Connect to The Things Stack

3.1 Network Structure

3.2 Creat Integration for The Things Stack.

Add Integration

1728535775119-971.png

Choose Connection Type

1728535857345-950.png

Input Uplink Data Converter Code

1728535941851-388.png

Demo JavaScript Code: https://raw.githubusercontent.com/ThingsEye-io/te-platform/refs/heads/main/Data%20Converters/The_Things_Network_MQTT_Uplink_Converter.js 

Input Downlink Converter

1728536142721-488.png

Example Javascript Code as below: https://raw.githubusercontent.com/ThingsEye-io/te-platform/refs/heads/main/Data%20Converters/The_Things_Network_MQTT_Downlink_Converter.js

Set up Connection to The Things Network application

1728536305503-380.png

Test Connection & Add iIntegration

1728536374214-962.png

After add , we can see the integration here:

1728536420275-153.png

We can use Simulate Uplink to simulate an uplink in the things stack. Then we should be able to see the message in ThingsEye

1728536524638-768.png

1728536541040-814.png

4. Check Data Uplink Log

User can check the devices log in Intergration.

1729562069134-315.png