Not working story. My own medicine reminder app. Sometimes it works, sometimes it doesn't

This is my own little log of how my customized medicine reminder app fails to work from time to time. Join me in wallowing in the disappointment!? I plan to update it every time I notice a fail. Maybe it will be a good way to vent frustration.

So this app has been untouched coding and settings wise for a long time. Worked fine yesterday, alerted us to a missed movement of the medicine box. Tonight. Failure. The medicine reminder app just didn’t do anything. Here is the log from the IDE of the device events.

Date Source Type Name Value User Displayed Text 2015-12-29 8:34:17.243 PM CST moments ago DEVICE acceleration inactive Medicine Box was inactive 2015-12-29 8:34:02.595 PM CST moments ago DEVICE acceleration active Medicine Box was active 2015-12-29 8:09:51.074 PM CST 26 minutes ago DEVICE temperature 69 Medicine Box was 69°F 2015-12-29 8:07:21.423 PM CST 29 minutes ago DEVICE temperature 71 Medicine Box was 71°F 2015-12-29 7:09:37.817 PM CST 1 hour ago DEVICE temperature 69 Medicine Box was 69°F 2015-12-29 7:07:08.222 PM CST 1 hour ago DEVICE temperature 70 Medicine Box was 70°F 2015-12-29 6:42:09.911 PM CST 2 hours ago DEVICE temperature 69 Medicine Box was 69°F 2015-12-29 6:37:10.474 PM CST 2 hours ago DEVICE acceleration inactive Medicine Box was inactive 2015-12-29 6:36:58.745 PM CST 2 hours ago DEVICE acceleration active Medicine Box was active

At 8:30CST we should of got a reminder because the app is scheduled to look for active 45 minutes either side of 19:45, which would mean movement between 19:00 and 20:30. Instead, nothing.

None of my routines worked this evening. Only one of my motion sensors is functioning as expected.

Go figure.

And another complete fail on this again tonight. Clearly did not move in the designated window, no alert.

Apparently the app ran, though. Maybe?

Scheduled Jobs Handler Next Run Time Prev Run Time Status Schedule scheduleCheck0 2016-01-01 8:30:00 AM CST 2015-12-31 8:30:00 AM CST WAITING Daily scheduleCheck1 2016-01-01 8:30:00 PM CST 2015-12-31 8:30:00 PM CST WAITING Daily

2015-12-31 8:45:24.493 PM CST 3 hours ago DEVICE acceleration inactive Medicine Box was inactive 2015-12-31 8:45:01.085 PM CST 3 hours ago DEVICE acceleration active Medicine Box was active 2015-12-31 8:25:16.401 PM CST 3 hours ago DEVICE temperature 67 Medicine Box was 67°F 2015-12-31 8:22:46.719 PM CST 3 hours ago DEVICE temperature 68 Medicine Box was 68°F 2015-12-31 7:24:16.101 PM CST 4 hours ago DEVICE temperature 67 Medicine Box was 67°F 2015-12-31 7:21:46.388 PM CST 4 hours ago DEVICE temperature 68 Medicine Box was 68°F 2015-12-31 6:23:16.232 PM CST 5 hours ago DEVICE temperature 67 Medicine Box was 67°F 2015-12-31 6:20:46.552 PM CST 5 hours ago DEVICE temperature 68 Medicine Box was 68°F 2015-12-31 5:23:19.769 PM CST 6 hours ago DEVICE temperature 67 Medicine Box was 67°F

And again another failure. Sigh…

Well so after a series of failures I eventually decided to stop whining and start looking closer at the problem. It turns out that the runDaily(endTime, scheduleCheck0) call seems to have the scheduleCheck0() function called for a while and then at some point it’s just notRanDailyAnymore(). So having noticed that it seemed to work pretty reliably after adjusting the start/stop times, I decided to just make the code call unschedule() and runDaily() on a regular basis. i.e it re-schedules its self after every run and then also every time the medicine box moves, which is at least once day. So really, don’t rely on runDaily to just run daily indefinitely seems to the the lesson here.