- Platform information:
- Hardware: Raspberry Pi Model 4b
- OS: openHABian 1.6.5
- Java Runtime Environment: Java v11
- openHAB version: openHAB 3.4.2
I am trying to configure OpenHAB 3 (running on OpenHABian on RPi 4b) to subscribe to MQTT topics from an external AWS server. I was expecting to be able to do this by just installing the MQTT binding, and configuring the endpoint, client_id, cert hash, and public key hash. However, I have not been able to get this to work. I keep getting timeout exceptions or “java.nio.channels.closedChannelException” exceptions. I’ve tried creating a java keystore and truststore, as explained by the following thread:
But so far, no luck. I’ve also tried switching between using MQTT version 3 and version 5, as well as toggling between trying TCP and webSockets protocols, since I’m not 100% sure which of those AWS is using. But again, no luck. The openHAB log has not been particularly helpful, as it doesn’t list any meaningful error messages. It just keeps repeating:
2023-03-23 14:27:00.348 [INFO ] [.reconnect.PeriodicReconnectStrategy] - Try to restore connection to '[AWS_endpoint]'. Next attempt in 60000ms
2023-03-23 14:27:00.358 [INFO ] [.transport.mqtt.MqttBrokerConnection] - Starting MQTT broker connection to '[AWS_endpoint]' with clientid raspberry_pi_test
I’m trying to avoid having to install and run a separate MQTT broker just for this purpose. We’re going to have other services and functions installed on this pi, so we want to conserve as many of the limited resources as possible, and running a dedicated MQTT broker as a middle-man between the AWS broker and OpenHAB seems like unnecessary overkill.
Can I subscribe to MQTT topics without having to install a whole separate broker (such as Mosquitto)? If so, how do I configure the MQTT binding to allow that?
Thanks in advance.