{"action":"created","issue":{"url":"https://api.github.com/repos/rwaldron/johnny-five/issues/1037","repository_url":"https://api.github.com/repos/rwaldron/johnny-five","labels_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/1037/labels{/name}","comments_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/1037/comments","events_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/1037/events","html_url":"https://github.com/rwaldron/johnny-five/issues/1037","id":134098588,"number":1037,"title":"Detect if board gets disconnected","user":{"login":"sofroniewn","id":6531703,"avatar_url":"https://avatars.githubusercontent.com/u/6531703?v=3","gravatar_id":"","url":"https://api.github.com/users/sofroniewn","html_url":"https://github.com/sofroniewn","followers_url":"https://api.github.com/users/sofroniewn/followers","following_url":"https://api.github.com/users/sofroniewn/following{/other_user}","gists_url":"https://api.github.com/users/sofroniewn/gists{/gist_id}","starred_url":"https://api.github.com/users/sofroniewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofroniewn/subscriptions","organizations_url":"https://api.github.com/users/sofroniewn/orgs","repos_url":"https://api.github.com/users/sofroniewn/repos","events_url":"https://api.github.com/users/sofroniewn/events{/privacy}","received_events_url":"https://api.github.com/users/sofroniewn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2016-02-16T21:14:46Z","updated_at":"2016-02-17T20:19:10Z","closed_at":null,"body":"Hi\r\nI was wondering if there is a way to detect if a board gets disconnected (i.e. the USB gets unplugged). I tried looking if there was a board fail event, but that does not appear to happen. I also thought about looking at whether there is a serial close event, but I am not sure if that is the right approach.\r\nAny help or advice would be much appreciated\r\nThanks\r\nNick"},"comment":{"url":"https://api.github.com/repos/rwaldron/johnny-five/issues/comments/185385884","html_url":"https://github.com/rwaldron/johnny-five/issues/1037#issuecomment-185385884","issue_url":"https://api.github.com/repos/rwaldron/johnny-five/issues/1037","id":185385884,"user":{"login":"sofroniewn","id":6531703,"avatar_url":"https://avatars.githubusercontent.com/u/6531703?v=3","gravatar_id":"","url":"https://api.github.com/users/sofroniewn","html_url":"https://github.com/sofroniewn","followers_url":"https://api.github.com/users/sofroniewn/followers","following_url":"https://api.github.com/users/sofroniewn/following{/other_user}","gists_url":"https://api.github.com/users/sofroniewn/gists{/gist_id}","starred_url":"https://api.github.com/users/sofroniewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofroniewn/subscriptions","organizations_url":"https://api.github.com/users/sofroniewn/orgs","repos_url":"https://api.github.com/users/sofroniewn/repos","events_url":"https://api.github.com/users/sofroniewn/events{/privacy}","received_events_url":"https://api.github.com/users/sofroniewn/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T20:19:10Z","updated_at":"2016-02-17T20:19:10Z","body":"Here is the output of running the following program https://gist.github.com/sofroniewn/511a40bc859c371e5c5b\r\nI unplug the USB after the \"Board ready\" message and nothing happens. I then press control C twice to quit normally\r\n\r\nsofroniewn-lm1:johnny-five-test sofroniewn$ node board-close.js\r\n1455740159684 Device(s) /dev/cu.usbmodem1411\r\n1455740159689 Connected /dev/cu.usbmodem1411\r\n1455740162347 Repl Initialized\r\n>> Board ready\r\n\r\n(^C again to quit)\r\n>>\r\n1455740173804 Board Closing.\r\n\r\n------------------------------------------------------------------------------------------------------------------------------"}}