By connecting to this broker (tcp://mqtt.flespi.io:1883) via ESP8266 a new session is created on the site. it would be all right, I would be happy because I only need a message transfer intermediary, but after a certain period of time, the connection will disconnect:
close_code : -6
event_code : 503
503: mqtt session connection was closed (connection lost)
This is true primarily for ESP, device lost connection constantly, in case of my JAVA app (based on org.eclipse.pro.client.mqttv3 API), connection lost is rarely, but only when session is inactive - it's okay.
From my side: ESP sends message once a minute, the image below shows how the connection is randomly terminated right after sending some messages. This obviously shouldn't be the case.
I tried to connect via channel item with tcp (
test protocol id) and mqtt protocol: it can be seen through mqtt that there is a receive and send activity, but ESP still disconnects;
test protocol, in turn, cannot be used - it immediately interrupts the connection due, as I know, to an incorrect chip response (it passes in answer mqtt local params instead of selecting a number). The device item also displays activity of specified topic, but the connection is unstable again.
The quality of the documentation is terrible, there is nothing to explain the correct way to connect to the broker with mqtt.
Okay it's esp problem: with another brokers has same issue: