Feeds:
Posts
Comments

Archive for the ‘Maker’ Category

Goal: run java code on your RPI 3 that connects with BLE devices

September 2017

rpi

It is non-trivial to achieve this, but fortunately there was this excellent guide by Michael Haugk: http://fam-haugk.de/starting-with-bluetooth-le-on-the-raspberry-pi

The guide gives step by step instructions on how to install the necessary libraries:

1. Install and test bluez
2. Install cmake
3. Install tinyb

Fortunately for us, the latest release of Raspbian now has good support for bluez and cmake, so these steps can be simplified if you start with a fresh copy of Raspbian.

I’ve used the september 2017 release of raspbian stretch, which can be found here: https://www.raspberrypi.org/downloads/raspbian/

1. Install and test bluez

The latest edition of cmake is now the default for this platform. So after installing the raspbian image to the memory card, just run these commands:

sudo apt-get update
sudo apt-get upgrade

(just press enter to answer Y when the tools ask for confirmation)

You now have access to the hcitool. Scan for nearby ble devices with:

sudo hcitool lescan

2. Install cmake

The good news is that the standard version of cmake is now the latest version, that will allow us to build tinyb. Install it with the following command:

sudo apt-get install cmake

3. Install tinyb

This you still have to do by hand. Therefore I refer you Michael Haugk’s manual:

http://fam-haugk.de/starting-with-bluetooth-le-on-the-raspberry-pi

Read Full Post »