IMP + BLE reference design

I intend to use the IMP004 + giga BLE as you have for the reference design (except it uses the IMP002)

Question:
Would it be possible for the BLE device to detect another BLE (like an enabled phone…and send a message to the cloud this device with this UUID is connected. I want to detect if a certain person is within a certain range of the IMP004/BLE gateway box.

Appreciate the comments

The phone would have to be sending stuff out for the giga BLE to see it; eg iBeacons just broadcast - the phone has to receive the beacon and have an app installed for any action to be triggered. The phone doesn’t send anything over BLE in reply.

Could be possible to identify another BLE device, such as phone with Bluetooth enabled, by scanning for it’s Bluetooth MAC address. Otherwise, depending on phone OS, could get phone to act like a beacon by creating an app to transmit a UUID for giga BLE to detect. You will of course need to check the giga firmware to make sure it has suitable functions you can use to detect your UUID formatted code.

If open to BLE alternatives, I notice that Sparkfun have a new BLE breakout board where you can create your own firmware https://www.sparkfun.com/products/13990

Mmm, generally bluetooth devices don’t respond to scans unless they’re in visible mode (eg when you’re in the pairing screen).

If you can install apps on the phone, then writing one that responds to a beacon being sent out by the BLE module (with an https request to a cloud server) is the most reliable method - at least for iOS devices.

Otherwise, some wifi APs (eg the already defunct Google Onhub) allows you to do this by monitoring when the phone signs onto the WiFi network.

Good point @hugo.

In fact my comment was based on assumption. Upon further checking it appears the Radius Networks’ Beacon Transmit app, which I had heard about, on Google Play store is limited to only a few phones.

The only other applications I’ve heard about, which can interact with a phone without an app use Google’s Eddystone protocol to transmit a URL. A demo of how a phone detects this URL and then how the back office processes this can be seen on this IBM Watson Parking demo. In my opinion, you could develop similar functionality using the IMP + BLE.

Thought to test your idea (helped me refine my thinking on topic) as just so happened that I have a Seeedstudio Grove BLE device (as well as a bunch of ibeacons) on my desk. This uses an HM-11 SOC (TI CC2540). This device is controlled via AT command set via UART. You can connect it up to an Imp device.

I used MIT App Inventor, which is a quick way to test proof of concept, to create a BLE enabled app. You will require the BLE extension. Here you can scan for BLE devices. You could then simply post this list off to the Imp Agent for assessment. Alternatively you can get the app to connect to the HM-11 device (default name HMsoft) and then the Imp Device will receive confirmation that something has connected to the HM-11 device. Some pictures of how simple phone app was created is attached.

Conclusion, this method appears much simpler than using Eddystone URL’s etc. Furthermore you could get the Imp device to change HM-11 device name and UUID’s dynamically too, if so required / inclined. Note that the scanned result list of detected BLE devices (shown in pictures) also provides signal strength which will help determine if within range etc.

Impeccable timing… just published today… document on how to implement web-based bluetooth scanning.

So no real need to develop yet-another-app. It can all be done via web-browser api (which means can be coded in Imp Agent if so inclined).

https://webbluetoothcg.github.io/web-bluetooth/scanning.html

Though, that requires the browser to have access to bluetooth. There are quite a few people who find the idea of letting webpages control local hardware (beyond the screen & speaker of your computer) a bit worrying…

Yes I find it curious that many are against it as seems an arbitrary limit (i.e. cannot go beyond screen & speaker). Maybe it’s linked to a Personal Computer / desktop mindset and not mobile technology with computing functionality/services on demand. I personally would be more worried about downloading an unknown or new app than opening up a website, as it can do just as much if not more damage to your hardware (or possibly extract personal data), and with an app you have no way of reviewing the client side code as you can a website, so more covert.

IMHO I think there are quite a few use cases where access to bluetooth via website would work better than via app.

I decided to pull together my earlier BLE demo, polish it up a bit to create an application and publish it on hackster.io for anyone interested.

Hello Gerrikoio
thank you very much for your insightful comments and work. I loked at hackster.io link and it looks like it is right in line with what I need to accomplish.
Essentially, I would like for any person with a BLE enables phone (Android or IoS) to be able to register their UUID at the front desk, which enters the UUD to a dashboard, assigns a room (ie like a hotel) and then as this UUID phone comes within range of the target area (which recognizes the UUID), then gives access to a set of functions in this area. Simply because the BLE gateway (with IMP004) identified the UUID, connected to the IMP IDE to the dashboard and a match was made.
Can this be done? I am not as good as you with this so I am looking for some help.

Hi @Jpaetau. Yes it can be done, but maybe not quite the way you say (ref @Hugo 's comment - a person’s phone must not only have bluetooth enabled but must be in scan / visible mode to be detected).

It just so happens that I am playing around with a similar idea via a Hackster competition - see: https://www.hackster.io/contests/Intel-Arduino-101/ideas/4828.

Although this is not an Electric Imp hardware project, it will hopefully validate some of the methodology further as to how best to handle exchange of person’s electronic data via bluetooth/BLE (or some other method) in order to validate / verify who they are and to make sure there is a unique token authenticating / controlling their access etc.

Still, the Electric Imp hardware may well prove to be the best ecosystem to handle the WiFi / Cloud server side which is essential in handling the messaging side seamlessly and securely (unless of course you want the whole system to be on a private LAN with no Internet access, which will then present a whole new set of challenges with data transfer to/from customer phone).