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

MQTT Issues - reconnects and status #154

Open
stomko11 opened this issue Nov 14, 2024 · 9 comments
Open

MQTT Issues - reconnects and status #154

stomko11 opened this issue Nov 14, 2024 · 9 comments

Comments

@stomko11
Copy link

stomko11 commented Nov 14, 2024

Describe the bug
I have configured my MQTT details. It connects fine to the server, I verified it via mqtt explorer, device is correctly reporting all the values. However there are 2 issues:

  1. webinterface of EVSE always shows "disconnected"
    image

  2. I see lot of reconnects on the mqtt server, like every minute. I found topic SmartEVSE randomly goes to unavailable in HA when connected via MQTT #115 which seems similar to what people were seeing, but it suggested fix would be incorporated in 3.7.0. I am on 3.7.2

2024-11-14 04:09:53: New connection from 192.168.x.x:51563 on port 1883.
2024-11-14 04:09:53: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:09:53: New client connected from 192.168.x.x:51563 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:09:56: New connection from 192.168.x.x:51564 on port 1883.
2024-11-14 04:09:56: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:09:56: New client connected from 192.168.x.x:51564 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:05: New connection from 192.168.x.x:51565 on port 1883.
2024-11-14 04:10:05: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:05: New client connected from 192.168.x.x:51565 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:06: New connection from 192.168.x.x:51566 on port 1883.
2024-11-14 04:10:06: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:06: New client connected from 192.168.x.x:51566 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:08: New connection from 192.168.x.x:51567 on port 1883.
2024-11-14 04:10:08: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:08: New client connected from 192.168.x.x:51567 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:15: New connection from 192.168.x.x:51568 on port 1883.
2024-11-14 04:10:15: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:15: New client connected from 192.168.x.x:51568 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:18: New connection from 192.168.x.x:51569 on port 1883.
2024-11-14 04:10:18: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:18: New client connected from 192.168.x.x:51569 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:21: New connection from 192.168.x.x:51570 on port 1883.
2024-11-14 04:10:21: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:21: New client connected from 192.168.x.x:51570 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:30: New connection from 192.168.x.x:51571 on port 1883.
2024-11-14 04:10:30: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:30: New client connected from 192.168.x.x:51571 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:31: New connection from 192.168.x.x:51572 on port 1883.
2024-11-14 04:10:31: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:31: New client connected from 192.168.x.x:51572 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:33: New connection from 192.168.x.x:51573 on port 1883.
2024-11-14 04:10:33: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:33: New client connected from 192.168.x.x:51573 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:43: New connection from 192.168.x.x:51574 on port 1883.
2024-11-14 04:10:43: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:43: New client connected from 192.168.x.x:51574 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:45: New connection from 192.168.x.x:51575 on port 1883.
2024-11-14 04:10:45: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:45: New client connected from 192.168.x.x:51575 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:46: New connection from 192.168.x.x:51576 on port 1883.
2024-11-14 04:10:46: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:46: New client connected from 192.168.x.x:51576 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:55: New connection from 192.168.x.x:51577 on port 1883.
2024-11-14 04:10:55: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:55: New client connected from 192.168.x.x:51577 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:10:58: New connection from 192.168.x.x:51578 on port 1883.
2024-11-14 04:10:58: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:10:58: New client connected from 192.168.x.x:51578 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:01: New connection from 192.168.x.x:51579 on port 1883.
2024-11-14 04:11:01: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:01: New client connected from 192.168.x.x:51579 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:08: New connection from 192.168.x.x:51580 on port 1883.
2024-11-14 04:11:08: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:08: New client connected from 192.168.x.x:51580 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:10: New connection from 192.168.x.x:51581 on port 1883.
2024-11-14 04:11:10: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:10: New client connected from 192.168.x.x:51581 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:16: New connection from 192.168.x.x:51582 on port 1883.
2024-11-14 04:11:16: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:16: New client connected from 192.168.x.x:51582 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:20: New connection from 192.168.x.x:51583 on port 1883.
2024-11-14 04:11:20: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:20: New client connected from 192.168.x.x:51583 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:23: New connection from 192.168.x.x:51584 on port 1883.
2024-11-14 04:11:23: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:23: New client connected from 192.168.x.x:51584 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:31: New connection from 192.168.x.x:51585 on port 1883.
2024-11-14 04:11:31: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:31: New client connected from 192.168.x.x:51585 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:33: New connection from 192.168.x.x:51586 on port 1883.
2024-11-14 04:11:33: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:33: New client connected from 192.168.x.x:51586 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:35: New connection from 192.168.x.x:51587 on port 1883.
2024-11-14 04:11:35: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:35: New client connected from 192.168.x.x:51587 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:45: New connection from 192.168.x.x:51588 on port 1883.
2024-11-14 04:11:45: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:45: New client connected from 192.168.x.x:51588 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:46: New connection from 192.168.x.x:51589 on port 1883.
2024-11-14 04:11:46: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:46: New client connected from 192.168.x.x:51589 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:48: New connection from 192.168.x.x:51590 on port 1883.
2024-11-14 04:11:48: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:48: New client connected from 192.168.x.x:51590 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:11:56: New connection from 192.168.x.x:51591 on port 1883.
2024-11-14 04:11:56: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:11:56: New client connected from 192.168.x.x:51591 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:00: New connection from 192.168.x.x:51592 on port 1883.
2024-11-14 04:12:00: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:00: New client connected from 192.168.x.x:51592 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:03: New connection from 192.168.x.x:51593 on port 1883.
2024-11-14 04:12:03: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:03: New client connected from 192.168.x.x:51593 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:10: New connection from 192.168.x.x:51594 on port 1883.
2024-11-14 04:12:10: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:10: New client connected from 192.168.x.x:51594 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:11: New connection from 192.168.x.x:51595 on port 1883.
2024-11-14 04:12:11: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:11: New client connected from 192.168.x.x:51595 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:13: New connection from 192.168.x.x:51596 on port 1883.
2024-11-14 04:12:13: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:13: New client connected from 192.168.x.x:51596 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:21: New connection from 192.168.x.x:51597 on port 1883.
2024-11-14 04:12:21: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:21: New client connected from 192.168.x.x:51597 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:25: New connection from 192.168.x.x:51598 on port 1883.
2024-11-14 04:12:25: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:25: New client connected from 192.168.x.x:51598 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
2024-11-14 04:12:28: New connection from 192.168.x.x:51599 on port 1883.
2024-11-14 04:12:28: Client SmartEVSE-xxxx already connected, closing old connection.
2024-11-14 04:12:28: New client connected from 192.168.x.x:51599 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').

