Question
ThingWorx with InfluxDB
Hi all:
Does anyone use InfluxDB to record history data?
I try to use "PostText()" And "PostJSON()"
But I can't get right response.
Here is my script:
QueryDB
var params = {
url: "http://" + me.host + ":" + me.port + "/query?db=" + p_database,
contentType: "application/x-www-form-urlencoded",
content: "q:SELECT * FROM sensor;",
timeout: 10,
username: me.user,
password: me.password
};
var result = Resources["ContentLoaderFunctions"].PostText(params);
InsertDB
var params = {
url: "http://" + me.host + ":" + me.port + "/query?db=" + p_database,
content: "sensor,type=123,way=222 value={"p_water":0.0,"p_power_value":-1}",
timeout: 10,
username: me.user,
password: me.password
};
var result = Resources["ContentLoaderFunctions"].PostText(params);
Usually I get timeout, but it is successful to execute on the Postman.
