-
Notifications
You must be signed in to change notification settings - Fork 9
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
sml2mqtt does not reconnect to mqtt broker upon los of connection #20
Comments
Could you post the error message from the log please? |
Here is the scenario, everything is running since days (or months) I then take mosquitto down via
This now goes on forever, even though I did a While I am typing this, I have now received 8 of those messages. If I now do a |
Strange - can you set the logging to DEBUG ( |
Could you try 2.0 and see if the issue is still there? |
ok, will do, however, might take a while to get back with results. Stay tuned. |
can I use the |
yes - should work without modification. The only change was to |
I did the upgrade following the steps in the documentation, then ran:
Then I received:
I must fallback to the previus version as this system is running in production and I have no sandbox environment for obvious reasons. |
Can't you just buy a second home so you can test this? ;-) I'll look into it since I'm very surprised that there's a behavior difference. |
here is my config for reference:
|
Your device seems to report the serial number under Matching the configuration through the serial path is no longer supported. |
Like this? ....
for reasons I don't remember I had this ID in
Perhaps this is why it failed ? But there must have been a reason why I needed to add that |
Like this general:
device id obis: ["0100600100ff"] or this: general:
device id obis:
- "0100600100ff" Whatever you like better.
It's automatically added to the ignore list, so you don't have to do that manually any more. |
Previously, as reported, it died on start. Now with the changed config it keeps running, however, with a warning:
|
something is broken. The new version, with the update config, sends MQTT messages at a high frequency (once per second) to the mosquitto:
The old version behaved like this, and honoured the time intervals I have in the config:
where
And I have tried it with that id listed in |
You have to configure your config as the config that is assigned to
Thanks for the hint - I'll have to fix the docs! |
Unfortunately I am not a yaml expert. I tried:
and:
venv/bin/sml2mqtt --config config.yml -a
|
You have to set the serial number instead of /dev/serial0 devices:
# Device configuration by OBIS value 0100000009ff or by url if the device does not report OBIS 0100000009ff
# instead of /dev/serial0:
"0a0149534b0005020de2":
mqtt:
topic: xxxxxxx |
Still not working with this change made. A few posts ago you wrote:
Now I am getting complaints in exactly that area:
Is there any updated documentation with respect to creating a valid After removing that line under "gerneral" the
|
For completeness, using the alternate syntax you recommended above:
also doesn't work. It creates:
|
You wrote above that it's working with the suggested changes and suddenly it doesn't any more. I guess you somehow messed up your configuration file. But you can always create a new default configuration file but just renaming the original one. If the file with the |
I have a working I have now renamed my config, then ran the program and it created a default config, as you mentioned above. Of course that doesn't work as it complains about a
The log:
|
Looks good so far. Now you still have to add the "device id obis" entry under |
Now it is indeed running. Not only without syntax errors in config but also with respect to the messages sent to the MQTT. Thanks much. Still no idea why the other config didn't work. Will do some serious Now comes the actual test. The original problem was that once the MQTT Broker is shut down (runs on a different server) and restarted later, sml2mqtt never retried the connection. Testscenario:
The results above match expectation. In this case the "code:7" is the result of my stopping MQTT. After I restarted MQTT I immediately got:
And after a while, and matching my interval settings in sml2mqtt config, the messages came in. So from my perspective it is now indeed working as expected and I will therefore close the issue. Again, thx much for your help and of course for developing the very useful tool in the first place. |
As it seems, and by observation, if I shutdown my remote moquitto for maintenance, even if it is just an instant
service mosquitto restart
, sml2mqtt loses its connection and never opens it again. To be on the safe side I typically reboot the raspi that runs sml2mqtt in such a situation. It would be much more reliable, however, if sml2mqtt detects the connection loss and performs an automatic reconnect, permanently and periodically, and never gives up on retry. My tasmota based sensors, which also report via MQTT do exactly that, therefore no manual intervention is ever required if one component in the flowgraph goes down for a while and comes back later.The text was updated successfully, but these errors were encountered: