robotastic / ble-ancs Goto Github PK
View Code? Open in Web Editor NEWA NodeJS library for Apple Notification Center Service over BLE
License: MIT License
A NodeJS library for Apple Notification Center Service over BLE
License: MIT License
Seems like ble-ansc is still the only possible way to get ANCS on raspberry. Got the script working and I can connect to the BLE device but after a few moments it just disconnects or with LightBlue I get an connection Alert Timeout interrogating the peripheral.
consol log:
Bleno: Handle: 68 UUID: 7069df31ed53 address 70:69:... on -> accept: Recieved a Pairing Request Hande:68 uuid: 7069df31ed53 Got a disconnect Got a disconnect Got a disconnect Got a disconnect Able: unknown peripheral 70:69:df:.. disconnected!
Is this a problem with iOS 9 or a configuration problem? Is this project still working?
What version of node should be installed to get all this working?
I’ve bought a Bluetooth USB dongle to try ble-ancs
in a Linux virtual machine on my Mac. Directly after the encryptChange
event the hci0
device powers off. Before starting, I made sure bluetoothd
has run and quit, and hciconfig
showed that hci0
was up. After the power-off, hciconfig
shows hci0
as being down and hcidump
automatically quits. Below are my logs, any idea what could be wrong?
My config:
$ node examples/test
on -> stateChange: poweredOn
on -> advertisingStart: success
Bleno: Handle: 68 UUID: 64f95443f4f9 address 64:f9:54:43:f4:f9
on -> accept:
Recieved a Pairing Request
able encryptChange!!!
on -> stateChange: poweredOff
Full hcidump
before exiting:
HCI sniffer - Bluetooth packet analyzer ver 2.5
device: hci0 snap_len: 1500 filter: 0xffffffffffffffff
> HCI Event: Command Complete (0x0e) plen 4
Set Event Mask (0x03|0x0001) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Event Mask (0x08|0x0001) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 12
Read Local Version Information (0x04|0x0001) ncmd 1
status 0x00
HCI Version: 4.0 (0x6) HCI Revision: 0x22bb
LMP Version: 4.0 (0x6) LMP Subversion: 0x22bb
Manufacturer: Cambridge Silicon Radio (10)
> HCI Event: Command Complete (0x0e) plen 10
Read BD ADDR (0x04|0x0009) ncmd 1
status 0x00 bdaddr 00:1A:7D:DA:71:04
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Enable (0x08|0x000c) ncmd 1
status 0x0c
Error: Command Disallowed
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Parameters (0x08|0x000b) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Response Data (0x08|0x0009) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Data (0x08|0x0008) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x00
> HCI Event: Command Complete (0x0e) plen 6
LE Long Term Key Request Reply (0x08|0x001a) ncmd 1
> HCI Event: Encrypt Change (0x08) plen 4
status 0x00 handle 68 encrypt 0x01
device: disconnected
My dmesg
logs after several attempts, probably including the automatic power-offs and me running sudo start bluetooth
, waiting, and running sudo stop bluetooth
:
[ 225.874987] usb 2-2: USB disconnect, device number 3
[ 229.706650] usb 2-2: new full-speed USB device number 4 using ohci-pci
[ 229.986997] usb 2-2: New USB device found, idVendor=0a12, idProduct=0001
[ 229.987002] usb 2-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 229.987004] usb 2-2: Product: CSR8510 A10
[ 260.126888] hrtimer: interrupt took 1147412 ns
[ 792.258649] usb 2-2: USB disconnect, device number 4
[ 796.072173] usb 2-2: new full-speed USB device number 5 using ohci-pci
[ 796.352900] usb 2-2: New USB device found, idVendor=0a12, idProduct=0001
[ 796.352904] usb 2-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 796.352906] usb 2-2: Product: CSR8510 A10
[ 944.772931] usb 2-2: USB disconnect, device number 5
[ 948.267545] sched: RT throttling activated
[ 948.604987] usb 2-2: new full-speed USB device number 6 using ohci-pci
[ 948.885637] usb 2-2: New USB device found, idVendor=0a12, idProduct=0001
[ 948.885641] usb 2-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 948.885643] usb 2-2: Product: CSR8510 A10
[ 1099.810795] usb 2-2: USB disconnect, device number 6
[ 1099.811419] Bluetooth: hci0 sending frame failed (-19)
[ 1099.812081] Bluetooth: hci0 sending frame failed (-19)
[ 1103.637618] usb 2-2: new full-speed USB device number 7 using ohci-pci
[ 1103.914310] usb 2-2: New USB device found, idVendor=0a12, idProduct=0001
[ 1103.914314] usb 2-2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 1103.914316] usb 2-2: Product: CSR8510 A10
Hi,
Really like the project, want to integrate the function in my CarPC ( raspberry).
When I run a test service, and connect my phone to the ANBR!Tusk Bluetooth device, the phone asks a code. When I try something, or just null, the service reply's disconnected.
Can anyone push me in the right direction to get it woking?
on -> stateChange: poweredOn
on -> advertisingStart: success
Bleno: Handle: 64 UUID: 77ca0d4ba34b address 77:ca:0d:4b:00:00
on -> accept:
Recieved a Pairing Request
Hande:64 uuid: 77ca0d4b0000
Got a disconnect
Got a disconnect
Got a disconnect
Able: unknown peripheral 77:ca:0d:4b:00:00 disconnected!
Thanks!
I am having trouble getting the any of the examples working. I have tried off and on for the last few days and have had little success.
when a run node test.js
I receive the following:
on -> stateChanged: poweredOn
on -> advertisingStart: success
I am running Ubuntu 16.04 LTS in a Virtual Box on top of OSX. I have been taking control of the Bluetooth adapter in the Virtual Box and have tried stopping the Bluetooth service at various states with no success.
I am excited at the possibilities of using this library and would love to contribute a "Getting Started" guide back if someone would be willing to help me get setup. Thank you in advanced.
Hello,
Im trying to connect with the Raspberry Pi 2 with bluetooth dongle. I'm shutting down bluetooth with sudo service bluetooth stop
And starting the example test.js app with node. If i'm trying to connect with my smartphone, i'm getting a timeout error and my raspi only showing up logs to this point:
on -> stateChange: poweredOn
on -> advertisingStart: success
Bleno: Handle: 69 UUID: 63814bf461cf address 63:81:4b:f4:61:cf
on -> accept:
Recieved a Pairing Request
Do you have any suggestions? Thanks a lot....
I’m trying to use ble-ancs to connect to my iPhone for ANCS, to my heart rate sensor, and to an UART device (Bluefruit Micro) from one Node script. Both the sensor and the UART device are BLE peripherals. Before I spend hours trying to make it work, should this be possible in ble-ancs / able already?
[edit: removed irrelevant example, will update if I have a clearer example]
One advantage of sandeepmistry/node-ancs is that the same code works on OS X and on Linux. This allows for developing on an OS X system while testing / deploying on an embedded Linux system. What would it take to add OS X compatibility (possibly through a different BLE library) to ble-ancs?
Here's what it looks like in console:
~/Documents/Coding/ble-ancs master
❯ sudo node examples/test.js
on -> stateChange: poweredOn
on -> advertisingStart: success
able encryptChange!!!
/home/paul/Documents/Coding/ble-ancs/index.js:45
this._peripheral.findServiceAndCharacteristics(SERVICE_UUID, [], function(error, services, characteristics) {
^
TypeError: Cannot read property 'findServiceAndCharacteristics' of undefined
at BleAncs.discoverServicesAndCharacteristics (/home/paul/Documents/Coding/ble-ancs/index.js:45:19)
at BleAncs.onEncryptChange (/home/paul/Documents/Coding/ble-ancs/index.js:233:12)
at emitNone (events.js:86:13)
at Able.emit (events.js:185:7)
at Able.onEncryptChange (/home/paul/Documents/Coding/ble-ancs/lib/able.js:90:10)
at emitNone (events.js:86:13)
at AbleBindings.emit (events.js:185:7)
at AbleBindings.onEncryptChange (/home/paul/Documents/Coding/ble-ancs/lib/hci-socket/bindings.js:370:10)
at emitTwo (events.js:106:13)
at Hci.emit (events.js:191:7)
this._peripheral
isn't set because the accept event hasn't been called yet.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.