{"action":"created","issue":{"url":"https://api.github.com/repos/adafruit/Adafruit_MQTT_Library/issues/33","repository_url":"https://api.github.com/repos/adafruit/Adafruit_MQTT_Library","labels_url":"https://api.github.com/repos/adafruit/Adafruit_MQTT_Library/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/adafruit/Adafruit_MQTT_Library/issues/33/comments","events_url":"https://api.github.com/repos/adafruit/Adafruit_MQTT_Library/issues/33/events","html_url":"https://github.com/adafruit/Adafruit_MQTT_Library/issues/33","id":145088289,"number":33,"title":"WDT Soft Reset when Not using SSL (port 1883)","user":{"login":"matlus","id":10308689,"avatar_url":"https://avatars.githubusercontent.com/u/10308689?v=3","gravatar_id":"","url":"https://api.github.com/users/matlus","html_url":"https://github.com/matlus","followers_url":"https://api.github.com/users/matlus/followers","following_url":"https://api.github.com/users/matlus/following{/other_user}","gists_url":"https://api.github.com/users/matlus/gists{/gist_id}","starred_url":"https://api.github.com/users/matlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matlus/subscriptions","organizations_url":"https://api.github.com/users/matlus/orgs","repos_url":"https://api.github.com/users/matlus/repos","events_url":"https://api.github.com/users/matlus/events{/privacy}","received_events_url":"https://api.github.com/users/matlus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-01T05:10:58Z","updated_at":"2016-04-01T05:12:48Z","closed_at":"2016-04-01T05:12:48Z","body":"Ok, this is really weird but I'm able to reproduce this....\r\n\r\nI'm porting code from using the PubSubClient library to this library. As you can imagine I had a few incompatibility issues. Nonetheless, I pressed on and but I was foxed with this one issue and couldn't figure out what I was doing wrong. So eventually, I use one of the Example sketches in order to provide a minimum reproducible case.\r\n\r\n`// This example uses an Adafruit Huzzah ESP8266\r\n// to connect to shiftr.io.\r\n//\r\n// You can check on your device after a successful\r\n// connection here: https://shiftr.io/try.\r\n//\r\n// by Joël Gähwiler\r\n// https://github.com/256dpi/arduino-mqtt\r\n\r\n#include <ESP8266WiFi.h>\r\n#include <MQTTClient.h>\r\n\r\nconst char *ssid = \"ssis\";\r\nconst char *pass = \"pass\";\r\n\r\nWiFiClientSecure net;\r\nMQTTClient client;\r\n\r\nunsigned long lastMillis = 0;\r\n\r\nvoid connect(); // <- predefine connect() for setup()\r\n\r\nvoid setup() {\r\n  Serial.begin(9600);\r\n  WiFi.begin(ssid, pass);\r\n  client.begin(\"iot.eclipse.org\", 1883, net); // MQTT brokers usually use port 8883 for secure connections\r\n\r\n  connect();\r\n}\r\n\r\nvoid connect() {\r\n  Serial.print(\"checking wifi...\");\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    Serial.print(\".\");\r\n    delay(500);\r\n  }\r\n\r\n  Serial.print(\"\\nconnecting...\");\r\n  while (!client.connect(\"arduino\")) {\r\n    Serial.print(\".\");\r\n  }\r\n\r\n  Serial.println(\"\\nconnected!\");\r\n\r\n  client.subscribe(\"/example\");\r\n  // client.unsubscribe(\"/example\");\r\n}\r\n\r\nvoid loop() {\r\n  client.loop();\r\n  delay(10); // <- fixes some issues with WiFi stability\r\n\r\n  if(!client.connected()) {\r\n    connect();\r\n  }\r\n\r\n  // publish a message roughly every second.\r\n  if(millis() - lastMillis > 1000) {\r\n    lastMillis = millis();\r\n    client.publish(\"/hello\", \"world\");\r\n  }\r\n}\r\n\r\nvoid messageReceived(String topic, String payload, char * bytes, unsigned int length) {\r\n  Serial.print(\"incoming: \");\r\n  Serial.print(topic);\r\n  Serial.print(\" - \");\r\n  Serial.print(payload);\r\n  Serial.println();\r\n}`\r\n\r\nThe changes I've made are:\r\n1. I'm not using SSL, so I've changed the port to 1883\r\n2. I'm using iot.eclispe.org as the MQTT broker\r\n3. I'm using the connect method's overload that takes just the clientId parameter.\r\n\r\nNow I have other cases (different code) where when I use a clientId of \"NestEyeESP8266\", I get the same soft WDT reset. However, if I change the clientId to \"NestEyeESP826\" or \"NestEyeESP82A66\" everything works as expected. I don't mind sharing this code privately if needed."},"comment":{"url":"https://api.github.com/repos/adafruit/Adafruit_MQTT_Library/issues/comments/204251676","html_url":"https://github.com/adafruit/Adafruit_MQTT_Library/issues/33#issuecomment-204251676","issue_url":"https://api.github.com/repos/adafruit/Adafruit_MQTT_Library/issues/33","id":204251676,"user":{"login":"matlus","id":10308689,"avatar_url":"https://avatars.githubusercontent.com/u/10308689?v=3","gravatar_id":"","url":"https://api.github.com/users/matlus","html_url":"https://github.com/matlus","followers_url":"https://api.github.com/users/matlus/followers","following_url":"https://api.github.com/users/matlus/following{/other_user}","gists_url":"https://api.github.com/users/matlus/gists{/gist_id}","starred_url":"https://api.github.com/users/matlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matlus/subscriptions","organizations_url":"https://api.github.com/users/matlus/orgs","repos_url":"https://api.github.com/users/matlus/repos","events_url":"https://api.github.com/users/matlus/events{/privacy}","received_events_url":"https://api.github.com/users/matlus/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T05:12:48Z","updated_at":"2016-04-01T05:12:48Z","body":"Opps, sorry wrong MQTT library. This post was meant for the Arduino MQTT library"}}