Custom device won't even respond to poll()?

I’m trying to tweak Patrick Stuart’s ps_Ubi device to handle multiple Ubis and also Celsius rather than Fahrenheit temperature readings.

Things were going nicely - I had the device type published, it was collecting info from the Ubi portal as designed, as I tweaked the code and re-published I could see the changes take effect, etc., etc.

Suddenly, however, the device is not responding - to anything.

  • I’ve removed the device and re-added it.
  • I’ve edited/saved/re-published the device type.
  • I’ve restarted the iPhone app.
  • I’ve logged out of the portal and back in.
  • I’ve tried polling with Pollster and other device polling smart apps. The logs show the apps trying to poll, but the poll() function on my devicetype is never being called.

What gives? Has anybody seen this state before where your device code is never called? How did you resolve it?

How do you know it isn’t being polled? I’m guessing there is an error in your code somewhere that isn’t being logged properly.

My starting point was to assume my code was wrong.


  1. I’m not getting any compile time errors. The IDE is telling me it is
    successfully publishing the device.

  2. I’m not getting any run time errors.

  3. There’s lots of logging calls, including one at the very start of
    the poll() function. There is also quite a bit of code with logging
    messages which executes before the portion I’m changing. None of
    these now appear in the log, whilst they were appearing fine

Most likely you have an error in your code. The debug logger is … less than entirely functional. There are many cases where something bad happens and you just have to guess where.

Yep - it’s a code error.

I started commenting out lines until it suddenly sprang back into life.

Until the offending line was commented out - complete radio silence in the logs.

That is…how should I phrase this…disappointing.

Something is obviously going awry but absolutely nothing shows up in the log.

1 Like