Just got my Raspberry Pi 3 and I like to get the Bluetooth going on it. I’m planning to use my Raspberry Pi 3 as an ‘obexpush’ server. I like to achieve this by using the command line only. This will help me to get everything I need in a startup bash script so that after every power cycle the Raspberry Pi 3 will be available for the intended operation.
Before starting to work on Raspberry Pi 3 it is a good idea to make sure we are using the latest software. Using an ssh shell and update to the latest software:
sudo apt-get update sudo apt-get upgrade -y sudo apt-get dist-upgrade -y sudo rpi-update sudo reboot
Lets make sure we have the up to date Bluetooth software:
sudo apt-get install pi-bluetooth
I like to have d-feet (The dbus debugging utility https://github.com/GNOME/d-feet) handy as well:
sudo apt-get install d-feet
Now lets get the Bluetooth going:
sudo service bluetooth stop sudo bluetoothd --compat & sudo obexpushd -B -n -o /home/pi/push_files & sudo hciconfig hci0 up
Let’s run the following bash script so that the Bluetooth adapter will be up and running:
#!/bin/bash bluetoothctl << EOF power on discoverable on agent on default-agent EOF
Now lets configure the device (I’m not sure how to resolve all of the below issues):
1. How to change the Pi 3 Bluetooth device name
sudo hciconfig hci0 name 'ArazPi'
2) How to add a “pin” so that any device that wants to pair with Pi 3 have to use this pin
3) How to make all there changes in a batch file and have it run every time after booting up the device