{"action":"created","comment":{"url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/comments/55400147","id":55400147,"diff_hunk":"@@ -63,11 +63,25 @@ def findSerialPorts():\n         else:\n             portMask = '/dev/ttyUSB*'\n         serialports = [(s,BAUDRATE_GINA) for s in glob.glob(portMask)]\n+\n+    # An OpenWSN mote normally sends a lot of data with \\x7e as frame delimiter,\n+    # so this should find all active motes\n+    mote_ports = []\n+\n+    for port in serialports:\n+        for baudrate in [port[1], 500000]:\n+            with serial.Serial(port[0],baudrate,timeout=0.3) as probe_serial:\n+                probe_serial.setDTR(0)\n+                probe_serial.setRTS(0)\n+\n+                rxBytes = probe_serial.read(60)\n+                if len(rxBytes) == 60 and rxBytes.count('\\x7e') > 4:","path":"software/openvisualizer/openvisualizer/moteProbe/moteProbe.py","position":16,"original_position":16,"commit_id":"69a9d857d1cae8b7e5d9aae26d73a48487d771ef","original_commit_id":"69a9d857d1cae8b7e5d9aae26d73a48487d771ef","user":{"login":"changtengfei","id":2661560,"avatar_url":"https://avatars.githubusercontent.com/u/2661560?v=3","gravatar_id":"","url":"https://api.github.com/users/changtengfei","html_url":"https://github.com/changtengfei","followers_url":"https://api.github.com/users/changtengfei/followers","following_url":"https://api.github.com/users/changtengfei/following{/other_user}","gists_url":"https://api.github.com/users/changtengfei/gists{/gist_id}","starred_url":"https://api.github.com/users/changtengfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/changtengfei/subscriptions","organizations_url":"https://api.github.com/users/changtengfei/orgs","repos_url":"https://api.github.com/users/changtengfei/repos","events_url":"https://api.github.com/users/changtengfei/events{/privacy}","received_events_url":"https://api.github.com/users/changtengfei/received_events","type":"User","site_admin":false},"body":"Even there are packets sent, if the length of packet is very long, it may have no enough \\x7e in 60 bytes. Right?","created_at":"2016-03-08T18:07:34Z","updated_at":"2016-03-08T18:07:34Z","html_url":"https://github.com/openwsn-berkeley/openwsn-sw/pull/112#discussion_r55400147","pull_request_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112","_links":{"self":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/comments/55400147"},"html":{"href":"https://github.com/openwsn-berkeley/openwsn-sw/pull/112#discussion_r55400147"},"pull_request":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112"}}},"pull_request":{"url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112","id":62080656,"html_url":"https://github.com/openwsn-berkeley/openwsn-sw/pull/112","diff_url":"https://github.com/openwsn-berkeley/openwsn-sw/pull/112.diff","patch_url":"https://github.com/openwsn-berkeley/openwsn-sw/pull/112.patch","issue_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/issues/112","number":112,"state":"open","locked":false,"title":"SW-221. Discover baudrate of boards automatically","user":{"login":"koalo","id":537059,"avatar_url":"https://avatars.githubusercontent.com/u/537059?v=3","gravatar_id":"","url":"https://api.github.com/users/koalo","html_url":"https://github.com/koalo","followers_url":"https://api.github.com/users/koalo/followers","following_url":"https://api.github.com/users/koalo/following{/other_user}","gists_url":"https://api.github.com/users/koalo/gists{/gist_id}","starred_url":"https://api.github.com/users/koalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koalo/subscriptions","organizations_url":"https://api.github.com/users/koalo/orgs","repos_url":"https://api.github.com/users/koalo/repos","events_url":"https://api.github.com/users/koalo/events{/privacy}","received_events_url":"https://api.github.com/users/koalo/received_events","type":"User","site_admin":false},"body":"This patch assumes that an OpenWSN mote continously sends packets via the\r\nserial port. During the probe process, the frame delimiters received during\r\na short time span are counted for all ports and the two possible baudrates\r\n(115200 and 500000). All matching port/baudrate combinations are rated\r\nas connections to OpenWSN motes.","created_at":"2016-03-08T14:47:13Z","updated_at":"2016-03-08T18:07:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d15e5b9ec9100250a5f63a11278cd0ddbf6eb91","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112/commits","review_comments_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112/comments","review_comment_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/issues/112/comments","statuses_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/statuses/69a9d857d1cae8b7e5d9aae26d73a48487d771ef","head":{"label":"koalo:develop","ref":"develop","sha":"69a9d857d1cae8b7e5d9aae26d73a48487d771ef","user":{"login":"koalo","id":537059,"avatar_url":"https://avatars.githubusercontent.com/u/537059?v=3","gravatar_id":"","url":"https://api.github.com/users/koalo","html_url":"https://github.com/koalo","followers_url":"https://api.github.com/users/koalo/followers","following_url":"https://api.github.com/users/koalo/following{/other_user}","gists_url":"https://api.github.com/users/koalo/gists{/gist_id}","starred_url":"https://api.github.com/users/koalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koalo/subscriptions","organizations_url":"https://api.github.com/users/koalo/orgs","repos_url":"https://api.github.com/users/koalo/repos","events_url":"https://api.github.com/users/koalo/events{/privacy}","received_events_url":"https://api.github.com/users/koalo/received_events","type":"User","site_admin":false},"repo":{"id":53419800,"name":"openwsn-sw","full_name":"koalo/openwsn-sw","owner":{"login":"koalo","id":537059,"avatar_url":"https://avatars.githubusercontent.com/u/537059?v=3","gravatar_id":"","url":"https://api.github.com/users/koalo","html_url":"https://github.com/koalo","followers_url":"https://api.github.com/users/koalo/followers","following_url":"https://api.github.com/users/koalo/following{/other_user}","gists_url":"https://api.github.com/users/koalo/gists{/gist_id}","starred_url":"https://api.github.com/users/koalo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koalo/subscriptions","organizations_url":"https://api.github.com/users/koalo/orgs","repos_url":"https://api.github.com/users/koalo/repos","events_url":"https://api.github.com/users/koalo/events{/privacy}","received_events_url":"https://api.github.com/users/koalo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/koalo/openwsn-sw","description":"OpenWSN software: stuff that runs on a computer","fork":true,"url":"https://api.github.com/repos/koalo/openwsn-sw","forks_url":"https://api.github.com/repos/koalo/openwsn-sw/forks","keys_url":"https://api.github.com/repos/koalo/openwsn-sw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koalo/openwsn-sw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koalo/openwsn-sw/teams","hooks_url":"https://api.github.com/repos/koalo/openwsn-sw/hooks","issue_events_url":"https://api.github.com/repos/koalo/openwsn-sw/issues/events{/number}","events_url":"https://api.github.com/repos/koalo/openwsn-sw/events","assignees_url":"https://api.github.com/repos/koalo/openwsn-sw/assignees{/user}","branches_url":"https://api.github.com/repos/koalo/openwsn-sw/branches{/branch}","tags_url":"https://api.github.com/repos/koalo/openwsn-sw/tags","blobs_url":"https://api.github.com/repos/koalo/openwsn-sw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koalo/openwsn-sw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koalo/openwsn-sw/git/refs{/sha}","trees_url":"https://api.github.com/repos/koalo/openwsn-sw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koalo/openwsn-sw/statuses/{sha}","languages_url":"https://api.github.com/repos/koalo/openwsn-sw/languages","stargazers_url":"https://api.github.com/repos/koalo/openwsn-sw/stargazers","contributors_url":"https://api.github.com/repos/koalo/openwsn-sw/contributors","subscribers_url":"https://api.github.com/repos/koalo/openwsn-sw/subscribers","subscription_url":"https://api.github.com/repos/koalo/openwsn-sw/subscription","commits_url":"https://api.github.com/repos/koalo/openwsn-sw/commits{/sha}","git_commits_url":"https://api.github.com/repos/koalo/openwsn-sw/git/commits{/sha}","comments_url":"https://api.github.com/repos/koalo/openwsn-sw/comments{/number}","issue_comment_url":"https://api.github.com/repos/koalo/openwsn-sw/issues/comments{/number}","contents_url":"https://api.github.com/repos/koalo/openwsn-sw/contents/{+path}","compare_url":"https://api.github.com/repos/koalo/openwsn-sw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koalo/openwsn-sw/merges","archive_url":"https://api.github.com/repos/koalo/openwsn-sw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koalo/openwsn-sw/downloads","issues_url":"https://api.github.com/repos/koalo/openwsn-sw/issues{/number}","pulls_url":"https://api.github.com/repos/koalo/openwsn-sw/pulls{/number}","milestones_url":"https://api.github.com/repos/koalo/openwsn-sw/milestones{/number}","notifications_url":"https://api.github.com/repos/koalo/openwsn-sw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koalo/openwsn-sw/labels{/name}","releases_url":"https://api.github.com/repos/koalo/openwsn-sw/releases{/id}","deployments_url":"https://api.github.com/repos/koalo/openwsn-sw/deployments","created_at":"2016-03-08T14:45:22Z","updated_at":"2016-03-08T14:45:24Z","pushed_at":"2016-03-08T14:46:01Z","git_url":"git://github.com/koalo/openwsn-sw.git","ssh_url":"git@github.com:koalo/openwsn-sw.git","clone_url":"https://github.com/koalo/openwsn-sw.git","svn_url":"https://github.com/koalo/openwsn-sw","homepage":"http://www.openwsn.org/","size":10766,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"openwsn-berkeley:develop","ref":"develop","sha":"1594ad6dfde1b0567b28a70328e9d046c7025dcf","user":{"login":"openwsn-berkeley","id":2546411,"avatar_url":"https://avatars.githubusercontent.com/u/2546411?v=3","gravatar_id":"","url":"https://api.github.com/users/openwsn-berkeley","html_url":"https://github.com/openwsn-berkeley","followers_url":"https://api.github.com/users/openwsn-berkeley/followers","following_url":"https://api.github.com/users/openwsn-berkeley/following{/other_user}","gists_url":"https://api.github.com/users/openwsn-berkeley/gists{/gist_id}","starred_url":"https://api.github.com/users/openwsn-berkeley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwsn-berkeley/subscriptions","organizations_url":"https://api.github.com/users/openwsn-berkeley/orgs","repos_url":"https://api.github.com/users/openwsn-berkeley/repos","events_url":"https://api.github.com/users/openwsn-berkeley/events{/privacy}","received_events_url":"https://api.github.com/users/openwsn-berkeley/received_events","type":"Organization","site_admin":false},"repo":{"id":6267406,"name":"openwsn-sw","full_name":"openwsn-berkeley/openwsn-sw","owner":{"login":"openwsn-berkeley","id":2546411,"avatar_url":"https://avatars.githubusercontent.com/u/2546411?v=3","gravatar_id":"","url":"https://api.github.com/users/openwsn-berkeley","html_url":"https://github.com/openwsn-berkeley","followers_url":"https://api.github.com/users/openwsn-berkeley/followers","following_url":"https://api.github.com/users/openwsn-berkeley/following{/other_user}","gists_url":"https://api.github.com/users/openwsn-berkeley/gists{/gist_id}","starred_url":"https://api.github.com/users/openwsn-berkeley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwsn-berkeley/subscriptions","organizations_url":"https://api.github.com/users/openwsn-berkeley/orgs","repos_url":"https://api.github.com/users/openwsn-berkeley/repos","events_url":"https://api.github.com/users/openwsn-berkeley/events{/privacy}","received_events_url":"https://api.github.com/users/openwsn-berkeley/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openwsn-berkeley/openwsn-sw","description":"OpenWSN software: stuff that runs on a computer","fork":false,"url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw","forks_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/forks","keys_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/teams","hooks_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/hooks","issue_events_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/issues/events{/number}","events_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/events","assignees_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/assignees{/user}","branches_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/branches{/branch}","tags_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/tags","blobs_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/git/refs{/sha}","trees_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/statuses/{sha}","languages_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/languages","stargazers_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/stargazers","contributors_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/contributors","subscribers_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/subscribers","subscription_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/subscription","commits_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/commits{/sha}","git_commits_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/git/commits{/sha}","comments_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/comments{/number}","issue_comment_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/issues/comments{/number}","contents_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/contents/{+path}","compare_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/merges","archive_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/downloads","issues_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/issues{/number}","pulls_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls{/number}","milestones_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/milestones{/number}","notifications_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/labels{/name}","releases_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/releases{/id}","deployments_url":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/deployments","created_at":"2012-10-17T19:36:59Z","updated_at":"2016-02-21T23:49:15Z","pushed_at":"2016-03-08T14:47:13Z","git_url":"git://github.com/openwsn-berkeley/openwsn-sw.git","ssh_url":"git@github.com:openwsn-berkeley/openwsn-sw.git","clone_url":"https://github.com/openwsn-berkeley/openwsn-sw.git","svn_url":"https://github.com/openwsn-berkeley/openwsn-sw","homepage":"http://www.openwsn.org/","size":22746,"stargazers_count":18,"watchers_count":18,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":60,"mirror_url":null,"open_issues_count":4,"forks":60,"open_issues":4,"watchers":18,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112"},"html":{"href":"https://github.com/openwsn-berkeley/openwsn-sw/pull/112"},"issue":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/issues/112"},"comments":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/openwsn-berkeley/openwsn-sw/statuses/69a9d857d1cae8b7e5d9aae26d73a48487d771ef"}}}}