{"action":"closed","issue":{"url":"https://api.github.com/repos/motoz/PellMon/issues/59","labels_url":"https://api.github.com/repos/motoz/PellMon/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/motoz/PellMon/issues/59/comments","events_url":"https://api.github.com/repos/motoz/PellMon/issues/59/events","html_url":"https://github.com/motoz/PellMon/issues/59","id":56434791,"number":59,"title":"owfs plugin sometimes reads an '!' character","user":{"login":"jteg68","id":6277924,"avatar_url":"https://avatars.githubusercontent.com/u/6277924?v=3","gravatar_id":"","url":"https://api.github.com/users/jteg68","html_url":"https://github.com/jteg68","followers_url":"https://api.github.com/users/jteg68/followers","following_url":"https://api.github.com/users/jteg68/following{/other_user}","gists_url":"https://api.github.com/users/jteg68/gists{/gist_id}","starred_url":"https://api.github.com/users/jteg68/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jteg68/subscriptions","organizations_url":"https://api.github.com/users/jteg68/orgs","repos_url":"https://api.github.com/users/jteg68/repos","events_url":"https://api.github.com/users/jteg68/events{/privacy}","received_events_url":"https://api.github.com/users/jteg68/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/motoz/PellMon/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-03T20:48:16Z","updated_at":"2015-11-02T11:18:08Z","closed_at":"2015-11-02T11:18:08Z","body":"Hi,\r\n\r\nsometimes the owfs plugin reads an '!' character from owserver. This is likely due to some cabling issues. The effect is that the log window gets messages from the calculation plugin, about failed operations. As the errors seems to go away immediately there are no visible errors in the system picture.\r\n\r\nThe following diff of connection.py seems to avoid the '!` being used. I'm not sure the changes are correct or complete.\r\n\r\nComments?\r\n\r\nThanks,\r\nJörgen\r\n\r\n````python\r\n--- connection.py.dist\t2015-02-01 19:03:02.014260446 +0100\r\n+++ connection.py\t2015-02-03 15:03:07.836475384 +0100\r\n@@ -140,12 +140,13 @@\r\n \r\n             ret, payload_len, data_len = self.unpack(data)\r\n \r\n-            if payload_len >= 0:\r\n+            if ret > 0 and payload_len >= 0:\r\n                 data = s.recv(payload_len)\r\n                 rtn = self.toNumber(data[:data_len])\r\n                 break\r\n             else:\r\n                     # ping response\r\n+                data = None\r\n                 rtn = None\r\n                 break\r\n \r\n@@ -237,8 +238,8 @@\r\n         payload_len  = socket.ntohl(val[1])\r\n         try:\r\n             ret_value    = socket.ntohl(val[2])\r\n-        except OverflowError:\r\n-            ret_value = 0\r\n+        except:\r\n+            return 0, -1, 0\r\n\r\n         format_flags = socket.ntohl(val[3])\r\n         data_len     = socket.ntohl(val[4])\r\n         offset       = socket.ntohl(val[5])\r\n\r\n\r\n"}}