Mainsail CNC Pendant for Klipper

I have some CNC background from 20 years back but am currently most familiar with Klipper as ran on 3D printers. Was a natural choice for me but after committing I couldn’t find a CNC interface I liked so me and my new AI friend got to work. I’m not a developer but I think it’s available on Github… input, suggestion & advice appreciated…

The AI generated description:

Mainsail CNC Pendant — an Android-friendly Klipper interface (early LowRider V4 preview)

I’ve been working on making Mainsail feel more natural for CNC use on my LowRider V4. It started with work-light controls and grew into a separate CNC Pendant page. The goal: your phone becomes your CNC pendant.

Standard Mainsail remains available. The pendant works in a PC or phone browser, and there’s an Android app with screen-awake support. The app displays the page hosted on the Pi, so most interface updates don’t require reinstalling it.

Project, screenshots and documentation:

Android demonstration:

Current features include:

  • Compact XY/Z jogging, coarse/fine increments, machine/work coordinates and travel ranges.

  • Shared PC/Android settings, including millimeters, centimeters and useful inch jog increments.

  • Safe-Z controls, a below-safe-height jog-speed cap and configurable keep-out areas for pendant jogging.

  • A separate running screen, jogging while paused, and verified, confirmed Resume.

  • Background scanning of supported G-code before Start, checking programmed travel against machine limits and current work offsets.

  • Full-screen toolpath viewing, work-light controls, idle-stepper reminders and configurable automatic stepper disable.

This is early days. It grew from brainstorming and hands-on testing on my machine. ChatGPT / OpenAI Codex did most of the software implementation, automated tests and documentation. I supplied the ideas, CNC workflow and physical testing.

It’s an independent project—not an official Mainsail, Klipper or V1 Engineering release—and not a universal one-click installation yet. The repository includes a webpage installer with backup/uninstall support, but the complete setup also requires Moonraker components and carefully reviewed Klipper macro changes. An AI implementation handoff is linked from the README.

The reference remains LowRider-specific in places, particularly homing and dual-motor recovery. Every machine needs individual review and testing. Travel verification doesn’t certify clamp or cutter clearance, and software E-stop doesn’t replace a physical stop. Optional individual-motor recovery is Cartesian-only.

I’m a GitHub newcomer and would love feedback, pull requests and help making this a useful Klipper CNC interface. Help with installation, compatibility and testing on other machines would be particularly welcome.

I’ll link this thread from my build thread so the software discussion can stay together here.

I too am a cnc klipper user. I made a bluetooth pendant with a wii remote, a bluetooth pendant with a switch remote, and i currently have an original nes controller modified with a raspberry pi to be used as a pendant, but typically use my phone or most often the pc mouse next to the system to run it. Remote commands on klipper over the network are pretty straight forward i have found.

As one if the few other cnc klipper operators, I plan to try your pendant app. Thanks for sharing it.

A quick update: this has grown quite a bit since the original post.

To be perfectly honest, the project may currently resemble more of an active construction site than it did when I first posted it. We have been adding features quickly, testing them on my LowRider, and gradually turning the original pendant experiment into a more complete Klipper CNC workflow.

One of the biggest additions since the original post is the Fusion integration.

Because Fusion Personal/Hobby does not output true rapid moves, the custom post identifies eligible non-cutting travel moves while preserving the cutting and plunge feeds. The Pendant can then preview those changes and create a separate optimized copy with faster XY and Z travel rates. This does not unlock Autodesk’s rapid-move feature or modify the original file—it provides a reviewed workaround that restores practical rapid-travel behavior for Hobby users.

Fusion jobs can also be posted as separate one-tool stages and then reviewed, reordered and consolidated across manual tool changes. The resulting prepared program retains the tool identities, operations and deliberate tool-change pauses, while preserving the original posted files. Tool definitions are checked, and a printable setup sheet can be generated before machining.

