Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to mqtt broker #5

Open
Vininski opened this issue May 27, 2022 · 6 comments
Open

Unable to connect to mqtt broker #5

Vininski opened this issue May 27, 2022 · 6 comments

Comments

@Vininski
Copy link

the bushrangers/ha-epever-mqtt container is repeatedly restarting, my knowledge on this is very limited but I gather there's a connection issue to the broker based on the following logs:

Starting MQTT Client... Epever Tracer Poller for Home Assistant.Creating sensor: manufacturer PHP Fatal error: Uncaught PhpMqtt\Client\Exceptions\ConnectingToBrokerFailedException: [6] Establishing a connection to the MQTT broker failed: Connection refused: Not authorized. in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php:376 Stack trace: #0 /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php(147): PhpMqtt\Client\MQTTClient->performConnectionHandshake(NULL, NULL, false) #1 /opt/epever/client(166): PhpMqtt\Client\MQTTClient->connect() #2 /opt/epever/client(55): registerHATopic('manufacturer', '', 'solar-power') #3 /opt/epever/client(35): registerTopics() #4 {main} thrown in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php on line 376 Starting MQTT Client... Epever Tracer Poller for Home Assistant.Creating sensor: manufacturer PHP Fatal error: Uncaught PhpMqtt\Client\Exceptions\ConnectingToBrokerFailedException: [6] Establishing a connection to the MQTT broker failed: Connection refused: Not authorized. in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php:376 Stack trace: #0 /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php(147): PhpMqtt\Client\MQTTClient->performConnectionHandshake(NULL, NULL, false) #1 /opt/epever/client(166): PhpMqtt\Client\MQTTClient->connect() #2 /opt/epever/client(55): registerHATopic('manufacturer', '', 'solar-power') #3 /opt/epever/client(35): registerTopics() #4 {main} thrown in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php on line 376 Starting MQTT Client... Epever Tracer Poller for Home Assistant.Creating sensor: manufacturer PHP Fatal error: Uncaught PhpMqtt\Client\Exceptions\ConnectingToBrokerFailedException: [6] Establishing a connection to the MQTT broker failed: Connection refused: Not authorized. in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php:376 Stack trace: #0 /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php(147): PhpMqtt\Client\MQTTClient->performConnectionHandshake(NULL, NULL, false) #1 /opt/epever/client(166): PhpMqtt\Client\MQTTClient->connect() #2 /opt/epever/client(55): registerHATopic('manufacturer', '', 'solar-power') #3 /opt/epever/client(35): registerTopics() #4 {main} thrown in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php on line 376 Starting MQTT Client... Epever Tracer Poller for Home Assistant.Creating sensor: manufacturer PHP Fatal error: Uncaught PhpMqtt\Client\Exceptions\ConnectingToBrokerFailedException: [6] Establishing a connection to the MQTT broker failed: Connection refused: Not authorized. in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php:376 Stack trace: #0 /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php(147): PhpMqtt\Client\MQTTClient->performConnectionHandshake(NULL, NULL, false) #1 /opt/epever/client(166): PhpMqtt\Client\MQTTClient->connect() #2 /opt/epever/client(55): registerHATopic('manufacturer', '', 'solar-power') #3 /opt/epever/client(35): registerTopics() #4 {main} thrown in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php on line 376 Starting MQTT Client... Epever Tracer Poller for Home Assistant.Creating sensor: manufacturer PHP Fatal error: Uncaught PhpMqtt\Client\Exceptions\ConnectingToBrokerFailedException: [6] Establishing a connection to the MQTT broker failed: Connection refused: Not authorized. in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php:376 Stack trace: #0 /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php(147): PhpMqtt\Client\MQTTClient->performConnectionHandshake(NULL, NULL, false) #1 /opt/epever/client(166): PhpMqtt\Client\MQTTClient->connect() #2 /opt/epever/client(55): registerHATopic('manufacturer', '', 'solar-power') #3 /opt/epever/client(35): registerTopics() #4 {main} thrown in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php on line 376 Starting MQTT Client... Epever Tracer Poller for Home Assistant.Creating sensor: manufacturer PHP Fatal error: Uncaught PhpMqtt\Client\Exceptions\ConnectingToBrokerFailedException: [6] Establishing a connection to the MQTT broker failed: Connection refused: Not authorized. in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php:376 Stack trace: #0 /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php(147): PhpMqtt\Client\MQTTClient->performConnectionHandshake(NULL, NULL, false) #1 /opt/epever/client(166): PhpMqtt\Client\MQTTClient->connect() #2 /opt/epever/client(55): registerHATopic('manufacturer', '', 'solar-power') #3 /opt/epever/client(35): registerTopics() #4 {main} thrown in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php on line 376 Starting MQTT Client... Epever Tracer Poller for Home Assistant.Creating sensor: manufacturer PHP Fatal error: Uncaught PhpMqtt\Client\Exceptions\ConnectingToBrokerFailedException: [6] Establishing a connection to the MQTT broker failed: Connection refused: Not authorized. in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php:376 Stack trace: #0 /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php(147): PhpMqtt\Client\MQTTClient->performConnectionHandshake(NULL, NULL, false) #1 /opt/epever/client(166): PhpMqtt\Client\MQTTClient->connect() #2 /opt/epever/client(55): registerHATopic('manufacturer', '', 'solar-power') #3 /opt/epever/client(35): registerTopics() #4 {main} thrown in /opt/epever/vendor/php-mqtt/client/src/MQTTClient.php on line 376 Starting MQTT Client...

The mqtt broker is working for Frigate (installed HASS addon) and when testing using the mqtt explorer app. Is there somewhere I need to enter the user name and password for the broker in the config?

@rizalafif
Copy link

I have similar problem. Do you manage to solve this in config,yml?

@Vininski
Copy link
Author

Vininski commented Jul 9, 2022

I have similar problem. Do you manage to solve this in config,yml?

Unfortunately I never figured it out. Just recently though I stumbled upon the modbus module in ESPHome so I might give that a go since I have a few esp devices setup already. Would use less battery power too. It does seem to require a TTL to modbus convertor board though.
https://www.esphome.io/components/modbus_controller.html

@rizalafif
Copy link

Thanks a lot!
I found another way too.. was thinking to use this script + mosquitto_pub to send selected data from the output to HA.
https://github.com/rosswarren/epevermodbus

@jiannis1453
Copy link

I have the same issue. I believe it has to do with Mosquitto Broker not accepting anonymous login's any more. I added the credentials in the config.yml but with no effect. In the past I had the same issue with the "docker-voltronic-homeassistant" but ned-kelly fixed it and still runs perfectly.
Maybe docker-epever-homeassistant also needs updating to be able to use username and password to connect to Mosquitto broker.

@sdacheson78
Copy link

I also have the same issue. How do I add username and password. Just add those to the config file?

@antorob
Copy link

antorob commented Jul 4, 2023

my solution for this error was: docker-compose build
but now have other problem, with php versionof my raspberry....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants