I saw the mqtt log status in a state where no data came in from node red and no connection was made.
However, the content in the picture is as follows.
"socket error on client mosqsub|15797-raspberry, disconnecting."
It came out like this.
It seems that the subscribing side doesn't send a signal, so it seems to end the process because it doesn't come from the publishing place.
If you look at it like this, is it a node-red problem, which is a form of subscription in a node-red flow?
Is it possible to solve this problem?
As far as I know, in the case of paho-mqtt, it is said that there is no problem if loop() is given.
I would like to know if there is a way to do it in node-red, or if I can do it by writing Python code.
For reference, the keepalive time in node-red was 60 seconds and the session was initialized.
Looks like you're using a fixed client id Daeho_2. These need to be unique for each connection or they will kick each other out and reconnect in an endless loop.
All these connections originate from localhost, so things to check:
Clear out the Client ID in the mqtt config. It is not necessary to provide an ID, node-red will generate a random one for you. It should only be there in one config node. If you find it in multiple config nodes that that is the problem. You should just be using one config node for all mqtt nodes.
See what the log now shows.
For the future, if posting logs please copy/paste the text rather than a screenshot, it can be very difficult to read screenshots. When pasting use the technique described in this post to stop the forum from messing with the text - How to share code or flow json
For future reference, you can start node-red in safe mode, which restarts only the editor without running any flows. You can then fix any issues in your flow, and deploy it again to restart it from running. To do so, stop the running node-red process if you hadn’t done so already, then start it as node-red --safe [flow.json]
I am confused, first you say that it runs ok for some hours before disconnecting, now you say the original problem (continuous connect/disconnect) is still there.
Please start again. Describe your setup and tell us what the problem is. Without clear information no-one can help you.
The problem is that the sensor is connected and not.
In conclusion, there is an endpoint setting in the software provided by the sensor manufacturer, and when it is changed, the sensor data is transmitted again.
In a word, the subscription is suddenly canceled after data comes in.