sandeepmistry / node-bleacon

A Node.js library for creating, discovering, and configuring iBeacons
MIT License
498 stars 88 forks source link

OS X - Error: service uuid 1800 not found! #70

Closed spatsatzis closed 7 years ago

spatsatzis commented 7 years ago

Hello, thanks for your projects. I'm reading about iBeacons and i came across you github repository.

I'm owning an Estimote Development Kit, (3 iBeacons) and i want to interact with them without using iOS or Android.

So here i'm reading about bleacon. I want you help in order to understand what i'm making wrong !

I can discover/connect/pair my beacons but that't it ! I can't go any further, and i'm failing to this error when i try to for example write a new device name.

Finally can you tell me the difference between these 3 projects:

https://github.com/sandeepmistry/bleno https://github.com/sandeepmistry/noble https://github.com/sandeepmistry/node-bleacon

thank you very much !

sandeepmistry commented 7 years ago

I can discover/connect/pair my beacons but that't it ! I can't go any further, and i'm failing to this error when i try to for example write a new device name.

Please share the example code you are using ... and firmware version on the beacons ...

spatsatzis commented 7 years ago

` var Estimote = require('bleacon').Estimote;

Estimote.discover(function(estimote){

estimote.connectAndSetUp(function(error) {
    estimote.pair(function(error){
        console.log('paired');
        estimote.subscribeMotion(function(error){
            console.log('subsc: ' + error)
        });

        estimote.on('motionStateChange', function(isMoving){
            console.log('motion: ' + isMoving);
        });

        var deviceName = 'estimote';
        estimote.writeDeviceName(deviceName, function(error){
            console.log('devname: '+error)
        });
    });
});

});

`

Thanks for answering, i can't make motionStateChange work either.

My firmware version is lower than 3.2.0. It's 3.0.1 or 3.1 i don't remember it right now. Do you want to check it?

Thanks !

sandeepmistry commented 7 years ago

Do you want to check it?

Yes, please. Also provide an HCI dump capture: sudo hcidump -t -x

spatsatzis commented 7 years ago

firmware version = A3.0.1���� hardware version = D3.4������

The first thing i should mention as i understand it's that i'm running OSX, not linux. later in the afternoon i will try with my raspberry pi.

Apple Bluetooth Software Version: 4.4.6f1 17910

Hardware, Features, and Settings: Address: 3C-15-C2-BB-2E-A7 Bluetooth Low Energy Supported: Yes Handoff Supported: Yes Instant Hot Spot Supported: Yes Manufacturer: Broadcom Transport: USB Chipset: 20702B0 Firmware Version: v118 c9121 Bluetooth Power: On Discoverable: Off Connectable: Yes Auto Seek Pointing: On Remote wake: On Vendor ID: 0x05AC Product ID: 0x8289 HCI Version: 4.0 (0x6) HCI Revision: 0x23A1 LMP Version: 4.0 (0x6) LMP Subversion: 0x4176 Device Type (Major): Computer Device Type (Complete): Mac Portable Composite Class Of Device: 0x38010C Device Class (Major): 0x01 Device Class (Minor): 0x03 Service Class: 0x1C0 Auto Seek Keyboard: On

Thanks

spatsatzis commented 7 years ago

So now im running on raspberry pi 3 and here is the dump

http://pastebin.com/raw/KtTcPxZZ

sandeepmistry commented 7 years ago

The first thing i should mention as i understand it's that i'm running OSX

Ok, that makes more sense. On OS X, CoreBluetooth does not provide access on the 1800 service, so writeDeviceName will always fail.

Can you try another operation?

spatsatzis commented 7 years ago

I'm trying the same code at my raspberry pi 3 with raspbian and the result is the same, i can't change the device name, neither trigger the motionStateChange event.

Sometimes i get

noble warning: unknown handle 64 disconnected! estimote.subscribeMotion -> Error: service uuid b9403000f5f8466eaff925556b57fe6d not found! estimote.writeDeviceName -> Error: service uuid 1800 not found!

Do you think its adapters problem or OS ?

What i'm trying to do is to measure the rssi and/or measuredPower and/or accuracy every X milliseconds in order to "detect" motion between the beacon and the receiver. Do you think it is possible?

sandeepmistry commented 7 years ago

Do you think its adapters problem or OS ?

Maybe, I would suggest you try to update to the latest noble dependency manually, there were some fixes.

What i'm trying to do is to measure the rssi and/or measuredPower and/or accuracy every X milliseconds in order to "detect" motion between the beacon and the receiver. Do you think it is possible?

Yes, but I haven't tried it myself of late.

spatsatzis commented 7 years ago

Lets close the issue, thank you very much for supporting.