Other recent additions include:

  • Fusion posting directly into a verified CNC Inbox

  • Multi-stage and multi-tool project preparation

  • Tool-change Resume checks

  • Tool-definition review and printable setup sheets

  • Better running-speed, motion and job-status information

  • Chip-load guidance

  • Configurable machine, spoilboard or saved work coordinates after homing

  • Endstop repeatability and hysteresis testing

  • Hardware-health monitoring groundwork

  • Dedicated Android and Windows pendant interfaces. Klipper sessions are no longer lost in browser sessions!

There are now quite a few safety checks around file changes, machine limits, work offsets, job state and tool changes. That also means installation is not yet a polished one-click experience, and some features remain specific to my LowRider V4 configuration. Please treat it as an actively developed reference project rather than finished CNC-control software.

The GitHub repository and README have just been brought up to date:

The latest catch-up commit is here:

Anyone running Klipper on a CNC is very welcome to take a look. Feedback about the workflow, installation, compatibility, unsafe assumptions, or features that would make it useful on another machine would be greatly appreciated.

@orob, I would be particularly interested in what feels natural or awkward compared with the phone, mouse and physical pendants you already use.

I have an android phone so ill check it out… Next week likely. Working on a 3d print halloween project, but i have a cribbage board to make so i hope to use your pendant for that.

I have not looked in detail yet, but my first question is where do my custom macros go on the pendant? I use a macro for probing z and zeroing the x/y position for workpiece positioning after squaring the system.

One thing that would be super helpful would be to record the position in the log when the x/y are zeroed, but that is likely out of scope for this project. I usually pencil it on the spoil board in case the system has to be resquared and then rezeroed.

Some action shots from tonight’s test…

I forked your repo and installed the preview apk.

Looks like the klipper page. When entering the device ip address do i need to specify pendant? Or do i need to build the current code set to get what you are seeing? I need a bit more direction to help test. Perhaps i missed something in the install instructions.

just saw this notification. The project it currently quite dynamic. Let me get with my programming team IE AI and get the repo current and try and get you some decent instructions. I’ll see if I can get it done here in the next few minutes before I hit the rack.

I found the part I missed. Have to actually install the klipper side page and supporting .py files. My pendants all just called custom macros so there was no adds other than the macros. Ill have time later to go through compatibility and example macros.

The repo is currently being updated hopefully with some reasonable instructions. I am 1,000,000 miles from a Github expert or a programmer but I have been absolutely amazed at how effective ChatGPT is implementing my wishes. I’m not sure how seamless this will be on your end trying to work through feedback. But I will try and keep an eye on any pull requests or anything in Github and keep pointing my end at it so if we see changes we’ll get them taken care of. Glad you’re interested It’s actually quite amazing I don’t know if you’re a Fusion user but that’s kind of what started this whole thing is re enabling multiple tools and rapid travels and it sort of grown out from there.

The repository is current now. If you already forked or cloned it, please pull the latest main before testing—the update is commit 1c44291.

Main repository:

I added two new starting points:

  • Tester guide and executive summary — end-to-end installation covering the Pi/Mainsail page, Moonraker/Klipper pieces, Android, Windows, Fusion, first tests, and rollback.
  • Install with ChatGPT or Codex — a short intake list and a ready-to-copy prompt for having an AI inspect and adapt another machine without blindly copying my LowRider-specific pins/macros.

For the Android app, enter the controller’s base address only, for example http://192.168.x.x. You should not add /pendant. The wrapper loads the live page installed on the Pi. It does not contain a separate copy of the Pendant logic, so installing only the APK will understandably look like ordinary Klipper/Mainsail or fail to find the Pendant page.

The important distinction you found is correct: this is more than an APK and a set of macros. The current system has several coordinated pieces:

  1. The separate /cnc-pendant.html web page and its assets on the Pi.
  2. Moonraker Python components that scan the actual G-code and verify file identity, offsets, bounds, keep-outs, and reviewed macro state.
  3. Klipper guard/macros adapted to the machine’s existing Pause/Resume/Start chain.
  4. Optional Android and Windows app-style shells that load the same Pi-hosted page.
  5. Optional Fusion post/add-in and Windows Outbox helper for splitting tool stages, restoring rapids in the Hobby workflow, carrying tool/operation/RPM/feed metadata, and checksum-verifying transfers to the Pi.

