{"action":"created","issue":{"url":"https://api.github.com/repos/OpenZWave/open-zwave/issues/441","repository_url":"https://api.github.com/repos/OpenZWave/open-zwave","labels_url":"https://api.github.com/repos/OpenZWave/open-zwave/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/OpenZWave/open-zwave/issues/441/comments","events_url":"https://api.github.com/repos/OpenZWave/open-zwave/issues/441/events","html_url":"https://github.com/OpenZWave/open-zwave/issues/441","id":61537839,"number":441,"title":"Sleeping Devices never get a NoMoreInfo packet if they are in any QueryStage other than QueryStage_Complete","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenZWave/open-zwave/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/OpenZWave/open-zwave/labels/GoogleCode-Issue","name":"GoogleCode-Issue","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"Fishwaldo","id":842308,"avatar_url":"https://avatars.githubusercontent.com/u/842308?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishwaldo","html_url":"https://github.com/Fishwaldo","followers_url":"https://api.github.com/users/Fishwaldo/followers","following_url":"https://api.github.com/users/Fishwaldo/following{/other_user}","gists_url":"https://api.github.com/users/Fishwaldo/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishwaldo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishwaldo/subscriptions","organizations_url":"https://api.github.com/users/Fishwaldo/orgs","repos_url":"https://api.github.com/users/Fishwaldo/repos","events_url":"https://api.github.com/users/Fishwaldo/events{/privacy}","received_events_url":"https://api.github.com/users/Fishwaldo/received_events","type":"User","site_admin":false},"assignees":[{"login":"Fishwaldo","id":842308,"avatar_url":"https://avatars.githubusercontent.com/u/842308?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishwaldo","html_url":"https://github.com/Fishwaldo","followers_url":"https://api.github.com/users/Fishwaldo/followers","following_url":"https://api.github.com/users/Fishwaldo/following{/other_user}","gists_url":"https://api.github.com/users/Fishwaldo/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishwaldo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishwaldo/subscriptions","organizations_url":"https://api.github.com/users/Fishwaldo/orgs","repos_url":"https://api.github.com/users/Fishwaldo/repos","events_url":"https://api.github.com/users/Fishwaldo/events{/privacy}","received_events_url":"https://api.github.com/users/Fishwaldo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2015-03-14T09:59:35Z","updated_at":"2016-07-07T19:31:30Z","closed_at":null,"body":"```\nOk... \nLooking at this, I think its not related to 955 (phew!)\n\nThe problem is that when we get that first Awake message during the QueryStage \n- (5b below) we never come back to the Wakeup CC when we reach a \nQueryStage_Complete. \n\nMost Devices should sleep on the timer but maybe the BeNext is different :)\n\nThe challenge is that if we do a test when getting to QueryStage_Complete to \nsee if we should send a NoMoreInfo packet - if the device has gone to sleep by \nthen, the NoMoreInfo packet will be put on the Wakeup Queue, and when the \ndevice wakes up next time and sends a I'm awake - the first message sent back \nto it is a NoMoreInfo (regardless of whats in the Queue behind it).\n\nI need to think about the best way to handle this. We could do a test in \nDriver::MoveMessagesToWakeUpQueue to see if any messages are a NoMoreInfo, and \ndrop them entirely (instead of Queuing them, but thats a bit of a hack). \n\nI'm going to log these as a bug report :)\n\nOn Wed, 2015-01-21 at 17:24 +0100, Alexie wrote:\nHi Justin,\n> \n> \n> Attached is the logging (revision 995), all my nodes are disconnected/removed \nbatteries except this Node017.\n> \n> \n> I notice the following in the logging during the FIRST wake-up:\n> 2015-01-21 17:00:43.343 Info, Node017,   Received: 0x01, 0x08, 0x00, 0x04, \n0x00, 0x11, 0x02, 0x84, 0x07, 0x63\n> \n> 2015-01-21 17:00:43.343 Alert, Node017, Received Wakeup Notification from \nnode 17\n> \n> 2015-01-21 17:00:43.343 Alert, Node017,   Node 17 has been marked as awake\n> \n> 2015-01-21 17:00:43.343 Info, Node017, Queuing (Query) Query Stage Complete \n(Probe)\n> \n> ...\n> 2015-01-21 17:00:44.271 Info, Node017,   Received: 0x01, 0x09, 0x00, 0x04, \n0x00, 0x11, 0x03, 0x80, 0x03, 0x60, 0x03\n> \n> 2015-01-21 17:00:44.273 Alert, Node017, Received Battery report from node 17: \nlevel=96\n> \n> 2015-01-21 17:00:44.274 Info, Node017, Refreshed Value: old value=96, new \nvalue=96, type=uint8\n> \n> 2015-01-21 17:00:44.274 Info, Node017, Changes to this value are not verified\n> \n> 2015-01-21 17:00:44.284 Info, Node017, Query Stage Complete (Dynamic)\n> \n> 2015-01-21 17:00:44.285 Info, Node017, AdvanceQueries queryPending=0 \nqueryRetries=0 queryStage=Configuration live=1\n> \n> 2015-01-21 17:00:44.286 Info, Node017, QueryStage_Configuration\n> \n> 2015-01-21 17:00:44.286 Info, Node017, QueryStage_Complete\n> \n> \n> So it is marked as \"Alive\", but it isn't marked as asleep anymore.\n> \n> \n> \n> With the SECOND wake-up it seems to be aware it should go to sleep, but NO \nawake message:\n> \n> 2015-01-21 17:01:31.829 Info, Node017,   Received: 0x01, 0x10, 0x00, 0x04, \n0x00, 0x11, 0x0a, 0x71, 0x05, 0x00, 0x00, 0x00, 0xff, 0x06, 0x06, 0x01, 0x01, \n0x7b\n> \n> 2015-01-21 17:01:31.829 Alert, Node017, Received Alarm report: type=0, level=0\n> \n> 2015-01-21 17:01:31.829 Info, Node017, Initial read of value\n> \n> 2015-01-21 17:01:31.829 Info, Node017, Initial read of value\n> \n> 2015-01-21 17:01:31.841 Info, Node017,   Received: 0x01, 0x08, 0x00, 0x04, \n0x00, 0x11, 0x02, 0x84, 0x07, 0x63\n> \n> 2015-01-21 17:01:31.843 Alert, Node017, Received Wakeup Notification from \nnode 17\n> \n> 2015-01-21 17:01:31.843 Info, Node017, Queuing (WakeUp) \nWakeUpCmd_NoMoreInformation (Node=17): 0x01, 0x09, 0x00, 0x13, 0x11, 0x02, \n0x84, 0x08, 0x25, 0x24, 0x7b\n> \n> 2015-01-21 17:01:31.844 Alert, Node017, Sending (WakeUp) message (Callback \nID=0x24, Expected Reply=0x13) - WakeUpCmd_NoMoreInformation (Node=17): 0x01, \n0x09, 0x00, 0x13, 0x11, 0x02, 0x84, 0x08, 0x25, 0x24, 0x7b\n> \n> 2015-01-21 17:01:31.851 Info, Node017,   Received: 0x01, 0x04, 0x01, 0x13, \n0x01, 0xe8\n> \n> 2015-01-21 17:01:31.852 Info, Node017,   ZW_SEND_DATA delivered to Z-Wave \nstack\n> \n> 2015-01-21 17:01:31.872 Info, Node017,   Received: 0x01, 0x05, 0x00, 0x13, \n0x24, 0x00, 0xcd\n> \n> 2015-01-21 17:01:31.872 Info, Node017,   ZW_SEND_DATA Request with callback \nID 0x24 received (expected 0x24)\n> \n> 2015-01-21 17:01:31.873 Alert, Node017, Request RTT 28 Average Request RTT 55\n> \n> 2015-01-21 17:01:31.873 Alert, Node017,   Node 17 has been marked as asleep\n> \n> 2015-01-21 17:01:31.873 Info, Node017,   Expected reply was received\n> \n> 2015-01-21 17:01:31.874 Info, Node017,   Message transaction complete\n> \n> 2015-01-21 17:01:31.875 Info, Node017, Removing current message\n> \n> \n> \n> \n> With the third and following, i can see awake -> asleep messages ...\n> \n> \n> Also - the configuration is *NEVER* requested during the moment when the node \nis first discovered. According to the code in the Node.cpp, this should happen \nwhen it first added (not when the device is in the zwcfg*xml). Only that piece \nof code is never used?! The routine is the \"void Node::SetQueryStage\".\n> \n> \n> Regards,\n> Alex\n> \n> 2015-01-21 16:43 GMT+01:00 Alexie <ualex73@gmail.com>:\n> Hi Justin,\n>         \n>         \n>         Thanks for the help already. I am going to test it soon, i will do an \nanalysis first again and will forward you the logfile.\n>         \n>         \n>         Regards,\n>         Alex\n>         \n>         2015-01-21 16:22 GMT+01:00 Justin Hammond <justin@dynam.ac>:\n>         Hi,\n>                 can you send a Log? I've tested here and it seems to work \ncorrectly.\n>                 \n>                 The way it works is pretty straight forward:\n>                 \n>                 1) Sleeping Devices - Try to send a message, it times out, \nmove all\n>                 messages for that node to the Wakeup Queue in the WakeupCC. \nset m_awake\n>                 and log a message \"Node %d has been marked as asleep\" [1]\n>                 2) Device sends a \"I'm awake message\"\n>                 3) Wakeup Class checks m_awake and then calls SendPending()\n>                 4) Send Pending checks the Queue for any messages and sends \nthem out\n>                 5) Then Checks if the Device is QueryStage_Complete.\n>                         5a - If it is Then sends the NoMoreInfo message to \nput the device to\n>                 sleep\n>                         5b - if its not, it doesnt send to allow other CC's \nto send messages\n>                 not queued up yet.\n>                 \n>                 If you not getting a NoMoreInfo message:\n>                 1) Check AssumeAwake in the Options.xml. Should be true.\n>                 2) the node is not QueryStage_Complete, but the device has \ngone back to\n>                 sleep by itself, so additional messages will get queued.\n>                 \n>                 There is a timer on each device, if we don't send a \nNoMoreInfo its meant\n>                 to go back to sleep by itself (Aeon Labs MultiSensor has a \nreally\n>                 aggressive timer - it sleeps even if there are messages \ncoming back in!)\n>                 \n>                 I'd really need to see a log to see whats going on. ideally a \nwhole\n>                 lifecycle - startup - Querystages - False sleeps etc till the \nnode goes\n>                 QueryStage_Complete.\n>                 \n>                 \n>                 \n>                 On Tue, 2015-01-20 at 20:52 +0100, Alexie wrote:\n>                 > Hi Justin,\n>                 >\n>                 >\n>                 > I was testing a little bit with my battery powered devices.\n>                 >\n>                 >\n>                 > I noticed the following behaviour, and i am not sure if it \nas\n>                 > expected:\n>                 > - Removed zwcfg*xml\n>                 > - Start open-zwave\n>                 > - Let it run until i get the all node queued notification\n>                 > - Wake-up my battery powered device, it does partially ... \nI am also\n>                 > missing the configuration get?\n>                 > - NO \"WakeUpCmd_NoMoreInformation\" queued/send, so the \nbattery will\n>                 > show \"Awake\" until the device wakes up again. Then this cmd \nis send\n>                 >\n>                 >\n>                 > If i remember correctly, the library always send the \nbattery powered\n>                 > devices into sleep mode with NoMoreInformation? This seems \nto cause\n>                 > battery drain in one of my devices.\n>                 >\n>                 >\n>                 > Regards,\n>                 > Alex\n>                 \n>                 \n>                 \n>                 \n>         \n>         \n> \n> \n\n```\n\nOriginal issue reported on code.google.com by `jus...@dynam.ac` on 21 Jan 2015 at 5:58"},"comment":{"url":"https://api.github.com/repos/OpenZWave/open-zwave/issues/comments/231182927","html_url":"https://github.com/OpenZWave/open-zwave/issues/441#issuecomment-231182927","issue_url":"https://api.github.com/repos/OpenZWave/open-zwave/issues/441","id":231182927,"user":{"login":"nechry","id":307966,"avatar_url":"https://avatars.githubusercontent.com/u/307966?v=3","gravatar_id":"","url":"https://api.github.com/users/nechry","html_url":"https://github.com/nechry","followers_url":"https://api.github.com/users/nechry/followers","following_url":"https://api.github.com/users/nechry/following{/other_user}","gists_url":"https://api.github.com/users/nechry/gists{/gist_id}","starred_url":"https://api.github.com/users/nechry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nechry/subscriptions","organizations_url":"https://api.github.com/users/nechry/orgs","repos_url":"https://api.github.com/users/nechry/repos","events_url":"https://api.github.com/users/nechry/events{/privacy}","received_events_url":"https://api.github.com/users/nechry/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T19:31:30Z","updated_at":"2016-07-07T19:31:30Z","body":"I got success also with the ZS6301 CO Detector on a second zwave server"}}
{"actor":{"display_login":"nechry"}}