Hi, first of all thank you very much for creating this awesome project!
I was able to follow your documentation to create my own devi_config.json with release 1.0.5.
After creating the mqtt_config.json I expected the connection to my mqtt server to be established.
However, when I tried to run it, I got an unauthorized exceptions when trying to connect to the mqtt server.
Steps to reproduce
Create the devi_config.json and mqtt_config.json as described in the README.md
20:56:29.865 [main] INFO i.h.devi.mqtt.service.ConsoleRunner - Starting exporter service
Not authorized to connect (5)
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:28)
at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:1053)
at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:151)
at java.base/java.lang.Thread.run(Unknown Source)
The previously created MqttConnectOptions, where password and username are being set, are not passed in.
After adding the options as an instance variable and passing it in, it starts to work for me and I have had the setup up and running for a day now without any issues.
I'll create a PR with the fix that you can merge if you'd like
Hi, first of all thank you very much for creating this awesome project!
I was able to follow your documentation to create my own
devi_config.json
with release1.0.5
.After creating the
mqtt_config.json
I expected the connection to my mqtt server to be established.However, when I tried to run it, I got an unauthorized exceptions when trying to connect to the mqtt server.
Steps to reproduce
devi_config.json
andmqtt_config.json
as described in the README.mdRun the service
Error log
Possible solution
I have tracked this down to the
client.connect()
call inMQTTService.java
.The previously created
MqttConnectOptions
, where password and username are being set, are not passed in.After adding the options as an instance variable and passing it in, it starts to work for me and I have had the setup up and running for a day now without any issues.
I'll create a PR with the fix that you can merge if you'd like