ESP32 Selfie/HID Volume Control
Posted: Tue Oct 17, 2023 7:57 pm
I am working on code to adjust the volume on a phone as a way of triggering the camera. I started with the esp_hid_device code in the esp-idf v4.4 branch but made a bunch of changes so that both a BT and a BLE connection launch the same demo script (run_example). This looks for a keyboard input and then will raise and lower the volume based on the input.
On an iPhone13 I get a BLE connection and this works well. On a PIxel7 it connects over BT and then I try to run this command:
I get these errors:
Here is a link to my code. Please help explain what is going on in this command and how I can make it work for BT.
https://github.com/josh-gc/esp_selfie
On an iPhone13 I get a BLE connection and this works well. On a PIxel7 it connects over BT and then I try to run this command:
Code: Select all
esp_hidd_dev_input_set(s_bt_hid_param.hid_dev, 1, HID_RPT_ID_CC_IN, buffer, HID_CC_IN_RPT_LEN);
Code: Select all
I (16648) bt_hidd_event_callback: CONNECTED
W (21848) BT_HCI: hci cmd send: sniff: hdl 0x81, intv(10 18)
W (21868) BT_HCI: hcif mode change: hdl 0x81, mode 2, intv 18, status 0x0
I (21868) ESP_HID_GAP: BT GAP MODE_CHG_EVT mode:2
W (21928) BT_HCI: hcif ssr evt: st 0x0, hdl 0x81, tx_lat 360 rx_lat 720
I (22078) esp_hid_device_main: send_volume_up
E (22078) BT_HIDD: index out of range[0-0]
E (22078) BT_HIDD: HID device not connected!
E (22178) BT_HIDD: index out of range[0-0]
E (22178) BT_HIDD: HID device not connected!
https://github.com/josh-gc/esp_selfie