### Setup OctoPrint Service Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Copy OctoPrint init scripts and configure them to start automatically on boot. ```bash sudo cp ~/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint sudo chmod +x /etc/init.d/octoprint sudo cp ~/OctoPrint/scripts/octoprint.default /etc/default/octoprint sudo update-rc.d octoprint defaults ``` -------------------------------- ### Install OctoPrint Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Clone the OctoPrint repository, set up a virtual environment, and install it. ```bash git clone https://github.com/foosel/OctoPrint.git cd OctoPrint/ virtualenv venv ./venv/bin/python setup.py install ``` -------------------------------- ### Run Klipper simulation with simulavr Source: https://github.com/klipper3d/klipper/blob/master/docs/Debugging.md Start the simulavr simulation of Klipper. Set the PYTHONPATH if the Python module is not installed system-wide. ```bash PYTHONPATH=/path/to/simulavr/build/pysimulavr/ ./scripts/avrsim.py out/klipper.elf ``` ```bash ./scripts/avrsim.py out/klipper.elf ``` -------------------------------- ### Install Git on Host Device Source: https://github.com/klipper3d/klipper/blob/master/docs/OctoPrint.md Use this command to install git if it is not already present on your host device. ```bash sudo apt install git ``` -------------------------------- ### Install can-utils Source: https://github.com/klipper3d/klipper/blob/master/docs/CANBUS_Troubleshooting.md Installs the necessary tools for capturing CAN bus traffic. Run this command on your host machine. ```bash sudo apt-get update && sudo apt-get install can-utils ``` -------------------------------- ### Install Klipper Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Clone the Klipper repository and run the installation script specifically designed for BeagleBone. ```bash git clone https://github.com/Klipper3d/klipper.git ./klipper/scripts/install-beaglebone.sh ``` -------------------------------- ### Clone Klipper and Install OctoPi Script Source: https://github.com/klipper3d/klipper/blob/master/docs/OctoPrint.md After installing git, clone the Klipper repository and execute the installation script for OctoPi. This process downloads Klipper, sets up system dependencies, and configures Klipper to run at startup. ```bash cd ~ git clone https://github.com/Klipper3d/klipper ./klipper/scripts/install-octopi.sh ``` -------------------------------- ### Install HID Flash Utility Source: https://github.com/klipper3d/klipper/blob/master/docs/Bootloaders.md Commands to install the necessary library and compile the hid-flash utility for uploading binaries to the HID bootloader. ```bash sudo apt install libusb-1.0 cd ~/klipper/lib/hidflash make ``` -------------------------------- ### Start OctoPrint Service Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Start the OctoPrint service using systemctl and verify accessibility via the web interface. ```bash sudo systemctl start octoprint ``` -------------------------------- ### Install simulavr on Debian-based systems Source: https://github.com/klipper3d/klipper/blob/master/docs/Debugging.md Install necessary packages and build debian packages for system-wide installation of simulavr on Debian-based systems. ```bash sudo apt update sudo apt install g++ make cmake swig rst2pdf help2man texinfo make cfgclean python debian sudo dpkg -i build/debian/python3-simulavr*.deb ``` -------------------------------- ### Install and Compile OpenOCD Source: https://github.com/klipper3d/klipper/blob/master/docs/Bootloaders.md Installs necessary dependencies, clones the OpenOCD repository, and compiles it with RPi GPIO support. This process can take a significant amount of time. ```bash sudo apt-get update sudo apt-get install autoconf libtool telnet mkdir ~/openocd cd ~/openocd/ git clone http://openocd.zylin.com/openocd cd openocd ./bootstrap ./configure --enable-sysfsgpio --enable-bcm2835gpio --prefix=/home/pi/openocd/install make make install ``` -------------------------------- ### Configure and Install Linux Host Firmware Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Configure Klipper a second time for a 'Linux process' and then install the micro-controller code for the host. This ensures the host MCU is set up correctly. ```bash make menuconfig ``` ```bash sudo service klipper stop make flash sudo service klipper start ``` -------------------------------- ### Copy and Edit Klipper Configuration Source: https://github.com/klipper3d/klipper/blob/master/docs/Installation.md Use these commands to copy an example configuration file and open it for editing. ```bash cp ~/klipper/config/example-cartesian.cfg ~/printer.cfg nano ~/printer.cfg ``` -------------------------------- ### Install Resonance Measurement Dependencies Source: https://github.com/klipper3d/klipper/blob/master/docs/Measuring_Resonances.md Installs Python libraries required for resonance measurements on a Raspberry Pi. Ensure you have sufficient RAM or enable swap if installation fails. ```bash sudo apt update sudo apt install python3-numpy python3-matplotlib libatlas-base-dev libopenblas-dev ``` ```bash ~/klippy-env/bin/pip install -v "numpy<1.26" ``` ```bash ~/klippy-env/bin/python -c 'import numpy;' ``` -------------------------------- ### Example Dual Carriage and Stepper Configuration Source: https://github.com/klipper3d/klipper/blob/master/docs/Config_Reference.md Illustrates the configuration of multiple carriages and a stepper motor for a dual carriage system. This setup is essential for defining how the dual carriage is controlled and synchronized. ```cfg [carriage carriage_x] ... [carriage carriage_y] ... [dual_carriage carriage_u] primary_carriage: carriage_x ... [stepper dc_stepper] carriages: carriage_u-carriage_y ... ``` -------------------------------- ### Save Variable Example Source: https://github.com/klipper3d/klipper/blob/master/docs/Command_Templates.md Demonstrates saving the current extruder state to a variable and recalling it on print start. Ensure the save_variables config section is enabled. ```yaml [gcode_macro T1] gcode: ACTIVATE_EXTRUDER extruder=extruder1 SAVE_VARIABLE VARIABLE=currentextruder VALUE='"extruder1"' [gcode_macro T0] gcode: ACTIVATE_EXTRUDER extruder=extruder SAVE_VARIABLE VARIABLE=currentextruder VALUE='"extruder"' [gcode_macro START_GCODE] gcode: {% set svv = printer.save_variables.variables %} ACTIVATE_EXTRUDER extruder={svv.currentextruder} ``` -------------------------------- ### Round Bed Mesh Configuration Example Source: https://github.com/klipper3d/klipper/blob/master/docs/Config_Reference.md This example shows the probe point distribution for a round bed with a round_probe_count of 5 and a bed_radius 'r'. ```cfg round bed, round_probe_count = 5, bed_radius = r: x (0, r) end / x---x---x \ (-r, 0) x---x---x---x---x (r, 0) \ x---x---x / x (0, -r) start ``` -------------------------------- ### Manual Stepper Configuration Example Source: https://github.com/klipper3d/klipper/blob/master/docs/Config_Reference.md This is an example configuration for a manual stepper. It includes commented-out parameters for step, direction, and enable pins, microsteps, rotation distance, velocity, acceleration, endstop pin, and position limits. ```ini [manual_stepper my_stepper] #step_pin: #dir_pin: #enable_pin: #microsteps: #rotation_distance: # See the "stepper" section for a description of these parameters. #velocity: # Set the default velocity (in mm/s) for the stepper. This value # will be used if a MANUAL_STEPPER command does not specify a SPEED # parameter. The default is 5mm/s. #accel: # Set the default acceleration (in mm/s^2) for the stepper. An # acceleration of zero will result in no acceleration. This value # will be used if a MANUAL_STEPPER command does not specify an ACCEL # parameter. The default is zero. #endstop_pin: # Endstop switch detection pin. If specified, then one may perform # "homing moves" by adding a STOP_ON_ENDSTOP parameter to # MANUAL_STEPPER movement commands. #position_min: #position_max: # The minimum and maximum position the stepper can be commanded to # move to. If specified then one may not command the stepper to move # past the given position. Note that these limits do not prevent # setting an arbitrary position with the `MANUAL_STEPPER # SET_POSITION=x` command. The default is to not enforce a limit. ``` -------------------------------- ### Install Linux GPIO Character Device Tools Source: https://github.com/klipper3d/klipper/blob/master/docs/RPi_microcontroller.md Install the necessary tools for interacting with the Linux GPIO character device on Debian-based systems like OctoPi. ```bash sudo apt-get install gpiod ``` -------------------------------- ### Example Output of calibrate_shaper.py Source: https://github.com/klipper3d/klipper/blob/master/docs/Measuring_Resonances.md This is an example of the output generated by the `calibrate_shaper.py` script, showing fitted shaper frequencies, vibration percentages, smoothing values, and recommended shaper configurations. ```text Fitted shaper 'zv' frequency = 34.4 Hz (vibrations = 4.0%, smoothing ~= 0.132) To avoid too much smoothing with 'zv', suggested max_accel <= 4500 mm/sec^2 Fitted shaper 'mzv' frequency = 34.6 Hz (vibrations = 0.0%, smoothing ~= 0.170) To avoid too much smoothing with 'mzv', suggested max_accel <= 3500 mm/sec^2 Fitted shaper 'ei' frequency = 41.4 Hz (vibrations = 0.0%, smoothing ~= 0.188) To avoid too much smoothing with 'ei', suggested max_accel <= 3200 mm/sec^2 Fitted shaper '2hump_ei' frequency = 51.8 Hz (vibrations = 0.0%, smoothing ~= 0.201) To avoid too much smoothing with '2hump_ei', suggested max_accel <= 3000 mm/sec^2 Fitted shaper '3hump_ei' frequency = 61.8 Hz (vibrations = 0.0%, smoothing ~= 0.215) To avoid too much smoothing with '3hump_ei', suggested max_accel <= 2800 mm/sec^2 Recommended shaper is mzv @ 34.6 Hz ``` -------------------------------- ### Apply Z Axis Shaper Parameters (Example 1) Source: https://github.com/klipper3d/klipper/blob/master/docs/Measuring_Resonances.md Store recommended shaper type and frequency for the Z axis in `printer.cfg` after successful calibration. ```ini [input_shaper] ... shaper_type_z: mzv shaper_freq_z: 42.6 ``` -------------------------------- ### Bed Mesh Configuration Example Source: https://github.com/klipper3d/klipper/blob/master/docs/Config_Reference.md The bed_mesh section enables mesh bed leveling. This example illustrates the probe point distribution for a rectangular bed with a probe_count of 3x3. ```cfg rectangular bed, probe_count = 3, 3: x---x---x (max_point) | x---x---x | (min_point) x---x---x ``` -------------------------------- ### Klipper API Gcode Script Request Example Source: https://github.com/klipper3d/klipper/blob/master/docs/API_Server.md An example of a request to execute a G-code script. This demonstrates the 'gcode/script' method with a 'script' parameter. ```json {"id": 123, "method": "gcode/script", "params": {"script": "G1 X200"}} ``` -------------------------------- ### Calculate Example Shaper Frequency X Source: https://github.com/klipper3d/klipper/blob/master/docs/Resonance_Compensation.md Example calculation for tuning tower parameters and the resulting shaper frequency. Assumes an initial measured frequency of 45 Hz. ```shell # Example calculation: # start = 45 * 83 / 132 = 28.30 # factor = 45 / 66 = 0.6818 # After printing, if band 4 shows least ringing: # new_shaper_freq_x = 45 * (39 + 5 * 4) / 66 ≈ 40.23 ``` -------------------------------- ### Check Accelerometer Connection Source: https://github.com/klipper3d/klipper/blob/master/docs/Measuring_Resonances.md Example output from the ACCELEROMETER_QUERY command, showing the measured acceleration values on the x, y, and z axes. ```text Recv: // adxl345 values (x, y, z): 470.719200, 941.438400, 9728.196800 ``` -------------------------------- ### Configure MCU Baud Rate Source: https://github.com/klipper3d/klipper/blob/master/docs/FAQ.md Example configuration snippet for the Klipper printer.cfg file to set the baud rate for the MCU. The recommended rate is 250000. ```ini [mcu] baud: 250000 ``` -------------------------------- ### LOAD_CELL_CALIBRATE Source: https://github.com/klipper3d/klipper/blob/master/docs/G-Codes.md Starts the guided calibration utility for a load cell. ```APIDOC ## LOAD_CELL_CALIBRATE ### Description Starts a guided 3-step calibration process for the load cell, involving TARE, CALIBRATE GRAMS, and ACCEPT commands. ### Method `LOAD_CELL_CALIBRATE` ### Parameters - **LOAD_CELL** (string) - Optional - The name of the load cell configuration. ``` -------------------------------- ### Configure BLTouch Probe Source: https://github.com/klipper3d/klipper/blob/master/docs/Config_Reference.md Use this section to enable and configure a BLTouch probe. Ensure the sensor_pin and control_pin are correctly set. Refer to the BLTouch guide for detailed setup. ```ini [bltouch] sensor_pin: # Pin connected to the BLTouch sensor pin. Most BLTouch devices # require a pullup on the sensor pin (prefix the pin name with "^"). # This parameter must be provided. control_pin: # Pin connected to the BLTouch control pin. This parameter must be # provided. #pin_move_time: 0.680 # The amount of time (in seconds) to wait for the BLTouch pin to # move up or down. The default is 0.680 seconds. #stow_on_each_sample: True # This determines if Klipper should command the pin to move up # between each probe attempt when performing a multiple probe # sequence. Read the directions in docs/BLTouch.md before setting # this to False. The default is True. #probe_with_touch_mode: False # If this is set to True then Klipper will probe with the device in # "touch_mode". The default is False (probing in "pin_down" mode). #pin_up_reports_not_triggered: True # Set if the BLTouch consistently reports the probe in a "not # triggered" state after a successful "pin_up" command. This should # be True for all genuine BLTouch devices. Read the directions in # docs/BLTouch.md before setting this to False. The default is True. #pin_up_touch_mode_reports_triggered: True # Set if the BLTouch consistently reports a "triggered" state after # the commands "pin_up" followed by "touch_mode". This should be # True for all genuine BLTouch devices. Read the directions in # docs/BLTouch.md before setting this to False. The default is True. #set_output_mode: # Request a specific sensor pin output mode on the BLTouch V3.0 (and # later). This setting should not be used on other types of probes. # Set to "5V" to request a sensor pin output of 5 Volts (only use if # the controller board needs 5V mode and is 5V tolerant on its input # signal line). Set to "OD" to request the sensor pin output use # open drain mode. The default is to not request an output mode. #x_offset: #y_offset: #z_offset: #speed: #lift_speed: #samples: #sample_retract_dist: #samples_result: #samples_tolerance: #samples_tolerance_retries: # See the "probe" section for information on these parameters. ``` -------------------------------- ### Adjust Bed Leveling Screws Source: https://github.com/klipper3d/klipper/blob/master/docs/Manual_Level.md Execute this command to start the automated bed leveling screw adjustment tool. The tool will guide you through adjusting each screw using the 'paper test'. ```shell BED_SCREWS_ADJUST ``` -------------------------------- ### Verify PRU Firmware Installation Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Check the system logs after flashing the PRU firmware to confirm that the PRU cores have started properly. Look for messages indicating remoteproc and virtio devices. ```bash dmesg ``` -------------------------------- ### Example GPIO Detection and Information on RPi 3B+ Source: https://github.com/klipper3d/klipper/blob/master/docs/RPi_microcontroller.md Demonstrates the output of `gpiodetect` and `gpioinfo` on an RPi 3B+, showing available GPIO chips and pin usage. Note that only lines marked as 'unused' can be utilized by Klipper. ```bash $ gpiodetect gpiochip0 [pinctrl-bcm2835] (54 lines) gpiochip1 [raspberrypi-exp-gpio] (8 lines) $ gpioinfo gpiochip0 - 54 lines: line 0: unnamed unused input active-high line 1: unnamed unused input active-high line 2: unnamed unused input active-high line 3: unnamed unused input active-high line 4: unnamed unused input active-high line 5: unnamed unused input active-high line 6: unnamed unused input active-high line 7: unnamed unused input active-high line 8: unnamed unused input active-high line 9: unnamed unused input active-high line 10: unnamed unused input active-high line 11: unnamed unused input active-high line 12: unnamed unused input active-high line 13: unnamed unused input active-high line 14: unnamed unused input active-high line 15: unnamed unused input active-high line 16: unnamed unused input active-high line 17: unnamed unused input active-high line 18: unnamed unused input active-high line 19: unnamed unused input active-high line 20: unnamed "klipper" output active-high [used] line 21: unnamed unused input active-high line 22: unnamed unused input active-high line 23: unnamed unused input active-high line 24: unnamed unused input active-high line 25: unnamed unused input active-high line 26: unnamed unused input active-high line 27: unnamed unused input active-high line 28: unnamed unused input active-high line 29: unnamed "led0" output active-high [used] line 30: unnamed unused input active-high line 31: unnamed unused input active-high line 32: unnamed unused input active-high line 33: unnamed unused input active-high line 34: unnamed unused input active-high line 35: unnamed unused input active-high line 36: unnamed unused input active-high line 37: unnamed unused input active-high line 38: unnamed unused input active-high line 39: unnamed unused input active-high line 40: unnamed unused input active-high line 41: unnamed unused input active-high line 42: unnamed unused input active-high line 43: unnamed unused input active-high line 44: unnamed unused input active-high line 45: unnamed unused input active-high line 46: unnamed unused input active-high line 47: unnamed unused input active-high line 48: unnamed unused input active-high line 49: unnamed unused input active-high line 50: unnamed unused input active-high line 51: unnamed unused input active-high line 52: unnamed unused input active-high line 53: unnamed unused input active-high gpiochip1 - 8 lines: line 0: unnamed unused input active-high ``` -------------------------------- ### Configure and Build BeagleBone PRU Firmware Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Navigate to the Klipper directory, configure the build for BeagleBone PRU, and then build and flash the firmware. Ensure optional features that exceed PRU memory are disabled. ```bash cd ~/klipper/ make menuconfig ``` ```bash sudo service klipper stop make flash sudo service klipper start ``` -------------------------------- ### Start Filament Diameter Logging Source: https://github.com/klipper3d/klipper/blob/master/docs/Hall_Filament_Width_Sensor.md Issue this command to start logging filament diameter measurements. Logging is disabled by default. ```text ENABLE_FILAMENT_WIDTH_LOG ``` -------------------------------- ### Enable PWM0 and PWM1 on GPIO12 and GPIO13 Source: https://github.com/klipper3d/klipper/blob/master/docs/RPi_microcontroller.md Use the `pwm-2chan` overlay in `/boot/config.txt` to enable both PWM channels, routing PWM0 to GPIO12 and PWM1 to GPIO13. ```bash # Enable pwmchip sysfs interface dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4 ``` -------------------------------- ### Example of Uninitialized CAN Device Detection Source: https://github.com/klipper3d/klipper/blob/master/docs/CANBUS.md This is an example output when the canbus_query.py tool detects uninitialized CAN devices. Each device will have a unique identifier. ```text Found canbus_uuid=11aa22bb33cc, Application: Klipper ``` -------------------------------- ### SD Card Upload Utility Help Screen Source: https://github.com/klipper3d/klipper/blob/master/docs/SDCard_Updates.md Displays the usage instructions and available options for the `flash-sdcard.sh` utility. ```bash ./scripts/flash-sdcard.sh -h ``` -------------------------------- ### Enable PWM0 on GPIO12 Source: https://github.com/klipper3d/klipper/blob/master/docs/RPi_microcontroller.md Add this line to `/boot/config.txt` to enable the PWM0 channel and route it to GPIO pin 12. ```bash # Enable pwmchip sysfs interface dtoverlay=pwm,pin=12,func=4 ``` -------------------------------- ### Install Klipper MCU Service Script Source: https://github.com/klipper3d/klipper/blob/master/docs/RPi_microcontroller.md Installs and enables the systemd service for the klipper_mcu process, ensuring it runs before the main klippy process. ```bash cd ~/klipper/ sudo cp ./scripts/klipper-mcu.service /etc/systemd/system/ sudo systemctl enable klipper-mcu.service ``` -------------------------------- ### Enter Bootloader using Picocom Source: https://github.com/klipper3d/klipper/blob/master/docs/Bootloader_Entry.md This method uses picocom to enter the bootloader via a virtual serial port. It requires setting the baud rate to 1200 and then sending a specific key combination. ```shell picocom -b 1200 ``` -------------------------------- ### Mark Start of Object G-code Source: https://github.com/klipper3d/klipper/blob/master/docs/G-Codes.md Denotes the start of an object's G-code for the current layer. Requires the exclude_object config section to be enabled. ```shell EXCLUDE_OBJECT_START NAME=object_name ``` -------------------------------- ### PALETTE_CONNECT Source: https://github.com/klipper3d/klipper/blob/master/docs/G-Codes.md Initializes the connection with the Palette 2 device. ```APIDOC ## PALETTE_CONNECT ### Description Initializes the connection with the Palette 2 device. ### Method Any ### Endpoint Any ### Parameters None ### Request Example ``` PALETTE_CONNECT ``` ### Response #### Success Response (200) None specified #### Response Example None specified ``` -------------------------------- ### Install Matplotlib for Graphing Source: https://github.com/klipper3d/klipper/blob/master/docs/Debugging.md Install the 'matplotlib' Python package, necessary for generating graphs with Klipper's analysis tools. Run on Debian-based systems. ```bash sudo apt-get update sudo apt-get install python-matplotlib ``` -------------------------------- ### Bed Mesh Configuration Example Source: https://github.com/klipper3d/klipper/blob/master/docs/Bed_Mesh.md Configure bed mesh settings including speed, horizontal move Z, mesh boundaries, probe count, and scan overshoot. Ensure `horizontal_move_z` is set appropriately to avoid scanning errors. ```ini [bed_mesh] speed: 120 horizontal_move_z: 5 mesh_min: 35, 6 mesh_max: 240, 198 probe_count: 5 scan_overshoot: 8 ``` -------------------------------- ### OctoPrint Old Setup Serial Port Source: https://github.com/klipper3d/klipper/blob/master/docs/OctoPrint.md In some older setups, the Klipper serial communication path might be different. Use this path if the standard one does not work. ```text /tmp/printer ``` -------------------------------- ### Start and Stop Accelerometer Measurements Source: https://github.com/klipper3d/klipper/blob/master/docs/G-Codes.md Use ACCELEROMETER_MEASURE to start or stop measurements. Results are saved to a CSV file. Specify CHIP and NAME for custom file naming. ```gcode ACCELEROMETER_MEASURE ``` ```gcode ACCELEROMETER_MEASURE CHIP=adxl345_name ``` ```gcode ACCELEROMETER_MEASURE NAME=my_measurements ``` ```gcode ACCELEROMETER_MEASURE CHIP=adxl345_name NAME=my_measurements ``` -------------------------------- ### Enter Bootloader using Python flash_usb Source: https://github.com/klipper3d/klipper/blob/master/docs/Bootloader_Entry.md Use this Python script to enter the bootloader via a virtual serial port. Replace with your actual serial port. Success is indicated by output; failure produces no output. ```shell > cd klipper/scripts > python3 -c 'import flash_usb as u; u.enter_bootloader("")' Entering bootloader on ``` -------------------------------- ### Download STM32duino Bootloader Source: https://github.com/klipper3d/klipper/blob/master/docs/Bootloaders.md Obtain the generic STM32duino bootloader binary for STM32F103 devices. ```shell wget 'https://github.com/rogerclarkmelbourne/STM32duino-bootloader/raw/master/binaries/generic_boot20_pc13.bin' ``` -------------------------------- ### Get Klipper System and Version Info Source: https://github.com/klipper3d/klipper/blob/master/docs/API_Server.md Use the 'info' endpoint to retrieve system and version details from Klipper. Clients can also provide their version information using the 'client_info' parameter. ```json {"id": 123, "method": "info", "params": { "client_info": { "version": "v1"}}} ``` -------------------------------- ### Configure Klipper Firmware Source: https://github.com/klipper3d/klipper/blob/master/docs/Installation.md Run 'make menuconfig' to configure the Klipper firmware settings. Refer to the printer configuration file for specific instructions. ```bash make menuconfig ``` -------------------------------- ### Install SciPy for Load Cell Filtering Source: https://github.com/klipper3d/klipper/blob/master/docs/Load_Cell.md Install the SciPy library using pip within your Klipper environment. This is a prerequisite for using Klipper's load cell filtering capabilities. ```bash ~/klippy-env/bin/pip install scipy ``` -------------------------------- ### Enable Klipper API Socket Source: https://github.com/klipper3d/klipper/blob/master/docs/API_Server.md Start the Klipper host software with the -a parameter to enable the API socket. This creates a Unix Domain Socket for client connections. ```bash ~/klipper-env/bin/python ~/klipper/klippy/klippy.py ~/printer.cfg -a /tmp/klippy_uds -l /tmp/klippy.log ``` -------------------------------- ### Navigate to Klipper Directory Source: https://github.com/klipper3d/klipper/blob/master/docs/Installation.md Change the current directory to the Klipper source code directory to begin the build process. ```bash cd ~/klipper/ ``` -------------------------------- ### Apply Z Axis Shaper Parameters (Example 2) Source: https://github.com/klipper3d/klipper/blob/master/docs/Measuring_Resonances.md Consider using more aggressive input shapers for the Z axis due to its typically slower movements. This example shows a '2hump_ei' shaper. ```ini [input_shaper] ... shaper_type_z: 2hump_ei shaper_freq_z: 63.0 ``` -------------------------------- ### Set G-code Variable Example Source: https://github.com/klipper3d/klipper/blob/master/docs/Command_Templates.md The `SET_GCODE_VARIABLE` command allows saving state between macro calls. Variable names must be lowercase. This example saves the bed target temperature before disabling the heater and probing. ```yaml [gcode_macro start_probe] variable_bed_temp: 0 gcode: # Save target temperature to bed_temp variable SET_GCODE_VARIABLE MACRO=start_probe VARIABLE=bed_temp VALUE={printer.heater_bed.target} # Disable bed heater M140 # Perform probe PROBE # Call finish_probe macro at completion of probe finish_probe [gcode_macro finish_probe] gcode: # Restore temperature M140 S{printer["gcode_macro start_probe"].bed_temp} ``` -------------------------------- ### Input Shaper Tuning Results with Max Smoothing Source: https://github.com/klipper3d/klipper/blob/master/docs/Measuring_Resonances.md Example output after applying a maximum smoothing limit, showing updated shaper parameters and a potentially different recommended shaper. ```text Fitted shaper 'zv' frequency = 55.4 Hz (vibrations = 19.7%, smoothing ~= 0.057) To avoid too much smoothing with 'zv', suggested max_accel <= 12000 mm/sec^2 Fitted shaper 'mzv' frequency = 34.6 Hz (vibrations = 3.6%, smoothing ~= 0.170) To avoid too much smoothing with 'mzv', suggested max_accel <= 3500 mm/sec^2 Fitted shaper 'ei' frequency = 48.2 Hz (vibrations = 4.8%, smoothing ~= 0.139) To avoid too much smoothing with 'ei', suggested max_accel <= 4300 mm/sec^2 Fitted shaper '2hump_ei' frequency = 52.0 Hz (vibrations = 2.7%, smoothing ~= 0.200) To avoid too much smoothing with '2hump_ei', suggested max_accel <= 3000 mm/sec^2 Fitted shaper '3hump_ei' frequency = 72.6 Hz (vibrations = 1.4%, smoothing ~= 0.155) To avoid too much smoothing with '3hump_ei', suggested max_accel <= 3900 mm/sec^2 Recommended shaper is 3hump_ei @ 72.6 Hz ``` -------------------------------- ### Configure Boot Stage 2 Name and Path Source: https://github.com/klipper3d/klipper/blob/master/lib/pico-sdk/rp2040/boot_stage2/CMakeLists.txt Configures the PICO_DEFAULT_BOOT_STAGE2 variable, falling back to 'compile_time_choice' if not set via environment or other means. It then constructs the full path to the boot stage 2 source file. ```cmake set(PICO_BOOT_STAGE2_COMPILE_TIME_CHOICE_NAME compile_time_choice) # local var if (NOT PICO_DEFAULT_BOOT_STAGE2_FILE) if (DEFINED ENV{PICO_DEFAULT_BOOT_STAGE2}) set(PICO_DEFAULT_BOOT_STAGE2 $ENV{PICO_DEFAULT_BOOT_STAGE2}) message("Using PICO_DEFAULT_BOOT_STAGE2 from environment ('${PICO_DEFAULT_BOOT_STAGE2}')") endif() if (NOT DEFINED PICO_DEFAULT_BOOT_STAGE2) set(PICO_DEFAULT_BOOT_STAGE2 ${PICO_BOOT_STAGE2_COMPILE_TIME_CHOICE_NAME}) endif() set(PICO_DEFAULT_BOOT_STAGE2 "${PICO_DEFAULT_BOOT_STAGE2}" CACHE STRING "boot stage 2 short name" FORCE) set(PICO_DEFAULT_BOOT_STAGE2_FILE "${CMAKE_CURRENT_LIST_DIR}/${PICO_DEFAULT_BOOT_STAGE2}.S") endif() ``` -------------------------------- ### Install AVR Packages on Beaglebone Source: https://github.com/klipper3d/klipper/blob/master/docs/Beaglebone.md Use these commands to remove PRU packages and install AVR packages if you need to build AVR micro-controller code in the Beaglebone environment. Remember to restore PRU packages afterward if necessary. ```bash sudo apt-get remove gcc-pru sudo apt-get install avrdude gcc-avr binutils-avr avr-libc ``` ```bash sudo apt-get remove avrdude gcc-avr binutils-avr avr-libc sudo apt-get install gcc-pru ``` -------------------------------- ### Set Default Boot Stage 2 File from Environment Source: https://github.com/klipper3d/klipper/blob/master/lib/pico-sdk/rp2040/boot_stage2/CMakeLists.txt Sets the PICO_DEFAULT_BOOT_STAGE2_FILE variable from the environment if defined, otherwise uses a cached value. Logs the source of the setting. ```cmake if (DEFINED ENV{PICO_DEFAULT_BOOT_STAGE2_FILE}) set(PICO_DEFAULT_BOOT_STAGE2_FILE $ENV{PICO_DEFAULT_BOOT_STAGE2_FILE}) message("Using PICO_DEFAULT_BOOT_STAGE2_FILE from environment ('${PICO_DEFAULT_BOOT_STAGE2_FILE}')") elseif (PICO_DEFAULT_BOOT_STAGE2_FILE) # explicitly set, so cache it set(PICO_DEFAULT_BOOT_STAGE2_FILE "${PICO_DEFAULT_BOOT_STAGE2_FILE}" CACHE STRING "boot stage 2 source file" FORCE) endif() ```