{"action":"created","issue":{"url":"https://api.github.com/repos/toblum/McLighting/issues/244","repository_url":"https://api.github.com/repos/toblum/McLighting","labels_url":"https://api.github.com/repos/toblum/McLighting/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/toblum/McLighting/issues/244/comments","events_url":"https://api.github.com/repos/toblum/McLighting/issues/244/events","html_url":"https://github.com/toblum/McLighting/issues/244","id":368879655,"node_id":"MDU6SXNzdWUzNjg4Nzk2NTU=","number":244,"title":"esp8266 crashes when sending ha json","user":{"login":"ryansabin","id":44041095,"node_id":"MDQ6VXNlcjQ0MDQxMDk1","avatar_url":"https://avatars3.githubusercontent.com/u/44041095?v=4","gravatar_id":"","url":"https://api.github.com/users/ryansabin","html_url":"https://github.com/ryansabin","followers_url":"https://api.github.com/users/ryansabin/followers","following_url":"https://api.github.com/users/ryansabin/following{/other_user}","gists_url":"https://api.github.com/users/ryansabin/gists{/gist_id}","starred_url":"https://api.github.com/users/ryansabin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryansabin/subscriptions","organizations_url":"https://api.github.com/users/ryansabin/orgs","repos_url":"https://api.github.com/users/ryansabin/repos","events_url":"https://api.github.com/users/ryansabin/events{/privacy}","received_events_url":"https://api.github.com/users/ryansabin/received_events","type":"User","site_admin":false},"labels":[{"id":890329566,"node_id":"MDU6TGFiZWw4OTAzMjk1NjY=","url":"https://api.github.com/repos/toblum/McLighting/labels/Home%20Assistant","name":"Home Assistant","color":"91eae3","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-10-10T22:24:35Z","updated_at":"2018-10-14T17:45:05Z","closed_at":null,"author_association":"NONE","body":"I have mosquitto running as my mqtt server. I am trying to send a json command to set the light string. It looks like the esp8266 crashes when I send it. Not sure what the issue is. I can send commands individually to mylight01/in and they work fine. It is just when I try to send the json command.\r\n\r\nhome/mylight01_ha/state/in\r\n{\"state\":\"ON\",\"color\":{\"r\":50,\"g\":226,\"b\":34},\"brightness\":255,\"color_temp\":327,\"speed\":179,\"effect\":\"Static\"}"},"comment":{"url":"https://api.github.com/repos/toblum/McLighting/issues/comments/429646471","html_url":"https://github.com/toblum/McLighting/issues/244#issuecomment-429646471","issue_url":"https://api.github.com/repos/toblum/McLighting/issues/244","id":429646471,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTY0NjQ3MQ==","user":{"login":"ryansabin","id":44041095,"node_id":"MDQ6VXNlcjQ0MDQxMDk1","avatar_url":"https://avatars3.githubusercontent.com/u/44041095?v=4","gravatar_id":"","url":"https://api.github.com/users/ryansabin","html_url":"https://github.com/ryansabin","followers_url":"https://api.github.com/users/ryansabin/followers","following_url":"https://api.github.com/users/ryansabin/following{/other_user}","gists_url":"https://api.github.com/users/ryansabin/gists{/gist_id}","starred_url":"https://api.github.com/users/ryansabin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryansabin/subscriptions","organizations_url":"https://api.github.com/users/ryansabin/orgs","repos_url":"https://api.github.com/users/ryansabin/repos","events_url":"https://api.github.com/users/ryansabin/events{/privacy}","received_events_url":"https://api.github.com/users/ryansabin/received_events","type":"User","site_admin":false},"created_at":"2018-10-14T17:45:05Z","updated_at":"2018-10-14T17:45:05Z","author_association":"NONE","body":"Also, in the Wiki for mclightning on the HA page it shows the \"in\" topic\ncontaining six objects including the \"state\".\nhttps://github.com/toblum/McLighting/wiki/Homeassistant-integration\n\nThe in-topic consumes JSON formatted data with the following structure:\n\n{\n\t\"brightness\": 196,\n\t\"color\": {\n\t\t\"r\": 255,\n\t\t\"g\": 100,\n\t\t\"b\": 10\n\t},\n\t\"speed\": 194,\n\t\"color_temp\": 24,\n\t\"effect\": \"Rainbow\",\n\t\"state\": \"ON\"\n}\n\n\nOn Sun, Oct 14, 2018 at 10:31 AM Ryan Sabin <ryansabin@gmail.com> wrote:\n\n> I made this change. It still crashes when sending message.I even tried\n> sending the message on individually and it crashes when receiving just that\n> message. It also crashes when receiving the other commands minus the ON\n> command. Not sure what the next steps are. Let me know. Thanks!\n>\n> On Thu, Oct 11, 2018 at 6:28 AM Debashish Sahu <notifications@github.com>\n> wrote:\n>\n>> Could you change const size_t bufferSize = JSON_OBJECT_SIZE(3) +\n>> JSON_OBJECT_SIZE(5) + 150; to const size_t bufferSize =\n>> JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(6) + 150; in processJson function\n>> in *request_handlers.h* file and see if this crash happens? It looks\n>> like you are trying to send HA commands manually. HA sends {\"state\":\"ON\"}\n>> seperate from other info, that is why object size is 5. If you are manually\n>> sending such data you need such modification.\n>>\n>> —\n>> You are receiving this because you authored the thread.\n>> Reply to this email directly, view it on GitHub\n>> <https://github.com/toblum/McLighting/issues/244#issuecomment-428955208>,\n>> or mute the thread\n>> <https://github.com/notifications/unsubscribe-auth/AqADh1p4FyqaGwdOlupnVvgXKXVz9acDks5uj0eIgaJpZM4XWcg3>\n>> .\n>>\n>\n"}}
{"actor":{"display_login":"ryansabin"}}