mosquito client opens new connections, then closes them
This is shown in log : 1636686996: New connection from 192.168.1.10:58779 on port 1884. 1636686996: New connection from 192.168.1.10:52435 on port 1884. 1636686996: New connection from 192.168.1.10:53212 on port 1884. 1636686996: New connection from 192.168.1.10:52612 on port 1884. 1636686996: New connection from 192.168.1.10:60982 on port 1884. 1636686996: New connection from 127.0.0.1:61362 on port 1884. 1636686996: New connection from 192.168.1.10:64731 on port 1884. 1636686996: Client mqtt_0dd8eeee22c90b58 closed its connection. 1636686996: New client connected from 192.168.1.10:55946 as ESP8266Client-1bdf (p2, c1, k15). 1636686996: No will message specified. 1636686996: Sending CONNACK to ESP8266Client-1bdf (0, 0) 1636686996: New client connected from 192.168.1.10:58779 as ESP8266Client-190f (p2, c1, k15). 1636686996: No will message specified. 1636686996: Sending CONNACK to ESP8266Client-190f (0, 0) 1636686996: New client connected from 192.168.1.10:52435 as ESP8266Client-5bbf (p2, c1, k15). 1636686996: No will message specified. 1636686996: Sending CONNACK to ESP8266Client-5bbf (0, 0) 1636686996: New client connected from 192.168.1.10:53212 as ESP8266Client-79d3 (p2, c1, k15). 1636686996: No will message specified. 1636686996: Sending CONNACK to ESP8266Client-79d3 (0, 0) 1636686996: New client connected from 192.168.1.10:52612 as ESP8266Client-e8df (p2, c1, k15). 1636686996: No will message specified. 1636686996: Sending CONNACK to ESP8266Client-e8df (0, 0) 1636686996: New client connected from 192.168.1.10:60982 as ESP8266Client-c6b0 (p2, c1, k15). 1636686996: No will message specified. 1636686996: Sending CONNACK to ESP8266Client-c6b0 (0, 0) 1636686996: New client connected from 127.0.0.1:61362 as mqtt_0dd8eeee22c90b58 (p2, c1, k60). 1636686996: No will message specified. 1636686996: Sending CONNACK to mqtt_0dd8eeee22c90b58 (0, 0) 1636686996: New client connected from 192.168.1.10:64731 as ESP8266Client-3a80 (p2, c1, k15). 1636686996: No will message specified. 1636686996: Sending CONNACK to ESP8266Client-3a80 (0, 0) 1636686996: Client ESP8266Client-1bdf closed its connection. 1636686996: Client ESP8266Client-190f closed its connection. 1636686996: Client ESP8266Client-5bbf closed its connection. 1636686996: Client ESP8266Client-79d3 closed its connection. 1636686996: Client ESP8266Client-e8df closed its connection. 1636686996: Client ESP8266Client-c6b0 closed its connection.
I'm using the pubsubclient library. I don't know either it is a network or nodemcu issue.
It's a bit difficult to say I'm afraid! It certainly looks as though the clients connect, receive their CONNACK messages and then close their connection rather than the broker doing something. Are you able to connect using an MQTT client on your computer?
Yes I have a node-red server that has a mqtt client module running at the same computer and connects correctly.
If the node red server functions correctly, it appears this is a problem with the esp8266 devices.
I'm closing this issue because I think it is in code outside of the mosquitto project. If you still have problems with mosquitto itself, please reopen and provide more details.