iCloud Binding Crashing - 2.5

There is no seperate “request” call in the binding.
Also there is a 10 seconds timeout when calling the API, but I think that is only for give enough time for the servers to respond.
So as I earlier said, you can’t request the phone to update its location (as you can in the Find My app for example - that uses a different API). I think the server just knows that the location is frequently called and sometimes it asks the device to update its location.

Also I have multiple phones in openHAB. When it updates the states of the phones, usually the location update date is differs per phone.

Is this issue unique to an OpenHabian install? The reason I ask is that I use the iCloud binding as part of my presence detection scheme and I haven’t noticed any issues with crashes or missing updates. It seems to be working fine for me. Using 2.5.1 docker, iPhone7 and iPhone6.

Is your fix now part of the latest openHab update/build? I see that new build is available in docker hub.

Running Openhab 2.5 from Qnapclubstore on a qnap nas.

No it is not merged yet. I think it will be available in the 2.5.2 release.

It might work for you even without this fix. I had this issue since a long time ago, but besides the last week, it only happened 1-2 times in a few months, so it was not so frequent.
It might be dependent on your location also… Basically the issue is only that sometimes the server responds with a “Service unavailable” message, which the binding can’t handle.
But why it is unavailable temporary, I don’t know…

OK. Thanks for the additional background and explanation. For now I think I’ll stay with what I have since I’m not experiencing any noticeable issues. If things change, it’s nice to know I have fallback with your update.

@rkrisi thanks for your work.

I just wanted to download the .jar and saw a line:
Last Modified: 20-01-20 18:21:53 +00:100
on the download page.
Did you change anything else since this morning?

Also an other question, just for my understanding.
Why do I find this .jar at
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/addons/bundles/org.openhab.binding.icloud/
and not at
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.icloud/

No I didn’t change anything. I don’t know why the build was retriggered. But I assume it will be the same version.
I’m not sure about why the different URLs and why it can’t be seem at the second location.
However the correct structure in the GitHub repo is bundles/org.openhab.binding.icloud
But I’m not a Jenkins and build server expert, so I can’t really answer your question.
I just copied the deployed artifact link yesterday, when the build finished for that PR.

@rkisi thanks anyway. I am installing it right at the moment.

Thanks!
Hope it doesn’t break anything!
I’m using the same version, but my local build…

No, I am running on Windows and have the same issue.

I’ve got a similar issue, my iCloud binding works fine when I reboot my OH pi bit then stops reporting a location after x, (still need to investigate if it’s immediate or after a certain time / number of refreshes). It also seems to work when you manually refresh it but the clock is 5 mins behind the actual time.

I’m running openhabian 2.4 with iCloud binding 2.5…

What testing would anyone like me to do or is this all rolled up into a bigger issue?

This is the issue here, there’s a fix up above

This is also discussed in this thread

Thanks, it was late last night so I only scanned the thread and messaged as a reminder to myself to investigate further :+1:

I’ll do some more reading / fixing and report back.

@rkrisi the binding did not stop working so far. That’s good.

I now run into a lot more “Unable to refresh device data” since this morning (starting maybe around 5 or 6 am), but I don’t think this is related to your changes.
Looks like the known SLHandshakeException/General SSLEngine problem. I have to try on this later on. I already renewed the certificates, but no change so far.

Yes I also have these… Sometimes almost every 2nd refresh says “unable to refresh device data” and all device will go to an OFFLINE state…
I will try to catch an error when this happens and why the binding assumes this. If you still have this, you can also do this, by putting the binding into TRACE logging (this will cause a lot of lines of log when updating the device state, so be prepared) and send me the json output or the detailed error if it shows anything…
But I think this is also related to Apple servers and the API. They might be doing some changes/improvements to this API, maybe that’s why these error happens now quite often (I can remember that there were a few days when it completely stopped working, and all of a sudden it started working again after a few days).

Looking at the code, that error might happen when the server didn’t respond at all. There is already a 10 second timeout, but if it doesn’t respond it will throw this error. I don’t know if it would make any change if I increase this timeout…

I need to see if I find some time this evening to get some traces, since I am not at home atm.

Same here unfortunately…

For me it seems that it stopped completely. A new cert has to be used to get it working again.
I have managed to fix this, I will provide a new jar soon…

1 Like

Yes, I noticed that also now…

Thank you for your effort!

2 Likes