{"action":"created","issue":{"url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus/issues/43","repository_url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus","labels_url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus/issues/43/comments","events_url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus/issues/43/events","html_url":"https://github.com/AdvancedClimateSystems/uModbus/issues/43","id":179115519,"number":43,"title":"Transaction ID overflow","user":{"login":"greg0pearce","id":20364440,"avatar_url":"https://avatars.githubusercontent.com/u/20364440?v=3","gravatar_id":"","url":"https://api.github.com/users/greg0pearce","html_url":"https://github.com/greg0pearce","followers_url":"https://api.github.com/users/greg0pearce/followers","following_url":"https://api.github.com/users/greg0pearce/following{/other_user}","gists_url":"https://api.github.com/users/greg0pearce/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0pearce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0pearce/subscriptions","organizations_url":"https://api.github.com/users/greg0pearce/orgs","repos_url":"https://api.github.com/users/greg0pearce/repos","events_url":"https://api.github.com/users/greg0pearce/events{/privacy}","received_events_url":"https://api.github.com/users/greg0pearce/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-25T23:22:21Z","updated_at":"2016-09-26T12:27:43Z","closed_at":null,"body":"Firstly, fantastic job Auke.\r\n\r\nWhen I run some dummy code \r\n```\r\n#!/usr/bin/env python\r\n# scripts/examples/simple_tcp_client.py\r\nimport socket\r\nimport sys\r\nfrom umodbus import conf\r\nfrom umodbus.client import tcp\r\n\r\nconf.SIGNED_VALUES = True\r\nsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\nsock.connect(('10.10.1.8', 502))\r\n\r\ni=0\r\nwhile True:\r\n    try:\r\n        i+=1\r\n        message = tcp.read_discrete_inputs(slave_id=1, starting_address=0,quantity=1)\r\n        response = tcp.send_message(message, sock)\r\n    except:\r\n        print(\"Unexpected error:\", sys.exc_info())\r\n        print(i)\r\n```\r\n\r\n\r\nI receive error \r\n\r\n> File \"C:\\Python34\\lib\\site-packages\\umodbus\\client\\tcp.py\", line 106, in _create_mbap_header\r\n>     return struct.pack('>HHHB', transaction_id, 0, length, slave_id)\r\n> struct.error: 'H' format requires 0 <= number <= 65535 \r\n\r\nI think uModbus/umodbus/client/tcp.py Line 103 be (2^16)-1=**65535**  to fit in 2 bytes\r\n\r\n```\r\n# 65536 = 2**16 aka maximum number that fits in 2 bytes.\r\ntransaction_id = randint(0, **65536**)\r\nlength = len(pdu) + 1\r\n```\r\n\r\nBest Regards,\r\nGreg Pearce"},"comment":{"url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus/issues/comments/249555873","html_url":"https://github.com/AdvancedClimateSystems/uModbus/issues/43#issuecomment-249555873","issue_url":"https://api.github.com/repos/AdvancedClimateSystems/uModbus/issues/43","id":249555873,"user":{"login":"OrangeTux","id":1565144,"avatar_url":"https://avatars.githubusercontent.com/u/1565144?v=3","gravatar_id":"","url":"https://api.github.com/users/OrangeTux","html_url":"https://github.com/OrangeTux","followers_url":"https://api.github.com/users/OrangeTux/followers","following_url":"https://api.github.com/users/OrangeTux/following{/other_user}","gists_url":"https://api.github.com/users/OrangeTux/gists{/gist_id}","starred_url":"https://api.github.com/users/OrangeTux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrangeTux/subscriptions","organizations_url":"https://api.github.com/users/OrangeTux/orgs","repos_url":"https://api.github.com/users/OrangeTux/repos","events_url":"https://api.github.com/users/OrangeTux/events{/privacy}","received_events_url":"https://api.github.com/users/OrangeTux/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T12:27:43Z","updated_at":"2016-09-26T12:27:43Z","body":"@greg0pearce Thanks for reporting, clever finding! \r\n\r\nOn your profile I see that you're a new user. Although the solution is trivial, are you interested in fixing this bug yourself to take your first steps in open source development? \r\n\r\nIf so, fork the repository and checkout the develop branch. Write your fix. Push those commits on the develop branch of your fork and create a pull request on the develop branch of this project.\r\n\r\nIt's no problem when you don't want to fix it yourself. In that case i'll fix it."}}
{"actor":{"display_login":"OrangeTux"}}