Giter Club home page Giter Club logo

bleno-mac's People

Contributors

ankidave avatar geovie avatar gpgabriel avatar koush avatar notjosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bleno-mac's Issues

install fails to compile

Can't install bleno-mac :(

I can install noble-mac fine using the same command, which from what I read sounds like this is just a fork of that then modified to be used for peripherals instead of central. So I'm thinking maybe there is a bug somewhere in this package.

Environment

os: macOS Mojave (10.14.2)
node: 10.14.2
node-gyp: 3.8.0
npm: 6.4.1

Command Issued

npm i github:notjosh/bleno-mac

Error Log

> [email protected] install /Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/notjosh/bleno-mac/releases/download/0.0.1/bleno_mac-v0.0.1-node-v64-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error Connection closed while downloading tarball file
  CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
  CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
rm: ./Release/.deps/Release/obj.target/nothing/../node-addon-api/src/nothing.o.d.raw: No such file or directory
make: *** [Release/obj.target/nothing/../node-addon-api/src/nothing.o] Error 1
gyp  LIBTOOL-STATIC Release/nothing.a
 ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node@10/10.14.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/node@10/10.14.2/bin/node" "/usr/local/Cellar/node@10/10.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native/bleno_mac.node" "--module_name=bleno_mac" "--module_path=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node@10/10.14.2/bin/node /usr/local/Cellar/node@10/10.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native/bleno_mac.node --module_name=bleno_mac --module_path=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/mark-rodgers/Projects/playground/nodehu/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Darwin 18.2.0
node-pre-gyp ERR! command "/usr/local/Cellar/node@10/10.14.2/bin/node" "/Users/mark-rodgers/Projects/playground/nodehu/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac
node-pre-gyp ERR! node -v v10.14.2
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node@10/10.14.2/bin/node /usr/local/Cellar/node@10/10.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native/bleno_mac.node --module_name=bleno_mac --module_path=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native --napi_version=3 --node_abi_napi=napi' (1)
  SOLINK_MODULE(target) /Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native/bleno_mac.node
clang: error: no such file or directory: 'Release/obj.target/bleno_mac/src/bleno_mac.o'
clang: error: no such file or directory: 'Release/obj.target/bleno_mac/src/napi_objc.o'
clang: error: no such file or directory: 'Release/obj.target/bleno_mac/src/ble_peripheral_manager.o'
clang: error: no such file or directory: 'Release/obj.target/bleno_mac/src/objc_cpp.o'
clang: error: no such file or directory: 'Release/obj.target/bleno_mac/src/callbacks.o'
make: *** [/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native/bleno_mac.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node@10/10.14.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/node@10/10.14.2/bin/node" "/usr/local/Cellar/node@10/10.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native/bleno_mac.node" "--module_name=bleno_mac" "--module_path=/Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac/native" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /Users/mark-rodgers/Projects/playground/nodehu/node_modules/bleno-mac
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/bluetooth-hci-socket):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux,android,win32","arch":"any"} (current: {"os":"darwin","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mark-rodgers/.npm/_logs/2018-12-28T18_17_01_916Z-debug.log

Advertising service UUID not actually being advertised

It seems advertising service UUIDs are not correctly being advertised, even though the log indicates it is.

This is the output from the advertising call:
startAdvertising:SOMEBOX #212222 serviceUUIDs:( "445B9FFB-348F-4E1B-A417-3559B8138390" )

But when I detect it via e.g. nRF Connect on an Android, or Bluecap on iOS, the advertised service IDs turns out to be an empty array. I'm digging some more into it, but it becomes rather problematic.

Segmentation Fault 11 Error

Hi,
I've been trying to get this to work for days. I'm running;

  • Mac OS X 10.15.2
  • Node v10.17.0
  • XCode 11.3
  • MacBook Pro (15-inch, 2019)

When I run a simple echo example I get a segfault 11 error, this error occures regardless of whether I have Bluetooth enabled or disabled. I have attached the relevant system log.

