Subject: [InfluxData Community] [Collect] Inputs.mqtt_consumer can't connect to broker


Hi,

I'm literally tearing my hair out (what little hair I have anyway!) as I cannot get Telegraf to connect to any MQTT broker. I was using Mosquitto locally but have tested public servers to rule that out yet I have exactly the same problem. I'm sure I'm doing something really stupid but I'm kind of out of ideas!

*May 28 08:08:20 raspberrypi telegraf[3365]: 2020-05-28T07:08:20Z I! [inputs.mqtt_consumer] Connected [tcp://127.0.0.1:1883]*
*May 28 08:08:20 raspberrypi telegraf[3365]: 2020-05-28T07:08:20Z E! [inputs.mqtt_consumer] Error in plugin: connection lost: EOF*
*May 28 08:08:20 raspberrypi telegraf[3365]: 2020-05-28T07:08:20Z E! [inputs.mqtt_consumer] Error in plugin: subscription error: topics: : Connection lost before Subscrib*

and the corresponding Mosquitto:

*1590649770: New connection from 127.0.0.1 on port 1883.*
*1590649770: New client connected from 127.0.0.1 as Telegraf-Consumer-NalQU (c1, k60).*
*1590649770: No will message specified.*
*1590649770: Sending CONNACK to Telegraf-Consumer-NalQU (0, 0)*
*1590649770: Received SUBSCRIBE from Telegraf-Consumer-NalQU*
*1590649770: Socket error on client Telegraf-Consumer-NalQU, disconnecting.*

Then using a public broker:

*May 28 08:10:41 raspberrypi telegraf[3421]: 2020-05-28T07:10:41Z I! [inputs.mqtt_consumer] Connected [tcp://broker.hivemq.com:1883]*
*May 28 08:10:41 raspberrypi telegraf[3421]: 2020-05-28T07:10:41Z E! [inputs.mqtt_consumer] Error in plugin: connection lost: EOF*
*May 28 08:10:41 raspberrypi telegraf[3421]: 2020-05-28T07:10:41Z E! [inputs.mqtt_consumer] Error in plugin: subscription error: topics: : Connection lost before Subscrib*

Any pointers would be greatly appreciated :slight_smile:

Cheers,
Ben

---