Connecting to a BT device using console tools

Open
#2,633 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
linux, shell

Research direction

The issue names no source file, test, or kernel entry point. Begin by reproducing the console-only setup with hciattach, hciconfig, hcitool scan, and hcitool cc, then determine whether a documented command or a kernel change is required; done means a verified replacement or a clear explanation that this is outside the kernel.

Written by the indexing model from the issue text.

Description

Bluetooth Issue

Hi there,

I have this Pi project where DBUS is not an option, but bluetooth connections are needed, in an embedded-like enviroment where services are mostly unwanted.

I was able to setup the BT hardware on the Pi by loading it's modules, and attaching it to hci:


sudo modprobe hci_uart
sudo modprobe btbcm
sudo hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -

I can see it's working without problems with:
sudo hciconfig -a

I can easily bring up the device like this:
sudo hciconfig hci0 up

I can even scan devices with sudo hcitool scan, and I can see the target devices in range. Great so far!

The problem comes when I try to connect the Pi3b+ to them. There used to be hidd --connect <address>, but the hidd command has been deprecated in favor of some mumbo-jumbo using DBUS and systemd services. I guess a service is needed to manage connections, etc, but all I need here is to manually stablish an one-time BT connection manually. Simple.
So, what should I use in place of hidd --connect <address> now? I have tried sudo hcitool cc <address>, but it doesn't stablish any connections (connections can be verified with hcitool con).

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.