Closed lkknguyen closed 6 years ago
I see the exact same!
In mac/bindings.js it seems to try to talk to "com.apple.blued" through XPC:
this._xpcConnection = new XpcConnection('com.apple.blued');
But High Sierra has no running services called "com.apple.blued"
sudo launchctl list | grep bl
0 com.apple.bluetoothReporter
0 com.apple.diagnosticextensions.osx.bluetooth.helper
108 0 com.apple.bluetoothd
0 com.apple.bluetoothaudiod
I changed:
this._xpcConnection = new XpcConnection('com.apple.blued');
to this
this._xpcConnection = new XpcConnection('com.apple.bluetoothd');
and this
107 blenoBindings.on('kCBMsgId4', function(args) {
to this
107 blenoBindings.on('kCBMsgId6', function(args) {
in mac/bindings.js and it seems to work
Great thx @nraamat , possible to make a PR?
I might not have the time for the PR - also I am not sure if this is a stable solution
I experience that some things work and some don't. Probably the name of the bluetooth deamon was not the only thing that changed.
Does anybody know the where to find documentation for XPC to com.apple.bluetoothd
Does this help? https://github.com/sandeepmistry/noble/pull/689/commits
It is heavily related - I just don't know how to get the reference/documentation for needed constants for high sierra
@lkknguyen
After installing your modified fork, it still doesn't work. bleno.on('stateChange', function (state)
is never called, I'm using macOS 10.13. But I'm very new to Node.JS, I'm not sure if it's correct to use npm install ./
in the downloaded bleno
's folder to install the modified local package?
Thanks in advance!
@CocoaBob My fork is not modified. It was actually merged into the main trunk and my contribution was released in 0.4.2. See https://github.com/sandeepmistry/bleno/pull/274
What makes you assume that my fork might work for your specific use case?
@malikolivier Sorry,sorry, sorry! I was trying to mention @lkknguyen but I typed ikk
, I thought it was I
, then GitHub automatically selected you 😂
I was trying to make it work under High Sierra, and @lkknguyen 's fork is supposed to contain the fix, but it doesn't work on my side.
It didn’t work for me yet, sorry couldn’t help you. I was just trying out what nraamat suggested.
Yes, an unfortunately it was only fixing the first of many problems. And I am not able to do the necessary reverse engineering of CoreBluetooth.
+1
This actually seems pretty real. Did anyone get this working?
@lkknguyen try the pr i just submitted #343
@aj-ptw Thanks, still unable to make it work. Is it working with your MacOS now?
@lkknguyen nope. still needs more work i think.
Have anyone got further insights to this?
I can report the same issue in MacOs High Sierra 10.13.
For me on MacOs HighSierra 10.13.1, I changed blenoBindings.on('kCBMsgId6',
to blenoBindings.on('kCBMsgId4',
in lib/mac/bindings.js
file
@Terfender in which file?
@aj-ptw mentioned in lib/mac/bindings.js
file. I believe this pull request will solve the issue
@aj-ptw , seems like your PR is not merged yet, I downloaded the lib from the mater branch. Sorry for miscommunication
@Terfender will changing the lib/mac/bindings.js break the previous version?
So you didnt need to make a new file? Could you PR to this repo with your fix so I can test it!
How did you know to change from a 6 to a 4?
Thanks!
@aj-ptw , I am kinda naive when it comes to create PR on github, I created a new branch. PR here, and my mac can pickup stateChange now. However, it doesn't pickup advertisingStart
event. Looks like kCBMsgId16
needs to change? I have no idea what these IDs are, but I will investigate and see if I come up with something.
I knew about changeing the ID from 6 to 4 from this comment.
Please test https://github.com/sandeepmistry/bleno/pull/360
Closed via PR #360 from @jacobrosenthal.
You can test master via npm install sandeepmistry/bleno
I was trying to run Bleno on Mac HighSierra but it doesn't work. I was working before with Sierra. No services shown on LightBlue.