Skip to content
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

This never works! #4

Open
eos1d3 opened this issue Jul 5, 2019 · 5 comments
Open

This never works! #4

eos1d3 opened this issue Jul 5, 2019 · 5 comments

Comments

@eos1d3
Copy link

eos1d3 commented Jul 5, 2019

I use your code and just removed the LCD and pubsub code.

This is the output:

Advertised Device: Name: MJ_HT_V1, Address: 58:2d:34:34:0f:a1, serviceUUID: 0000180f-0000-1000-8000-00805f9b34fb
Payload:fe95c12d3f3acea2
Found device count : 4
Start BLE scan for 60 seconds...


Advertised Device: Name: MJ_HT_V1, Address: 58:2d:34:34:0f:a1, serviceUUID: 0000180f-0000-1000-8000-00805f9b34fb
Payload:fe95c12d3f3acea2
Found device count : 4
Start BLE scan for 60 seconds...


Advertised Device: Name: MJ_HT_V1, Address: 58:2d:34:34:0f:a1, serviceUUID: 0000180f-0000-1000-8000-00805f9b34fb
Payload:fe95c12d3f3acea2
Found device count : 4
Start BLE scan for 60 seconds...


strServiceData.length() is always 6. How can this work?

@eos1d3 eos1d3 changed the title This never work! This never works! Jul 5, 2019
@eos1d3
Copy link
Author

eos1d3 commented Jul 6, 2019

The official ESP32 Arduino BLE does not work for getting service data of MJ_HT_V1.

Use https://github.com/fguiet/ESP32_BLE_Arduino

Use advertisedDevice.getServiceDataCount() to get no. of data, and use advertisedDevice.getServiceData(serviceDataIndex) for getting actual data.

Then this fixes the problem.

@nicoinn
Copy link

nicoinn commented Nov 26, 2019

@eos1d3

I seem to be facing the same problems. Could you give a bit more details on how you got around that issue ?

@stripu
Copy link

stripu commented Jan 14, 2020

@eos1d3
Can you please give us an example of the implementation, for us beginners? :)
I've been banging my head trying to make this work, and i'm stuck exactly on this issue.
Thanks!

@eos1d3
Copy link
Author

eos1d3 commented Jan 14, 2020

@nicoinn @stripu Use the library I mentioned above.

The old one does not work:
advertisedDevice.getServiceData();

With the new above library, you have to get no. of service data:
int serviceDataCount = advertisedDevice.getServiceDataCount();

And then loop for each service data with:
advertisedDevice.getServiceData(serviceDataIndex);

@educ8s
Copy link

educ8s commented Oct 7, 2020

I get it to work.

At line 63 at the bridge file replace the command with following two commands.

int serviceDataCount = advertisedDevice.getServiceDataCount();
std::string strServiceData = advertisedDevice.getServiceData(0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants