SenseCAP T1000 is a compact LoRaWAN® tracker that utilizes GNSS/Wi-Fi/Bluetooth for precise indoor & outdoor location tracking. It boasts self-geo-adaptive capabilities, local data storage, and an impressive months of battery life. Additionally, it is equipped with temperature, light, and motion sensors, making it ideal for a variety of location-based applications.
The Things Stack(TTS) is a LoRaWAN® Network Server stack which is the critical component for any LoRaWAN solution.
InfluxDB is an open source time series database, focusing on high-performance reading, high-performance writing, efficient storage and real-time analysis of massive time series data. In addition to native protocols such as HTTP and UDP, it is also compatible with communication protocols of components such as CollectD, Graphite, OpenTSDB, and Prometheus. Widely used in DevOps monitoring, IoT monitoring, real-time analysis and other scenarios.
The content of this chapter will guide users how to connect the SenseCAP T1000 Tracker to InfluxDB through TTN.
Before connecting to the TTS, you need to configure the basic parameters of your device on SenseCAP Mate APP, check Get Started for more details.
- Set the platform to TTN, and then copy the Device EUI/APP EUI/APP Key.
To begin, register an account on The Things Network.
Navigate to Applications page, click "+Create application".
Enter an Application ID, click Create Application to save your changes.
We uploaded a template for users,you only need to select the product model to quickly set up. Select the input method to 'Select the end device in the LoRaWAN Device Repository'
INFO
End device brand:SenseCAPModel:SenseCAP T1000 Tracker A/B
Select the frequency plan according to your device.
Paste the Device EUI/APP EUI/APP Key of your device, and then click 'Register end device'.
When the device tries to connect to the network, the breathing light will flash. If the device joins the network successfully, the breathing light will flash quickly, and there will be a light and cheerful melody.
Then you can check the data on the TTS console.
SenseCAP T1000 Tracker Decoder for TTN
Before ste up the InfluxDB, we need to in install the Telegraf agent (version 1.9.2 or higher).
Step 2: Setup InfluxDB Cloud Log in to your InfluxDB Cloud.
On the Buckets tab.
Click the Create Bucket button to create a new bucket.
Name your bucket, choose how long the data will remain in the database and then click Create.
Navigate to API TOKENS tab and click the GENERATE API TOKEN button to create a token.
This section shows you how to configure your Telegraf agent with MQTT Consumer plugin used for connecting to TTS MQTT Server.
Navigate to TELEGRAF tab and click CREATE CONFIGURATION
Select your bucket we created before, and select system.
Name your configuration, select Create and Verify and then Finish.
Once you have downloaded the Telegraf configuration file as described in InfluxDB Cloud 2.0 Setup, update it by adding the following lines and modifying them according to your MQTT server info:
[[inputs.mqtt_consumer]]
#
#MQTT broker URLs to be used. The format is scheme://host:port, schema can be tcp, ssl, or ws.
servers = ["tcp://localhost:1883"]
#
#Topics to subscribe to
topics = ["#"]
#
#Username and password
username = "example"
password = "NNSXS.JNSBLIV34VXYXS7D4ZWV2IKPTGJM3DFRGO.........."
#
#Needed only if your payload type is string, since Telegraf does not forward data of this type by default
json_string_fields = ["uplink_message_frm_payload"]
#
#Define the message format
data_format = "json"
INFO
You can check the TTS info on the following tab.
Next, you need to copy the previously generated token from the Tokens tab and export it to an environmental variable to be used by the InfluxDB output plugin, or you can simply pass it directly as a token value in the configuration file. You can set the environmental variable by using the following command in your terminal:
INFLUX_TOKEN="paste your token here"
Run the Telegraf agent in your terminal with the following command:
telegraf --config /path/to/custom/telegraf.conf
This section shows you how to configure the Telegraf agent with HTTP Listener v2 plugin and how to create a belonging Webhook integration on The Things Stack.
Update the Telegraf configuration you previously downloaded as described in InfluxDB Cloud 2.0 Setup by adding the following lines and modifying them according to your setup:
[[inputs.http_listener_v2]]
#
# Address and port to host HTTP listener on
service_address = ":8080"
#
# Path to listen to
path = "/telegraf"
#
# HTTP methods to accept
methods = ["POST"]
#
# Needed only if your payload type is string, since Telegraf does not forward data of this type by default
json_string_fields = ["uplink_message_frm_payload"]
#
# Define the message format
data_format = "json"
Copy the generated token from the Tokens tab and use it as a token value for the output plugin in your Telegraf configuration file, or export it to an environmental variable with the following command in your terminal:
INFLUX_TOKEN="paste your token here"
Start the Telegraf agent by running the following command in the terminal:
telegraf --config /path/to/custom/telegraf.conf
Step 4: Data Explorer Select your explorer type, select _measurement on the drop-down menu in the Filter window and tick the mqtt_consumer box. Then you can choose the topic and parameter you wish to monitor.
Location Data
FROM: Your bucketMEASUREMENT: matt_sonsumer_field: uplink_message_decoded_payloadtopic: v3/...
You can also click SAVE AS in the upper right corner to save this explorer as a Dashboard cell.
A dashboard is where you visualize and interact with data in real time. You can customize the dashboard according to your needs.
Navigate to Dashboard tab and click Create Dashbaord.
Comments
Please log in or sign up to comment.