-
Notifications
You must be signed in to change notification settings - Fork 39
Corrupt SDK response when heartbeat is fast #24
Comments
It is not reproducible here. The error shows the response from the bridge can not be parsed and causing the behaviour you mentioned. Can you enable debug logging, which also shows the response we get from the http requests, and post the result ? |
Maybe it is bridge load related? I will send the debug responses but ultimately does it matter? To me it seems there is a race condition at the SDK level. Whatever the reason, the issue lies within the SDK as it sometimes works and sometimes does not. BTW I can replicate this same behaviour with a disconnect followed by a connect in a quick fashion. So if you press the back button to get out of the app and tap the icon to start again, if call bridge.disconnect() and bridge.connect() in the onResume and onPause events the same issue occurs. Even if I disable the heartbeat and manually call refresh it ends up calling the same methods and get the corruption. |
The debug log does matter, because it will contain all the http responses from the requests sent to the bridge. Based on the http responses we can check whether the response from the bridge is valid or there is a problem in the processing part of the SDK. To enable debug logging, you have the set the log level in HueLog.java. We internally test on bridges that have more lights and other resources. So far this issue has never been reproduced. |
Is there an email I can send this to? I got an error for groups and for scenes checking the response it seems it is missing the final ending } on one response but not on others. same goes for scenes. and as I mentioned already the older SDK had the same issue. |
Email: [email protected] |
"and as I mentioned already the older SDK had the same issue." Ok I missed that part. Are you saying that our old iOS and Java SDK have the same issue ? |
I have sent an email. Yes indeed the old SDK (Java - cannot comment for iOS) also had the same issue. So, maybe it is the bridge or some common code between the two SDKs? no idea but for sure the last } is missing |
There is no common code between old an new SDK's. |
v2 latest firmware but it has been happening through various firmware updates for a long time now Model: BSB002 but you can see this from the log as well. by common code I didn't mean shared library but common implementation that has the issue |
here is a different incident but again invalid JSON with the old SDK |
Analysing the logs clearly shows that for some requests the '}' at the end is missing. As this behaviour is also seen on the old SDK's, I suspect this is a bridge issue. I will file a ticket internally. I'll keep you posted. |
BTW same with latest bridge version: SWVersion: 1802201122 |
Also it might be worth reconsidering the current HueSDK implementation to disconnect when it gets these errors. Why was the decision taken to disconnect after a bad response? Thanks |
I agree the disconnect is inconvenient. I don't think the disconnect option should be configurable though. |
Only mentioned configurable to allow for any reasoning behind making this fatal. As mentioned the disconnect makes this unusable. Thanks again for your help. |
Any update on this? |
We have no reproduction scenario. If you can reproduce, can you provide us the Wireshark logs, so we can investigate this further ? |
I have already sent it at the philips hue dev email more than a month ago |
Ok. I was not aware of that. I will check with my colleagues :) |
Thank you |
@jhvdb87 |
@smiLLe yes there are also other occurences of this issue in other posts in the forums. Don't know why it has not been addressed as it has been going on for years. The previous SDK treated the situation as a "warning" and continued. @jhvdb87 Honestly if the issue is deeply rooted into the bridge firmware and it is too difficult to resolve all we need is an option to tell the SDK to not treat the situation as terminal. This should be easy to implement. |
@smiLLe Thanks for the info. |
@jhvdb87 thanks for the quick reply. Any idea on timelines? |
@jhvdb87 the fix will end up in the new EDK? I requested access but got no invite. Would appreciate if i had access. |
@gkamperis This will be picked up in the coming sprints. So release window will be around 2 months before we can release this fix on our new repo |
@jhvdb87 Any news on this? It has been more than two months and the specific issue can be probably resolved with a few lines of code. A beta version will be sufficient. |
Yes there is news: the fix has been implemented. The release is being prepared as we speak. ETA was end Augustus/begin September, so we are a little late. |
@jhvdb87 the new way of using the sdk in Android introduces a min version of 21. Why does it do so? Please consider reducing it to 16. SDK 16 - 19 still covers about 11% of Android devices EDIT: seems to be missing mips, mips64, armeabi, x86_64 |
@jhvdb87 when running my app... E/HueSDK: JNI_HueSDK - Java SDK version 1.28.49 does not match binary version 1.21.0, fatal error! EDIT: figured it out... |
Exactly this. The min SDK has changed from 19 to 21, without any message to developers to let us know about this breaking change. Please reduce it to at least 19 as it was before. |
@jhvdb87 Any comments/guidance on the missing libs and min SDK? |
mips, mips64 and armeabi are deprecated, so we removed them. x86_64 is removed, because it was not used by our app. It shouldn't make a difference though, x86 is still there :) |
@jhvdb87 any reason why not support 16+? what android APIs are missing from it? |
We have to investigate whether we can revert to 16. We chose 19 initially, because it was back then also the min version used by our Android app. |
To reproduce just take your sample android app.
Change the below to enable hertbeat.
It either breaks down and disconnects like the below
or gets errors every heartbeat:
The text was updated successfully, but these errors were encountered: