{"action":"created","issue":{"url":"https://api.github.com/repos/knolleary/pubsubclient/issues/108","labels_url":"https://api.github.com/repos/knolleary/pubsubclient/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/knolleary/pubsubclient/issues/108/comments","events_url":"https://api.github.com/repos/knolleary/pubsubclient/issues/108/events","html_url":"https://github.com/knolleary/pubsubclient/issues/108","id":124962488,"number":108,"title":"Connection failed all the time, why ?","user":{"login":"donnib","id":252702,"avatar_url":"https://avatars.githubusercontent.com/u/252702?v=3","gravatar_id":"","url":"https://api.github.com/users/donnib","html_url":"https://github.com/donnib","followers_url":"https://api.github.com/users/donnib/followers","following_url":"https://api.github.com/users/donnib/following{/other_user}","gists_url":"https://api.github.com/users/donnib/gists{/gist_id}","starred_url":"https://api.github.com/users/donnib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donnib/subscriptions","organizations_url":"https://api.github.com/users/donnib/orgs","repos_url":"https://api.github.com/users/donnib/repos","events_url":"https://api.github.com/users/donnib/events{/privacy}","received_events_url":"https://api.github.com/users/donnib/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-05T13:00:47Z","updated_at":"2016-01-24T18:18:21Z","closed_at":null,"body":"Hi,\r\nI have a sensor on ESP8266 and i use this library to post to CloudMQTT and i always get : \r\n\r\nAttempting MQTT connection...failed, rc=-2 try again in 5 seconds\r\nAttempting MQTT connection...failed, rc=-2 try again in 5 seconds\r\nAttempting MQTT connection...connected\r\n\r\nIt never connects and sends, this is a major issue for me since it consumes power and i am running on batteries so the quicker and more robust this operation is the better, is there something i can do to minimize this ? I have tried different wifi networks to see if it solves problem but it has not.\r\n\r\nAny ideas would be appreciated."},"comment":{"url":"https://api.github.com/repos/knolleary/pubsubclient/issues/comments/174326635","html_url":"https://github.com/knolleary/pubsubclient/issues/108#issuecomment-174326635","issue_url":"https://api.github.com/repos/knolleary/pubsubclient/issues/108","id":174326635,"user":{"login":"gadjet","id":1810366,"avatar_url":"https://avatars.githubusercontent.com/u/1810366?v=3","gravatar_id":"","url":"https://api.github.com/users/gadjet","html_url":"https://github.com/gadjet","followers_url":"https://api.github.com/users/gadjet/followers","following_url":"https://api.github.com/users/gadjet/following{/other_user}","gists_url":"https://api.github.com/users/gadjet/gists{/gist_id}","starred_url":"https://api.github.com/users/gadjet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gadjet/subscriptions","organizations_url":"https://api.github.com/users/gadjet/orgs","repos_url":"https://api.github.com/users/gadjet/repos","events_url":"https://api.github.com/users/gadjet/events{/privacy}","received_events_url":"https://api.github.com/users/gadjet/received_events","type":"User","site_admin":false},"created_at":"2016-01-24T18:18:21Z","updated_at":"2016-01-24T18:18:21Z","body":"Hi,\r\nJust trying your example and I've got the same problem, I added a half second delay before the \r\nclient.setServer(mqtt_server, 10388);\r\n\r\nBut still getting the same 12 error.\r\nAnything else I can try?"}}