{"id":21045648,"url":"https://github.com/vertexbz/imonk","last_synced_at":"2025-07-24T11:41:04.561Z","repository":{"id":214883507,"uuid":"737586960","full_name":"vertexbz/imonk","owner":"vertexbz","description":"If you kno' me, you had a chance to say halo ;)","archived":false,"fork":false,"pushed_at":"2024-01-04T21:59:20.000Z","size":21262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T17:48:38.710Z","etag":null,"topics":["3dprinting","extensions","extras","klipper","lcd","macros","moonraker","plugin"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vertexbz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-31T16:26:39.000Z","updated_at":"2023-12-31T22:41:55.000Z","dependencies_parsed_at":"2024-01-04T22:51:22.242Z","dependency_job_id":null,"html_url":"https://github.com/vertexbz/imonk","commit_stats":null,"previous_names":["vertexbz/imonk"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vertexbz%2Fimonk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vertexbz%2Fimonk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vertexbz%2Fimonk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vertexbz%2Fimonk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vertexbz","download_url":"https://codeload.github.com/vertexbz/imonk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243489758,"owners_count":20299001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3dprinting","extensions","extras","klipper","lcd","macros","moonraker","plugin"],"created_at":"2024-11-19T14:23:31.218Z","updated_at":"2025-03-13T22:21:00.741Z","avatar_url":"https://github.com/vertexbz.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IMONK\n\nIf you kno' me, you had a chance to say halo ;)\n\n* No Wi-Fi required\n* Full control via GCode commands\n* Customizable views\n* Custom images support\n\n## BOM\n\n### Printed parts\n* [KNOMI v2 StealthBurner body \u0026 mount plate](https://github.com/bigtreetech/KNOMI/tree/master/KNOMI2/STL) - mount plate to be modified, original kinda fits\n\n### SPI Version\n* https://www.waveshare.com/rp2040-lcd-1.28.htm\n* wires, connectors  (jst, gold-pin), probably soldering iron\n\n\n## Software setup\n\nThis repository contains all bits and pieces required to bring IMONK to life, to make things easier clone it to your host machine. \n```\ncd ~\ngit clone https://github.com/vertexbz/imonk.git\n```\n\n### IMONK Display firmware\n\n\u003e For the first time only it is required to flash the firmware manually. \n\n#### From binary build \n* Download `firmware.uf2` from latest [release](https://github.com/vertexbz/imonk/releases)\n* Connect display via usb-c while holding BOOT button\n* Upload the firmware to the device \n\n#### Manual build\n* Install [PlatformIO](https://docs.platformio.org/en/latest/core/installation/methods/installer-script.html#super-quick-macos-linux)\n* Connect display via usb-c while holding BOOT button\n* Enter the cloned copy of repository\n* Build \u0026 flash screen module firmware \n    ```\n    cd ~/imonk\n    pio run -e release -t upload\n    ```\n\n### Assembly\n* Minimal wiring with RPi Pico's main SPI\n\n  ![connections.png](doc%2Fconnections.png)\n\n\n### Extensions\n\nFor proper operation IMONK needs Klipper and Monraker extensions\n\n```\ncd ~/imonk\nln -s ./klipper/imonk ~/klipper/klippy/extras/\nln -s ./moonraker/imonk ~/moonraker/moonraker/components/\n```\n\n#### Moonraker configuration\n```ini\n[imonk]\n```\n\n#### Klipper configuration\n\n**Main configuration** block tells Klipper how to connect to the display, will vary depending on your board. \n\n* SB2240/2209 board\n```ini\n[imonk]\ncs_pin: PA10\nspi_software_sclk_pin: PB10\nspi_software_mosi_pin: PB11\nspi_software_miso_pin: PB2\n```\n\n* RPi Pico main SPI\n```ini\n[imonk]\ncs_pin: gpio1\nspi_bus: spi0a\n```\n  \n\n**Image configuration**\n\u003e Currently only PNG images are supported\n```ini\n[imonk image smily-face]\npath: ~/imonk/doc/smily-face.png\n```\n_Can appear multiple times, each section defines one image that can be identified by name provided in section brackets. Images are synchronized to device on Klipper start (or with g-code commands) to save on communication during print and operation._\n\n\n**View configuration**\n```ini\n[imonk view test-gauge]\nbackground: 333333  # View background color\nwidgets: [  # List of widgets to render on the view\n    {\n        \"type\": \"gauge\",\n        \"x\": 120,  # X Coordinate of the widget\n        \"y\": 120,  # Y Coordinate of the widget\n        \"id\": \"progress\",  # Handle to set gauge value\n        \"r-end\": 80,  # End radius of the gauge\n        \"r-start\": 60,  # Start radius of the gauge\n        \"color\": \"FF0000\",  # Gauge fill color\n        \"background\": \"000000\",  # (optional) Gauge background color (default: \"000000\") \n        \"value\": 0,  # (optional) Gauge value, i.e. how much of the gauge should be filled (default: 0) \n        \"rotation\": 90.0,  # (optional) Gauge widget rotation (in degrees) (default: 90.0) \n        \"arc\": 260.0  # (optional) How much of the circle should be used as gauge (in degrees) (default: 260.0) \n    }\n  ]\n[imonk view test-text]\nbackground: 333333\nwidgets: [\n    {\n        \"type\": \"string\",\n        \"x\": 120,  # X Coordinate of the widget\n        \"y\": 120,  # Y Coordinate of the widget\n        \"id\": \"text1\",  # Handle to set widgets text\n        \"color\": \"FFFFFF\",  # Text color\n        \"value\": \"Testy text\",  # (optional) Text to display on screen (default: \"\") \n        \"font\": \"roboto24\",  # (optional) Font to use to render the text (default: \"font0\") \n        \"align\": \"left\"  # (optional) Text alignment in relation to provided coordinates (default: \"center\") \n    }\n  ]\n[imonk view test-images]\nbackground: 333333\nwidgets: [\n    {\n        \"type\": \"image\",\n        \"x\": 70,  # X Coordinate of the widget\n        \"y\": 60,  # Y Coordinate of the widget\n        \"name\": \"smily-face\"  # Name of the image to display - same as in [imonk image ...] section\n    },\n    {\n         \"type\": \"string\",\n         \"x\": 120,\n         \"y\": 120,\n         \"id\": \"text\",\n         \"color\": \"FF0000\",\n         \"value\": \"Klipper Test Text\"\n    },\n    {\n        \"type\": \"image\",\n        \"x\": 70,\n        \"y\": 140,\n        \"name\": \"smily-face\"\n    }\n  ]\n```\n_Can appear multiple times, each section defines one view that can be identified by name provided in section brackets. Views are synchronized to device on Klipper start (or with g-code commands) to save on communication during print and operation._\n\n#### Klipper commands\n\n* **Firmware**\n  * `IMONK_FIRMWARE_VERSION` - Prints current IMONK firmware version\n  * `IMONK_FIRMWARE_UPDATE` - Update firmware from file, takes `PATH` argument - path to .bin firmware file\n* **Views**\n  * `IMONK_STAGE_VIEW` - Stages View with provided `NAME` for variables input, to display staged view use IMONK_COMMIT_VIEW\n  * `IMONK_STAGE_VIEW_IF_NEEDED` - Stages View with provided `NAME` for variables input, only if not already staged or current\n  * `IMONK_SET_VALUE` - Set view widget value, requires `SID` of current or staged view, `SLOT` widget identifier input and `VALUE` to set. When called with current view SID, changes are applied immediately\n  * `IMONK_COMMIT_VIEW` - Commits (displays) prepared IMONK View\n  * `IMONK_ABORT_VIEW` - Discards staged view and entered values\n  * `IMONK_SET_VIEW` - Stages View with provided `NAME` (if not staged or current) with provided `SLOT_\u003cid\u003e=\u003cvalue\u003e` values (previous or defaults used when omitted) and (if not current) commits the view automatically\n* **Misc**\n  * `IMONK_REBOOT` - Reboots the display\n  * `IMONK_RELOAD_CONFIG` - Reloads IMONK configuration from files\n  * `IMONK_LOAD_DEVICE_STATE` - Reloads IMONK device state\n  * `IMONK_SYNCHRONIZE` - Synchronizes IMONK device state with configuration\n\n#### Klipper GCode macro helpers\n\nDue to macro execution flow, using `IMONK_STAGE_VIEW`, `IMONK_STAGE_VIEW_IF_NEEDED`, `IMONK_SET_VIEW` and checking IMONK extension state may be inconvenient,\nthe extension provides macro helpers for stage/set commands that output `stage_id` for convenience.\n\n* Example `stage` call\n  ```jinja\n  {% set stage_id = printer.imonk.stage('test-images') %}\n  ```\n\n* `stage_if_needed` additionally returns information whether the view is staged or current\n  ```jinja\n  {% set stage_id, is_current = printer.imonk.stage_if_needed('test-images') %}\n  ```\n\n* The `set_view` takes dictionary of values to set as second parameter\n  ```jinja\n  {% set stage_id = printer.imonk.set_view('test-images', {'text': 'Value to display'}) %}\n  ```\n\n\n#### Moonraker API endpoints\n\n* **Check version**\n  `[GET] /machine/imonk/version`\n\n  **Response**\n  ```json\n  {\n    \"result\": {\n      \"version\": {\n        \"major\": 0,\n        \"minor\": 0,\n        \"micro\": 1\n      }\n    }\n  }\n  ```\n\n\n* **Update firmware** \n  `[POST] /machine/imonk/firmware`, firmware provided as `file` param via multipart/form-data\n\n  **Response**\n  ```json\n  {\n    \"info\": \"Firmware update continues on the device\"\n  }\n  ```\n\n#### Test macros\n\nTest gcode macros using above configuration examples\n\n```jinja\n[gcode_macro IMONK_TEST_GAUGE]\ngcode:\n  {% set progress = params.PROGRESS|default(0)|int %}\n  {% set stage_id = printer.imonk.set_view('test-gauge', {'progress': progress}) %}\n  # {action_respond_info('test-gauge sid: {} {}%'.format(stage_id, progress))}\n\n[gcode_macro IMONK_TEST_IMAGES]\ngcode:\n  {% set stage_id = printer.imonk.set_view('test-images', {'text': 'Text between images'}) %}\n  # {action_respond_info('test-images sid: {}'.format(stage_id))}\n\n\n[gcode_macro IMONK_TEST_TEXT]\ngcode:\n  {% set stage_id = printer.imonk.set_view('test-text', {'text1': 'aaa'}) %}\n  G4 P3000\n  IMONK_SET_VALUE SID={stage_id} SLOT=text1 VALUE=bbb\n  G4 P3000\n  IMONK_SET_VALUE SID={stage_id} SLOT=text1 VALUE=ccc\n  G4 P3000\n  # {action_respond_info('test-text sid: {}'.format(stage_id))}\n  \n\n[gcode_macro IMONK_TEST]\ngcode:\n  {% for i in range(101) %}\n    IMONK_TEST_GAUGE PROGRESS={i}\n  {% endfor %}\n\n  IMONK_TEST_IMAGES\n  G4 P5000\n\n  IMONK_TEST_TEXT\n  \n  {% for i in range(101) %}\n    IMONK_TEST_GAUGE PROGRESS={100 - i}\n  {% endfor %}\n\n```\n\nResult\n\n![preview.gif](doc%2Fpreview.gif)\n\n\n## Motivation\n\nThis project came to live mainly to prove that additional display can be fully configured and controlled directly via klipper without wi-fi connection, but I'm happy to further maintain and develop the project if it gets interest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvertexbz%2Fimonk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvertexbz%2Fimonk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvertexbz%2Fimonk/lists"}