The error appears to relate to the native bindings - BlenoMac::Init(Napi::CallbackInfo const&) + 133 (bleno_mac.mm:52)

I've created a repo to replicate my issue.

stack-trace.txt

Question: Documentation for adapters

Hey,

I am trying to rewrite parts of Noble / Bleno in TypeScript and I am looking for some documentation on adapters. Can you tell me how you figured out how to implement your adapter (interface)?

Cheers
Lukas

macOS 10.14.2 no services or characteristics being broadcast on Android

Since updating to 10.14.2, I haven't been able to see any services or characteristics, although I can connect to the device just fine. Seeing as this was not the issue with 10.14.1, I'm suspecting some change in how CoreBluetooth handles adding services "on-the-fly". I'm investigating it as well, but any pointers to where to start would be greatly appreciated.

It seems that this only affects Android for now.

EDIT: It turned out to be due to mismatched bonding information. This can be avoided by forgetting the previous bonding information. It's going to be interesting seeing if this issue persists with the next macOS update.

Status / Demo

Hey, I managed to get this installed and start advertising, at least the console output says so. I explained how I did it here. I started advertising with this script:

const bleno = require("bleno-mac");

bleno.on("stateChange", function(state) {
  if (state === "poweredOn") {
    bleno.startAdvertising("DE1", ["a000"]);
  } else {
    bleno.stopAdvertising();
  }
});

bleno.on("accept", clientAddress => {
  console.log("Accepted connection to", clientAddress);
});

Unfortunately my device cannot be discovered. So I am wondering if I am doing something wrong or if the project is currently broken. Oh I am running macOS Mojave 10.14.5.

Can you tell me if this should work and maybe the project does not work on Mojave or if I am doing something wrong? Maybe as a proper GitHub issue and not a should-be-stack-overflow post, can you include a simple example in the project?

Thank you

Unable to Set ArrayBuffer Value for Descriptor

Attempting to set the following descriptors fails on the second descriptor. This approach works flawlessly on Linux, assuming something is getting lost in translation for the second descriptors arraybuffer

descriptors: [
                new Descriptor({
                    uuid: '2901',
                    value: Buffer.from('Volume', 'utf8')
                }),
                new Descriptor({
                    uuid: '2904', // https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
                    value: new Buffer([
                        0x04, // Uint8 0-255 value is allowed (numeric keypad)
                        0x00, // no exponent (value === value)
                        0x27, 0x25, // https://www.bluetooth.com/specifications/assigned-numbers/units joules (energy)
                        0x01, // Bluetooth SIG Assigned Numbers
                        0x00, // No description
                        0x00])
                })
            ]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expecting NSData value type for Format descriptor'

does this module support startAdvertising?

I'm trying this fork because the sandeepmistry version never starts advertising. I was hoping this version would work.

I am running Mojave.

It seems to run without errors. I'm not sure I installed it correctly.

npm install blen-mac didn't work.

So, I:

  1. downloaded the zip, unzipped it into my node_modeles and named the folder bleno-mac
  2. got an error
  3. cd into bleno-mac and ran npm install which seemed to install successfully

when running, the poweredOn event occurs, after which I'm called startAdvertising, but the advertisingStart never occurs.

Writing multiple values quickly on a characteristic fails

I use bleno to emulate a BLE device, which writes values on a characteristic as data packets.

When I switched to Mojave, I started using bleno-mac, and my emulator stopped working.
The only output I got is peripheralManagerIsReadyToUpdateSubscribers.
Seems it is due to too much data being written.

I was able to verify this by:

  • setting up breakpoints before writing data, thus slowing the rate
  • setting up a delay in between the writes

Possible to make the maxValueSize larger?

First off I want to preface this with I'm a BLE noob so apologies up front,
Second thank you for a node BT lib that actually works with OSX, it's maddening how many are broken or haven't been updated in a long while.

So I'm trying to send information from the peripheral (OSX) but the max value size is set to 20 so if it's bigger than that I can't.

Is it possible to change that or is there a better way to send more info from a peripheral?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.