{"action":"opened","issue":{"url":"https://api.github.com/repos/Imroy/pubsubclient/issues/37","labels_url":"https://api.github.com/repos/Imroy/pubsubclient/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/Imroy/pubsubclient/issues/37/comments","events_url":"https://api.github.com/repos/Imroy/pubsubclient/issues/37/events","html_url":"https://github.com/Imroy/pubsubclient/issues/37","id":115743841,"number":37,"title":"ESP8266 lost MQTT connection, no TCP to reconnect","user":{"login":"Pfannex","id":7262813,"avatar_url":"https://avatars.githubusercontent.com/u/7262813?v=3","gravatar_id":"","url":"https://api.github.com/users/Pfannex","html_url":"https://github.com/Pfannex","followers_url":"https://api.github.com/users/Pfannex/followers","following_url":"https://api.github.com/users/Pfannex/following{/other_user}","gists_url":"https://api.github.com/users/Pfannex/gists{/gist_id}","starred_url":"https://api.github.com/users/Pfannex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pfannex/subscriptions","organizations_url":"https://api.github.com/users/Pfannex/orgs","repos_url":"https://api.github.com/users/Pfannex/repos","events_url":"https://api.github.com/users/Pfannex/events{/privacy}","received_events_url":"https://api.github.com/users/Pfannex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-08T16:47:52Z","updated_at":"2015-11-08T16:47:52Z","closed_at":null,"body":"I'm trying to run the PubSubClient with my ESP8266-12e.\r\nI run the following Code on my ESP:\r\n\r\n```\r\n/*\r\n Basic MQTT example \r\n \r\n  - connects to an MQTT server\r\n  - publishes \"hello world\" to the topic \"outTopic\"\r\n  - subscribes to the topic \"inTopic\"\r\n*/\r\n\r\n#include <ESP8266WiFi.h>\r\n#include <PubSubClient.h>\r\n#include \"MySecret.h\"\r\n\r\n\r\n// Update these with values suitable for your network.\r\nIPAddress server(192, 168, 1, 203);\r\nlong lastMsg = 0;\r\n\r\nvoid callback(const MQTT::Publish& pub) {\r\n  // handle message arrived\r\n}\r\n\r\nWiFiClient wclient;\r\nPubSubClient client(wclient, server);\r\n\r\nvoid setup() {\r\n  // Setup console\r\n  Serial.begin(115200);\r\n  delay(10);\r\n  Serial.println();\r\n  Serial.println();\r\n\r\n  client.set_callback(callback);\r\n}\r\n\r\nvoid loop() {\r\n  if (WiFi.status() != WL_CONNECTED) {\r\n    Serial.print(\"Connecting to \");\r\n    Serial.print(ssid);\r\n    Serial.println(\"...\");\r\n    WiFi.begin(ssid, password);\r\n\r\n    if (WiFi.waitForConnectResult() != WL_CONNECTED)\r\n      return;\r\n    Serial.println(\"WiFi connected\");\r\n  }\r\n\r\n  if (WiFi.status() == WL_CONNECTED) {\r\n    if (!client.connected()) {\r\n      Serial.println(\"MQTT-Client disconnected\");\r\n      if (client.connect(\"arduinoClient\")) {\r\n        Serial.println(\"MQTT-Client connected\");\r\n        //client.publish(\"outTopic\",\"hello world\");\r\n        client.subscribe(\"inTopic\");\r\n      }\r\n    }\r\n\r\n    if (client.connected())\r\n      client.loop();\r\n  }\r\n\r\n    long now = millis();\r\n  if (now - lastMsg > 300000) {\r\n    lastMsg = now;\r\n    client.publish(\"/30/Status/MQTT\",\"on\");\r\n  }\r\n\r\n}\r\n\r\n```\r\n\r\nGenerally the Code runs, but after a while it seams that the ESP lost his TCP-connection to the MQTT-Server.\r\n\r\nAt this point the debug :\r\n```\r\nConnecting to Pf@nne-NET...\r\nWiFi connected\r\nMQTT-Client disconnected\r\nMQTT-Client connected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\nMQTT-Client disconnected\r\n```\r\n\r\n**At this point the TCP-connection should be renewed, but no network activity will shown on my WireShark monitor!**\r\n\r\nMaybe, the TCP-Connection is always active.\r\n\r\nIs the someone who has problems like this?\r\nI´m not a C expert, so maybe someone has fun to help me to set some more debug-informations to solve the problem.\r\n\r\nThe MQTT-broker runs on a Rapberry.\r\nUsed version of the Mosquitto broker is 1.4.4.\r\n\r\nThaks for your Help.......\r\n"}}