Serial stream over bluetooth

Here are the steps to stream serial data over bluetooth:

Setup

sudo apt-get install bluetooth bluez blueman

To check the status of the bluetooth enter:

systemctl status bluetooth

Then add the serial port profile:

Edit /etc/systemd/system/dbus-org.bluez.service

-Change the ExecStart line by adding a "-C" flag at the end, it should now read "ExecStart=/usr/lib/bluetooth/bluetoothd -C"

-Directly below it add the line "ExecStartPost=/usr/bin/sdptool add SP"

Then change the bluetooth name of the analyzer:

Create the file /etc/machine-info and add "PRETTY_HOSTNAME=device-name"

Pairing

bluetoothctl is used to pair with the computer

enter

sudo bluetoothctl

scan on

This way you can find the address of the computer, once found enter:

scan off

agent on

default-agent

pair <address>

trust <address>

connect <address>

If you go to bluetooth settings in  windows there is an option for "more bluetooth settings."  By opening this up you can find the Com Ports that the bluetooth connection is using.  I read in the forums to try and connect from the PC but I never did get that to work, it worked best to connect from the Zero W.

Streaming

Then type

sudo rfcomm listen hci0

This makes the connection with the bluetooth device

Open a new terminal and start the executable to begin streaming data over bluetooth

Then go to windows and find the "Outgoing" com port, open that port using Putty and the data should start streaming

External links

www.raspberrypi.org/forums/viewtopic.php?t=138145&f=28 

www.raspberrypi.org/forums/viewtopic.php?t=154651 

www.raspberrypi.org/forums/viewtopic.php?t=210881 

stackoverflow.com/questions/26299053/changing-raspberry-pi-bluetooth-device-name 

www.raspberrypi.org/forums/viewtopic.php?p=947185#p947185 

raspberrypi.stackexchange.com/questions/119160/where-to-get-bluetooth-bluetooth-h-for-raspberry-pi