The current feature set includes guarded jogging, machine/work coordinates, Safe Z and keep-outs, actual G-code preflight, project/stage rollup, ordered tool-change pauses, requested-RPM warnings, calculated chip load, job/tool-change timers, hardware-health monitoring, battery-router reminders, and E-stop recovery records. Some of that is still evolving, and guided E-stop recovery is not yet completely automatic.

The repo now also includes current Android and Windows instructions plus the Fusion workflow:

I also fixed a packaging omission in the installer, removed my private machine IP as a default, updated the older documentation, and ran the full software test set: all 26 JavaScript test programs and all 93 Python tests passed (one intentional skip).

This is still an early developer preview, not a generic one-click CNC conversion. Please compare the compatibility guide and example macros to your actual machine before enabling motion. The LowRider reference assumes its particular homing directions, paired motors, Pause/Resume chain, LEDs, and manual router behavior. Keep normal Mainsail available, start with the installer dry run and motionless tests, and retain a real physical stop.

Your feedback is exactly what I need. If the instructions go sideways anywhere, post the machine/board, kinematics, Klipper/Moonraker/Mainsail versions, what optional pieces you installed, and the exact step where it failed. Pull requests are welcome too—just bear with me while I learn the GitHub end of this.

I find this AI stuff fascinating and I’m just going to include this here this is a conversation I’ve just had with AI to update the Github including instructions etc It actually generated the previous post here so here’s how I got there:

Okay, I’ve got somebody interested in testing Pendant. Can you get the repo current, and can you generate some reasonable instructions, including our Android and PC side works, as well as the Fusion posting scripts and so forth, with fairly detailed installation instructions, maybe some kind of executive summary?

8:23 PM

Worked for 13m 29s

Repository is current and pushed to GitHub:

Mainsail CNC Pendant repository

Key starting documents:

The tester guide covers Pendant, Android, the Windows desktop shell, Fusion post processor, Fusion Outbox add-in, automatic PC-to-Pi transfers, backend installation, initial testing, and rollback.

I also:

  • Added current battery-router, RPM-change, chip-load and recovery documentation.
  • Fixed the installer to include the new E-stop/recovery and battery modules.
  • Removed the private LowRider IP from the Outbox installer default.
  • Updated outdated project, Fusion and running-display documentation.
  • Ran all 26 JavaScript test programs successfully.
  • Ran all 93 Python tests successfully, with one intentional skip.
  • Checked PowerShell parsing, Python compilation, documentation links and privacy-sensitive strings.

Published commit: 1c44291

This updates GitHub only; it did not redeploy or restart the live LowRider.

8:37 PM

From the 7:57 p.m. onwards on rebuilding the GitHub, can you create a post with links that I can put into the V1E forum? Or better yet, I’ll just open. The forum’s open. Can you just do a reply and add the information there and let me post it when you’re done?

8:38 PM

Worked for 2m 56s

The V1E reply editor is open and ready. I’ve prepared the update with the GitHub, tester guide, ChatGPT/Codex installer starter, Android/Windows/Fusion details, testing results, and current limitations.

Please confirm that I may type this draft into the forum editor. I’ll leave it unposted for your review.

8:41 PM

Proceed to put it in the open reply in B1E form.

8:41 PM

Worked for 2m 58s

The full update is in the open V1E reply editor and remains unposted for your review.

The forum displayed a harmless warning that the main GitHub link appeared previously in the topic. I left it included because this reply points to the newly updated repository and documentation.

8:44 PM

Ok, I’ll go actually review the github docs now!

I don’t understand the need for outlook or pc implementation. Is that for the fusion link?

