Skip to content

Malaquitte/KlipperEndstopPanel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Endstops Status Panel for Mainsail

A custom panel for Mainsail that displays real-time status of all endstops on your Klipper-powered 3D printer.

Endstops Panel Preview

Features

  • ✅ Real-time display of all endstop states
  • ✅ Automatic updates with toggle option
  • ✅ Clear visual indicators (green for triggered, red for open)
  • ✅ Manual refresh on demand
  • ✅ Last update timestamp
  • ✅ Design integrated with Mainsail interface
  • ✅ Compatible with all endstop types supported by Klipper

Requirements

  • A 3D printer running Klipper
  • Mainsail installed and configured
  • SSH access to your Raspberry Pi or other computer hosting Mainsail

Installation

Manual Method

  1. Connect to your Raspberry Pi via SSH

  2. Create the custom panels folder if it doesn't already exist:

    mkdir -p ~/printer_data/config/custom_panels
  3. Create the panel file:

    nano ~/printer_data/config/custom_panels/endstops_panel.js
  4. Copy and paste the content of the endstops_panel.js file.

  5. Restart Moonraker:

    sudo service moonraker restart
  6. Refresh Mainsail in your browser.

Git Installation (recommended)

  1. Clone this repository to your Raspberry Pi:

    cd ~
    git clone https://github.com/Malaquitte/KlipperEndstopPanel.git
  2. Create a symbolic link to your Mainsail configuration folder:

    mkdir -p ~/printer_data/config/custom_panels
    ln -sf ~/endstops-panel/endstops_panel.js ~/printer_data/config/custom_panels/
  3. Add the update configuration to your moonraker.conf file:

    [update_manager client endstops_panel]
    type: git_repo
    path: ~/KlipperEndstopPanel
    origin: https://github.com/Malaquitte/KlipperEndstopPanel.git
    primary_branch: main
    is_system_service: False
    
  4. Restart Moonraker:

    sudo service moonraker restart

Updates

To update the panel to the latest version:

  1. Using Moonraker's Update Manager (recommended):

    • Go to the Machine section in Mainsail
    • Look for "endstops_panel" in the update manager
    • Click "Update" if an update is available
  2. Manual update:

    cd ~/KlipperEndstopPanel
    git pull
    cp endstops_panel.js ~/printer_data/config/custom_panels/

Uninstallation

If you need to remove the Endstops Panel, an uninstallation script is provided:

Automatic Uninstallation (Recommended)

cd ~/KlipperEndstopPanel
./uninstall.sh

The uninstallation script will:

  1. Remove the endstops_panel.js file from your custom panels directory
  2. Remove the update manager entry from moonraker.conf
  3. Offer to restart Moonraker
  4. Offer to delete the repository

Manual Uninstallation

If you prefer to uninstall manually:

  1. Remove the panel file:

    rm ~/printer_data/config/custom_panels/endstops_panel.js
  2. Edit your moonraker.conf file and remove the section:

    [update_manager client endstops_panel]
    type: git_repo
    path: ~/KlipperEndstopPanel
    origin: https://github.com/Malaquitte/KlipperEndstopPanel.git
    primary_branch: main
    is_system_service: False
    
  3. Restart Moonraker:

    sudo systemctl restart moonraker
  4. Optionally remove the repository:

    rm -rf ~/KlipperEndstopPanel

Usage

After installation, the panel can be accessed in two ways:

  1. Via the icon in the Mainsail sidebar
  2. In "Interface Settings" > "Custom Panels" where you can configure its placement

Features

  • Automatic Refresh: By default, the panel updates the endstop status every 5 seconds. You can enable/disable this feature with the "Auto" switch.
  • Manual Refresh: Click the "Refresh" button to immediately update the endstop status.
  • Visual Indicators:
    • Green (✅): Endstop triggered
    • Red (❌): Endstop open/not triggered

Troubleshooting

Panel doesn't appear

  • Check that the file is correctly placed in ~/printer_data/config/custom_panels/
  • Make sure the file is named endstops_panel.js
  • Check for JavaScript errors in your browser's console (F12)
  • Restart Moonraker and fully refresh Mainsail (Ctrl+F5)

Panel appears but doesn't show endstops

  • Verify that your printer is connected
  • Make sure Klipper supports the QUERY_ENDSTOPS command
  • Check Klipper logs for any errors

Customization

You can customize the appearance and behavior of the panel by modifying the endstops_panel.js file. Here are some common modifications:

Change refresh frequency

Modify the value 5000 (5 seconds) in the startAutoRefresh method:

startAutoRefresh() {
    this.stopAutoRefresh();
    this.refreshInterval = setInterval(() => {
        this.queryEndstops();
    }, 10000); // 10 seconds instead of 5
},

Change panel icon

Modify the icon value at the beginning of the code. You can use any icon from the Material Design Icons library:

MOONRAKER.customPanels.endstopsPanel = {
    name: "Endstops Status",
    icon: "mdi-home-floor-3",  // Change this value
    sidebar_icon: true,
    
    // ...
}

Contributing

Contributions are welcome! Feel free to open an issue or pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • The Klipper team for their excellent firmware
  • The Mainsail team for their outstanding web interface
  • All contributors in the 3D printing community

About

Mainsail panel to monitor all endstops status

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors