Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing "service data" on Windows #11

Closed
spudwebb opened this issue Oct 9, 2024 · 17 comments
Closed

Missing "service data" on Windows #11

spudwebb opened this issue Oct 9, 2024 · 17 comments

Comments

@spudwebb
Copy link

spudwebb commented Oct 9, 2024

It looks like on Windows the "service data" are not correctly parsed and passed back but these are required by the Matter standard. Using the same bluetooth dongle and the same Matter device, the "service data" are correctly reported on Linux.

Linux:
2024-10-08 14:48:59.885 DEBUG NobleBleClient Found peripheral 30:de:4b:db:7f:24 (undefined): {"localName":"undefined","txPowerLevel":"undefined","manufacturerData":"undefined","serviceData":[{"uuid":"fff6","data":{"type":"Buffer","data":[0,206,4,136,17,1,1,1]}}],"serviceUuids":["8641","fff6"],"solicitationServiceUuids":[],"serviceSolicitationUuids":[]}

Windows:
2024-10-08 15:13:19.756 DEBUG NobleBleClient Found peripheral 30:de:4b:db:7f:24 (): {"localName":"","txPowerLevel":0,"manufacturerData":{"type":"Buffer","data":[]},"serviceData":[],"serviceUuids":["8641","fff6"]}

Reference discussion with @Apollon77 : project-chip/matter.js#1241

@stoprocent
Copy link
Owner

What kind of BLE implementation you are using? Native windows or USB ?

@spudwebb
Copy link
Author

I'm using a TP-Link UB500 USB adapter on my desktop PC

But I saw the exact same problem using the native BLE from my windows laptop.

@stoprocent
Copy link
Owner

I'm on a business trip right now. I will be back soon and I will have a look. No probs

@leonardocavagnis
Copy link

Hi @stoprocent,
I'm experiencing the same issue. On macOS, service data is parsed correctly, but on Windows 10, it isn't.

@spudwebb Any updates?

@spudwebb
Copy link
Author

No update on my side, but I would love to make this work.

@stoprocent , let us know how we can help to fix this.

@stoprocent
Copy link
Owner

Hi Guys I had a crazy time at work. I will try to look at this end of the current week. Stay tuned

@stoprocent
Copy link
Owner

I've just compiled noble on my windows 11 and this is what im getting:
Screenshot 2024-12-22 002447
Im getting full advertising data, maybe the problem isnt Noble?

@stoprocent
Copy link
Owner

stoprocent commented Dec 22, 2024

Ok. I found the issue and it's not just Windows :) The issue was noble was/is only parsing advertising data when in scan response and not advertising frames. That was a mistake by the original author. I will fix it this week.

@stoprocent
Copy link
Owner

@Apollon77 @spudwebb @leonardocavagnis I've added this feature now for native Windows. It wasn't even the above. Windows native implementation didn't even parse the data. Now I've added the same behavior in all platforms: Linux, Mac and Windows. Test it please and let me know so I can close the issue :)

@leonardocavagnis
Copy link

@stoprocent Sure! Thanks! I'll test it soon and get back to you with feedback!

@Apollon77
Copy link

Thanks a lot @stoprocent. Matter.js nighly is using the latest noble version as dependency. So can be used to test.

@stoprocent
Copy link
Owner

Any update @leonardocavagnis or @Apollon77.
BTW @Apollon77 I want to do 2.0 version soon.
I would like to ditch all websocket-related stuff and just keep: Native Win, Mac, Linux and HCI over UART and USB. I've started converting code to TypeScript and doing many other cleanups. Do you have any more ideas for the lib?

@Apollon77
Copy link

Hey @stoprocent,

I asked in the matter.js community (I myself do not use windows) ... but no feedback so far, sorry. I would expect that also the holidays are reasons and hope we get feedback when people come back in january.

TS conversion sounds awesome. Fully support it!!

I still have this issue on noble side that when device unexpected disconnects directly after connect and first command is then send that "something" does an automatic reconnect and resends the command - but the response can not be mapped and so the command "hangs" and never resolves. If you have an idea where this auto-reconnect happens then I might also be also to look ... or maybe you already fixed that one by the TS conversion or such :-)
(Also repro that is PITA because just happens sometimes ;-) )
Maybe once you have a new codebase release as "beta" or "dev" tag to npm and I can test it and provide new log.

Re other idea I will send you one thing in slack.

@stoprocent
Copy link
Owner

As far as I was testing it it's completed and working just fine on windows 10 and 11. I will close the issue and if anything will be wrong with the implementation let's create a new one @spudwebb @Apollon77 and @leonardocavagnis

@Apollon77
Copy link

I agree. I also now have another ble test device so I will try to check things next with newest version of noble. Awesome work!

@leonardocavagnis
Copy link

Hey @stoprocent! It works like a charm! Tested on Win10 :)
Thanks a lot

@spudwebb
Copy link
Author

spudwebb commented Jan 8, 2025

@stoprocent , I confirm that the problem described in my first post is fixed, the device is now correctly discovered by matter.js on Windows, Thanks for the fix.

However, I found some other problems with other devices on windows, see #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants