-
Notifications
You must be signed in to change notification settings - Fork 708
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
BLE Library - Please add Major/Minor #271
Comments
The good news is that the capability you seek is already available. When you are being a BLE Client and performing a scan, for each received advert, you are given an instance of the "BLEAdvertisedDevice". This is the description of the device that is doing the advertising. Now let us turn our attention to a device that IS advertising ... review the following:
You will find that the "beacon" data is advertised in an ordinary BLE Advert and the data you are looking for is contained within the Manufacturer Data portion. This means that when you get a BLEAdvertisedDevice you can perform code similar to the following:
Note that I coded this here in github so haven't tested it. |
See also #196 |
A new class called BLEBeacon has been added ... see #196. |
I was looking at you news BLEAdvertising.h under snippets and wondering if should I copy those under ESP_32_Arduino BLE without pain or better wait for an upgrade and a beacon example working under Arduino. |
What keeps you to not copy it? If it wont works for some reason then you can delete it. Only thing is, if you need to replace files with the same name then make backup. |
You are absolutely right ..later I will do a it and will let you know if somethings brakes. But are not so clear right ways to use them .. let’s try
Inviato da iPhone
… Il giorno 17 dic 2017, alle ore 18:30, chegewara ***@***.***> ha scritto:
What keeps you to not copy it? If it wont works for some reason then you can delete it. Only thing is, if you need to replace files with the same name then make backup.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
OK done Any tips ? Here is the code:
|
@qrpfun Is it still not working for you? |
@chegewara I did some other test but without any success, so then I give up taking care if some other updates should be useful to solve it. But not much time last weeks.
Did you have any new idea about it ?
… @qrpfun Is it still not working for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@qrpfun Im not sure if its still working, but at the publish time its been working If you will find any issues running it just let us know |
@chegewara thanks for the new advice. I have tried again with your code, that's not different from mine, but no result at all. May be the problem is in the rest of the arduino libs, maybe in the iPhone bluetooth stack. |
@qrpfun Thats the problem, you are trying to find not genuine iBeacon with iPhone. Apple sucks (opinion) so much in many ways. If you will check esp-idf issues you can see that espressif devs advise to not use iBeacon with iPhone (i think so). But i will check it out one more time and write arduino ibeacon, but i dont have apple device to make real tests. |
@chegewara maybe that's the problem. I should check with an android device
I do not have any one now.
by now many thanks and have an happy new year !!
…On Sun, Dec 31, 2017 at 4:31 PM, chegewara ***@***.***> wrote:
@qrpfun <https://github.com/qrpfun> Thats the problem, you are trying to
find not genuine iBeacon with iPhone. Apple sucks (opinion) so much in many
ways. If you will check esp-idf issues you can see that espressif devs
advise to not use iBeacon with iPhone (i think so). But i will check it out
one more time and write arduino ibeacon, but i dont have apple device to
make real tests.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AP1uezWqyrRbsKRor6LKBGtWd2ukOYJoks5tF6jdgaJpZM4Q_tlM>
.
--
Giampiero Raschetti
|
Hi Guys - I'm a complete beginner at C++ so looking for some help if possible to get the major and minor values from the call to myAdvertisedDevice->getManufacturerData().data() as per Neil's example above. Thanks for any help. |
Howdy @BladeRunner68 .... I'm thinking your question should be posted to its own issue? This thread has been exclusively about an ESP32 BEING a BLE beacon. I think you are asking about an ESP32 BEING a client to external BLE beacons? If so, can I ask you to create a whole new issue and we'll track it there? |
Hi @nkolban , I'm a bit confused as i created this particular issue back in December to ask about getting the major and minor values from a scan. I can create a separate question if you want but if you review the first couple of points in this issue then review, we can take it further based on your view? Thanks |
Howdy @BladeRunner68 ... its very likely I missed something ... and re-reading the whole thread from the start and will be back shortly. My goal is to delight .... lets see if I can make that goal :-) Doh!!! I see now that this thread is indeed YOUR thread ... and it was piggybacked by others .... studying your question now. |
What we have now done is refactored some code and "hopefully" made things easier. A while back we created a class (BLEBeacon) that provided a way for an ESP32 to become an iBeacon however we neglected to see that the class could also be used to receive data from an iBeacon. I will assume that you are running your ESP32 as a BLE Client and that you are performing scans. When a advert arrives AND you have good faith that the advert represents an iBeacon, you can now call:
In English, what we are saying in the above is "Create me an instance of a class called BLEBeacon" and make the variable
Let's see how you get on with this. Make a first pass attempt at getting something working but don't struggle too much if it is confusing. Instead, post a link to a pastebin of your code and what issues/symptoms you are finding and we'll iterate forward together to get you going. |
Hey @nkolban thanks very much for the code inclusions - no doubt at all that these additions will help me (and others) - particularly the getters. I'll have a bash at some coding this weekend and revert back. |
And please ... don't be shy. If we can be of ANY assistance, don't hesitate to ask. We are happy to help and meet you more than half way. |
@nkolban just for an update: I have imported changes in Arduino IDE by simply copying BLEAdvertising.* BLEBeacon.* and BLEUUID.h and it compiles without any problem. Using this server code on iPhone, iBeacons data still fails |
Howdy mr @qrpfun .... If I'm understanding correctly, your puzzle is about using the ESP32 as a BLE beacon which is broadcasting information. I am thinking that mr @BladeRunner68 puzzle is about using the ESP32 as a BLE advertizing receiver that is receiving incoming BLE adverts from external (real world) beacons. To my thinking these are distinct puzzles. Since this current issue was created first by mr @BladeRunner68 what I'd like to suggest is that you go ahead and create a whole new issue containing your story and documentation. What we'll then do is give you good attention on your puzzle. I think that would be best for all as when we read an issue, it gets complicated when we start to intertwine multiple stories. |
Howdy mr @nkolban . There was some misunderstanding in the beginning while using iBeacon data structure but You are absolutely right, I'm sorry. |
@BladeRunner68 have you had any success finding TILTs with the esp32? I'm actually trying to get it to do the same thing. I'd like to use the values in a temperature controller example |
@rawestmoreland not yet - @nkolban added some great features in the c++ lib but it appears these are not yet accessible by the Arduino/Platformio envs and as such i've put this on hold for a while as I don't have the time anymore to pick this up. |
@nkolban
I get something like this:
This value does not correspond to any of our iBeacons. |
It should have return int16 value. I dont have any iBeacon so i cant test this code, but there is small chance that value needs to be changed from little to big endian before get returned to user. If you can post value that you expect and value you have received then i could have confirm that. ie if im right and you get |
@chegewara |
Hi, You can try to print beacon HEX values in next line where its bugged value. Beacon length is 25 bytes. |
OK i will try. But right now i did't have any Beacon device. I was using my brother's phone to simulate as Beacon(mine does not support beacon advertisement). But now he is gone for may be weak or two. I will test and post results soon. Thank you for response. |
that is the ibeacon structure of payload data: you can get major and minor from bytes 25 to 28 |
I'm looking at using your BLE libs in the ESP32 for scanning and getting major and minor values from a BLE hydrometer (Tilt)
According to the Apple Ibeacon spec: "The UUID, major and minor values provide the identifying information for the iBeacon. "
https://developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf
The makers of the Tilt hydrometer are using the Major and Minor fields to hold variable gravity and temperature values without having to connect directly to the BLE device (thus saving the device battery). This makes the values discoverable by a simple ble scan on a regular basis.
Any chance you can amend the libs to add getters for these values please?
The text was updated successfully, but these errors were encountered: