Sunday, July 23, 2017

Scan For Bluetooth Enabled iBeacons Via A Raspberry Pi IoT Device

Scan For Bluetooth Enabled iBeacons Via A Raspberry Pi IoT Device



Lately I’ve been working a lot with iBeacons and Raspberry Pi Internet of Things (IoT) devices.  I’ve been building an office monitor for logging foot traffic around the office.  I planted a few Raspberry Pi devices around the office and distributed some Gimbal iBeacons to a few of my coworkers so I could determine what part of the office experiences the most heat.
While Raspberry Pi 3 devices come with integrated bluetooth, Raspbian Linux is not configured to support BLE scanning.  There are a few packages that must be installed to make BLE scanning possible.
We’re going to see what is necessary to scan for BLE iBeacons using a Raspberry Pi with Raspbian Linux installed.
To be clear, you can actually scan for bluetooth devices with the latest version of Raspbian, but it isn’t enough out of the box.  Instead, we need to install a few things.
We’re going to be using Raspbian Linux.  If you don’t already have it set up, check out a tutorial I wrote previously on the subject.  Assuming your Raspberry Pi is already up and running with Raspbian, execute the following:
BlueZ is a very popular Linux bluetooth stack and it includes tools like hcitool and hcidump.  The goal with these tools is to scan for LE data in the background and dump the data into a script.
With the appropriate tools installed, iBeacons can be scanned and dumped like the following:
The above commands are only a part of the puzzle.  The data dumped by hcidump isn’t anything nice to work with.  Instead, we can take a look at a very popular parsing tool released by Radius Networks.
If you downloaded the tool, execute it like the following:
The script will output the UUID, major, minor and power for any iBeacon that was found.  I’m personally using the Radius Networks script to pipe the iBeacon information into another application that will record it.

Conclusion

With the price of iBeacons and Raspberry Pi devices being so low, it makes developing with the two more enjoyable.  To scan for iBeacon devices with a Raspberry Pi, you need the BlueZ tool set and the convenient Radius Networks command line script.  There are many other ways to scan for proximity beacons on a Raspberry Pi, for example Python, but that is a story best saved for another day.

Creating ISO images from a folder in OSX – Matt Berther

Creating ISO images from a folder in OSX – Matt Berther



Yet one other thing I love about OSX is that .iso is a first-class citizen. I'm able to mount/burn iso files without installing any other software (yes, I'm looking at you Windows).
Recently, I had a group of files and folders that I have been transporting around. I had been looking for a way to group these into an ISO so 1) they'd be easier to transport and 2) I could burn them to a CD easier. What I did not know was that with the hdiutil terminal app, I am also able to create an ISO of a folder in OSX without any additional tools.
The syntax is pretty simple:
hdiutil makehybrid -o ~/Desktop/image.iso ~/path/to/folder/to/be/converted -iso -joliet
Mission accomplished.