Closed krid002 closed 10 months ago
Sounds like you have the maxAgeSeconds
set too low, lower than the interval you are getting updates. See config and try a higher value.
Hi, thank you for your quick reaction.
I have no maxAgeSeconds defined this is the complete configuration.
module: 'MMM-MQTT', position: 'bottom_left', header: 'Status', config: { mqttServers: [ { address: '192.168.1.13', // Server address or IP address port: '1883', // Port number if other than default user: 'user', // Leave out for no user password: 'pass', // Leave out for no password subscriptions: [ { topic: 'rasen/status', // Topic to look for label: 'Status ' // Displayed in front of v> }, { topic: 'fenster/og', label: 'Fenster OG' }, { topic: 'fenster/eg', label: 'Fenster EG' } ] } ], } },
I also thought maxAgeSeconds is the cause. But I did not find any default value. And if there is a default value I would like to set it to infinite.
this is my customcss:
.region.bottom.left .container .MMM-MQTT { position: absolute; left: 10px; bottom: 0px; width: 1080px; }
As written before this configuration was running since 2018 without any problems. The only real change now is a clean installation and server only with client.
Have you tried to connect to the queue and verified that new values are actually received? And how often? What do you mean by fades away? Are they not visible at all or just dimmed? What is your node version?
By the way, I am not sure what you mean by client / server style. Can you explain?
I can see that if I connect to my MMM from a laptop, then I do not see values until they are updated, so I suspect you are not getting updated values for some reason. This is because the values are received by the mqtt_helper.js
, that is kind of a server, and this is sending updates to clients only when updates are received, so a client that is connecting will not see all values immediately.
What is your MMM running on?
I have a VM running with the Magicmirror as server(npm start server). The raspi behind my mirror just connects to it as client (from MMM wiki: node clientonly --address 192.168.1.5 --port 8080).
Have you tried to connect to the queue and verified that new values are actually received? And how often?
What do you mean exactly? The values stored in the topics which are subscribed are very static, they sometimes are not refreshed in days. (which was never a problem)
What do you mean by fades away? Are they not visible at all or just dimmed?
They are simply gone. When I restart the server on the VM and connect to the web page I see the values for some seconds. When I change the values they are visible for some time.
What is your node version?
broker is running mqtt I am running EMQS as a broker. I can see that MMM_mqtt connects as version 3.1
Oh our answeres where over lapping.
and this is sending updates to clients only when updates are received, so a client that is connecting will not see all values immediately.
yes that seems to be the problem.
Client is running on a raspi as written in answer below "node clientonly" the server is running on a VM. The raspi is a rpi4 with latest bullseye. The Server is running a debian VM.
I am glad that you experience the same issue. It drives me mad since 1 week
The problem here is that the values received are only stored in the client, so if the client starts after the server, and no new values are received, there is no value to show in the client. This is designed like this because the different clients may subscribe to different topics. There may be multiple clients even in on MM. I can see that this design has a drawback :-)
However, if the client is started at the same the as the server, any value received should be kept and displayed. I am not sure what happens if the client is started before the server.
And I do not understand why your client have a value and then looses it. Is the client restarted somehow?
When I ask if you have tried to connect to the queue and verified that new values are actually received, I mean that you can subscribe to the same topic and verify that you are actually receiving anything at all. If you have mosquitto installed, you can do this by the mosquitto_sub
command line tool. For example:
mosquitto_sub -u otto -P secret -t "home/temperature/stue" -v -h 10.0.0.123 -p 1234
When you run this command with the correct options, you should receive a value when a value is sent, and if it is retained, also immediately.
I don't think I have a solution to your problem, but it would be nice to understand exactly what is happening.
Honestly I do not understand the problem in total. As for the MQTT side I believe there is no problem. The broker works like a charm. When subscribe with Mosquitto_sub directly I receive the data as expected and it remains as it is.
Yes the client is restarted once every hour. This might be the problem that the data is lost after some time even if it has been set on the server instance of MM.
Please clarify when writing of client / server in your reply do you mean the mqtt server and client? Because the MQTT broker will never(power loss or update excluded) restart and it even restores the retained topics.
What I do not understand MM wise is that in my understanding the MM-server should always display the same as the MM-clients. Because the MM-client itself has no configuration file. Therefore I do not understand that it will not be updated.
Is there a way to debug your module to find the solution or is there a way to align it? I am really wondering because this module is the only which has such errors. calendar/fuel/NOAA3 ... are working like a charm.
thank you for your time by the way;)
With client and server I mean the MM client and server. All MM modules have a client part running in the browser, and many modules have a node_helper that is running on the MM server.
Anyway, I have been thinking about this issue today, and I am working on a fix. Just give me a little more time, and you can try it out.
Thanks a lot. Looking forward to test.
Please do a git pull
now. You should get version 1.2.0
. Let me know how it works for you :-)
Remember to run npm install
.
I just did quick tests. It did not help. When I start the restart the MM-server, the MM-client gets the data but when I restart the the MM-client it does not get it.
I can easier reproduce it by refreshing a tab on my machine with the MM-server. If I refresh the first time after the start of MM-server it gets the data. If I refresh/reload the page again the data is not shown :(
Just for completeness: the lables remain all the time in place only the values get lost.
Are you sure you got version 1.2.0? (Check the package.json
file).
My MM crashed yesterday, and now I am at work, so I have less time to check this now. Will do later.
Yes I have the latest version: Also did a npm install and of course restarted mm
Now I tried running the same way as you do, and I discovered that the server part is behaving differently in those cases. It is not connecting to the MQ until a client connects, and if new client connects, they are not receiving any data that has been received before.
So here we try again :-) I have released version 1.2.1 where data is sent to the client 2 seconds after they connect. Try that. I am not sure it solves all your problems, but let me know if there is any difference.,
It seems this fixed the issue. I did several restart cycles, I changed the values inside the topic. Error seems to be gone. Thank you very much for your effort!
Hi, first of all thank you for the nice module. I am running it since 2018 without any problems. I now changed my MMM configuration to client / server style. the MQTT broker did NOT change.
I am reading 3 topics which contain more or less static input. the msg is available:
config is as simple as it can get example for one(all the same): { topic: 'fenster/eg', label: 'Fenster EG' } . When restarting the server MMM it fetches the msgs and shows them for sometime. Also when the value updates it is also visible for some time. But it fades away.
Any ideas?