How to properly configure ctrlControllerApiMqtt?

Hi energy managers!

I spent some time trying to get the MQTT Api running.

My config (eclipse-mosquitto is configured to allow anonymous connections):

Checking if broker is reachable:

OpenEMS log entry:

Any hints on how to solve this appreciated. Thanks in advance.

Hello,

could you please do us all a favour and copy the Error Codes instead of just posting a Picture? So we could copy it ourselfes ?

My guess is that your files (Key) are missing as it states a NullPointer Exception.

Greetings !

1 Like

My broker is a default setup without any security whatsoever. MQTT Explorer anonymously connects to it with success.

if (certPem != null && !certPem.isBlank() //
	&& privateKeyPem != null && !privateKeyPem.isBlank() //
	&& trustStorePem != null && !trustStorePem.isBlank()) {
		options.setSocketFactory(createSslSocketFactory(certPem, privateKeyPem, trustStorePem));
		}

Looks like the missing keys case is properly handled.

There is by the way an inconsistency in the openems ui and the openems edge ui. In the user ui the key files are marked as mandatory, in the edge ui they are not.

1 Like

Ha, indeed, did not know that… will try to look into this Issue if i find time to do so :slight_smile:
Thanks!!