How to view gateway status in your own dashboard
Table of Contents:
- 1.Import rulechain/deviceprofile/widget
- 2.Create gateway devices
- 3.Modify the rule chain
- 4.Check if the widget is displayed correctly
If you want to see the status of your gateway within your own dashboard, you can use the method in this post to add a dashboard status display widget for yourself
1.Import rulechain/deviceprofile/widget
1.1 Get the json files
where to get:https://github.com/ThingsEye-io/te-platform/tree/main/Devices/Gateway/Gateway%20in%20TE
what files to get:Download the three json files with the suffixes Widget, and Rulechain.
1.2 Import rulechain
Firstly, we need to import the rule chain. The rule chain tells platform how we should handel the uplink and downlink for this device.
Open rule chains, click on the "+" in the upper right corner,
select "import rule chain", and then drag the downloaded JSON file with the suffix "_rule_chain" into the text box
1.3 Add deviceprofile
In this step, we need to create a deviceprofile to connect the device to the rulechain in the following way:
1.4 Import widget
First we need to open the dashboard we want to put in to show the gateway status, click "Edit mode“
Then click “Add widget”
Then you need to click “Add widgts” and drag and drop the downloaded json file into it, as shown in the picture:
2.Create gateway devices
Since a gateway can't transmit packets like a device, so we need to create a virtual gateway device ourselves in the following steps:
First of all, we need to open the device interface, click the upper right corner of the “+” and then click “Add device”, fill in the device information as shown in the figure
- Note: The device name format must be: gateway-"your Gateway EUI”
3.Modify the rule chain
After the device is created, we need to modify the data source of the rule chain so that our gateway's data can be stored in the device we created
3.1 Open our newly imported rule chain
3.2 Select the server
If the server our gateway connects to is TTN, we need to modify the above rulechain
If the server our gateway connects to is chirpstack, we need to modify the following rulechain
3.3 Modify rulechain
3.3.1 Modify the generator node:
3.3.2 Modify the rest api call node:
- Don't forget to save your changes when they're done!
3.3.3 Where to find this information on the server
TTN:
Regarding the API key acquisition, we need to create one as shown below:
Then copy the API key
Chirpstack:
The EUI and ID of chirpstack are identical:
Regarding the API key acquisition, we need to create one as shown below:
Then copy the API key