Skip to content

Connecting to a BT device using console tools #2633

Open
@vanfanel

Description

@vanfanel

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions