Skip to content

Instantly share code, notes, and snippets.

@StevenRudenko
Last active March 27, 2019 12:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StevenRudenko/b6c032c3c1fdfb5c641ff95883e6cd02 to your computer and use it in GitHub Desktop.
Save StevenRudenko/b6c032c3c1fdfb5c641ff95883e6cd02 to your computer and use it in GitHub Desktop.
https://github.com/intel-iot-devkit/tinyb
https://mcuoneclipse.com/2016/12/19/tutorial-ble-pairing-the-raspberry-pi-3-model-b-with-hexiwear/
# Update BlueZ
sudo apt-get update
sudo apt-get install git build-essential autoconf cmake libtool libglib2.0 libdbus-1-dev libudev-dev libical-dev libreadline-dev
wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.39.tar.xz
tar xvf bluez-5.39.tar.xz
cd bluez-5.39/
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental --with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/systemd
./configure --prefix=/usr \
--mandir=/usr/share/man \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-experimental \
--enable-maintainer-mode
make
sudo make install
sudo cp attrib/gatttool /usr/local/bin
sudo sed -i '/^ExecStart.*bluetoothd\s*$/ s/$/ --experimental/' /lib/systemd/system/bluetooth.service
sudo ln -s /lib/firmware /etc/firmware
sudo systemctl enable bluetooth
sudo systemctl daemon-reload
sudo apt-mark hold bluez
sudo nano /lib/systemd/system/bluetooth.service
ExecStart=/usr/local/libexec/bluetooth/bluetoothd --experimental
sudo systemctl daemon-reload
sudo systemctl restart bluetooth
bluetoothctl
power on
agent on
scan on
scan off
info 00:34:40:0A:00:4E
pair 00:34:40:0A:00:4E
devices
list-attributes 00:34:40:0A:00:4E
read
atribute-info
select-attribute /org/bluez/hci0/dev_00_32_40_08_00_12/service002e/char002f
write 0x3 0x4 0x10 0x20 0x30 0x40
disconnect 00:32:40:08:00:12
quit
sudo apt-get install cmake build-essentials check-install libglib2.0-dev doxygen
git clone https://github.com/intel-iot-devkit/tinyb.git
mkdir build
cd build
cmake -DBUILDJAVA=ON ..
make
sudo checkinstall install
// to remove dpkg -r build
java -Djava.library.path=/usr/lib/jni -cp /usr/share/java/RXTXcomm.jar -jar your.jar
@emnavarro02
Copy link

emnavarro02 commented Mar 27, 2019

Thanks a lot! This script helped me to solve my problem!

However, I think you have a miss-typo in line 59... Where you have

sudo apt-get install cmake build-essentials check-install libglib2.0-dev doxygen

should be:

sudo apt-get install cmake build-essential checkinstall libglib2.0-dev doxygen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment