{"action":"created","issue":{"url":"https://api.github.com/repos/nfarina/homebridge/issues/441","repository_url":"https://api.github.com/repos/nfarina/homebridge","labels_url":"https://api.github.com/repos/nfarina/homebridge/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/nfarina/homebridge/issues/441/comments","events_url":"https://api.github.com/repos/nfarina/homebridge/issues/441/events","html_url":"https://github.com/nfarina/homebridge/issues/441","id":123987450,"number":441,"title":"Valid config.json won't parse in homebridge","user":{"login":"fahrvergnuugen","id":4663918,"avatar_url":"https://avatars.githubusercontent.com/u/4663918?v=3","gravatar_id":"","url":"https://api.github.com/users/fahrvergnuugen","html_url":"https://github.com/fahrvergnuugen","followers_url":"https://api.github.com/users/fahrvergnuugen/followers","following_url":"https://api.github.com/users/fahrvergnuugen/following{/other_user}","gists_url":"https://api.github.com/users/fahrvergnuugen/gists{/gist_id}","starred_url":"https://api.github.com/users/fahrvergnuugen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fahrvergnuugen/subscriptions","organizations_url":"https://api.github.com/users/fahrvergnuugen/orgs","repos_url":"https://api.github.com/users/fahrvergnuugen/repos","events_url":"https://api.github.com/users/fahrvergnuugen/events{/privacy}","received_events_url":"https://api.github.com/users/fahrvergnuugen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2015-12-27T16:59:07Z","updated_at":"2016-03-11T23:06:56Z","closed_at":null,"body":"I am trying to pass RS232 control characters into my homebridge plugin from the config.json file, but homebridge fails to load:\r\n\r\n```\r\nThere was a problem reading your config.json file.\r\nPlease try pasting your config.json file here to validate it: http://jsonlint.com\r\n\r\n/usr/local/lib/node_modules/homebridge/lib/server.js:124\r\n    throw err;\r\n    ^\r\n\r\nSyntaxError: Unexpected token x\r\n    at Object.parse (native)\r\n    at Server._loadConfig (/usr/local/lib/node_modules/homebridge/lib/server.js:118:19)\r\n    at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:25:23)\r\n    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:23:3)\r\n    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)\r\n    at Module._compile (module.js:399:26)\r\n    at Object.Module._extensions..js (module.js:406:10)\r\n    at Module.load (module.js:345:32)\r\n    at Function.Module._load (module.js:302:12)\r\n    at Function.Module.runMain (module.js:431:10)\r\n```\r\n\r\nTo reproduce this issue, use this example config.json. The \"test\" property which contains the \\x02 \\x03 control characters causes the error:\r\n\r\n```\r\n{\r\n    \"bridge\": {\r\n        \"name\": \"Homebridge\",\r\n        \"username\": \"CC:22:3D:E3:CE:30\",\r\n        \"port\": 51826,\r\n        \"pin\": \"031-45-154\",\r\n        \"test\": \"\\x02PON\\x03\"\r\n    },\r\n    \r\n    \"description\": \"This is an example configuration file that will cause homebridge to throw an error even though the json validates.\",\r\n\r\n    \"accessories\": [\r\n    ],\r\n\r\n    \"platforms\": [\r\n   ]\r\n\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/nfarina/homebridge/issues/comments/195596683","html_url":"https://github.com/nfarina/homebridge/issues/441#issuecomment-195596683","issue_url":"https://api.github.com/repos/nfarina/homebridge/issues/441","id":195596683,"user":{"login":"mightythias","id":17790027,"avatar_url":"https://avatars.githubusercontent.com/u/17790027?v=3","gravatar_id":"","url":"https://api.github.com/users/mightythias","html_url":"https://github.com/mightythias","followers_url":"https://api.github.com/users/mightythias/followers","following_url":"https://api.github.com/users/mightythias/following{/other_user}","gists_url":"https://api.github.com/users/mightythias/gists{/gist_id}","starred_url":"https://api.github.com/users/mightythias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mightythias/subscriptions","organizations_url":"https://api.github.com/users/mightythias/orgs","repos_url":"https://api.github.com/users/mightythias/repos","events_url":"https://api.github.com/users/mightythias/events{/privacy}","received_events_url":"https://api.github.com/users/mightythias/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T23:06:56Z","updated_at":"2016-03-11T23:06:56Z","body":"Hello I am also having this issue.\r\n\r\nI had homebrigde working perfectly but when i tried to add smarthings it doesn't want to load anymore. I installed the smartthings plugin modified my config.json file but when i start it up i get the bellow error.\r\n\r\nLoaded plugin: homebridge-harmonyhub\r\n[3/11/2016, 3:03:42 PM] Registering platform 'homebridge-harmonyhub.HarmonyHub'\r\n[3/11/2016, 3:03:42 PM] ---\r\n[3/11/2016, 3:03:42 PM] Loaded plugin: homebridge-smartthings\r\n[3/11/2016, 3:03:42 PM] Registering platform 'homebridge-smartthings.SmartThings'\r\n[3/11/2016, 3:03:42 PM] ---\r\n[3/11/2016, 3:03:42 PM] There was a problem reading your config.json file.\r\n[3/11/2016, 3:03:42 PM] Please try pasting your config.json file here to validate it: http://jsonlint.com\r\n[3/11/2016, 3:03:42 PM] \r\n/usr/local/lib/node_modules/homebridge/lib/server.js:176\r\n    throw err;\r\n    ^\r\n\r\nSyntaxError: Unexpected token  \r\n    at Object.parse (native)\r\n    at Server._loadConfig (/usr/local/lib/node_modules/homebridge/lib/server.js:170:19)\r\n    at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:44:23)\r\n    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:26:16)\r\n    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)\r\n    at Module._compile (module.js:409:26)\r\n    at Object.Module._extensions..js (module.js:416:10)\r\n    at Module.load (module.js:343:32)\r\n    at Function.Module._load (module.js:300:12)\r\n    at Function.Module.runMain (module.js:441:10)\r\n\r\nconfig.json:\r\n\r\n{\r\n\t\"bridge\": {\r\n\t\t\"name\": \"Homebridge\",\r\n\t\t\"username\": \"CC:22:3D:E3:CE:30\",\r\n\t\t\"port\": 51826,\r\n\t\t\"pin\": \"987-65-432\"\r\n\t},\r\n\r\n\t\"platforms\": [{\r\n\t\t\t\"platform\": \"HarmonyHub\",\r\n\t\t\t\"name\": \"MyHub\"\r\n\t\t},\r\n{\r\n            \"platform\": \"SmartThings\",\r\n            \"name\": \"SmartThings\",\r\n            \"app_url\": \"https://graph.api.smartthings.com:443/api/smartapps/installations/\",\r\n            \"app_id\": \"37b335e5-5d16-4ba7-b9d4-0c481c63f206\",\r\n            \"access_token\": \"9dff3176-4047-4927-94a4-26b4d73036c2\"\r\n        }\r\n\t]\r\n}\r\n\r\nAny help would be appreciated."}}