My name is Gabriel J-C. I attended 9th grade this past school year (2016 to 2017) at The High School for Math, Science, and Engineering at CCNY. I chose to build a Bluetooth beacon for my main project because I wanted to learn more about low-level networking and how it works from the standpoint of electrical engineering (e.g. the way Bluetooth transmitters pack data onto radio waves). I decided on the TV-B-Gone for my starter project because it is a relatively simple tool with significant utility.
I came to BlueStamp because I like engineering and was looking for a project-based program. I’ve had a great experience here. In the end, BlueStamp has taught me that tasks in a project that may seem simple at the outset often end up causing the most trouble. I experienced this when struggling to get the physical PiBeacon device and its corresponding app to “talk” to each other.
Area of Interest
The High School for Math, Science, and Engineering at CCNY
The physical beacon device is a Raspberry Pi Zero W, which has integrated Wi-Fi and Bluetooth radios. I wrote a Python script to automatically set the packet data to be transmitted over Bluetooth LE. That same script also binds a custom HTTP server to port 80 on all of the Pi’s network interfaces. It sets up four HTTP routes: “/enable”, “/disable”, “/status”, and “/update”.
The “/enable” and “/disable” routes enable and disable, respectively, the Pi’s Bluetooth radio when supplied an HTTP GET or HTTP POST request. The “/status” route accepts an HTTP GET request and returns the text “Enabled” or “Disabled” depending on status of the Pi’s Bluetooth radio. The “/update” route accepts an HTTP GET request with the Major and Minor values in the query string. Those values are included in Bluetooth payload and are used to differentiate between different beacons transmitting in the same place, at the same time.
I added a way to visualize the signal strength of the beacon in augmented reality to the iOS app. This functionality is implemented using Apple’s ARKit framework for iOS. Once the user taps the beacon in the camera view, the operating system’s machine vision tracks it and other anchors in said camera view as the iOS device is moved. The app constantly gathers the varying signal strengths of the beacon at different points in space, compiling them into the circular visualization.
I devised an algorithm for translating the signal strength data into real-world space. When a significant change in the RSSI, a measure of signal strength, occurs, the circle extends to the physical location of the phone when said RSSI change was detected. This way, as new data points are collected, the visualization continuously improves in accuracy.
The main GitHub repository for the PiBeacon project can be found at https://github.com/Gerzer/PiBeacon. The GitHub repository for the iOS client app can be found at https://github.com/Gerzer/PiBeacon-Client—mobile-edition. The Bill of Materials (BOM) can be found at https://github.com/Gerzer/PiBeacon#components. The BOM as an Excel file can be found at bluestamp-bill-of-materials-bom.