I install influx in Portanier and when I go to the terminal and enter influx I received this,
NAME:
influx - Influx Client
USAGE:
influx [command]
HINT: If you are looking for the InfluxQL shell from 1.x, run “influx v1 shell”
COMMANDS:
version Print the influx CLI version
write Write points to InfluxDB
bucket Bucket management commands
completion Generates completion scripts
query Execute a Flux query
config Config management commands
org, organization Organization management commands
delete Delete points from InfluxDB
user User management commands
task Task management commands
telegrafs List Telegraf configuration(s). Subcommands manage Telegraf configurations.
dashboards List Dashboard(s).
export Export existing resources as a template
secret Secret management commands
v1 InfluxDB v1 management commands
auth, authorization Authorization management commands
apply Apply a template to manage resources
stacks List stack(s) and associated templates. Subcommands manage stacks.
template Summarize the provided template
bucket-schema Bucket schema management commands
scripts Scripts management commands
ping Check the InfluxDB /health endpoint
setup Setup instance with initial user, org, bucket
backup Backup database
restore Restores a backup directory to InfluxDB
remote Remote connection management commands
replication Replication stream management commands
server-config Display server config
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
–help, -h show help
Error: flag provided but not defined: -database
red@RED:~ $
I am not familiar with influx but it suppose to open influx, any help will be appreciate
@Telescopio You’re installing InfluxDB v2. In InfluxDB v2, “databases” and “retention policies” have been combined and replaced with “buckets.” Also with InfluxDB v2, all the administrative tasks (such as creating a bucket) are managed through the API, not through InfluxQL or an interactive shell. To create bucket, use the influx bucket create command. For example, to create a bucket named example-bucket with a 30 day retention period:
If you don’t want to use InfluxDB v2 and use v1 instead, you’ll need to update what image you’re using to create the container. The official InfluxDB container image has 1.x tags that you can use.
Thanks a lot
As I say before I am new in this area. I have the Influx in Portanier that mean that I need to create the database as a bucket in Influxdb2. I will read about to see how since I was use to work with v1. If you can point me where in specific I will apreciate
.
Soory to take your time but in my 72 I am working in Mini Observatory using NodenRed, Grafana and Influx in Portanier.
So far almost there
Sorry for the late, I am running 2.7.6. I was able to create a bucket, now I am struggling to connect from Node Red using the API to insert data but so far have no luck.
I have this data from my weather station as a string from a HTTP Get node
dataGMTTime=2024/04/17 00:00:55
cwinfo=Serial: 2387, FW: 5.88
clouds=9.380000
temp=30.730000
wind=-1
gust=-1
rain=2443
lightmpsas=-10.69
switch=0
safe=0
hum=69
dewp=24.390000
rawir=19.660000
abspress=1008.250000
relpress=1009.386999
I create a Bucket Name Red in my OBS Organization, in Influxdb v2 running in Portainer localhost;8086. Also I have the Token BJWJe8g1PaWlbJUrXJrxDFtczETHIwlwfCQX0e6DqiL7QqRzpEqhuDzd9LcSku5Jb8QLK07o_nMI4EH2lCOR3Q
My problem is that I can not insert the data to the Database.
Yes to many but I am down to this one after working with my new helper GTP.
I have this function getting the output of the data that I show you
var data = msg.payload;
var lines = data.split(“\n”);
var sensorData = {};
lines.forEach(function (line) {
var parts = line.split(“=”);
if (parts.length === 2) {
var key = parts[0].trim();
var value = parts[1].trim();
if (key !== “dataGMTTime” && key !== “cwinfo”) {
var numericValue = parseFloat(value);
if (!isNaN(numericValue)) {
sensorData[key] = numericValue;
}
}
}
});
msg.payload = sensorData;
return msg;
and I have this influx output node configured
var data = msg.payload;
var lines = data.split(“\n”);
var sensorData = {};
lines.forEach(function (line) {
var parts = line.split(“=”);
if (parts.length === 2) {
var key = parts[0].trim();
var value = parts[1].trim();
if (key !== “dataGMTTime” && key !== “cwinfo”) {
var numericValue = parseFloat(value);
if (!isNaN(numericValue)) {
sensorData[key] = numericValue;
}
}
}
});
msg.payload = sensorData;
return msg;
and I am receiving this error message now
msg : error
“HttpError: failure writing points to database: partial write: field type conflict: input field “abspress” on measurement “weather” is type float, already exists as type string dropped=1”
I am thinking that maybe the values need to be correct in the database but I can find the way to change the configuration on the values. I was thing to delete the ducker and make a new one to see if when insert line new data the problem wili go away. Now I will wait for your recommendation to procced. I think I am getting close, But thanks for your help
Ok, so Node Red is connecting to InfluxDB just fine, the problem is that you’ve changed the type of one of your fields and now there’s a type conflict. At one point, you wrote the abspress field as a string and are now trying to write it as a float. This isn’t allowed, so InfluxDB is rejecting the write request.
You can’t change the type of data that’s already written. Do you need the data that’s been previously written as a string? If not, I’d suggest just creating a new bucket and updating your Node Red configuration to begin writing to the new bucket.
Thanks I will use the data in Grafana.I just delete the bucket and I have no error in Node red. I look that is going out but I have the error in Data Explorer unsupported input type for mean aggregate: string. I can see that I have the names of all values in the data explorer.