I use MillMage or Estlcam and sometimes the new browser freazycam.
Klipper runs on a raspberry pi and my pendant is a pixel8 android device. Based on further reading, compatibility.md needs to be reviewed and the macros in examples/lowrider4 need to be included from the printer.cfg file.

I’ll have some time later today or early tomorrow to look at it.

Correct—the Windows Outbox/PC pieces are mainly for automating the Fusion-to-Pi workflow. With MillMage, Estlcam, or FreezyCAM you do not need them. Generate normal G-code and upload it through Mainsail or Pendant.

For the basic setup, the actual Pendant page and supporting Moonraker/Klipper pieces go on the Raspberry Pi. On the Pixel 8 you can either browse directly to http://PI-ADDRESS/cnc-pendant.html, or install the optional Android APK and enter the Pi’s base address. The APK provides the dedicated full-screen interface and, importantly, keeps the phone awake while it is being used as the Pendant; it still loads the live page from the Pi. No separate PC installation is required.

One caution: examples/lowrider-v4/cnc-macros.cfg is my working reference, not necessarily a file to include unchanged. Compare and merge the required behavior with your existing macros, especially PAUSE/RESUME, G28, M220, SDCARD_PRINT_FILE, START_JOB, and any rename_existing chains. We should also test a small MillMage/Estlcam/FreezyCAM file motionlessly first, since those posts may use commands or omit Fusion-specific metadata that the scanner has not seen yet.

I have macro commands in my cam software post processor

Will that trip up your scanner software? When im back at the machine ill detail how i have it laid out. The preview works fine. The pendant page is blank because the server side has not yet been installed.

Yes—an unrecognized macro command will currently make preflight fail closed rather than guess what it does. That is intentional, but it should be straightforward to adapt once we see your actual output.

The scanner reads the actual G-code rather than trusting only a CAM preview. It tracks absolute and relative moves and arcs, calculates the XYZ motion envelope, divides the file at real pause/tool-change boundaries, fingerprints the file, and checks the resulting motion against the current work offsets, configured machine travel, keep-outs, and the paused resume return path.

Our Fusion post also adds metadata similar in purpose to your post-processor macros: setup, operation and tool information, stock and clearance data, requested spindle RPM, feed rate and flute count. Pendant uses that for clearer tool-change prompts, approximate timing and calculated chip load. The RPM is the requested setting, not a measured spindle speed, and the metadata complements rather than replaces scanning the actual motion.

When you are back at the machine, please send one small representative G-code file plus the Klipper definitions for every macro your post inserts. We can classify each one as harmless messaging, a reviewed runtime macro whose body is hash-checked, or motion that the bounds scanner must explicitly understand. I would rather add the exact reviewed commands than weaken the scanner globally.

One current LowRider-reference assumption: leave at least 10 mm of usable Z travel above the job/tool-change position. Our ordered pause/resume workflow uses a 10 mm lift by default, and preflight rejects a return path that cannot fit. We should probably expose that as an explicit, configurable machine setting instead of leaving it as a hidden assumption.

And yes, the blank Pendant page before installing the Pi-side web assets/supporting components is expected. The fact that the Android preview itself opens correctly is encouraging.

One clarification about the previous reply: it was drafted by the same AI agent that has been helping me build, test and document this project. This is not just a chatbot giving generic advice—the agent can work directly with the repository and, when authorized, inspect the installed system, compare configuration files, run tests, update documentation and prepare GitHub changes.

I think that direct, project-aware assistance is an enormous part of the value here. Instead of expecting every new user to interpret a long generic installation guide, I strongly encourage using AI as an installation and configuration partner: give it the repository, the machine configuration and the CAM-generated G-code; have it explain proposed changes, preserve a backup, run the motionless tests, and help identify differences from the reference LowRider setup.

That process can help us as well. If another CAM package, macro arrangement or machine exposes a compatibility problem, the AI can help reduce it to a reproducible case, update the documentation or code, run the test suite, and prepare a pull request back to GitHub for human review. That is far more useful than each installer privately solving the same problem.

