I believe I have the native RPi4 bluetooth functioning. It connects now through both my phone's bluetooth, via the Gateway to the Head Unit Server, and for kicks I also have it connected to my phone's Hotspot service and a bluetooth stereo speaker at the same time. Here's what I did if others want to test and validate:
[Sources: https://www.raspberrypi.org/forums/viewt...185#947185 post #2, and https://www.raspberrypi.org/forums/viewt...?p=1093588 post #10 ... both by Douglas6.]
From the first link, add SP profile via /etc/systemd/system/dbus-org.bluez.service by adding the compatibility flag, ' -C', at the end of the 'ExecStart=' line and adding a new line after that to add the SP profile:
Then, save and exit. I rebooted the RPi4.
After the reboot, I navigated back to the system from OpenAuto and opened the terminal back up and moved over to the second link from above and proceeded with bluetoothctl (where, "AA:BB:CC: DD:EE:FF"=[bdaddr]):
Before exiting bluetoothctl, I opened a second terminal to connect to my phone:
I waited for a few minute to verify that my phone and the RPi both showed as being connected to one another. I chose to reboot because my phone notified me that the RPi has some advanced bluetooth features (still not sure what they are) and that I needed to repair from the peer (RPi) to enable them. So I rebooted to force the RPi to call for the BT connection for my phone to accept.
Normally, I cleanly exit out of everything before shutting down or rebooting, but this time I did a dirty reboot in the second terminal where I entered the rfcomm command (may or may not matter at all, I don't know for sure):
After this reboot, my phone connected automatically and the bluetooth context menu in the Rasbian task bar has a nice green check mark next to my phone without having a bluetooth dongle in my RPi4.
For my bluetooth speaker, I just used the bluetooth icon in the task bar to pair and then the speaker icon in the task bar to connect to it. BT 5.0 can handle multiple devices.
I welcome feedback and how something like this might be implemented into the image once properly vetted by the communnity and developers.
[Sources: https://www.raspberrypi.org/forums/viewt...185#947185 post #2, and https://www.raspberrypi.org/forums/viewt...?p=1093588 post #10 ... both by Douglas6.]
From the first link, add SP profile via /etc/systemd/system/dbus-org.bluez.service by adding the compatibility flag, ' -C', at the end of the 'ExecStart=' line and adding a new line after that to add the SP profile:
ExecStart=/usr/lib/bluetooth/bluetoothd -C
ExecStartPost=/usr/bin/sdptool add SP
Then, save and exit. I rebooted the RPi4.
After the reboot, I navigated back to the system from OpenAuto and opened the terminal back up and moved over to the second link from above and proceeded with bluetoothctl (where, "AA:BB:CC: DD:EE:FF"=[bdaddr]):
$ bluetoothctl
[bluetoothctl]# agent on
[bluetoothctl]# discoverable on
[bluetoothctl]# scan on
[bluetoothctl]# pair AA:BB:CC:DD:EE:FF
[bluetoothctl]# trust AA:BB:CC:DD:EE:FF
[bluetoothctl]# info AA:BB:CC:DD:EE:FF
Before exiting bluetoothctl, I opened a second terminal to connect to my phone:
$ sudo rfcomm connect hci0 AA:BB:CC:DD:EE:FF
I waited for a few minute to verify that my phone and the RPi both showed as being connected to one another. I chose to reboot because my phone notified me that the RPi has some advanced bluetooth features (still not sure what they are) and that I needed to repair from the peer (RPi) to enable them. So I rebooted to force the RPi to call for the BT connection for my phone to accept.
Normally, I cleanly exit out of everything before shutting down or rebooting, but this time I did a dirty reboot in the second terminal where I entered the rfcomm command (may or may not matter at all, I don't know for sure):
$ sudo reboot now
After this reboot, my phone connected automatically and the bluetooth context menu in the Rasbian task bar has a nice green check mark next to my phone without having a bluetooth dongle in my RPi4.
For my bluetooth speaker, I just used the bluetooth icon in the task bar to pair and then the speaker icon in the task bar to connect to it. BT 5.0 can handle multiple devices.
I welcome feedback and how something like this might be implemented into the image once properly vetted by the communnity and developers.