athombv / homey-apps-sdk-issues

This issue tracker is for Homey Developers using the Apps SDK.
20 stars 4 forks source link

BLE - Connection problem #245

Open emilohman opened 2 years ago

emilohman commented 2 years ago

I've reported ble connection problems before and it seems to work better since v7.2.1. But now I get error reports again with connection problems for two different apps. Two of my users have posted error reports to you with id 77F945 (ecoControl app) and BB0086 (Plejd app). Both of them are running Homey 7.3.0-rc.6 but had problems with 7.2.1 as well. Can you see any problems from your side?

emilohman commented 2 years ago

More and more of my users are reporting errors with connecting to BLE after upgrading to 7.3.0.

AdyRock commented 2 years ago

I'm also finding some strange issue with the BLE. One of my Homey Pro's works very well and rarely has an issue, The other Homey Pro seems to kill the BLE whenever I try to connect to send a command (possible faulty hardware), but also my Homey bridge seems to be have random issue sending BLE commands that just timeout when trying to connect. Both my Homey Pro's are on version 7.3.0 and are about 1 meter apart and a similar short distance from the devices I'm controlling.

emilohman commented 2 years ago

@WeeJeWel Do you have any status according to BLE in Homey? Is it true you don't have any developers working on BLE anymore? Is your goal to continue to support and develop the support for BLE or whats you future plan with BLE?

WeeJeWel commented 2 years ago

I'm also finding some strange issue with the BLE. One of my Homey Pro's works very well and rarely has an issue, The other Homey Pro seems to kill the BLE whenever I try to connect to send a command (possible faulty hardware), but also my Homey bridge seems to be have random issue sending BLE commands that just timeout when trying to connect. Both my Homey Pro's are on version 7.3.0 and are about 1 meter apart and a similar short distance from the devices I'm controlling.

Can you share your Homey Pro model IDs? You can find these in the Mobile App → More → Settings → General.

@WeeJeWel Do you have any status according to BLE in Homey? Is it true you don't have any developers working on BLE anymore? Is your goal to continue to support and develop the support for BLE or whats you future plan with BLE?

No, that is not true.

BLE works, might be flaky in some ways but that might be inherently part of the protocol & end devices.

AdyRock commented 2 years ago

Both my Homey Pros report "Homey Pro (Early 2019)" in the app, but in the developer portal, the new one shows "homey4d" and the older one is "homey3d"

I currently have an open support case for the BLE problem on the new one.

AdyRock commented 2 years ago

I have also noticed that all the BLE timeouts seem to be fixed at 30 seconds now, and passing in a timeout has no effect. But, I have found that the longest delay for a command that works is about 5 seconds, and if it hasn't worked by, then it will fail. Therefore, 3 retries to send a failed command take 1:30 minutes, which could be reduced considerably if the timeouts were shorter.

WeeJeWel commented 2 years ago

Both my Homey Pros report "Homey Pro (Early 2019)" in the app, but in the developer portal, the new one shows "homey4d" and the older one is "homey3d"

I currently have an open support case for the BLE problem on the new one.

To be clear, what issues are you exactly having with homey4d?

AdyRock commented 2 years ago

When I boot the homey4d and look in the developer portal, it list most of the BLE devices around it. Also I can discover the BLE devices in my app. However, if I try to connected to a BLE device, either via my app or the portal it errors out and then is not capable of detecting devices anymore. The support case is #40690 and is awaiting discussion with the developers.

Also, just for comparison, I have made hubs out of ESP32 modules that talk to Homey via WIFI and send / receive BLE commands to / from the devices. These work flawlessly and extremely fast all the time. Typical latency for sending a command is about 2 seconds. Typical latency for detecting a change of state on a device is also 1 to 2 seconds. I appreciate that they have a dedicated role compared to Homey's multiple roles via many apps but it is a big difference in speed and reliability.

As I normally use the hubs, I hadn't notice the BLE errors with my Homey until a user reported issues and I tried to replicate them.

WeeJeWel commented 2 years ago

OK, thanks, I'll make sure we'll look into this.

emilohman commented 2 years ago

@WeeJeWel Thanks for replying, sounds great! I hope you find something that can be tweaked. Let us know if we can help with something.

