Code Monkey home page Code Monkey logo

vicinity's Introduction

Vicinity

Vicinity replicates iBeacons and supports broadcasting and detecting low-energy bluetooth devices in the background.

It is built with CoreBluetooth framework and doesn't use CoreLocation to implement iBeacons. CoreLocation itself limits how it can be used when apps are in the background, whereas CoreBluetooth fully supports background operations.

What is iBeacon

The term iBeacon describes the ability of low-engergy bluetooth devices to broadcast and detect proximity of devices by analyzing the received signal strength of the wireless bluetooth signal.

In the iOS SDK iBeacons are implemented in the CoreLocation framework—which places many limits on how it can be used in the background.

The CoreBluetooth framework itself supports RSSI (received signal strength indication), which is all that it is needed to replicate the iBeacon sections of CoreLocation.

The problem with using CoreLocation to detect iBeacons is this functionality is very limited once an app is in the background. CoreBluetooth has much greater background support of iOS apps. With CoreBluetooth, you can broadcast as a peripheral and detect as a central while in the background. The framework will even allow limited actions within your app code while these services are running.

INBeaconService

The heart of this is INBeaconService. This replicates how iBeacons work by analyzing RSSI of low-energy bluetooth broadcasts. Most of the work is done using CBPeripheralManager and CBCentralManager, which are classes in the CoreBluetooth framework.

Getting this to work effectively required a two things:

  1. interpreting the RSSI values reliably, taking into account sensor noise and signal spikes
  2. converting the RSSI values to distances

Signal Noise

When Reading data from sensors on iOS, be that accelerometer or RSSI, the values can contain a lot of noise and spikes. I initially tried to use a weighted average which didn't work that well. Applying an "easing function" to smooth out the incoming signal values worked much better.

RSSI to Distance

Converting the RSSI values to distances was a matter of trial and error. I also cheated by realizing that iBeacons uses fuzzy distance terms like "Far", "Near", and "Immediate". The reason for these values became obvious once we analyzed the actual data. Bluetooth RSSI flucuates wildly at ranges beyond five feet and becomes more accurate at values less than 1 foot.

Supposedly, different bluetooth devices are going to have varying signal strengths, but the smattering of iOS devices we measured reported the same values.

Conclusion

We hope this simple app will come in useful.

Contact us with questions!

vicinity's People

Contributors

bentford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vicinity's Issues

Broadcast/Detect simultaneously

Hi,

is it possible to broadcast and detect with a device simultaneously? I was just wondering while studying the code...

Thank you for a reply :)

Cant find my beacon

Hi Is there any UUID i need to change to find my beacon? I cant find my beacon.

Device Reboot

Hello,

Have you been able to make this work after a device reboot? It seems that broadcasting and scanning both work in the background, but not after the device is restarted.

Thanks,

-Dave

Which files do I need in my own project?

Hi!

I can't really distinguish between the files I need if I want to implement Vicinity into my own project, because the repo is at the same time a demo. Running the downloaded repo is no problem, but I want to import just the essential files of INBeaconService and its dependencies into my project to reconstruct similar behaviour as shown in your demo. I hope you can help me a little bit, because it's also hard to understand the code if I don't know where to look.

Thank you very much,
Cheers! :)
Gian

Major/Minor values

Hi,
From what I understood by briefly looking at your code there is no support for the major/minor values when broadcasting? Without them it's impossible to get a unique identifier per device without connecting to the device I guess?
From my research Apple seems to prohibit adding any useful information to the advertisement packet which is a shame.

Thanks!
Michael

plainButtonWithNormalImageName method not found

First, I download the code, and then I run the code, the error say the EasyLayout.h not found. so I download the EasyLayout Code, and add it to the Xcode project. And I run again, the error say plainButtonWithNormalImageName not found.I have to annotate the code in order to run successfully. where is the method?

EasyLayout.h

Hey all,

I am trying out this project. However, I got ConsoleView.m complaining EasyLayout.h file not found.

I am using latest Xcode and checked out the latest version of this project.

Thanks,
Frank

Problem ranging real iBeacons

Hi,
It looks like there is a problem when detecting the real iBeacon signals. When two instances of Vicinity is running on different devices (one for advertising and one for detecting) they see each other. However, when I use a real iBeacon, Vicinity can not detect the signals. It is always out of range. I did not forget to provide the correct "SINGLETON_IDENTIFIER" value for estimate beacons. This is also true for advertising. Vicinity signals can not be detected as iBeacon signals (as an example, can'be detected by Estimote app). So is this example only meant to work with "Vicinity way" of beacons or am I missing out something?

Help Launching on IOS

I cannot for the life of me figure out how to get this onto my iphone, any help with the issue would be greatly appreciated. I have X-Code but I cannot get the project to run.

Detecting beacons with Swift

Hello,

First of all, thank you so much for a great project. Vicinity is exactly what I was looking for.


Okay, I'm trying to use Vicinity with Swift; mainly to broadcast and detect beacons in background mode.
I succeed to make my swift-app to broadcast beacons but still not able to pull data from INBeaconServices's detector-part. (I'm using the original Vicinity to detect and show the range of beacons at this moment.)
I'd tried to show logs of every functions in INBeaconService and I'm sure it's detecting beacons from other devices. So, the only problem is I'm not able to get data from there.

If someone is using Vicinity + Swift, I would appreciate some hints to pull out beacon data from INBeaconService -automatically&frequently like the original Vicinity is doing.

Thank you,

Detecting background broadcast while in the background

I'm having an issue detecting another device while both devices are in the background.

I start one device and lock it, having it detect in the background. I start the app on the other device, having it broadcast in the foreground. Detecting device finds the broadcast, great.

Then comes my problem:

I restart the device in the background. This time I have the second device broadcast while in the background. The detecting device is not able to find it.

Have you encountered this problem? Any ideas?

Thanks

Android version

I want to create a Vicinity android version. The app I am developing is cross platform. How should I approach this problem? How can I be able to scan and broadcast Vicinity signals on android?
Thank you very much in advance!

Support for iOS Simulator

I am unable to toggle into broadcast mode in the iOS Simulator. Looking at the code, it seems that since both isDetecting and isBroadcasting are false, nothing happens when you tap the toggle button.

see - (void)didToggleMode:(UIButton *)button

Beacon Advertising

I am attempting to transmit beacons in the background on iOS devices while in Advertisement mode and not Connected Mode. I have a scanner that is able to pick up on various formatted beacons while they are within range. I am able to transmit and receive ibeacons when utilizing the coreloction framework, but I am not able to detect any beacons when utilizing this project. I do not want to establish any connections. I strictly want to transmit ble advertisements over the three established BLE advertising channels. Does this project allow for BLE advertising of UUID beacons while in "Advertisement Mode" and also in the background? Does another iOS device have to be specifically looking for this beacon? If that is the case, is there a way around that so a linux machine scanning the three advertising channels would be able to detect the UUID beacon?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.