Skip to content

K7MDL2/BT-Keyboard-CW-Keyer

Repository files navigation

Support Targets alt text
Boards Used alt text

October 4, 2025 - No longer working on this but it does work if you want a simple BT keyer you can add to. I have replaced this with an Arduino IDE version at https://github.com/K7MDL2/Keyboard_keyer_3. I have both the BT Classic Logitech K380 and a BLE mini keyboard Rii i8+ working.

I was able to get this working under Arduino IDE by inserting btStarted() function just before the BT_keyboard.setup() to bypass a bt_controller_init error under Arduino IDE. The Arduinio version of this is simpler to compile and I added more keyboard keystroke processing and assinged the onboard LED to show BT Keyboard connecxted status. See this project linkeds above. I set up the bt_Keyboard code as a Arduino library also.

I have also been able to integrate the BT Keboard library into a 2022 version of K3NG Keyer modified to run onteh ESP32. See my modified fork of that here https://github.com/K7MDL2/k3ng_cw_keyer-master_2022

+++++++++++++++++ Archived ++++++++++++++++++++++++++++++

CW keyer with BT keyboard on ESP32-WROOM-32 module ( new project under construction, sends out text to a LED and buzzer today )

As of Oct 2, 2025 I have CMake automatically copy binary image files to the "precompiled_images" folder. You can now upload these image files to the CPU and skip compiling this code. Follow the instructions on this Wiki page.

https://github.com/K7MDL2/BT-Keyboard-CW-Keyer/wiki/Using-the-Flash-Download-Tool

https://github.com/K7MDL2/BT-Keyboard-CW-Keyer/wiki/Flash-Firmware-Using-the-esptool-Utility

Use the 3 files in the precompiled_images folder here. The Flash_Tool_REadme.txt has offset info as do the Wiki pages.

This merges 2 projects.

  1. The BT Keyboad Class was derived largely intact from https://github.com/turgu1/bt-keyboard.

  2. "The Arduino Morse Keyer" project from K6HX (code location TBD)

It is early days with this first effort to replace the PS2Keyboard in "The Morse Keyer" by K6HX with the BT keyboard and send out basic letters and numbers to a buzzer and LED. May add features like macros, memories, own callsign, own grid, destination call and grid and a screen. Going to consider using this experience to add BT Keyboard to something like the K3NG keyer project.

I am using a Rii model i8+ (aka K08) mini dual mode keyboard with touchpad and buttons. The bt_keyboard code was looking for appearance == 0x031c and UUID == 0x1812 to initiate connection to the keyboard. The Rii keyboard showed up as UUID=0x0000. I bypassed the UUID match and just use appearance value. The code scans BLE thgen BT to build a device list. It then scans the list and connects to the first device that matches the appearance number.

As of 10/1/2025 initial code check-in, the code accepts 0-9, a-z, and space character. Letters are converted to upper case. The characters are sent out real time as morse code on a PWM I/O pin. I hooked up a standard piezo buzzer to pin 25. The speed and frequency are set in the code. An onboard user LED (blue in my case) on pin 2 also lights.

Hardware is a ESP32-WROOM-32 module from https://www.amazon.com/dp/B0C5MJ6CPL. Use care, some are older or even single core versions, many listing make it hard to tell.

Chip is ESP32-D0WD-V3 (revision v3.1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz

I am using esp-idf 5.5.1 in Visual Studio Code. I had to add the Arduino32 component to support the arduino Tone() and noTone() functions rather then make the effort to set up PWM channels (using ledc() ) manually). The bt_keyboard .cpp and .hpp are under components/bt_keyboard/src folder. The CMakeLists.tx files are set accordingly. I edited the c_cpp_properties.json and sdkconfig and sdkconfig.defaults quite a bit to get things working. -> Update Oct 3, 2025: I found a workaround for the BT controller_init error at startup. Had to make a call to btStarted() inthe main program setup before calling bt_keyboard.setup(). It forces a certain esp bt api .c file to get linked in and it magically makes things work. So I can now compile and run this under Arduino IDE. I also was able to integrate the bt_keyboard library into a 2022 era fork of K3NG Keyer, modified to run on ESP32 hardware. It works but the BT-keyboard loop is hanging up the main app loop so the timing of dits and dahs is affected. Still work to do.

These are some direct links to the Wiki pages

https://github.com/K7MDL2/BT-Keyboard-CW-Keyer/wiki/CPU-Module

https://github.com/K7MDL2/BT-Keyboard-CW-Keyer/wiki/IO-Pin-Assignments

You can flash precompiled images and skip teh compiler setup by following one of these 2 processes. 'esptool.py' is an alternative if teh Flash Download Tool does not work for you. It uses the same files, just uses a Python program executed on the command line.

https://github.com/K7MDL2/BT-Keyboard-CW-Keyer/wiki/Using-the-Flash-Download-Tool

https://github.com/K7MDL2/BT-Keyboard-CW-Keyer/wiki/Flash-Firmware-Using-the-esptool-Utility

About

A basic CW Keyer with BT keyboard

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.txt

Stars

Watchers

Forks