Enable Bluetooth Adapter for BeagleBone Black - bluetooth

I recently bought a USB 2.0 Bluetooth Adapter. It claims to have support from Linux kernels of versions 3.4 and higher. I have a BeagleBone Black with Debian GNU/Linux 7 image and kernel 3.8. I am developing on BeagleBone Black by hosting it through USB with ssh.
I have tried both hot plugging and plugging in before boot and failed.
Then, I tried this tutorial. However, I cannot find the connman directory on my BeagleBone Black device. I looked up and assumed I needed to install the connman package, but my BeagleBone Black has no internet access.
I have also tried lsusb -v, as suggested by an answer of a similar question to this, with no luck. The weird thing is, while lsusb itself prints
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
lsusb -v only prints
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
then hangs. Information regarding bus 002, which I believe the device is connected to, is not printed. I have to restart the ssh connection to get back to work.
How should I approach to get the dongle to work on my BeagleBone Black? If the connman package is sufficient, how do I install it on my BeagleBone Black without internet access. Why does lsusb -v hang?
Any help is appreciated!
UPDATE:
The actual problem turned out to be that my BeagleBone Black is flawed/damaged. I plugged the Bluetooth Adapter into a plain new BeagleBone Black before powering it, and the Bluetooth Adapter is recognized! Not only does lsusb prints out the adapter info, but also lsusb -v does not hang at all. The overall performance of the new board (boot time, compilation time, execution time) is also several times better. I suspect that it was due to the various improper power-off.
In case anyone is just as careless, the BeagleBone Black SHALL be powered off by:
Holding down the power button for about 8 seconds then releasing it.
Using halt or shutdown -h now command in the Userspace.

I have possible 4 solutions for you:
1) download the connman package and save it to a usb flashdrive. Connect the flashdrive to the beaglebone and install the package using the following command: dpkg -i {.deb package}.
2) download the connman package on your desktop computer and ssh into your beaglebone. once you ssh in you could copy the file trough ssh using scp. Note the syntax $ scp your_username#remotehost.edu:foobar.txt /some/local/directory. Then install the connman package using dpkg -i {.deb package}.
3) share your desktop computers internet connection with the beaglebone and ssh into the beaglebone. Download the package directly using apt-get or wget whatever tool you prefer.
4) connect your beaglebone to your router using rj-45 cable. Maybe this is not your preferred solution but it's easy and after port forwarding you will have access to your beaglebone from anywhere.
Hope this helps and note that I never used a bluetooth adapter with a BBB. I'm just giving generic instructions on your general problem.

Related

How to create a virtual Mic on MacOS with pulseaudio

I am trying to use pulseaudio with MacOS (Big sur) to create a virtual mic that can be recognised by apps systemwide.I am able to install pulseaudio without any error.
Even the following command is executing:
pacmd load-module module-null-sink sink_name=MySink
But I am not able to see any virtual device created in my device.
What am I missing? Is there any other way to do this?

Do Spreadtrum USB Drivers exist for Linux?

