ESPresense / ESPresense-companion

HA Add-on / Docker container that solves indoor positions with mqtt data received from multiple ESPresense stations
Apache License 2.0
138 stars 11 forks source link

Client espresence-companion disconnected, not authorized #658

Closed DevGoran closed 3 months ago

DevGoran commented 3 months ago

Issue:

Troubleshooting: Mosquito broker has following log entry:

Client espresence-companion disconnected, not authorized

ESPresence-Companion log entries:

[09:26:51 INF] Loading /config/espresense/config.yaml
[09:26:51 INF] Attempting to connect to mqtt server at 192.168.1.184:1883 as Mqttuser1...
[09:26:51 INF] Optimization enabled
[09:26:52 INF] MQTT disconnected
[09:26:52 ERR] MQTT connection failed {"primary": true}: Connecting with MQTT server failed (NotAuthorized).
[09:26:52 WRN] Overriding HTTP_PORTS '8080' and HTTPS_PORTS ''. Binding to values defined by URLS instead 'http://+:8267'.
[09:26:52 INF] Now listening on: http://[::]:8267/
[09:26:52 INF] Application started. Press Ctrl+C to shut down.
[09:26:52 INF] Hosting environment: Production
[09:26:52 INF] Content root path: /App

But I also saw following log entries at some point:

[09:22:31 INF] HTTP GET /api/state/config responded 200 in 0.7477 ms
[09:22:31 INF] HTTP GET /api/state/devices responded 200 in 0.2845 ms
[09:22:32 INF] HTTP GET /api/state/nodes responded 200 in 0.6129 ms
[09:22:32 INF] HTTP GET /api/firmware/types responded 200 in 0.3821 ms
[09:22:33 INF] HTTP GET /api/state/nodes responded 200 in 0.4665 ms
[09:22:34 INF] HTTP GET /api/state/nodes responded 200 in 0.4796 ms

Node config in the companion config.yaml:

# Locations of espresense nodes in meters
nodes: 
  - name: Guest Room
    point: [6.47,4.34, 0]
    floors: ["first"]
  - name: Bedroom
    point: [0.2,4.39, 0]
    floors: ["first"]
  - name: Living Room
    point: [0.36,10.41, 0]
    floors: ["first"]

The credentials should be fine, as I used them also to connect the ESP32 to HA previously. Currently the nodes are working, just not in the companion add-on.