knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

ECONNRESET at broker side on more than 5 subscriptions need to call client.loop() #278

Closed contact-circularblue closed 7 years ago

contact-circularblue commented 7 years ago

SERVER LOGS: {"name":"mosca","hostname":"dev0003","pid":14618,"client":"push/4409b077adf1f29","level":40,"err":{"message":"read ECONNRESET","name":"Error","stack":"Error: read ECONNRESET\n at errnoException (net.js:904:11)\n at TCP.onread (net.js:558:19)","code":"ECONNRESET"},"msg":"read ECONNRESET","time":"2015-03-12T03:15:26.368Z","v":0}

The Client disconnects on more than 5 subscriptions, giving the above message on the server logs.

contact-circularblue commented 7 years ago

SOLUTION: Added client.loop() after every subscription in the client code. Worked for us. We are using pubsubclient for esp8366 (https://github.com/knolleary/pubsubclient). ISSUE: marvinroger/homie-esp8266#11