Using the new jBluetooth library it is possible to communicate with Raspberry Pi devices over Bluetooth.
Bluetooth can be very useful in places where there is no local network.
The configuration is not so simple but it works and it seems to be stable.
I've used a Broadcamm dongle.
Lets start with a video that shows an Android device connects to the RPi with PiFace. The Android device controls the leds and monitors the buttons state.
Note that the PiFace extension is only used for demonstration purposes.
(Make sure to set the video setting to HD.)
Configuration
The first step is to install the drivers required.
1. Follow these instructions: https://www.raspberrypi.org/learning/robo-butler/bluetooth-setup/
At this point the Bluetooth should work when you test it with: hcitool scan
2. Run this command:
3. Download bluecove_rpi_jars.zip that is attached to this post and copy the jars to the additional libraries folder.
Note that bluecove-gpl is licensed under the GPL license. The other jars are licensed under the Apache 2 license.
The jars are based on this build: http://lukealderton.co.uk/blog/posts/2015/january/raspberry-pi-bluetooth-using-bluecove-on-raspbian/
4. Run the attached example and monitor the logs. You can enable debug logs with this line:
Assuming that everything works properly then you should see the MAC address in the logs.
You can use this address to connect from the Android device
Bluetooth can be very useful in places where there is no local network.
The configuration is not so simple but it works and it seems to be stable.
I've used a Broadcamm dongle.
Lets start with a video that shows an Android device connects to the RPi with PiFace. The Android device controls the leds and monitors the buttons state.
Note that the PiFace extension is only used for demonstration purposes.
(Make sure to set the video setting to HD.)
Configuration
The first step is to install the drivers required.
1. Follow these instructions: https://www.raspberrypi.org/learning/robo-butler/bluetooth-setup/
At this point the Bluetooth should work when you test it with: hcitool scan
2. Run this command:
B4X:
sudo apt-get install libbluetooth-dev
Note that bluecove-gpl is licensed under the GPL license. The other jars are licensed under the Apache 2 license.
The jars are based on this build: http://lukealderton.co.uk/blog/posts/2015/january/raspberry-pi-bluetooth-using-bluecove-on-raspbian/
4. Run the attached example and monitor the logs. You can enable debug logs with this line:
B4X:
SetSystemProperty("bluecove.debug", "true")
Assuming that everything works properly then you should see the MAC address in the logs.
You can use this address to connect from the Android device