@nickrout @chrisjcbt
Yes, and I am using forum search, google search, etc …
I did learn a lot but still cannot get MQTT bridging working.
First of all - my HA installation came preloaded on ODROID N2+ hardware.
I am not 100% sure but I think this is Supervised HA installation. Am I right?
Second - I got a lot of info from Reverie tech support on how to configure MQTT.
I tested the connection with MQTT Explorer very successfully. So the provided info is correct and
sufficient for the establishing a successful connection to the AWS IoT MQTT Broker.
They also send me an info how to configure Mosquitto MQTT Broker:
log_dest stdout
log_type error
log_type warning
log_type notice
log_type information
connection awsiot
address XXXXXXXXXXXXXX.amazonaws.com:8883
topic # out
start_type automatic
try_private false
bridge_cafile /ssl/Amazon_AWS/XXX_CA.pem
bridge_certfile /ssl/Amazon_AWS/XXX_certificate.pem.crt
bridge_keyfile /ssl/Amazon_AWS/XXX_private.pem.key
My understanding is: the above configuration should be entered in the mosquitto.conf file
and file should be in the /share/mosquitto location.
I created a mosquitto folder ander /share and created a mosquitto.conf file with all the above entries.
Also I created a Amazon_AWS folder inder /ssl and pasted all 3 certificate related files into this folder.
I restarted MQTT Broker few times and even rebooted few times the HA.
But to my eyes the Mosquetto MQTT Broker does not use all my updated configurations.
Just in case, here is a Mosquuetto MQTT Broker log after rebooting the HA:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/mosquitto.sh
[12:33:19] INFO: SSL is not enabled
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun mosquitto (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
[12:33:20] INFO: Starting NGINX for authentication handling…
s6-rc: info: service legacy-services successfully started
[12:33:20] INFO: Starting mosquitto MQTT broker…
2023-05-19 12:33:21: Warning: Mosquitto should not be run as root/administrator.
[12:33:22] INFO: Successfully send discovery information to Home Assistant.
[12:33:22] INFO: Successfully send service information to the Supervisor.
Please advice what I am missing and how to get it working.
Thank you,
UPDATE
OK, I changed customization option to true:
customize:
active: true
folder: mosquitto
Now log said configuration was red:
[14:48:17] INFO: Starting mosquitto MQTT broker…
1684522097: Loading config file /share/mosquitto/mosquitto.conf
but bridge still is not working. At least I don’t see any evidence.
UPDATE 2
I enabled all logging (added log_type all to the conf file) and i can see some log entries
related to the attempted connection to the AWS IoT MQTT:
2023-05-19 18:48:52: Bridge local.HomeAssistant doing local SUBSCRIBE on topic #
2023-05-19 18:48:52: Connecting bridge awsiot (xxxxxxxxx-ats.iot.us-east-1.amazonaws.com:8883)
2023-05-19 18:48:52: Bridge HomeAssistant sending CONNECT
2023-05-19 18:48:52: mosquitto version 2.0.15 running
2023-05-19 18:48:52: New connection from 127.0.0.1:44288 on port 1883.
2023-05-19 18:48:52: Client closed its connection.
2023-05-19 18:48:52: Client local.HomeAssistant closed its connection.
If I am not mistaken local Mosquitto MQTT Broker closes the connection.
What is wrong in my configuration?