MCPcopy Index your code
hub / github.com/SmallPond/X-Knob

github.com/SmallPond/X-Knob @v1.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.1 ↗ · + Follow
3,558 symbols 13,768 edges 774 files 992 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

X-Knob

Last year (2021) while surfing the internet, I came across the smart_knob(SK) project and was immediately interested. However, after looking into it, I was discouraged by the "expensive" brushless motor that was out of stock 😅.

I recently discovered @45coll and @fywbcchong2's open source Super_Dial, which inspired me to try it out 🤗.

The Super_Dial replaces the "expensive motor" used in the original smart_knob project and adopts a straight design, which I personally find more aesthetically pleasing.

In addition, the author of smart_knob mentioned in the project that they plan to use lvgl to design the UI in the future.

migrate to LVGL, for better display rendering and easy support for menus, etc. Shouldn't require a full 240x240x24b framebuffer in memory, freeing some for wifi, etc.

Coincidentally, I had previously played with X-TRACK, which had an extremely smooth UI. Therefore, this project will be a composite version of Smart Knob + X-Track UI. So I call it X-Knob.

Main hardware list: - 3 PCBs: main control board + driver board + screen board - 3205 Brushless Direct Current Motor(10 CNY) - MCU: ESP32-S3 WROOM-1U-N16R8 - Screen: 240x240 round LCD ("GC9A01"), protected by 40.0 mm watch glass - Magnetic encoder: MT6701CT - 602535 600mAh Lithium Battery

Features supported by X-KNOB:

  • X-TRACK UI framework(based on LVGL)
  • 7 Modes: Combinations of BOUND, DETENTS, ENDSTOPS, and more
  • smart-knob UI based on LVGL framework
  • Surface Dial
  • Press vibration feedback
  • Power management
  • Battery management, system deep sleep;
  • Latest hardware (V2) supports UPS
  • X-Knob can be integrated with Home Assistant via MQTT to control devices connected to HASS.

Demo video

Demo video

Demo video of controlling smart home via MQTT

3D CAD

3d

The picture above (3D CAD) is from 455555菌的视频

Get Started

Basic environment: - VScode + PlatformIO - arduino-esp32 v2.0.5

  1. Basic configuration
git clone https://github.com/SmallPond/X-Knob.git

# Open the Firmware project using PlatformIO
# Rename the src/secrets.h.example file to src/secrets.h
# and modify the relevant configurations: WiFi password, MQTT server, etc.
cp src/secrets.h.example src/secrets.h

# (Optional) Modify MQTT_HOST in the config.h file to your name
# This macro is used to attach to the MQTT Topic
#define MQTT_HOST               "dingmos"      
  1. Compile && Flash && Enjoy

Acknowledgements

Core symbols most depended-on inside this repo

lv_obj_add_style
called by 511
1.Firmware/lib/lvgl/src/core/lv_obj_style.c
lv_scr_act
called by 251
1.Firmware/lib/lvgl/src/core/lv_disp.h
lv_event_send
called by 213
1.Firmware/lib/lvgl/src/core/lv_event.c
lv_area_get_width
called by 187
1.Firmware/lib/lvgl/src/misc/lv_area.h
lv_obj_invalidate
called by 165
1.Firmware/lib/lvgl/src/core/lv_obj_pos.c
lv_mem_free
called by 157
1.Firmware/lib/lvgl/src/misc/lv_mem.c
lv_obj_set_size
called by 133
1.Firmware/lib/lvgl/src/core/lv_obj_pos.c
lv_event_get_target
called by 120
1.Firmware/lib/lvgl/src/core/lv_event.c

Shape

Function 2,938
Method 429
Class 173
Enum 18

Languages

C71%
C++24%
Python4%
Ruby1%

Modules by API surface

1.Firmware/lib/lvgl/src/extra/libs/png/lodepng.c247 symbols
1.Firmware/lib/lvgl/src/core/lv_obj_style_gen.h90 symbols
1.Firmware/lib/lvgl/src/core/lv_obj_style_gen.c90 symbols
1.Firmware/lib/lvgl/src/misc/lv_style_gen.c89 symbols
1.Firmware/lib/lvgl/src/misc/lv_tlsf.c71 symbols
1.Firmware/lib/lvgl/src/extra/widgets/chart/lv_chart.c51 symbols
1.Firmware/lib/lvgl/tests/unity/unity.c50 symbols
1.Firmware/lib/lvgl/src/widgets/lv_textarea.c49 symbols
1.Firmware/lib/lvgl/src/core/lv_obj_pos.c45 symbols
1.Firmware/lib/lvgl/src/extra/layouts/grid/lv_grid.c42 symbols
1.Firmware/lib/lvgl/src/extra/libs/qrcode/qrcodegen.c41 symbols
1.Firmware/lib/lvgl/src/extra/widgets/span/lv_span.c39 symbols

For agents

$ claude mcp add X-Knob \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page