Hi. I have an MQTT broker/server, mosquitto, running accepting inputs of temperature and tds/ec values for a hydroponics setup.
The data is collected and sent from the client (a NodeMCU device) and is received properly by the broker. I can verify that it is received correctly by querying the broker via the MQTT.fx tool.
I have a simple python script running on the same server as the broker that queries the values and then posts it to an InfluxDB. The DB receives that data and is the plotted out using Grafana. All’s good here.
I wanted to replace the python script with telegraf which I feel is a better way to do these instead of a bespoke script.
I set up the section in the telegraf.conf for inputs.mqtt_consumer as follows:
===== extracted from telegraph.conf =========
[inputs.mqtt_consumer]]
servers = [“tcp://127.0.0.1:1883”]
topics = [
“hydroponics/sensor/temperature”,
“hydroponics/sensor/tds”,
]
client_id = “telegraf”
======== end of extract =============
and when I run the following to test the config:
i get the following error:
2020-12-07T02:19:15Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:6: “29.38”
2020-12-07T02:19:15Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:7: “258.88”
I can’t see why there is an error based on the config above. All this while the python script is running just fine and adding to the Influx db.