当前位置:网站首页>Influxdb2 sources add data sources
Influxdb2 sources add data sources
2022-07-03 14:59:00 【Allen electronic IOT studio】
It is mainly divided into the following ways :
1、 Upload files
2、 client API: This tutorial mainly adds data in this way
3、telegraf plug-in unit , Telegraph plug-in
With C# Take the client as an example :

Choose to generate API token:


Then return to this interface :
establish vs2019 Console Application :

Actual test findings /netframework4.5 Cannot install this nuget package :
Adjusted for 4.7.2 after .

C# The code is as follows :
// You can generate an API token from the "API Tokens Tab" in the UI
const string token = "oskR6XS-LT5myc6RwWwb0QTvKSsoWvfxklNXgkknYgzZJyk0K80IKhFQuMSGexfjCSRCO-xUHA0MFL0LG5BlFA==";
const string bucket = "scada_bucket";
const string org = "ghy";
// Get client object
var client = InfluxDBClientFactory.Create("http://124.223.23.44:8086", token);
// Writing data
const string data = "mem,host=host1 used_percent=23.43234543";
using (var writeApi = client.GetWriteApi())
{
writeApi.WriteRecord(bucket, org, WritePrecision.Ns, data);
}
Console.WriteLine("ok");Write successfully :

Use node-red Client to test :
Install nodes :node-red-contrib-influxdb

contain 3 Nodes :
Write operations :
The information above is wrong :

Set node information :
The overall process is as follows :
Test whether the write is successful :
Use the output node to view :
The overall process is as follows :
The timestamp node remains the default .
The configuration of the setting node is as follows :

The query statement is as follows :
from(bucket: \"scada_bucket\") |> range(start: -1h)The output node is configured as follows ;

Passing the above test has no result :
Report errors :
Be careful : The query function has not passed the test for the time being , But the data is really inserted .
边栏推荐
- Yolov5 series (I) -- network visualization tool netron
- C language dup2 function
- 5.2-5.3
- ASTC texture compression (adaptive scalable texture compression)
- NOI OPENJUDGE 1.4(15)
- Global and Chinese markets of AC electromechanical relays 2022-2028: Research Report on technology, participants, trends, market size and share
- Introduction to opengl4.0 tutorial computing shaders
- 1017 a divided by B (20 points)
- Déformation de la chaîne bm83 de niuke (conversion de cas, inversion de chaîne, remplacement de chaîne)
- Awvs batch operation script
猜你喜欢

How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03

Yolov5系列(一)——網絡可視化工具netron

PS tips - draw green earth with a brush

Tencent internship interview sorting

创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03

Vs+qt application development, set software icon icon

5-1 blocking / non blocking, synchronous / asynchronous

Zero copy underlying analysis

5.2-5.3

Byte practice plane longitude 2
随机推荐
On MEM series functions of C language
Neon global and Chinese markets 2022-2028: Research Report on technology, participants, trends, market size and share
Detailed explanation of four modes of distributed transaction (Seata)
ASTC texture compression (adaptive scalable texture compression)
Devaxpress: range selection control rangecontrol uses
【Transform】【实践】使用Pytorch的torch.nn.MultiheadAttention来实现self-attention
[combinatorics] permutation and combination (set combination, one-to-one correspondence model analysis example)
Zzuli:1044 failure rate
Global and Chinese markets of AC electromechanical relays 2022-2028: Research Report on technology, participants, trends, market size and share
Container of symfony
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
2021-10-16 initial programming
dllexport和dllimport
Zzuli:1054 monkeys eat peaches
B2020 分糖果
[opengl] face pinching system
Zzuli:1059 highest score
Piwigo 2.7.1 sqli learning
[wechat applet] wxss template style
Implement Gobang with C language