MQTT in randomly disconnect

In my experience, such continual connect/disconnect is caused by a duplicate MQTT client ID.

image
on V 3.1.1

image
on V 5

So it is likely that the broker does not support it.

I left the client id blank for automatic generation
image
should she be a constant to everyone ?

I have had the problem for over 2 months now, during this time I have also tried to search for the problem on my own by which I came across your earlier posts and also tried to follow them but unfortunately nothing helped.

only thing is that earlier I had "keep alive" set to 45 after changing it to 60 the occurrence changed from 4-5 days to a week- two weeks without any problem.

I really appreciate your time :slight_smile:

I am confused. You said two hours ago that it fails every 4-5 days, now you say that since you made that change it has worked for two weeks without a problem. Please clarify.

at the very loss I wrote in brackets (once every 4 days, every 5 days, the last 2 weeks)

two weeks it worked after changing the "keep alive" to 60 from 45 but this could just be a coincidence

I am sorry if I have misled you

No, should be different for every connection - left blank should do that anyway.

According to AWS IoT Core docs, it does support many (not all) V5 features: MQTT - AWS IoT Core

But it should connect. You should try again (perhaps restart node-red changing just in case).

V5 has a lot of benefits, and in this case, v5 has greatly improved status info & so your logs should include reason codes (and if AWS did a good job, you should also get a friendly reason description alongside the reason code)

Did you try to monitor the topic $aws/events/presence/# ? There you will find disconnection codes that may give you some hint.

Reference: Lifecycle events - AWS IoT Core

1 Like

I found something like this

(node:29) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. (Use `node --trace-warnings ...` to show where the warning was created)

Hi
After 20 days
image
all MQTT discconected
in logs typical
"connected
disconnected..."
as above

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.