Published state on mqtt server in SmartEVSE-xxxx/connected topic (mosquito addon in HA) is bouncing from offline to online constantly.
Publishing anything to /set/ topic works only if I make few tries to publish the same value. Perhaps it has something to do with often reconnects? Maybe it is also why webUI doesn't show it properly?

Upload your config
Press the "raw" button in the SmartEVSE webserver and upload the json settings file, so we can look at your configuration.
-attached

To Reproduce
Steps to reproduce the behavior:

  1. Normal
  2. Configure MQTT

Expected behavior
I would expect no reconnects on MQTT server. This is the only client that does this. Also I would expect "connected" status in the webUI

Screenshots
See above
settings.json

@dingo35
Copy link
Owner

dingo35 commented Nov 14, 2024

You are right, that fix is implemented in v3.7.2, and was tested by the people having the issue.
Im going to try to reproduce this!

@dingo35
Copy link
Owner

dingo35 commented Nov 14, 2024

Which MQTT server on which OS are you using?

@stomko11
Copy link
Author

Mosquitto as official addon on Home Assistant OS

@dingo35
Copy link
Owner

dingo35 commented Nov 14, 2024

Do you have the possibillity to install a standalone mosquitto server on Linux to see if this behaviour persists with your SmartEVSE?

@stomko11
Copy link
Author

I should be able to try in docker container on a server, outside of HA. Will try later today and let you know.

@stomko11
Copy link
Author

stomko11 commented Nov 14, 2024

I have tested by installing official docker image of mosquitto, running on unraid server.
Result is the same, this is running for about a minute. What I find strange - as I found out correct settings to allow mqtt connections in to the docker, I have been messing with mqtt setup on evse - changing usernames from none, to anonymous, evsemqtt and as well test1. What I find strange is that after I apply config, instead of just trying with the last entered username onwards, it actually keeps trying with all usernames entered before. As if each "save" on evse started additional instance of mqtt client with its own settings? I have not tried rebooting evse controller.

