Skip to content

[FreeBSD] Apple Magic Trackpad 2

September 17, 2022 | 10:23 PM

EDIT: This will manage to get connectivity working, but the device will be recognized as a PS/2 device. It seems further support for the device is WIP 🚧.

I followed the Handbook closely and it only got me to the point of confirming my USB bluetooth dongle was recognized, and could see my Magic Trackpad. From there, it was a mystery. It’s safe to follow the guide but it will be a deadend around the time you finish device pairing. Here’s the rest of the bits I needed to connect my trackpad, which by the way automatically connected on startup, something that bluez even fails to do on my Arch install.

Encryption modes

I stumbled on to this FreeBSD forum post because hccontrol -n ubt0hci create_connection trackpad was resulting in an error Encryption mode: Only for point-to-point packets [1] . To resolve this, simply tell the controller that comms are going to be encrypted.

# hccontrol -n ubt0hci write_authentication_enable 1
# hccontrol -n ubt0hci write_encryption_mode 1

HID Control

I was truly lost at this point 😕 because I knew enough to get the hcsecd daemon running which helped with managing link keys for bluetooth devices from the guide. I saw the device find the appropriate link key and pin code from my config, but what I was missing (and the guide IMO) was the connection to bthidd the Bluetooth HID daemon! It stands to reason why these are different services, they perform different tasks and all of that, but I think it warrants a section in the guide, either under a mouse/keyboard/desktop section, or just a subsection in Bluetooth much the way the audio side of things is called out.

Thankfully some very cool person has a website that serves much the same purpose this one does! I would credit them but they don’t list a name that I can find. Anyway here is the important page on Using a Bluetooth mouse in FreeBSD. It’s all there. The bit I was missing was the existance of the daemon and how to generate a configuration from bthidcontrol query .

# bthidcontrol -a BDADDR query >> /etc/bluetooth/bthidd.conf

I of course enabled the services to start automatically in my /etc/rc.conf which has now become second nature.

# /etc/rc.conf
# enable bluetooth pairing
hcsecd_enable="YES"
bthidd_enable="YES"

Worth noting, minor quirk here… I had to restart my computer for this to work. All signs pointed to it should be working, however the mouse didn’t move until I rebooted. 🪄✨