proof of concept demo (windows) of arduino firmata support in qmk firmware
- set rgb matrix from host: video/gif playback, matplotlib animation, audio peak level
- build and load kbsm behavior modules (flash or SRAM) — see "kbsm modules" below
- build and upload user RGB animation dynamically to SRAM
- set default layer and switch kbsm behavior module depending on application in focus
- set parameters: mac/win mode, debug config, rgb mode/hsv/speed, keymap flags, debounce, ...
- get battery/raw matrix/dip switch status
- "keyboard scripting", access keyboard mcu memory/eeprom and compile/execute c function from host python.
- show console output
- websocket server to set default layer from other apps
- websocket server to set rgb matrix from other apps (screen capture ws client example)
- keychron q3 max (https://github.com/bugbuster-dev/keychron_qmk_firmware)
- python 3.11
- install packages in requirements.txt:
pip install -r requirements.txt
python QMKata.py
see kb_scripts dir for examples.
see: https://developer.arm.com/downloads/-/gnu-rm and docs/cross-compiler-setup.md for setup details.
modify KeychronQ3Max.TOOLCHAIN to change path, includes/options, ... as needed.
QMKata builds and uploads kbsm behavior modules to the keyboard. The same C source can be linked for either of two targets:
- Flash — module ships to a 4 KB module-loader slot in MCU flash
(slot 0..7 on the Keychron Q3 Max). Writable globals (
.data,.bss) are rejected at build time; only code + read-only data is uploaded. Survives power cycles andeeconfigresets. - SRAM — module is relocated into a reserved SRAM slot (slot 8 on
the Q3 Max) at upload time.
.dataand.bssare kept in the module blob, so the module can hold mutable state across callbacks. Lost on reboot; meant for iteration and for modules that need persistent runtime state.
See kbsm_module_examples/ for working SRAM modules
(kbsm_dyad, kbsm_holdseq, kbsm_autotext, kbsm_sticky_combo,
kbsm_vim_modal), module_api.h for the host-side ABI
(kbsm_env_t, hook indices, version), and docs/ for the build
pipeline (sram-module-compilation.md), the relocation model and the
-fPIC rationale (sram-module-relocation.md), step-by-step
authoring (authoring-sram-modules.md), and the LLM agent guide
for generating modules (kbsm-agent-instructions.md).
in ws_client/
set default layer:
python layer_switch.py <layer>
NOTE: screen capture uses d3dshot which fails to install with python 3.11 so install python 3.8 for screen capture example and the packages in requirements_screen_capture.txt
screen capture and send rgb image:
<python 3.8 path>/python screen_capture_rgb_stream.py --display 0 --fps 25 --width 17 --height 6 --port 8787
WARNING: flashing lights
rgb from video/gif playback, screen capture:
- https://www.dropbox.com/scl/fi/o1hf8g2pgcmz6pnmi4lf0/qmk_firmata_demo_video_playback.mp4?rlkey=109kbajetq0ow28s3isaid5ih&st=hl9uuwiq&dl=0
- https://www.dropbox.com/scl/fi/7iep6tmbkys5mlwfh9xo6/keychron-q3-max-cat-gif.mp4?rlkey=koq4ncl3ntxfqfz0uvkm0rvap&dl=0
- https://www.dropbox.com/scl/fi/lmipvwwoth5pdwywp1cyd/qmk_firmata_demo_disco.mp4?rlkey=ogiihll52lg1xm7t6kvqmmls8&st=z7cbqsnn&dl=0
- https://www.dropbox.com/scl/fi/vo263yf3ihkgcrgsrq34t/qmk_firmata_demo_screen_capture.mp4?rlkey=0i9iiv63berpbxkypu1eti3xd&st=zovba14p&dl=0
rgb light speaker:
- https://www.dropbox.com/scl/fi/ql8ucdq006b8wl9upkfih/keychron-q3-max-audio-rgb-kraftwerk.mp4?rlkey=60k17649zv307izt2ocnprojd&st=tin9p5z0&dl=0
- https://www.dropbox.com/scl/fi/zkvbqu0e8nxutxmxazdgd/keychron-q3-max-audio-rgb-sail.mp4?rlkey=6rnj8elf144y1s5nu6q5nomfm&st=zbconab1&dl=0
- https://www.dropbox.com/scl/fi/7liw11vouhzc31s6g354j/keychron-q3-max-audio-rgb-justin-johson-slide-guitar.mp4?rlkey=hsv2zx0cv9hj6p5ekw7cpajg5&st=az04r0my&dl=0
- https://www.dropbox.com/scl/fi/45fuu7pm1zjgli6ow79qy/keychron-q3-max-audio-rgb-fear-factory.mp4?rlkey=tq9qeqh7kq9yh9khkbqmx22yk&st=dieme07j&dl=0
- https://www.dropbox.com/scl/fi/pba2bdu83l31b361na0i0/keychron-q3-max-audio-rgb-der-holle-rache.mp4?rlkey=moxiyt05vv2za2sjsvqorgr0m&st=1k6i3aeg&dl=0