Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] can connect to android, but not to (linux) pc #34

Open
prankousky opened this issue Mar 27, 2024 · 1 comment
Open

[BUG] can connect to android, but not to (linux) pc #34

prankousky opened this issue Mar 27, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@prankousky
Copy link

Hi,

I was hoping to control my linux PC with this project. I flashed an ESP32, connected it to Home Assistant. I can find the device with two different android devices and connect to it. Some buttons will work, others won't. But connection and at least some buttons work.

But the device won't connect to my PC / my PC won't connect to it. It won't even discover it. It is discoverable, I made sure by testing if "start/stop advertising" works by pressing those buttons, then checking my android phones. When I do, the desired action will happen. So it should be discoverable when I click "start advertising".

However, it won't show. Since I know the MAC, I tried manually connecting and pairing it (via bluetoothctl and bluetuith), but am only getting "Device not available".

What can be done to fix this?

My entire configuration is attached below.

Please complete the following information:

  • ESPHome version: 2024.3.1
  • Component version: not sure how to find this; I included the lines below in my yaml, so I assume it is the most current, stable version..?
external_components:
  - source: github://dmamontov/esphome-blekeyboard


esphome:
  name: blekeyboard
  friendly_name: BLEKeyboard

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:
  level: VERY_VERBOSE
  
# Enable Home Assistant API
api:
  encryption:
    key: "yes"

ota:
  password: "indeed"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Blekeyboard Fallback Hotspot"
    password: "himom"

captive_portal:
    
external_components:
  - source: github://dmamontov/esphome-blekeyboard

ble_keyboard:
  id: my_ble_keyboard
  name: "MamonTechKeyboard"
  manufacturer_id: "MamonTech"
  battery_level: 50
  reconnect: true
  buttons: true
  use_default_libs: false

text_sensor:
  - platform: homeassistant
    id: input_text
    entity_id: input_text.global_fritzbox_letzter_anruf
    internal: true

sensor:
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: 60s

button:
  - platform: restart
    entity_category: "config"
    name: "Restart"

  - platform: template
    name: "Release"
    id: key_release
    icon: "mdi:send"
    on_press:
      then:
        - ble_keyboard.print:
            id: my_ble_keyboard
            text: !lambda "return id(input_text).state;"
        - ble_keyboard.release: my_ble_keyboard

  - platform: template
    name: "Ctrl + A"
    id: key_ctrl_a
    icon: "mdi:vector-combine"
    on_press:
      then:
        - ble_keyboard.combination:
            id: my_ble_keyboard
            delay: 8
            keys:
              - 0x80
              - "a"

  - platform: template
    name: "Calc"
    id: key_calc
    icon: "mdi:calculator"
    on_press:
      then:
        - ble_keyboard.press:
            id: my_ble_keyboard
            code:
              - 0
              - 2

  - platform: template
    name: "Start advertising"
    id: start_advertising
    icon: "mdi:play"
    on_press:
      then:
        - ble_keyboard.start: my_ble_keyboard

  - platform: template
    name: "Stop advertising"
    id: stop_advertising
    icon: "mdi:stop"
    on_press:
      then:
        - ble_keyboard.stop: my_ble_keyboard
@prankousky prankousky added the bug Something isn't working label Mar 27, 2024
@prankousky
Copy link
Author

Anybody? This is still not working :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants