{"action":"created","issue":{"url":"https://api.github.com/repos/weewx/weewx/issues/109","repository_url":"https://api.github.com/repos/weewx/weewx","labels_url":"https://api.github.com/repos/weewx/weewx/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/weewx/weewx/issues/109/comments","events_url":"https://api.github.com/repos/weewx/weewx/issues/109/events","html_url":"https://github.com/weewx/weewx/pull/109","id":138453976,"number":109,"title":"Improved communication with both ip and serial data loggers","user":{"login":"lheijst","id":4925023,"avatar_url":"https://avatars.githubusercontent.com/u/4925023?v=3","gravatar_id":"","url":"https://api.github.com/users/lheijst","html_url":"https://github.com/lheijst","followers_url":"https://api.github.com/users/lheijst/followers","following_url":"https://api.github.com/users/lheijst/following{/other_user}","gists_url":"https://api.github.com/users/lheijst/gists{/gist_id}","starred_url":"https://api.github.com/users/lheijst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lheijst/subscriptions","organizations_url":"https://api.github.com/users/lheijst/orgs","repos_url":"https://api.github.com/users/lheijst/repos","events_url":"https://api.github.com/users/lheijst/events{/privacy}","received_events_url":"https://api.github.com/users/lheijst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2016-03-04T11:41:58Z","updated_at":"2016-03-05T18:55:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/weewx/weewx/pulls/109","html_url":"https://github.com/weewx/weewx/pull/109","diff_url":"https://github.com/weewx/weewx/pull/109.diff","patch_url":"https://github.com/weewx/weewx/pull/109.patch"},"body":"Improved communication with both ip and serial data loggers"},"comment":{"url":"https://api.github.com/repos/weewx/weewx/issues/comments/192706170","html_url":"https://github.com/weewx/weewx/pull/109#issuecomment-192706170","issue_url":"https://api.github.com/repos/weewx/weewx/issues/109","id":192706170,"user":{"login":"lheijst","id":4925023,"avatar_url":"https://avatars.githubusercontent.com/u/4925023?v=3","gravatar_id":"","url":"https://api.github.com/users/lheijst","html_url":"https://github.com/lheijst","followers_url":"https://api.github.com/users/lheijst/followers","following_url":"https://api.github.com/users/lheijst/following{/other_user}","gists_url":"https://api.github.com/users/lheijst/gists{/gist_id}","starred_url":"https://api.github.com/users/lheijst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lheijst/subscriptions","organizations_url":"https://api.github.com/users/lheijst/orgs","repos_url":"https://api.github.com/users/lheijst/repos","events_url":"https://api.github.com/users/lheijst/events{/privacy}","received_events_url":"https://api.github.com/users/lheijst/received_events","type":"User","site_admin":false},"created_at":"2016-03-05T18:55:50Z","updated_at":"2016-03-05T18:55:50Z","body":"Testing my patch a little bit more: now I use only one wake up type which is presented as: 'flush input and wake up console'. Testing currently on both USB and IP data loggers. More to come...\r\n\r\n    def wakeup_console(self, max_tries=3, wait_before_retry=1.2):\r\n        \"\"\"Wake up a Davis Vantage console.\r\n        \r\n        If unsuccessful, an exception of type weewx.WakeupError is thrown\"\"\"\r\n    \r\n        # Try up to max_tries times\r\n        for count in xrange(max_tries):\r\n            try:\r\n                # Now flush everything, do it again, then look for the \\n\\r acknowledgment\r\n                self.flush_input()\r\n                self.write('\\n')\r\n                _resp = self.read(2)\r\n                if _resp == '\\n\\r':\r\n                    syslog.syslog(syslog.LOG_DEBUG, \"vantage: flush input and wake up successful\")\r\n                    return\r\n                print \"Unable to wake up console... sleeping\"\r\n                time.sleep(wait_before_retry)\r\n                print \"Unable to wake up console... retrying\"\r\n            except weewx.WeeWxIOError:\r\n                pass\r\n            syslog.syslog(syslog.LOG_DEBUG, \"vantage: retry  #%d failed\" % count)\r\n\r\n        syslog.syslog(syslog.LOG_ERR, \"vantage: Unable to wake up console\")\r\n        raise weewx.WakeupError(\"Unable to wake up Vantage console\")\r\n\r\n\r\n"}}