{"action":"created","issue":{"url":"https://api.github.com/repos/hrafnkelle/tfbrew/issues/5","repository_url":"https://api.github.com/repos/hrafnkelle/tfbrew","labels_url":"https://api.github.com/repos/hrafnkelle/tfbrew/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/hrafnkelle/tfbrew/issues/5/comments","events_url":"https://api.github.com/repos/hrafnkelle/tfbrew/issues/5/events","html_url":"https://github.com/hrafnkelle/tfbrew/issues/5","id":366536151,"node_id":"MDU6SXNzdWUzNjY1MzYxNTE=","number":5,"title":"New hardware v2.0 and new firmware 1.5.4 not working","user":{"login":"ChuckGl","id":39985823,"node_id":"MDQ6VXNlcjM5OTg1ODIz","avatar_url":"https://avatars3.githubusercontent.com/u/39985823?v=4","gravatar_id":"","url":"https://api.github.com/users/ChuckGl","html_url":"https://github.com/ChuckGl","followers_url":"https://api.github.com/users/ChuckGl/followers","following_url":"https://api.github.com/users/ChuckGl/following{/other_user}","gists_url":"https://api.github.com/users/ChuckGl/gists{/gist_id}","starred_url":"https://api.github.com/users/ChuckGl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChuckGl/subscriptions","organizations_url":"https://api.github.com/users/ChuckGl/orgs","repos_url":"https://api.github.com/users/ChuckGl/repos","events_url":"https://api.github.com/users/ChuckGl/events{/privacy}","received_events_url":"https://api.github.com/users/ChuckGl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-03T21:26:25Z","updated_at":"2018-10-18T19:32:32Z","closed_at":null,"author_association":"NONE","body":"Took a power hit and had to replace one of my HS100 plugs.  The new plug is HW v2.0 with Firmware v1.5.4 and it tfbrew is not able to communicate with it.  The tfbrew.log file shows tfbrew thinks it is turning the plug on/off but there is no change.  After some time there is also a error message from the TPLinkActor [Errno 24] Too many open files. I found references with other projects indicating there is an even newer version v3.0 that experiences the same issue.  These references talk of an issues related to the header being empty and/or a change to the encryption/decryption."},"comment":{"url":"https://api.github.com/repos/hrafnkelle/tfbrew/issues/comments/431133903","html_url":"https://github.com/hrafnkelle/tfbrew/issues/5#issuecomment-431133903","issue_url":"https://api.github.com/repos/hrafnkelle/tfbrew/issues/5","id":431133903,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTEzMzkwMw==","user":{"login":"ChuckGl","id":39985823,"node_id":"MDQ6VXNlcjM5OTg1ODIz","avatar_url":"https://avatars3.githubusercontent.com/u/39985823?v=4","gravatar_id":"","url":"https://api.github.com/users/ChuckGl","html_url":"https://github.com/ChuckGl","followers_url":"https://api.github.com/users/ChuckGl/followers","following_url":"https://api.github.com/users/ChuckGl/following{/other_user}","gists_url":"https://api.github.com/users/ChuckGl/gists{/gist_id}","starred_url":"https://api.github.com/users/ChuckGl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChuckGl/subscriptions","organizations_url":"https://api.github.com/users/ChuckGl/orgs","repos_url":"https://api.github.com/users/ChuckGl/repos","events_url":"https://api.github.com/users/ChuckGl/events{/privacy}","received_events_url":"https://api.github.com/users/ChuckGl/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T19:32:32Z","updated_at":"2018-10-18T19:32:32Z","author_association":"NONE","body":"Ok after much trial and error I have my HW 2.0 HS100 working.  I made the following changes which I found in the softcheck tplink-smartplug github project.\r\n\r\ndef encrypt(string):\r\n    key = 171\r\n    result = b\"\\0\\0\\0\"+ chr(len(string)).encode('latin-1')\r\n    for i in string.encode('latin-1'):\r\n        a = key ^ i\r\n        key = a\r\n        result += chr(a).encode('latin-1')\r\n    return result\r\ndef decrypt(string):\r\n    key = 171 \r\n    result = \"\"\r\n    for i in string: \r\n        a = key ^ i\r\n        key = i \r\n        result += chr(a)\r\n    return result\r\nThis required changing line 98:\r\ntransport.write(encrypt(bytes(msg,'ascii')))\r\n      to\r\ntransport.write(encrypt(msg))\r\n\r\nIt works with both the HW 2.0 and the previous HW 1.0.  I have a HS110 coming this weekend I will test with it as well."}}
{"actor":{"display_login":"ChuckGl"}}