1731590788: Client SmartEVSE-xxxx already connected, closing old connection.
1731590788: New client connected from 192.168.89.67:60043 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590791: New connection from 192.168.89.67:60045 on port 1883.
1731590791: Client SmartEVSE-xxxx already connected, closing old connection.
1731590791: New client connected from 192.168.89.67:60045 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590791: New connection from 192.168.89.67:60046 on port 1883.
1731590791: Client SmartEVSE-xxxx already connected, closing old connection.
1731590791: New client connected from 192.168.89.67:60046 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590798: New connection from 192.168.89.67:60048 on port 1883.
1731590798: Client SmartEVSE-xxxx already connected, closing old connection.
1731590798: New client connected from 192.168.89.67:60048 as SmartEVSE-xxxx (p2, c1, k15).
1731590803: New connection from 192.168.89.67:60050 on port 1883.
1731590803: Client SmartEVSE-xxxx already connected, closing old connection.
1731590803: New client connected from 192.168.89.67:60050 as SmartEVSE-xxxx (p2, c1, k15, u'anonymous').
1731590806: New connection from 192.168.89.67:60052 on port 1883.
1731590806: Client SmartEVSE-xxxx already connected, closing old connection.
1731590806: New client connected from 192.168.89.67:60052 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590806: New connection from 192.168.89.67:60053 on port 1883.
1731590806: Client SmartEVSE-xxxx already connected, closing old connection.
1731590806: New client connected from 192.168.89.67:60053 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590813: New connection from 192.168.89.67:60056 on port 1883.
1731590813: Client SmartEVSE-xxxx already connected, closing old connection.
1731590813: New client connected from 192.168.89.67:60056 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590813: New connection from 192.168.89.67:60057 on port 1883.
1731590813: Client SmartEVSE-xxxx already connected, closing old connection.
1731590813: New client connected from 192.168.89.67:60057 as SmartEVSE-xxxx (p2, c1, k15).
1731590816: New connection from 192.168.89.67:60059 on port 1883.
1731590816: Client SmartEVSE-xxxx already connected, closing old connection.
1731590816: New client connected from 192.168.89.67:60059 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590820: New connection from 192.168.89.67:60061 on port 1883.
1731590820: Client SmartEVSE-xxxx already connected, closing old connection.
1731590820: New client connected from 192.168.89.67:60061 as SmartEVSE-xxxx (p2, c1, k15, u'test1').
1731590821: New connection from 192.168.89.67:60062 on port 1883.
1731590821: Client SmartEVSE-xxxx already connected, closing old connection.
1731590821: New client connected from 192.168.89.67:60062 as SmartEVSE-xxxx (p2, c1, k15, u'anonymous').
1731590823: New connection from 192.168.89.67:60063 on port 1883.
1731590823: Client SmartEVSE-xxxx already connected, closing old connection.
1731590823: New client connected from 192.168.89.67:60063 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590824: New connection from 192.168.89.67:60064 on port 1883.
1731590824: Client SmartEVSE-xxxx already connected, closing old connection.
1731590824: New client connected from 192.168.89.67:60064 as SmartEVSE-xxxx (p2, c1, k15, u'evsemqtt').
1731590831: New connection from 192.168.89.67:60067 on port 1883.
1731590831: Client SmartEVSE-xxxx already connected, closing old connection.
1731590831: New client connected from 192.168.89.67:60067 as SmartEVSE-xxxx (p2, c1, k15, u'test1').
1731590831: New connection from 192.168.89.67:60068 on port 1883.
1731590831: Client SmartEVSE-xxxx already connected, closing old connection.
1731590831: New client connected from 192.168.89.67:60068 as SmartEVSE-xxxx (p2, c1, k15).```

@dingo35
Copy link
Owner

dingo35 commented Nov 14, 2024

Rebooting the controller seems the most logical thing to do in this test situation...

@stomko11
Copy link
Author

Strange - rebooted EVSE (did that yesterday too), and I no longer see that behavior neither on mosquitto docker not in HA addon

@dingo35
Copy link
Owner

dingo35 commented Nov 18, 2024

This strange behaviour should be solved in this version:
20ccbee72.zip

Please test!

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

2 participants