Skip to content

Instantly share code, notes, and snippets.

@HeadHodge
HeadHodge / Bluez HID over GATT (HOGP) Keyboard Emulator Example.md
Last active April 22, 2024 00:38
Bluez HID over GATT (HOGP) Keyboard Emulator Example

Bluez HID over GATT (HOGP) Keyboard Emulator Example

A working example of a BLE Keyboard Peripheral (Server) ran on my Raspberry PI4-b with Buster Raspbian-Lite for all to use. My desire is to hopefully save at least one other person the literal weeks I've spent trying to get this working for my little home automation project.

Verified working connected to my Blade Android, Windows 10 laptop, and Amazon FireTV stick devices

Once running and connectted properly to a client device, it will update the battery status with a lower percentage every 60 seconds, use the Keyboard Input Report to send a capital 'M' every 10 secomds, and use the Consumer Input Report to send a 'volumeUp' every 15 seconds.

TIPS

@ivandjuricic
ivandjuricic / iam_ws.py
Last active February 13, 2024 10:18
Generate AWS4 signed URL to connect to APIGateway websocket with IAM Authorizer
import datetime
import hashlib
import hmac
import boto3
try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus