{"action":"opened","issue":{"url":"https://api.github.com/repos/CosmicPi/cosmicpi-daq/issues/16","repository_url":"https://api.github.com/repos/CosmicPi/cosmicpi-daq","labels_url":"https://api.github.com/repos/CosmicPi/cosmicpi-daq/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/CosmicPi/cosmicpi-daq/issues/16/comments","events_url":"https://api.github.com/repos/CosmicPi/cosmicpi-daq/issues/16/events","html_url":"https://github.com/CosmicPi/cosmicpi-daq/issues/16","id":154765625,"number":16,"title":"Stop serial connection resetting the Arduino board","user":{"login":"quixoft","id":9697175,"avatar_url":"https://avatars.githubusercontent.com/u/9697175?v=3","gravatar_id":"","url":"https://api.github.com/users/quixoft","html_url":"https://github.com/quixoft","followers_url":"https://api.github.com/users/quixoft/followers","following_url":"https://api.github.com/users/quixoft/following{/other_user}","gists_url":"https://api.github.com/users/quixoft/gists{/gist_id}","starred_url":"https://api.github.com/users/quixoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quixoft/subscriptions","organizations_url":"https://api.github.com/users/quixoft/orgs","repos_url":"https://api.github.com/users/quixoft/repos","events_url":"https://api.github.com/users/quixoft/events{/privacy}","received_events_url":"https://api.github.com/users/quixoft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-13T17:46:28Z","updated_at":"2016-05-13T17:46:28Z","closed_at":null,"body":"The serial connect resets the Arduino causing the breakout boards to die.\r\nPlease edit the __init__ method of the keyboard file __init__ method as follows\r\n\r\nclass KeyBoard(object):\r\n    def __init__(self):\r\n        self.fd = sys.stdin.fileno()\r\n<Add this>\r\n        # Stop resetting the Arduino on serial connect, it kills the breakouts\r\n        self.newattr = termios.tcgetattr(self.fd)\r\n        self.newattr[3] = self.newattr[3] & ~termios.HUPCL\r\n        termios.tcsetattr(self.fd, termios.TCSANOW, self.newattr)\r\n</Add this>"}}