Wiki source code of How to view gateway status in your own dashboard
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | **Table of Contents:** | ||
| 2 | |||
| 3 | {{toc/}} | ||
| 4 | |||
| 5 | 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 | ||
| 6 | |||
| 7 | = 1.Import rulechain/deviceprofile/widget = | ||
| 8 | |||
| 9 | == 1.1 Get the json files == | ||
| 10 | |||
| 11 | where to get:[[https:~~/~~/github.com/ThingsEye-io/te-platform/tree/main/Devices/Gateway/Gateway%20in%20TE>>url:https://github.com/ThingsEye-io/te-platform/tree/main/Devices/Gateway/Gateway%20in%20TE]] | ||
| 12 | |||
| 13 | what files to get:Download the three json files with the suffixes Widget, Deviceprofile, and Rulechain. | ||
| 14 | |||
| 15 | [[image:1732852638724-480.png]] | ||
| 16 | |||
| 17 | == 1.2 Import rulechain == | ||
| 18 | |||
| 19 | Firstly, we need to import the rule chain. The rule chain tells platform how we should handel the uplink and downlink for this device. | ||
| 20 | |||
| 21 | Open rule chains, click on the "+" in the upper right corner, | ||
| 22 | |||
| 23 | select "import rule chain", and then drag the downloaded JSON file with the suffix "_rule_chain" into the text box | ||
| 24 | |||
| 25 | [[image:1732871330988-833.png||height="590" width="1472"]] | ||
| 26 | |||
| 27 | == 1.3 Add deviceprofile == | ||
| 28 | |||
| 29 | In this step, we need to create a deviceprofile to connect the device to the rulechain in the following way: | ||
| 30 | |||
| 31 | [[image:1732871669250-727.png||height="745" width="1483"]] | ||
| 32 | |||
| 33 | == 1.4 Import widget == | ||
| 34 | |||
| 35 | First we need to open the dashboard we want to put in to show the gateway status, click "Edit mode“ | ||
| 36 | |||
| 37 | Then click “Add widget” | ||
| 38 | |||
| 39 | [[image:1732871411495-758.png]][[image:Arrow.png]][[image:1732860065652-745.png]] | ||
| 40 | |||
| 41 | Then you need to click “Add widgts” and drag and drop the downloaded json file into it, as shown in the picture: | ||
| 42 | |||
| 43 | [[image:1732871426417-457.png||height="767" width="1496"]] | ||
| 44 | |||
| 45 | = 2.Create gateway devices = | ||
| 46 | |||
| 47 | Since a gateway can't transmit packets like a device, so we need to create a virtual gateway device ourselves in the following steps: | ||
| 48 | |||
| 49 | 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 | ||
| 50 | |||
| 51 | [[image:1732872944272-113.png||height="717" width="1494"]] | ||
| 52 | |||
| 53 | * **Note: The device name format must be: gateway-"your Gateway EUI”** | ||
| 54 | |||
| 55 | [[image:1732873162583-780.png]] | ||
| 56 | |||
| 57 | = 3.Modify the rule chain = | ||
| 58 | |||
| 59 | 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 | ||
| 60 | |||
| 61 | == 3.1 Open our newly imported rule chain == | ||
| 62 | |||
| 63 | [[image:1732873370029-976.png]] | ||
| 64 | |||
| 65 | == 3.2 Select the server == | ||
| 66 | |||
| 67 | If the server our gateway connects to is TTN, we need to modify the above rulechain | ||
| 68 | |||
| 69 | [[image:1732873519190-256.png]] | ||
| 70 | |||
| 71 | If the server our gateway connects to is chirpstack, we need to modify the following rulechain | ||
| 72 | |||
| 73 | [[image:1732873574205-948.png]] | ||
| 74 | |||
| 75 | == 3.3 Modify rulechain == | ||
| 76 | |||
| 77 | === 3.3.1 Modify the generator node: === | ||
| 78 | |||
| 79 | [[image:1732874053403-590.png||height="749" width="1340"]] | ||
| 80 | |||
| 81 | === 3.3.2 Modify the rest api call node: === | ||
| 82 | |||
| 83 | [[image:1732874643625-371.png||height="738" width="1348"]] | ||
| 84 | |||
| 85 | * **Don't forget to save your changes when they're done!** | ||
| 86 | |||
| 87 | === 3.3.3 Where to find this information on the server === | ||
| 88 | |||
| 89 | TTN: | ||
| 90 | |||
| 91 | [[image:1732874983084-697.png]] | ||
| 92 | |||
| 93 | Regarding the API key acquisition, we need to create one as shown below: | ||
| 94 | |||
| 95 | [[image:1732875200332-670.png]] | ||
| 96 | |||
| 97 | [[image:1732875581453-282.png||height="688" width="1838"]] | ||
| 98 | |||
| 99 | [[image:1732875893182-155.png]] | ||
| 100 | |||
| 101 | **Then copy the API key** | ||
| 102 | |||
| 103 | Chirpstack: | ||
| 104 | |||
| 105 | The EUI and ID of chirpstack are identical: | ||
| 106 | |||
| 107 | [[image:1732876339913-617.png]] | ||
| 108 | |||
| 109 | Regarding the API key acquisition, we need to create one as shown below: | ||
| 110 | |||
| 111 | [[image:屏幕截图 2024-11-29 183344.png]] | ||
| 112 | |||
| 113 | [[image:屏幕截图 2024-11-29 183436.png]][[image:Arrow.png]][[image:屏幕截图 2024-11-29 183501.png]] | ||
| 114 | |||
| 115 | **Then copy the API key** | ||
| 116 | |||
| 117 | = 4.Check if the widget is displayed correctly = | ||
| 118 | |||
| 119 | [[image:1732876759232-239.png]] |