{"action":"created","issue":{"url":"https://api.github.com/repos/arduino-libraries/WiFi101/issues/250","repository_url":"https://api.github.com/repos/arduino-libraries/WiFi101","labels_url":"https://api.github.com/repos/arduino-libraries/WiFi101/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/arduino-libraries/WiFi101/issues/250/comments","events_url":"https://api.github.com/repos/arduino-libraries/WiFi101/issues/250/events","html_url":"https://github.com/arduino-libraries/WiFi101/issues/250","id":368527082,"node_id":"MDU6SXNzdWUzNjg1MjcwODI=","number":250,"title":"WiFiSocketClass::connect gets stuck at handle events","user":{"login":"axelbusch","id":3216230,"node_id":"MDQ6VXNlcjMyMTYyMzA=","avatar_url":"https://avatars0.githubusercontent.com/u/3216230?v=4","gravatar_id":"","url":"https://api.github.com/users/axelbusch","html_url":"https://github.com/axelbusch","followers_url":"https://api.github.com/users/axelbusch/followers","following_url":"https://api.github.com/users/axelbusch/following{/other_user}","gists_url":"https://api.github.com/users/axelbusch/gists{/gist_id}","starred_url":"https://api.github.com/users/axelbusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axelbusch/subscriptions","organizations_url":"https://api.github.com/users/axelbusch/orgs","repos_url":"https://api.github.com/users/axelbusch/repos","events_url":"https://api.github.com/users/axelbusch/events{/privacy}","received_events_url":"https://api.github.com/users/axelbusch/received_events","type":"User","site_admin":false},"labels":[{"id":291904850,"node_id":"MDU6TGFiZWwyOTE5MDQ4NTA=","url":"https://api.github.com/repos/arduino-libraries/WiFi101/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"Rocketct","id":37290960,"node_id":"MDQ6VXNlcjM3MjkwOTYw","avatar_url":"https://avatars3.githubusercontent.com/u/37290960?v=4","gravatar_id":"","url":"https://api.github.com/users/Rocketct","html_url":"https://github.com/Rocketct","followers_url":"https://api.github.com/users/Rocketct/followers","following_url":"https://api.github.com/users/Rocketct/following{/other_user}","gists_url":"https://api.github.com/users/Rocketct/gists{/gist_id}","starred_url":"https://api.github.com/users/Rocketct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rocketct/subscriptions","organizations_url":"https://api.github.com/users/Rocketct/orgs","repos_url":"https://api.github.com/users/Rocketct/repos","events_url":"https://api.github.com/users/Rocketct/events{/privacy}","received_events_url":"https://api.github.com/users/Rocketct/received_events","type":"User","site_admin":false},"assignees":[{"login":"Rocketct","id":37290960,"node_id":"MDQ6VXNlcjM3MjkwOTYw","avatar_url":"https://avatars3.githubusercontent.com/u/37290960?v=4","gravatar_id":"","url":"https://api.github.com/users/Rocketct","html_url":"https://github.com/Rocketct","followers_url":"https://api.github.com/users/Rocketct/followers","following_url":"https://api.github.com/users/Rocketct/following{/other_user}","gists_url":"https://api.github.com/users/Rocketct/gists{/gist_id}","starred_url":"https://api.github.com/users/Rocketct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rocketct/subscriptions","organizations_url":"https://api.github.com/users/Rocketct/orgs","repos_url":"https://api.github.com/users/Rocketct/repos","events_url":"https://api.github.com/users/Rocketct/events{/privacy}","received_events_url":"https://api.github.com/users/Rocketct/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-10-10T07:24:52Z","updated_at":"2018-11-02T11:59:44Z","closed_at":null,"author_association":"NONE","body":"My application receives data packets via an RFM69 based chip, packages them into a JSON representation and sends them via WiFi to a nodeJS based backend. \r\nI have a SAMD21 design board with several peripherals, including the ATWINC1500 for wifi. I use the WiFi101 library. However, sporadically (sometimes after 30 min, but more often after several hours) the code gets stuck in WiFiSocketClass::connect at handle events in the loop:\r\n`while (_info[sock].state == SOCKET_STATE_CONNECTING && millis() - start < 20000) {\r\n\t\tm2m_wifi_handle_events(NULL); //Code gets stuck here\r\n\t}`\r\nI decreased the timeout from 20000 to 4000, but whitout success. \r\nIt should be mentioned that connect is called quite often, i.e. about 2-3 times per minute.\r\nAt first I thought about too little available RAM. My application uses about 10-12kb of SRAM, so before I start the connection I have about 20kb available RAM.\r\nI use the latest firmware.\r\n\r\nWhat could be the problem of the freeze? Any idea?\r\n\r\n```\r\nbool sendWiFiMessage(SensorData* data)\r\n{\r\n  WiFiSSLClient client;\r\n  client.setTimeout(2500);\r\n  if (!wlanUp())\r\n    wifiConnect();\r\n  if (client.connect(statusServer, statusServerPort)) {\r\n    postDataMessage(client, data);\r\n  }\r\n  else\r\n    return false;\r\n  int timeout_at = millis() + _timeout;\r\n  while (!client.available() && timeout_at - millis() < 0) {\r\n    client.stop();\r\n  }\r\n  if(!checkServerOkMessage(client)) \r\n      return false;\r\n  //Stop connection\r\n  if (client.connected()) {\r\n    client.stop();\r\n    return false;\r\n  }    \r\n  return true;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/arduino-libraries/WiFi101/issues/comments/435356370","html_url":"https://github.com/arduino-libraries/WiFi101/issues/250#issuecomment-435356370","issue_url":"https://api.github.com/repos/arduino-libraries/WiFi101/issues/250","id":435356370,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTM1NjM3MA==","user":{"login":"desvdp","id":14137728,"node_id":"MDQ6VXNlcjE0MTM3NzI4","avatar_url":"https://avatars3.githubusercontent.com/u/14137728?v=4","gravatar_id":"","url":"https://api.github.com/users/desvdp","html_url":"https://github.com/desvdp","followers_url":"https://api.github.com/users/desvdp/followers","following_url":"https://api.github.com/users/desvdp/following{/other_user}","gists_url":"https://api.github.com/users/desvdp/gists{/gist_id}","starred_url":"https://api.github.com/users/desvdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desvdp/subscriptions","organizations_url":"https://api.github.com/users/desvdp/orgs","repos_url":"https://api.github.com/users/desvdp/repos","events_url":"https://api.github.com/users/desvdp/events{/privacy}","received_events_url":"https://api.github.com/users/desvdp/received_events","type":"User","site_admin":false},"created_at":"2018-11-02T11:59:44Z","updated_at":"2018-11-02T11:59:44Z","author_association":"NONE","body":"Hi @axelbusch , when you say your code gets \"stuck\", is it the WINC1500 module which becomes stale or your own code running on the SAMD21? I'm having a similar issue but in my case it's clearly the WINC1500 that gives up. As a matter of fact, the problem might have been described a couple of times before, such as for example in: #86. @sandeepmistry; might there still be an issue where the WINC1500 hangs, possibly by overflowing the RX buffers? At least in my case I can confirm that when it happens the RSSI is reported 0 while the conneciton status reports \"all good\". "}}
{"actor":{"display_login":"desvdp"}}