Taelek commented 2 years ago

Any advance on Homey / BLE / homey4d problems at Athom side?

AdyRock commented 2 years ago

They now know how to reproduce the problem at will, so hopefully, there is some progress. I just hope it's not a hardware problem 🙏

emilohman commented 2 years ago

Today BLE stopped working on my Homey. When I debug my apps and run: const advertisements = await this.homey.ble.discover(); Homey finds no advertisements at all. After I restarted my Homey everything works like before.

I created a diagnostic report: BA3191 and my Homey model is homey2s.

Taelek commented 2 years ago

OK, thanks, I'll make sure we'll look into this.

@WeeJeWel any news? We have lots of customer complaints.

WeeJeWel commented 2 years ago

Yes. We've been able to reproduce the issue in some cases, and are investigating why this happens so we can work on a fix.

Taelek commented 2 years ago

@WeeJeWel any news? We have lots of customer complaints!

WeeJeWel commented 2 years ago

Sorry, not yet, it's quite a rabbithole.

Taelek commented 2 years ago

Sorry, not yet, it's quite a rabbithole.

Any news?

AdyRock commented 2 years ago

Ferrets are good in rabbit holes ;-) I must admit is is getting frustrating not being able to use BLE to test things, but at least I have another Homey that is working perfectly. So I can appreciate the pain that users are going though if it is their only Homey.

Taelek commented 2 years ago

Any advance? It has taken very long time!

risoy commented 2 years ago

When I boot the homey4d and look in the developer portal, it list most of the BLE devices around it. Also I can discover the BLE devices in my app. However, if I try to connected to a BLE device, either via my app or the portal it errors out and then is not capable of detecting devices anymore. The support case is #40690 and is awaiting discussion with the developers.

I have this issue too. I also have the homey4d. I only manage to stay connected to a BLE device for about 5 seconds in the Developer Tools.

Pirez commented 2 years ago

When I boot the homey4d and look in the developer portal, it list most of the BLE devices around it. Also I can discover the BLE devices in my app. However, if I try to connected to a BLE device, either via my app or the portal it errors out and then is not capable of detecting devices anymore. The support case is #40690 and is awaiting discussion with the developers.

I have this issue too. I also have the homey4d. I only manage to stay connected to a BLE device for about 5 seconds in the Developer Tools.

I have the same issue too (homey4d). It does discover and make an initial connection to the BLE devices, but afterwards I loose the connection and can't connect to any BLE devices.

Are there any progress on this issue? And does someone knows if the same issue occurs on Homey Bridge (don't have it yet)?

homey_BLE_issue

djFooFoo commented 1 year ago

I’ve got kind of the same issue with ble here. While I was able to create a Python application that communicates with a Bluetooth standing desk from Ikea, I seem to have trouble doing the same with Homey.

I can list the bluetooth device, but I’m not able to list the device’s services. The services array is empty and discovering services results in an error.

Maybe it has something to do with the short timeout of only 5 seconds, which might not be enough for older bluetooth devices.

When I list the devices in the developer portal, I can see my desk. I can connect to it, but it nearly immediatly disconnects as well.

If needed, I’m willing to reproduce the issue, but I can confirm there are BLE issues.

emilohman commented 1 year ago

Is this problem solved in Homey v8.1.3?

Homey v8.1.3 [Zigbee] Add firmware revision to developer tools. [BLE] Update Apps SDK with BLE stability improvements. [Flow] Fix issue with Flow card "week number is between".

AdyRock commented 1 year ago

From my experience, the BLE on Homey Pro 4d and on the bridge is much better. It still seems a bit slow and occasionally fails, but at least it can find my Switchbot devices that are in range. I still think my Homey Pro 3d is a bit better but that is subjective as it has worked quite well all the time. The range is still not as good as the ESP32 devices, but I guess that's hardware and not firmware.

Baldesjo commented 1 year ago

Problems with homey5q. I have the hole house with plejd ble. If this not working it is bad news for me. All my planes is failing..

ludwich commented 1 year ago

Problems with homey5q as well on my side. Cant connect to my plejd devices at all since upgrading to the new Homey Pro 23....