Mr Dog Mr Dog - 1 year ago 131
iOS Question

HM-10 and iOS/iBeacon. Communicating between the two

I am trying to wrap my head around the possibilities of the HM-10 but am very new to a lot of how it works. I am only familiar with higher level things.

I originally thought I was going to use the hm-10 as an iBeacon but quickly found out it's limitations. Here was the original plan prior:

iBeacon(HM-10) broadcast in a particular room, when I walk in with my iPhone, it detects my iPhone and then does something, i.e Sets one of its Pins to High.

But based on my research now, this is not possible with iBeacon? I need to use iBeacon broadcasting in hand with regular bluetooth?

As in, upon my App/Phone detecting the iBeacon it then pairs with the HM-10 and sends an AT- command to set one of the pins HIGH.

Does all of this make sense? Could anyone provide some more input?

I am in the process of putting together an iPhone App but just wanted to know if I am on the right track.

Answer Source

Since the HM-10 is based on the CC2540, it should be possible to turn it into a Bluetooth LE beacon, including one that supports an iBeacon format.

A few thoughts to help your understanding:

  1. Standard Bluetooth LE beacons (AltBeacon, iBeacon, URL beacon) are transmit only devices that don't detect phones -- phones detect them using a custom app. So when you say "it detects my iPhone and then does something" this is diverging from a standard Bluetooth LE beacon.

  2. The concept of "pairing" with a Bluetooth device is typically related to Bluetooth classic (e.g. pre-4.0) technology. Bluetooth LE devices like the beacons mentioned above have the concept of connecting to read and write GATT characteristics.

  3. If you do build a custom BLE device that out of a HM-10/CC2540, it would be possible to make it "detect" mobile phones, perhaps by advertising a GATT service, and then doing something upon connecting and/or writing to a characteristic. Since the CC2540 contains GPIO pins, it would be possible to make it "do something" by making a pin go high.

There are two big chunks of work to doing what you describe: (1) writing custom firmware for the CC2540 and (2) writing an iPhone app using CoreBluetooth and/or CoreLocation iBeacon APIs. Before starting on the iOS side, you need to figure out how the Bluetooth device is going to work.