Detect iBeacons using Spark Core and BLE Mini

@krvarma, many thanks for the suggestion. I modified your code to output to an arduino serial and removed the 1000ms delay, but the delay remains ( still trying to work out why )

I’m really trying to find a way to make it so that if a beacon is set to advertise every 20ms, the BLE mini would pick each up and pass it to the serial to print (Im trying to get as much resolution on the change of distance of a beacon as possible )

@Mike100, let me check this weekend and get back here.

Hi Mike, KRVarma,

I’m a newbie trying to hookup a BLE Mini with an Arduino Mega and attempting to listen to a Beacon Module Bluetooth 4.0 (CC2541). If you don’t mind, can you please share what modifications you did to the code to get it to work with Arduino? Thanks! Instead of displaying results on the screen, I am trying to simply have an LED light up for a particular set of beacons.

@raza, it should work by changing the Serial1 to Serial or SoftSerial. I have tried while working on this project. First I tried with Arduino and then converted to Spark Core.

Can this program be used to detect Google Eddystone beacons? I’m looking for a way to “see” the URL that the Eddystone beacon broadcasts.

@bravomikebravo, this as such will not work for Eddystone because the Advertisement Data is very different. We have to modify it to parse the Eddystone data. So by parsing the Eddystone Advertisement data, we can use this for your purpose.

Hello
I Test your program, but Arduino reset at a certain time
I put the following line

void setup(){
  Serial.begin(9600);
  Serial.println("START");
  BTSerial.begin(57600);
  hci_init();
}

to give the following

RSSI: 169, 169
iBeacon UUID: B9:40:7F:30:F5:F8:46:6E:AF:F9:25:55:6B:57:FE:6D
iBeaconMajor: 1915
Minor: 28520
Measured Power: BC

RSSI: 104, 104
iBeacon UUID: 00:09:8C:7D:9D:66:7C:B9:1E:02:01:06:1A:FF:4C:6D
iBeaconMajor: 1915
Minor: 28520
Measured Power: BC
START

RSSI: 177, 177
iBeacon UUID: B9:40:7F:30:F5:F8:46:6E:AF:F9:25:55:6B:57:FE:6D
iBeaconMajor: 5953
Minor: -18880
Measured Power: B6

RSSI: 177, 177
iBeacon UUID: FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:6D
iBeaconMajor: 5953
Minor: -18880
Measured Power: B6

RSSI: 170, 170
iBeacon UUID: B9:40:7F:30:F5:F8:46:6E:AF:F9:25:55:6B:57:FE:6D
iBeaconMajor: 4533
Minor: -14213
Measured Power: BC

RSSI: 170, 170
iBeacon UUID: 7F:30:F5:F8:46:6E:AF:F9:25:55:6B:57:FE:6D:11:6D
iBeaconMajor: 4533
Minor: -14213
Measured Power: BC
START

RSSI: 174, 174
iBeacon UUID: B9:40:7F:30:F5:F8:46:6E:AF:F9:25:55:6B:57:FE:6D
iBeaconMajor: 5953
Minor: -18880
Measured Power: B6

Hello!
Can you use another Bluetooth module for the same application?
In particular I am interested in whether this module can be used: https://shop.mikroe.com/ble-2-click in combination with Electron.
@krvarma @jbennett @peekay123 @ScruffR

Have a nice weekend :slight_smile:

@developer_bt, the code is for BLE Mini board and it uses HCI commands. I am not familiar with the BLE2 Click board and not sure it supports HCI commands. Even if it supports you have to change the code for this board.

Hi @krvarma
Thanks for the answer. I currently have only this module. I’ll check it out, but it looks like I will have to buy BLE mini.

@krvarma
Did you manage to successfully read more than one ibeacon? Or the problem has not yet been found.

@developer_bt, no, I didn’t solve that. It is kept aside for a long time. I am sure when I will be able to resume it since I am busy with other works. Sorry about that.

Thanks for the answer. I’ll see what can be done.