I'm trying to connect to a KaiOS device with adb but whenever I run adb devices I get an empty list of devices, however when I run lsusb I get:
Bus 001 Device 017: ID 1782:4001 Spreadtrum Communications Inc. Spreadtrum Phone
I've done all the pre-setup which include:
Adding SUBSYSTEM=="usb", ATTR{idVendor}=="1782", MODE="0666", GROUP="plugdev" to /etc/udev/rules.d/51-android.rules
Adding 0x1782 to ~/.android/adb_usb.ini
Running sudo udevadm control --reload-rules
But I still get an empty list (I'm on Linux to emphasize). I believe the issue may be that I need a spreadtrum drivers to connect to the device through adb. However I can't seem to find any spreadtrum drivers for Linux, they seem to only be available for Windows?

bcm43xx_init Initialization timed out with buildroot raspberry pi 3 hciattach

I am trying to get the Bluetooth to work in Raspberry Pi 3.
I am using buildroot with:
BlueZ 5.45 ( changed the package to get the latest)
Not using systemd, but I run bluetoothd because
the bluez script is for systemd.
In buildroot I enabled the bt firmware.
I can see the hci_uart.ko file and the Bluetooth firmware hcd file
I removed the console=ttyAMA0,115200 from cmdline.txt
I added rfkill for busybox but I only see the wifi interface, no Bluetooth interface.
running:
hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
output showed:
bcm43xx_init
Initialization timed out
tried 115200, the same.
Notes:
When using BlueZ 3 I am getting invalid id
I read that it is somehow related to BlueZ version so I did take the latest
All the above was taken after deep search.
So what I am missing here?
How can I get the Bluetooth to start running in my Raspberry Pi 3
with buildroot as image creator?
Thank you all!
The main problem is that buildroot adds the pi3-miniuart-bt overlay
in config.txt.
To remove it we need to remove if from the post-image.sh script as parameter to the above script.
In raspberry pi 3 the ttyAMA0 was assigned to bluetooth and the pi3-miniuart-bt restored it back to be serial com port, which disconnects the bluetooth again.
To summarize the steps in buildroot.
Add the bluetooth firmware.
Add bluez 5 utils.
Change the package from bluez 5.44 to 5.45
Add the above sleep. (delete the .stamp_build in bluez to build it again)
remove the /dev/ttyAMA0 from cmdline.txt
After building, check on the target (pi3)
the BCM4343 hcd firmware
hci_uart.ko should be there
hci_uart is not running in case of busybox init (only in systemd)
so just modprobe hci_uart. run lsmod to see that it is running.
To start the service and load the firmware, use hciattach:
hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
Start the bluetoothd daemon:
/usr/libexec/bluetooth/bluetoothd &
Power up the bluetooth hardware using bluetoothctl (power on and agent on).
Now you should see it using hcitool dev.
Again, if you don't remove the overlay you will get timeout.
That it. the hci device should be seen now.
you can see it using:
rfkill list ( install it from busybox-menuconfig)
hciconfig -a
The above steps does not get the console to work properly on the Pi 3 but this is a different story.
As described in the commit adding the firmware, you unfortunately need to patch bluez5_utils to get the firmware to work:
https://git.buildroot.net/buildroot/commit/?id=1f94f1aaab2e786542a83327358570a828d68f45

Pulseaudio no audio via bluetooth a2dp connection buildroot

Edit:
I discovered, that if I run parec | paplay --raw it does play back properly.
How is this possible? There should be just a simple module-loopback error or something like that.
I´m using the CHIP SBC from getchip.com to build an embedded bluetooth audio receiver.
getchip.com offers a debian linux and a customizable buildroot distribution.
I got everything working on the debian distribution with one exception. The volume control with iOS devices don´t work because of the lack of uinput inside the debian kernel.
That´s why i tried to get it to work with the buildroot distribution. It took me a while to get bluetoothd running with simple-agent, as well as pulseaudio built with bluetooth support and the dbus configuration.
I finally got everything ready.
But:
I can connect to the sbc, but there is no sound playing on the headphone jack.
My debugging steps so far:
I´m able to play a local .wav file via paplay
just fine.
I allowed every communication via dbus
the pulseaudio logs show, that sound is coming from the bluetooth source.
the module-switch-on-connect does spawn a loopback from the bluetooth source to the same audio sink as paplay uses.
Debug Logs:
Boot log
Pulseaudio verbose startup
/usr/bin/pulseaudio -vvvv --system --daemonize --disallow-exit
Bluetoothd verbose connection
/usr/libexec/bluetooth/bluetoothd -C -d &
and the bt-agent:
/usr/bin/bt-agent -d -c NoInputNoOutput -p /home/cubbo/.config/bluetooth-default-pin
Pulseaudio verbose connection
Configuration:
Pulseaudio system.pa
Pulseaudio daemon.conf
dbus system.conf
dbus-1/system.d/bluetooth.conf
dbus-1/system.d/pulseaudio-bluetooth.conf
bluetooth/audio.conf
bluetooth/main.conf
I´m pretty sure that I just miss some little configuration and it´ll play just fine. But after nearly one week of debugging I wanted to ask you for help.
I hope I´ve done everything right with attaching the logs via pastebin.
I would appreciate your help!
Thanks!
Greetings, Phil.
I had a similar problem on Antergos, A2DP was not available in pulseaudio.
A2DP was available only when restarting bluethooth service by "systemctl restart bluethooth"
It resulted to be a problem caused by GDM that opened another instance of pulseaudio and captured the bluethooth device. I prevented pulseaudio capturing bluethooth device by masking it for GDM user.
https://wiki.archlinux.org/index.php/Bluetooth_headset#Connecting_works.2C_but_I_cannot_play_sound
$ mkdir -p ~/.config/systemd/user
$ ln -s /dev/null ~/.config/systemd/user/pulseaudio.socket
[restart required]

Can`t find ttyUSB[id]

I have just started with my Raspberry Pi and I have a project where I want to read data from the USB port. I have installed Java JDK8 and written the program that compiles and run. But I get the message that /dev/ttyUSB1 does not exist.
I just have a cable from the USB port on the Arduino going to the USB port on the RPi and I am using Raspbian Debian Wheezy
When I go to DIR /dev/ and use $ ls, I can only find tty0 up to tty63. I have searched on the internet and some say that you can use ttyAMA0, but this does not work. I have also searched for the same problem, but have not found a answer to my problem.
I have used $ lsusb which gave me 4 devices (001-004) on Bus 001. I can see that, for example, my USB keyboard is listed as Bus 001 Device 004: ID 1532:010b Razer USA, Ltd.
and if I run $ dmesg | grep Manufacturer I get that:
[xxxxxxxxx] usb 1-1.2: Manufacturer: Razer
So my question is why does my usb devices not get listed as ttyUSB[id]? Do I have to manually attach it?
I am a bit noob when it comes to Linux.
Hope someone can help me!
I have some bad news for you. The reason you have no /dev/ttyUSB[n] devices on the RPi (when you connect your Arduino) is because you need the Arduino drivers (FTDI drivers in particular). The unfortunate thing is that these drivers don't yet exist for the Arm platform (which includes the RPi). This is according to the FTDI web page showing support. Note the lack of Linux driver support for Arm.
Apparently on Arm running Linux the only way to program the Arduino is via the serial port interface directly via the GPIO pins. Information on doing this can be found here . You will also have to do something similar on the Arduino side see this information.
Once you have the two devices connected via straight serial then your going to probably run into another SNAFU. By default apparently on the RPi Linux will use the serial port for sending debug/console output. In order to use the serial interface for something that behavior has to be modified. This article discusses that. In particular disabling the kernel from using the serial port for terminal use this would seem to apply:
The following steps (based on a clean 2012-07-15-wheezy-raspbian install
Open a terminal on the Raspberry, or connect to Raspberry Pi through SSH.
Make a backup of the /boot/cmdline.txt file.
sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt
Edit /boot/cmdline.txt file:
sudo vi /boot/cmdline.txt
This file contains:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 $
Remove the parameters that reference the UART serial port (ttyAMA0):
dwc_otg.lpm_enable=0 console=tty1 $
Comment next line in /etc/inittab:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Reboot Raspberry Pi
sudo reboot
If you use a different Linux distro than Debian it would be different but the basics would still apply (modifying the kernel command line)

Resources