-->

Can I read iBeacon data using Arduino?

2019-08-05 19:16发布

问题:

I am using an HM-10 module and Arduino UNO.

My requirement is to read data from ibeacons near me using Arduino. Is it possible? I have not been able to find any articles on this. All articles talk about connecting your android phone with arduino. Any idea?

回答1:

Yes, it is possible. I'm using an HM-10 as an iBeacon detector (linksprite.com BLE 4.0 shield), and it is successfully detecting a RadBeacon running in iBeacon mode. Firmware on my HM-10 is version 540.

Before it would detect the RadBeacon, I had to send the HM-10 the following commands:

AT+ROLE1
AT+IMME1
AT+RESET

Then I used the AT-DISI? command, and the serial monitor is showing the broadcast received from the RadBeacon (and one other beacon) as follows (for example):

OK+DISISOK+DISC:4C000215:2G234454CF6D5A0FADF2F4911BA9FFA7:00000001AC:0CF3EE041CCE:-052OK+DISC:00000000:00000000000000000000000000000000:0000000000:B9782E08068C:-071OK+DISCE

In this example, the HM-10 is detecting my RadBeacon which has UUID of 2G234454...with signal strength of -052. It is also detecting another BLE beacon (my AppleTV downstairs) with UUID of B9782E08068C with signal strength of -071.

I'm definitely not very knowledgable about any of this stuff, but it seems to be working for me so far. Next challenge for me will be to figure out how to parse the text data being received. I'm mostly interested in the distance/signal strength data in order to trigger an action when the RadBeacon gets very close to the HM-10.

[Full disclosure: I jumbled some of the UUID numbers above since I'm not sure if any of this information is private or hackable or whatever]

[By the way, the nRF8001 BLE Shield will not do this since it only runs in peripheral mode.]



回答2:

In firmware version V539 of the HM-10, it adds an AT command to list nearby iBeacons. The command is AT+DISI?. You would simply need to set up the Arduion to send that command over a serial port and parse the data it returns.



回答3:

Yes, you can get the Min and Max number of the nearby iBeacons. You need to Attach hm-10 to Arduino Uno.

Try using this Library : https://github.com/dinosd/BLE_PROXIMITY You can configure suitable AT commands if you want to configure it. But it should work with default settings as well.

Use SoftwareSerial to access HM-10.