-
Notifications
You must be signed in to change notification settings - Fork 451
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
stuck on startAdvertising, MacOS 10.14 #404
Comments
I'm getting the same thing on macOS 10.14 (18A347e), works fine on other os |
noble doesn't work yet on 10.14 either, I would guess for similar reasons: noble/noble#804 |
I think now's a good time to adopt a native approach, so I've forked noble/noble#828 and have made some progress on porting that for Bleno. I've spent a couple of hours on it so far, and it can establish connections + set services + perform static reads just fine. The "read request" and "write request" events are gonna take some more noodling around (callback inception!), and I haven't looked at any of the more advanced events in of characteristics yet. I should hopefully have a rough version working tomorrow though! At the very least, I'll clean up what I've got and push it. 🤞 |
Alright, I've got something working, though not complete over at https://github.com/notjosh/bleno-mac. (It won't work out of the box until #415 is merged, but you can run that locally and For now, I can read/write/subscribe just fine, and it seems to be fairly stable. I haven't touched any of the iBeacon code, and some events aren't being sent. My 90% use case works though, so hopefully it should be usable enough to start with if anyone is interested? Any help is welcome :) |
(To be very clear: the approach was copied straight over from https://github.com/Timeular/noble-mac, so @geovie should get all the credit for the idea! I've just been filling in the gaps on the Bleno side.) |
@notjosh Thanks for your work ! But I'm still having the issue described by @galenzhao. Could you explain a bit more how you get the example given by galenzhao solved and working with your https://github.com/Timeular/noble-mac ? Thanks in advance ! |
@jwheatp you'll want to point to https://github.com/notjosh/bleno-mac (not the Might be easier to hold off until #415 is in, 'cos that's kind of a pain to deal with just now. |
@notjosh Yes I meant https://github.com/notjosh/bleno-mac, sorry. I tried to manually apply the #415 on my noble/bleno but the advertising is not starting when I run the echo example. I also tried to install your notjosh/bleno-mac and replaced Any clue ? Thanks in advance. |
@notjosh's
|
One limitation of this approach using CoreBluetooth appears to be that bleno is unable to set the primary service UUID in the advertising data. Is this expected? |
Oh uhhh, I think that's a bug. I'll see what I can do about it, thanks! (I've had a pause on the project that required Bleno, but I'm picking up again ~next weeks or so, so hopefully have some more updates then) |
I just tried to install noble on 10.14. Since advertising didn't work, I found this thread. I tried the approach from karlrl:
Then I started Any clues or updates? Thanks in advance |
@mikk92 installing still works for me (though I didn't clone anything again, since they're on the same revision). What if you just try |
I apparently set the dependency in the modified bleno repository to bleno-mac creating a loop. |
@notjosh Thank you so much for that fix, i hope it get's merged in the original repo soon! For now, replacing the dependencies to point to your fixes made it work "out of the box".
🚀 |
I'm new to bleno running on 10.14.2 and cannot get a callback from |
Forgive the newb question @codeofdiego (I am new to node), but to run something like the echo sample ( Thanks!
I created a package.json file at
and then ran However, when I then re-run Am I missing something? Many thanks! |
Based on guidance from previous posters, I forked bleno-mac to restore the original sample functionality. This is just a stopgap until these changes are merged, but it allows you to use the sample apps out of the box. I made the following changes:
This means that at least for sake of testing, you can
And then with the iOS / LightBlue app, poke at the echo server. |
The battery service doesn't work (also doesn't work with the official repo);
Is that 'as expected'? |
@chrisco314 Sorry for the late response. I was traveling. That was for my own node project, so I added a new package file. I'm still using those branches successfully. |
@codeofdiego what's the ETA on this fix getting into release? |
Just a note, if you're using the temporary solution "dependencies": {
"bleno": "github:notjosh/bleno#inject-bindings",
"bleno-mac": "github:notjosh/bleno-mac"
} make sure you change all imports to |
I've observed this same behavior and I believe I have a fix for it up in a pull request: notjosh/bleno-mac#7 |
Thanks @petrbela gathering the stuff from here I stitched up a solution: {
"dependencies": {
"bleno": "github:notjosh/bleno#inject-bindings",
"bleno-mac": "github:notjosh/bleno-mac",
"xpc-connection": "sandeepmistry/node-xpc-connection#pull/26/head"
},
"resolutions": {
"xpc-connection": "sandeepmistry/node-xpc-connection#pull/26/head"
}
} See my other post for more information here: #416 |
@LukasBombach that works perfectly! You're a legend. I wonder if there would be a way to let open source repos opt into a Code Will, where if they do not log in or reply / change the code after a period of time part control is transferred to the registry so that someone else from the community can take over and fix it. Seems like a fair thing to require of non validated open source contributors so their packages dont get stale and cause an issue for everyone in the community. |
Oh I have already done that before with https://www.npmjs.com/package/react-web-component , the guy who owned the npm package before registered the name and never did anything. You can write to npm and ask for a transfer. It works quite well. Also I am currently working on a complete reimplementation of noble (current status: everything seems to work fine on macOS but I still need to add support for other platforms): https://github.com/LukasBombach/sblendid/ Maybe I'll look into Bleno as well |
@LukasBombach amazing!! :) Thanks again for your awesome work! |
Hi, I just installed bleno and want to run it & facing this very same issue. Reading through this discussion I'm still confused about the concluding solution. It would be really nice to have a concluding answer of what steps to follow to fix. Thanks |
FWIW, I decided to switch away from using bleno and implemented a React Native plugin with a similar API https://github.com/petrbela/react-native-peripheral |
@khaledalaneziq8 have you tried my solution? Also you can use sblendid, which I made because bleno is abandoned. |
I'm actually confused as to where to apply those lines. I added those lines in last lines in the package.json file (see below snippet) and ran the command node main.js but nothing have changed. "scripts": { as for using sblendid, looks like it is used for BLE central, however, I'm interested in running BLE peripheral mode on my macOS. |
Oh right, this is |
This is the link to the gist: This is my directory structure: The package.json I posted and the main.js I try to run are highlighted in bold. Also, find below the terminal output for running the echo program: |
First of all you don't have to have to (and should never) change a Since these are issues not related to this package but to JavaScript development in general I suggest you ask this question on StackOverflow, this issue is too specific for that topic. |
I agree that the structure had many errors but I embarked to it after tinkering with different ways trying to make things work. Anyway, the best thing that easily worked with me out of the box was by following the below instructions. I feel it is my duty to put this summary here to help those who come later & try to install bleno. Thanks @LukasBombach for your great support & thanks to all contributors of this thread.
|
`
I added start event callback but never get called,
The text was updated successfully, but these errors were encountered: