Hi, Thanks for your reply.
Do you have any advice on what I can do?
My goal is the following:
I would like to use my input devices on 2 devices (macos and windows).
My idea is to connect my Apple Magic Keyboard and my Apple Magic Mouse to arduino via bluetooth so as to take the signal and use arduino as a HID proxy that will send the data via the usb.
Any idea on which device I can use to be able to connect these devices to arduino?
I am facing a similar problem. I would like to connect an Apple Magic Trackpad (1. gen) to the HC-05 to forward its signals to USB HID (additionally I would like to preprocess the signals to get more gestures). I thought a DIY build would be the only option to do that?
@J-M-L , do you know of any KVM switches, which allow a Bluetooth mouse/keyboard to be connected?
I wanted to achieve something similar to @PierAndrea, i.e. connect the trackpad to some device via Bluetooth and then forward the mouse control signals via USB to the computer, so that I can do some preprocessing in between, e.g. add more gestures. Most importantly I wanna have that without requiring any specific driver for the OS.
That way, the trackpad would be connected via USB, so that I can plug it into a docking station and swap computers by a single connector, as well as having advanced trackpad gestures without requiring any driver.
It looks like I am on the wrong way with the HC-05. I would definitely need a BT Classic (2.0) capable device though and as far as I know the ESP32 devices only support BLE. Do you know of any other devices or modules, which support pairing with a BT Classic mouse/trackpad?
The ESP32-S3 has USB OTG (host and device) and has Bluetooth Low Energy (BLE) but does not have Bluetooth Classic. Only the original ESP32 has BLE and BT classic.
You could connect an RP2040 (Pi Pico) to the ESP32 to get USB HID mouse output. Your choice of UART, SPI, or I2C.
Thanks @J-M-L for the informative video!
Thanks @Icebuster for the suggestion! I thought about that, i.e. whether it is possible to connect some USB HID capable device to the ESP32 to add the USB HID functionality. The Pi Pico seems like an option. What do you think about the Arduino Micro. As I now already have one laying around, would that be an option too or would it make things more complicated, or slower / produce more latency? (i saw that the Pi Pico uses an ARM Cortex-M0+, 2x 133MHz, while the Arduino Micro has an Atmel ATmega32u4 with only 16MHz)
Yeah, it is subjective. However, does anybody have an idea with which combination I could expect minimum latency? (Usecase: Bluetooth trackpad input -> processing -> HID USB mouse output)
Since you have a Micro you should be able to run the USB mouse examples to get some idea of what is involved on the software side. This is the easy part compared to Bluetooth on ESP32.
The Micro uses 5V logic levels (the ESP32 uses 3.3V) so interfacing via UART avoids the need for logic level converters. For example, connect ESP32 Serial1 TX to Micro Serial1 RX. And connect ground. Set both serial ports to 115,200 bits/sec. That is 11,520 bytes per second so transmission latency should be pretty low. The USB mouse HID report is only 4 byte long. If this is too slow there may be higher UART speeds available.
There is not much work for the Micro or RP2040 to do. In loop(),
I see, so I would do the actual gesture processing on the ESP32 and let the Micro just forward basic movement/click commands. I expect the latter to be fairly simple.
I currently mainly have doubts regarding the Bluetooth pairing and reading part on the ESP32. I am having hard times trying to find any project, which involves pairing any Bluetooth Classic keyboard/mouse/trackpad to a ESP32, so I don't really have an idea how complicated that is or whether it is actually possible? Can anybody confirm that for sure? Is it as simple as pairing one with a PC?
Finally reading the Bluetooth input and decoding it might be complex too, but I feel it is possible given there still is enough motivation to do it