{"action":"created","issue":{"url":"https://api.github.com/repos/danielolson13/wink-mqtt/issues/9","repository_url":"https://api.github.com/repos/danielolson13/wink-mqtt","labels_url":"https://api.github.com/repos/danielolson13/wink-mqtt/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/danielolson13/wink-mqtt/issues/9/comments","events_url":"https://api.github.com/repos/danielolson13/wink-mqtt/issues/9/events","html_url":"https://github.com/danielolson13/wink-mqtt/issues/9","id":168904597,"number":9,"title":"wink-mqtt.js will not run - Aborted","user":{"login":"bazhip","id":10350445,"avatar_url":"https://avatars.githubusercontent.com/u/10350445?v=3","gravatar_id":"","url":"https://api.github.com/users/bazhip","html_url":"https://github.com/bazhip","followers_url":"https://api.github.com/users/bazhip/followers","following_url":"https://api.github.com/users/bazhip/following{/other_user}","gists_url":"https://api.github.com/users/bazhip/gists{/gist_id}","starred_url":"https://api.github.com/users/bazhip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazhip/subscriptions","organizations_url":"https://api.github.com/users/bazhip/orgs","repos_url":"https://api.github.com/users/bazhip/repos","events_url":"https://api.github.com/users/bazhip/events{/privacy}","received_events_url":"https://api.github.com/users/bazhip/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-02T14:47:52Z","updated_at":"2016-08-02T16:21:38Z","closed_at":null,"body":"So I ran npm install, copied all the files over, and modified the init. I noticed it wasn't running after the reboot so I manually started it with the script. Still wasn't running after that. I manually started it with \"node wink-mqtt.js\" while I was in the directory and it said 'Aborted' and quit out. I threw some console prints in there and it's executing them. I have zero experience with Node unfortunately, so I can't do much debugging. Any ideas?"},"comment":{"url":"https://api.github.com/repos/danielolson13/wink-mqtt/issues/comments/236958504","html_url":"https://github.com/danielolson13/wink-mqtt/issues/9#issuecomment-236958504","issue_url":"https://api.github.com/repos/danielolson13/wink-mqtt/issues/9","id":236958504,"user":{"login":"bazhip","id":10350445,"avatar_url":"https://avatars.githubusercontent.com/u/10350445?v=3","gravatar_id":"","url":"https://api.github.com/users/bazhip","html_url":"https://github.com/bazhip","followers_url":"https://api.github.com/users/bazhip/followers","following_url":"https://api.github.com/users/bazhip/following{/other_user}","gists_url":"https://api.github.com/users/bazhip/gists{/gist_id}","starred_url":"https://api.github.com/users/bazhip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazhip/subscriptions","organizations_url":"https://api.github.com/users/bazhip/orgs","repos_url":"https://api.github.com/users/bazhip/repos","events_url":"https://api.github.com/users/bazhip/events{/privacy}","received_events_url":"https://api.github.com/users/bazhip/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T16:21:37Z","updated_at":"2016-08-02T16:21:37Z","body":"Okay, so I'm an idiot partially. Turns out it is running (doh) and trying to spawn it again gave the \"Aborted\".  I didn't see it in 'top' so I thought it wasn't. Double checked with ps and there it is. \r\n\r\nI was rather brief in my initial post. What lead me to not thinking it was running and trying to start it again was that no messages are getting published on state changes. I had this up and running nicely on 2.49, but long story short I wasn't using it for quite some time, I upgraded and reinstalled today to get it going again.\r\n\r\nI've done some more digging and here is what I found:\r\n\r\nOn the initial boot, it is publishing out the initial states (although uncorrectly. Some things that are off are publishing as on, and some that are on are publishing as off)\r\n\r\nYour program is correctly tailing the log file and checking the database when it reads there is a state change. What's interesting though is that it is not getting the correct results back from the query (I believe). I uncommented the console.log where it prints out the values from the query, and they are all the same as the initial publish. Since they are always the same, it is never publishing out the values.\r\n\r\nWhen I publish TO it ( `mosquitto_pub -t 'home/4/1/set' -m 'ON' `) it fires everything off and the database query comes back as:\r\n\r\nrunApron() -u,-m,4,-t,1,-v,ON\r\nPUBLISHING: home/4/1v: ON\r\nPublish status home 4 1\r\nstate change\r\ncheckdb()\r\nhome/4/1:ON:OFF\r\ndifferent#############################################\r\nPUBLISHING: home/4/1v: OFF\r\nhome/4/2:254:254\r\nhome/5/1:OFF:OFF\r\nhome/5/2:254:254\r\n\r\n(I added some extra debugging)\r\n\r\nThen when I turn a DIFFERENT light off, it goes back to OFF\r\nstate change\r\ncheckdb()\r\nhome/4/1:OFF:OFF\r\nhome/4/2:254:254\r\nhome/5/1:OFF:OFF\r\nhome/5/2:254:254\r\n\r\nSo the status is only changing when I push an update to it through MQTT, and it is only like that temporarily. It never changes the values when I do it through the app.\r\n\r\nI wonder if something changed in the database? Maybe it's just something with my hub? It is reading correctly in the wink app though."}}
{"actor":{"display_login":"bazhip"}}