A paid plan is not strictly required. OpenAI currently includes Codex capability on the free ChatGPT plan for quick coding tasks, so the free tier should be enough to try the guided installation, inspect a few files and work through smaller configuration changes. ChatGPT Plus is currently US$20/month and is much better suited to sustained, multi-file sessions like the development work shown in this thread, with higher practical usage and GitHub-oriented cloud features. I would start free if you are curious and only upgrade if the limits interrupt the work.

The important distinction is that AI assistance does not remove the need for review—especially around motion, homing, limits and safety macros. It gives the installer a project-aware collaborator that can explain and verify changes instead of asking them to blindly paste a reference configuration.

Ok, this is actually me now, the above was AI generated. Let me add That this $20 monthly plan is probably the biggest value I have experienced in a long long . I would highly encourage you to at least use chat GTP’S free plan to double check your install and make any recommendations. The ability of it to interact with the Github project which will allow us to keep it up to date on our side we will prove invaluable as well . You don’t have to turn it loose you can have it do a review only without making any changes with zero issues.

I think you will be amazed if you just feed Chad GTP the handoff instructions from GitHub and pro ceed from there.

I’m not pushing everything to AI. I’ll try the pendant as a beta user, but I’m not signing over my setup. it is simple enough now and just works. if I can add a file or better yet, if you can add it to the advanced kiauh setup utility, then great, but it is describing major rewrites of klipper under the hood for gcode verification. As it is I can write a macro in klipper and call it remotely with an HTTP post command, so there is no need to make a klipper fork and change everything. As described, you are not using the klipper main branch anymore. Can you deconvolute your additions and make it just an add-on? like crowsnest, timelapse, or klipperscreen are separate addons?

If this isnt’ what it is, you need to retrain your ai posting bot to not describe it as such.

Have you looked at the mobileraker app?

Nobody is pushing you toward AI or asking you to sign over your setup. I was sharing what has worked well for me, and suggesting the free read-only compatibility review because this project was developed with AI assistance and that may be the easiest path of least resistance through the current documentation. You can keep it strictly read-only and approve every proposed change yourself.

More importantly, you are correct about the architecture we should be aiming for, and my description evidently made it sound much more invasive than it is. This does not use a Klipper fork and it does not replace the Klipper main branch. The current pieces are:

  • a separate Pendant web page alongside Mainsail;
  • optional custom Moonraker components that scan and stage G-code;
  • a small reviewed Klipper configuration include and macro wrappers that gate Start/Resume through preflight.

The scanner runs on the Pi/Moonraker side. It does not rewrite Klipper’s motion code. The Klipper macros are ordinary configuration, not changes to Klipper source. They are needed only if the user wants the verified Start/Resume path to be enforced so a normal Mainsail start cannot bypass it. The reference LowRider macro file is not intended to replace an existing working configuration wholesale.

So yes: packaging this as a clean optional add-on, with a KIAUH-style advanced installer, dependency checks and a coherent uninstall/rollback path, is exactly the right goal. The current installer handles the UI, but the Moonraker component and macro integration are still too manual and the documentation makes that dependency set look more tangled than it should. Your feedback identifies a real packaging/documentation problem.

I am aware of Mobileraker, but I have not yet done a serious feature-by-feature evaluation against this project. It may already cover much of the general mobile Klipper-control use case. The reason for this Pendant is the CNC-specific workflow: deliberate jogging, tool-change handling, work-coordinate protection, G-code envelope/preflight checks, keep-outs and E-stop recovery. I would be interested in identifying what Mobileraker already solves well so we do not duplicate it unnecessarily.

For beta testing, there is no need to install the verification backend first. We can separate this into stages: preview the standalone UI, perform a read-only compatibility review, then decide whether any optional integration is worthwhile. Your existing working setup should remain the baseline, not something the project assumes it may replace.