- Have a linux PC (LPC) ready along with an Arduino(ARD) running the SPP or SPP Multi example code.
- Turn ON the Bluetooth radio(BR) on your LPC.
- Open a terminal on the LPC and type sdptool browse local. This will search for existing services available with your BR.
- If Service Name: Serial Port is not available, type sdptool add SP. Repeat above command to verify if service has now been added.
- Power ON the ARD and connect to it’s USB-to-Serial port using your favorite console program. I used Putty with baud rate 115200. You should see a dialog saying “SPP Bluetooth Library Started”. Without connecting, the arduino firmware is hung up in the setup loop. Use sudo putty if needed.
- Next, perform a scan to verify if Arduino is running the SPP example using hcitool scan. Note the Bluetooth(BDADDR) address of the device.
- Next scan for the services provided by Arduino using sdptool search SP. Arduino with the SPP example will be providing a service called TKJSP (Not sure why it's called that). Note the channel number on which this service is being provided <CH_NUM>.
- Next, we connect and provide the PIN for the bluetooth device using the command bluetooth-agent 0000 <BDADDR>.
- Next we create a port which we will use to talk via the serial port using the command sudo rfcomm bind 0 <BDADDR> <CH_NUM>. If you have already existing rfcomm bindings substitute 0 with a different consecutive number to the last existing rfcomm device. You can check if rfcommN exists by using the command ls /dev/rfc*.
- Open a new putty in root mode and provide /dev/rfcomm0 as the Serial Line @ 9600 baud and watch the first message pop up. Use command sudo putty