Inconsistent Polling Intervals


(Col Hack) #1

A question for SmartThings developers. I wrote a device type that uses poll() to update its status. What I see from the logs is that poll() is being called on average 4 times per hour. But the poling intervals are not evenly spaced, i.e. instead of regular 15-minute polling intervals I see poll() being called at 00, 20, 30 and 50 minutes. For example: 7:00PM, 7:20PM, 7:30PM, 7:50PM, 8:00PM, etc. I could understand if ST tried to randomize polling schedule to avoid peak loads, but the polling times are always the same, they just play this weird syncopated rhythm. Is this by design?


Scheduler and Polling quits after some minutes, hours, or days
Scheduler and Polling quits after some minutes, hours, or days
(Col Hack) #2

Wow! I look at my event log and the polling was happily waltzing away in 10-20-10-20 rhythm until exactly 5PM this afternoon. Then it suddenly stopped. What happened? The polling daemons got tired and went home? That’s the problem with SmartThings - stuff mostly works until it doesn’t. You can’t really depend on it working all the time. Any feedback from developers? Anyone?

P.S. Sorry @twack, forgot to gat your permission to complain again :wink:


(Col Hack) #3

Bumping up again… I uninstalled, then re-installed my device – polling still doesn’t work.


(Col Hack) #4

Well… looks like polling has been restored. Since of 8AM PST this morning, I’m seeing regular 10 minutes polling intervals. Whatever it was it seems to be fixed now. Let’s see how long it will last :wink:


(Aaronw) #5

Strangely enough, I was just trying out http://build.smartthings.com/projects/xively/logging-thermostat-status-to-xively and I checked it today and I noticed it wasn’t at all working. I started to try to debug the code myself, and puilled up the ‘activity’ for the device on the iphone app, and noticed that a ‘poll command was sent’ happened every few minutes up until 4:03AM, and that was the last one. If I hit refresh in the app and look at the activity a poll command gets sent… but I’m not sure if it’s going to start re-polling automatically. So it looks like the hub stopped sending poll commands… but it still works to view everything. Any ideas?


(Col Hack) #6

That’s exactly what I experienced last Saturday. Polling suddenly stopped. It resumed only Monday or Tuesday, I don’t remember, and continued with more or less regular 10 minute intervals (with occasional misses) until 1AM this morning. Now it’s playing Texas two-step again - 10-20-10-20…

This BTW has nothing to do with the hub. It’s all done on the server side. I believe they’re using Quartz that gives them a lot of grief.


(Col Hack) #7

Guess what. Yep, polling stopped again at 4:30 AM this morning. This looks like a pattern. The polling daemon must be a union member and they have to let him go for a weekend :slight_smile:


(Steve S) #8

I’m a little confused - can someone help me understand what the poll() function is used? I have an Arduino shield project I used to control and sense the state of my two garage doors. Sometimes the ST device will get out of sync with the actual state of the garage doors. I know that the Arduino knows the correct state because I use LEDs to indicate when it knows the door is open or closed. If I implemented a poll() function in my device handler which then would send a command out to the Shield which would in turn cause the Shield to re-send the door status… is that the correct use of this function?


(Kristopher Kubicki) #9

I am also looking for more information about polling, and how to control it. Its been very inconsistent for me.