question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nothing returned from device.discoverAllServicesAndCharacteristics()

See original GitHub issue

I have a raspBerry Pi zero W running node with bleno. I have a service for writing to the PI. I used lightblue to connect to the pi over bluetooth and write hex values which I am able to see logging from the pi. (<< just to confirm the pi is working as expected)

So I am sure I have a service working but when I call device.discoverAllServicesAndCharacteristics() from the “Connecting and discovering services and characteristics” section in the documents, the device object, when I console.log from the second .then() looks like – id:“B8:27:EB:E4:EF:C5” isConnectable:null localName:null manufacturerData:null name:“raspberrypi” overflowServiceUUIDs:null rssi:null serviceData:null serviceUUIDs:null solicitedServiceUUIDs:null txPowerLevel:null

to me it seems there are no services coming from the device? what might I be doing incorrectly? I have also confirmed the deviced id matches that coming from the pi.

the code im having issues with is - `

scanAndConnect() { this.manager.startDeviceScan(null, null, (error, device) => { if (error) { // Handle error (scanning will be stopped automatically) return } // Check if it is a device you are looking for based on advertisement data // or other criteria. if (device.name === ‘raspberrypi’) { this.manager.stopDeviceScan(); device.connect() .then((device) => { return device.discoverAllServicesAndCharacteristics(device.id) }) .then((device) => { console.log(“device connected!”); console.log(device); // <--------- this is the console.log() I am referring to // Do work on device with services and characteristics }) .catch((error) => { // Handle errors console.log(error); }); } }); } `

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
Cierpliwycommented, Nov 30, 2017

There is services() function which returns Array of currently discovered services.

0reactions
Cierpliwycommented, Nov 30, 2017

Fixed previous comment to not mislead anybody.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nothing returned from device ...
I have a raspBerry Pi zero W running node with bleno. I have a service for writing to the PI. I used lightblue...
Read more >
RxBLELibraries/react-native-ble - Gitter
Hello everyone, I have been working on react-native project which uses react-native-ble-plx library to connect to devices and read their characteristics. I ...
Read more >
react-native-ble-plx HELP to get the Service ... - Stack Overflow
I have something already but when I write the characteristics the device doesn't change as we spect, the device does NOTHING and I...
Read more >
react-native-ble-plx 2.0.2 | Documentation
Characteristic is a container for a value which can be read, written and monitored based on available capabilities. For example connection may look...
Read more >
react-native-ble-plx - npm
async device.discoverAllServicesAndCharacteristics(). Discovers all services and characteristics for device. Parameters and return value:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found