Hi all,
I just started with openHAB and so far it’s going fine.
Running openHABianPI 2.4 with the embedded MQTT server which is working (Sonoffs and Shellies implemented).
However, it’s constantly writing the following error to the log:
2019-03-27 22:30:20.186 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to 'openhabianpi'. Next attempt in 10000ms
2019-03-27 22:30:20.200 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to 'openhabianpi' with clientid paho240689520484113 and file store '/var/lib/openhab2/mqtt/openhabianpi'
2019-03-27 22:30:20.218 [ERROR] [.moquette.spi.impl.ProtocolProcessor] - Authenticator has rejected the MQTT credentials CId=paho240689520484113, username=openhabian
2019-03-27 22:30:20.269 [ERROR] [.moquette.spi.impl.ProtocolProcessor] - Authenticator has rejected the MQTT credentials CId=paho240689520484113, username=openhabian
I am not sure what is causing this. In the embedded broker, I am not even using this username.
The error comes from the following bit in MQTT’s ProtocolProcessor.java file:
private boolean login(Channel channel, MqttConnectMessage msg, final String clientId) {
// handle user authentication
if (msg.variableHeader().hasUserName()) {
byte[] pwd = null;
if (msg.variableHeader().hasPassword()) {
pwd = msg.payload().password().getBytes();
} else if (!this.allowAnonymous) {
LOG.error("Client didn't supply any password and MQTT anonymous mode is disabled CId={}", clientId);
failedCredentials(channel);
return false;
}
if (!m_authenticator.checkValid(clientId, msg.payload().userName(), pwd)) {
LOG.error("Authenticator has rejected the MQTT credentials CId={}, username={}, password={}",
clientId, msg.payload().userName(), pwd);
failedCredentials(channel);
return false;
}
Best regards