diff --git a/ender_data/config/printer.cfg b/ender_data/config/printer.cfg deleted file mode 100644 index 1ce5383..0000000 --- a/ender_data/config/printer.cfg +++ /dev/null @@ -1,13 +0,0 @@ -[include shell_command.cfg] -[include fluidd.cfg] -[mcu] -serial: /dev/serial/by-id/ - -[virtual_sdcard] -path: /home/jeka/ender_data/gcodes -on_error_gcode: CANCEL_PRINT - -[printer] -kinematics: none -max_velocity: 1000 -max_accel: 1000 diff --git a/ender_data/config/telegram.conf b/ender_data/config/telegram.conf deleted file mode 100644 index 6d5b90b..0000000 --- a/ender_data/config/telegram.conf +++ /dev/null @@ -1,20 +0,0 @@ -# Please refer to the wiki(https://github.com/nlef/moonraker-telegram-bot/wiki) for detailed information on how to configure the bot - -[bot] -server: localhost -bot_token: AweSomeBotToken -chat_id: 0 - -[camera] -host: http://localhost:8080/?action=stream - -[progress_notification] -percent: 5 -height: 5 -time: 5 - -[timelapse] -cleanup: true -height: 0.2 -time: 5 -target_fps: 30 diff --git a/steel_data/config/crowsnest.conf b/steel_data/config/crowsnest.conf new file mode 100644 index 0000000..4abcef6 --- /dev/null +++ b/steel_data/config/crowsnest.conf @@ -0,0 +1,60 @@ +#### crowsnest.conf +#### This is a typical default config. +#### Also used as default in mainsail / MainsailOS +#### See: +#### https://github.com/mainsail-crew/crowsnest/blob/master/README.md +#### for details to configure to your needs. + + +##################################################################### +#### ##### +#### Information about ports and according URL's ##### +#### ##### +##################################################################### +#### ##### +#### Port 8080 equals /webcam/?action=[stream/snapshot] ##### +#### Port 8081 equals /webcam2/?action=[stream/snapshot] ##### +#### Port 8082 equals /webcam3/?action=[stream/snapshot] ##### +#### Port 8083 equals /webcam4/?action=[stream/snapshot] ##### +#### ##### +#### Note: These ports are default for most Mainsail ##### +#### installations. To use any other port would involve ##### +#### changing the proxy configuration or using directly ##### +#### http://:/?action=[stream/snapshot] ##### +#### ##### +##################################################################### +#### RTSP Stream URL: ( if enabled and supported ) ##### +#### rtsp://:/stream.h264 ##### +##################################################################### + + +[crowsnest] +log_path: /home/jeka/steel_data/logs/crowsnest.log +log_level: verbose # Valid Options are quiet/verbose/debug +delete_log: false # Deletes log on every restart, if set to true +no_proxy: false + +[cam 1] +mode: camera-streamer # ustreamer - Provides mjpg and snapshots. (All devices) + # camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only) +enable_rtsp: false # If camera-streamer is used, this enables also usage of an rtsp server +rtsp_port: 8554 # Set different ports for each device! +port: 8080 # HTTP/MJPG Stream/Snapshot Port +device: /base/soc/i2c0mux/i2c@1/imx219@10 +resolution: 1296x972 # widthxheight format +max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. +#custom_flags: # You can run the Stream Services with custom flags. +#v4l2ctl: # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of. + +[cam 2] +mode: ustreamer # ustreamer - Provides mjpg and snapshots. (All devices) + # camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only) +enable_rtsp: false # If camera-streamer is used, this enables also usage of an rtsp server +rtsp_port: 8555 # Set different ports for each device! +port: 8081 # HTTP/MJPG Stream/Snapshot Port +device: /dev/v4l/by-id/usb-AONI_ELECTRONIC_CO.LTD_Canyon_CNS-CWC5_Webcam_20200706001-video-index0 +resolution: 1024x768 # widthxheight format +max_fps: 15 # If Hardware Supports this it will be forced, otherwise ignored/coerced. +#custom_flags: # You can run the Stream Services with custom flags. +v4l2ctl: focus_auto=0,exposure_auto=1,exposure_absolute=450 # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of. +# diff --git a/steel_data/config/macros.cfg b/steel_data/config/macros.cfg new file mode 100644 index 0000000..18ef729 --- /dev/null +++ b/steel_data/config/macros.cfg @@ -0,0 +1,267 @@ +# This file provides examples of Klipper G-Code macros. The snippets +# in this file may be copied into the main printer.cfg file and +# customized. + +# See docs/Config_Reference.md for a description of parameters. +# +# BACKUP config to git.npau.ru +[gcode_macro update_git] +gcode: + {% set message = params.MESSAGE|default() %} + {% if message %} + RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" + {% else %} + RUN_SHELL_COMMAND CMD=update_git_script + {% endif %} + +[gcode_shell_command update_git_script] +command: bash -c "bash $HOME/klipper-backup-steel/script.sh" +timeout: 90.0 +verbose: True + +[gcode_shell_command update_git_script_message] +command: bash -c "bash $HOME/klipper-backup-steel/script.sh $0" +timeout: 90.0 +verbose: True + + +###################################################################### +# Start Print and End Print +###################################################################### + +# Replace the slicer's custom start and end g-code scripts with +# START_PRINT and END_PRINT. See docs/Slicers.md for more information on using these macros. + +[gcode_macro _POWER_OFF_PRINTER] +gcode: + {action_call_remote_method("set_device_power", + device="printer", + state="off")} + +[delayed_gcode POWER_OFF_PRINTER_CHECK] +gcode: + {% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %} + {% if printer.extruder.temperature < 50.0 and printer.heater_bed.temperature < 50.0 %} + {% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %} + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=0 + _POWER_OFF_PRINTER + {% else %} + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=2 + {% endif %} + {% else %} + {% if printer.idle_timeout.state == "Printing" %} + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=0 + {% else %} + {% if printer.extruder.target == 0.0 and printer.heater_bed.target == 0.0 %} + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=2 + {% else %} + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=0 + {% endif %} + {% endif %} + {% endif %} + {% endif %} + +[gcode_macro ACTIVATE_POWER_OFF] +gcode: + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK_ACT DURATION=60 + +[gcode_macro DEACTIVATE_POWER_OFF] +gcode: + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK_ACT DURATION=0 + +[delayed_gcode POWER_OFF_PRINTER_CHECK_ACT] +gcode: + {% if printer.idle_timeout.state == "Idle" or printer.idle_timeout.state == "Ready" %} + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK DURATION=30 + {% else %} + UPDATE_DELAYED_GCODE ID=POWER_OFF_PRINTER_CHECK_ACT DURATION=60 + {% endif %} + +[gcode_macro START_PRINT] +gcode: + {% set BED_TEMP = params.BED_TEMP|default(60)|float %} + {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %} + # Start bed heating + M140 S{BED_TEMP} + # Use absolute coordinates + G90 + # Reset the G-Code Z offset (adjust Z offset if needed) + SET_GCODE_OFFSET Z=0.0 + # Home the printer + G28 + # Move the nozzle near the bed + BED_MESH_PROFILE LOAD=default + G1 Z5 F3000 + # Move the nozzle very close to the bed + G1 Z0.15 F300 + # Wait for bed to reach temperature + M190 S{BED_TEMP} + # Set and wait for nozzle to reach temperature + M109 S{EXTRUDER_TEMP} + +[gcode_macro END_PRINT] +gcode: + # Turn off bed, extruder, and fan + M140 S0 + M104 S0 + M106 S0 + # Move nozzle away from print while retracting + G91 + G1 X-2 Y-2 E-3 F300 + # Raise nozzle by 10mm + G1 Z10 F3000 + G90 + # Disable steppers + M84 + + +###################################################################### +# Beeper +###################################################################### + +# M300 : Play tone. Beeper support, as commonly found on usual LCD +# displays (i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount +# 12864 Full Graphic). This defines a custom I/O pin and a custom +# GCODE macro. Usage: +# M300 [P] [S] +# P is the tone duration, S the tone frequency. +# The frequency won't be pitch perfect. + +[pwm_cycle_time BEEPER_pin] +pin: EXP1_1 +# Beeper pin. This parameter must be provided. +# ar37 is the default RAMPS/MKS pin. +value: 0 +# Silent at power on, set to 1 if active low. +shutdown_value: 0 +# Disable at emergency shutdown (no PWM would be available anyway). +cycle_time: 0.001 +# Default PWM frequency : 0.001 = 1ms will give a tone of 1kHz +# Although not pitch perfect. + +[gcode_macro M300] +gcode: + # Use a default 1kHz tone if S is omitted. + {% set S = params.S|default(1000)|int %} + # Use a 10ms duration is P is omitted. + {% set P = params.P|default(100)|int %} + SET_PIN PIN=BEEPER_pin VALUE=0.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 } + G4 P{P} + SET_PIN PIN=BEEPER_pin VALUE=0 + + +###################################################################### +# Filament Change +###################################################################### + +# M600: Filament Change. This macro will pause the printer, move the +# tool to the change position, and retract the filament 50mm. Adjust +# the retraction settings for your own extruder. After filament has +# been changed, the print can be resumed from its previous position +# with the "RESUME" gcode. + +[pause_resume] + +[gcode_macro M600] +gcode: + {% set X = params.X|default(50)|float %} + {% set Y = params.Y|default(0)|float %} + {% set Z = params.Z|default(10)|float %} + SAVE_GCODE_STATE NAME=M600_state + PAUSE + G91 + G1 E-.8 F2700 + G1 Z{Z} + G90 + G1 X{X} Y{Y} F3000 + G91 + G1 E-50 F1000 + RESTORE_GCODE_STATE NAME=M600_state + +###################################################################### +# Override M117 command with rawparams +###################################################################### + +# The macro below will override the default M117 command to echo the message. +# +# It uses the rawparams pseudo-variable that contains the full unparsed +# parameters that was passed to the M117 command. +# +# As this can include comments, we are trimming the text when a `;` or `#` is +# found, and escaping any existing `"` + +[gcode_macro M117] +rename_existing: M117.1 +gcode: + {% if rawparams %} + {% set escaped_msg = rawparams.split(';', 1)[0].split('\x23', 1)[0]|replace('"', '\\"') %} + SET_DISPLAY_TEXT MSG="{escaped_msg}" + RESPOND TYPE=command MSG="{escaped_msg}" + {% else %} + SET_DISPLAY_TEXT + {% endif %} + +# SDCard 'looping' (aka Marlin M808 commands) support +# +# Support SDCard looping +[sdcard_loop] + +# 'Marlin' style M808 compatibility macro for SDCard looping +[gcode_macro M808] +gcode: + {% if params.K is not defined and params.L is defined %}SDCARD_LOOP_BEGIN COUNT={params.L|int}{% endif %} + {% if params.K is not defined and params.L is not defined %}SDCARD_LOOP_END{% endif %} + {% if params.K is defined and params.L is not defined %}SDCARD_LOOP_DESIST{% endif %} + +# Cancel object (aka Marlin/RRF M486 commands) support +# +# Enable object exclusion +[exclude_object] + +[gcode_macro M486] +gcode: + # Parameters known to M486 are as follows: + # [C] Cancel the current object + # [P] Cancel the object with the given index + # [S] Set the index of the current object. + # If the object with the given index has been canceled, this will cause + # the firmware to skip to the next object. The value -1 is used to + # indicate something that isn’t an object and shouldn’t be skipped. + # [T] Reset the state and set the number of objects + # [U] Un-cancel the object with the given index. This command will be + # ignored if the object has already been skipped + + {% if 'exclude_object' not in printer %} + {action_raise_error("[exclude_object] is not enabled")} + {% endif %} + + {% if 'T' in params %} + EXCLUDE_OBJECT RESET=1 + + {% for i in range(params.T | int) %} + EXCLUDE_OBJECT_DEFINE NAME={i} + {% endfor %} + {% endif %} + + {% if 'C' in params %} + EXCLUDE_OBJECT CURRENT=1 + {% endif %} + + {% if 'P' in params %} + EXCLUDE_OBJECT NAME={params.P} + {% endif %} + + {% if 'S' in params %} + {% if params.S == '-1' %} + {% if printer.exclude_object.current_object %} + EXCLUDE_OBJECT_END NAME={printer.exclude_object.current_object} + {% endif %} + {% else %} + EXCLUDE_OBJECT_START NAME={params.S} + {% endif %} + {% endif %} + + {% if 'U' in params %} + EXCLUDE_OBJECT RESET=1 NAME={params.U} + {% endif %} + diff --git a/ender_data/config/moonraker.conf b/steel_data/config/moonraker.conf similarity index 58% rename from ender_data/config/moonraker.conf rename to steel_data/config/moonraker.conf index 36003e1..098f0cd 100644 --- a/ender_data/config/moonraker.conf +++ b/steel_data/config/moonraker.conf @@ -1,7 +1,7 @@ [server] host: 0.0.0.0 -port: 7125 -klippy_uds_address: /home/jeka/ender_data/comms/klippy.sock +port: 7126 +klippy_uds_address: /home/jeka/steel_data/comms/klippy.sock [authorization] trusted_clients: @@ -49,9 +49,35 @@ env: ~/moonraker-telegram-bot-env/bin/python requirements: scripts/requirements.txt install_script: scripts/install.sh -[update_manager klipper-backup-ender] +# Crowsnest update_manager entry +[update_manager crowsnest] type: git_repo -path: ~/klipper-backup-ender +path: ~/crowsnest +origin: https://github.com/mainsail-crew/crowsnest.git +managed_services: crowsnest +install_script: tools/pkglist.sh + +[update_manager klipper-macros] +type: git_repo +origin: https://github.com/jschuh/klipper-macros.git +path: ~/klipper-macros +primary_branch: main +is_system_service: False +managed_services: klipper + +[update_manager klipper-backup-steel] +type: git_repo +path: ~/klipper-backup-steel origin: https://github.com/Staubgeborener/klipper-backup.git managed_services: moonraker primary_branch: main + +[power printer] +type: gpio +pin: gpiochip0/gpio2 +off_when_shutdown: true +on_when_job_queued: true +locked_while_printing: true +restart_klipper_when_powered: false +initial_state: off + diff --git a/steel_data/config/printer.cfg b/steel_data/config/printer.cfg new file mode 100644 index 0000000..1a75c50 --- /dev/null +++ b/steel_data/config/printer.cfg @@ -0,0 +1,180 @@ +[include shell_command.cfg] +[include fluidd.cfg] + +[virtual_sdcard] +path: /home/jeka/steel_data/gcodes +on_error_gcode: CANCEL_PRINT + +[include macros.cfg] + +[virtual_sdcard] +path: /home/jeka/steel_data/gcodes +on_error_gcode: CANCEL_PRINT + +[mcu] +serial: /dev/ttySteel + +# ================================================================================ +# Homing Override: +# This section is called any time a G28 [home] is called. + +;[homing_override] +;set_position_z:0 +;gcode: +; G1 Z10 F600 +; G28 X Y +; G1 X102.5 Y99.5 F6000 +; G28 Z +; G1 Z5 + +[bed_mesh] +speed: 60 +horizontal_move_z: 5 +mesh_min: 15,15 +mesh_max: 180,180 +probe_count: 3, 3 +mesh_pps: 2, 2 +fade_start: 1 +fade_end: 10 +fade_target: 0 + +[bed_screws] +screw1: 15,10 +screw2: 15,185 +screw3: 185,10 +screw4: 185,185 + +#[safe_z_home] +#home_xy_position = 0,0 +#speed = 50 +#z_hop = 5 +#_hop_speed = 5 + +[stepper_x] +step_pin: PF0 +dir_pin: !PF1 +enable_pin: !PD7 +microsteps: 16 +rotation_distance: 32 +endstop_pin: ^!PE4 +position_endstop: 200 +position_max: 200 +position_min: 0 +homing_speed: 50 + +[stepper_y] +step_pin: PF6 +dir_pin: !PF7 +enable_pin: !PF2 +microsteps: 16 +rotation_distance: 32 +endstop_pin: ^!PJ0 +position_endstop: 200 +position_max: 200 +position_min: 0 +homing_speed: 50 + +[stepper_z] +step_pin: PL3 +dir_pin: !PL1 +enable_pin: !PK0 +microsteps: 16 +rotation_distance: 0.8 +endstop_pin: ^!PD3 +#position_endstop: 0.0 +position_max: 270 +position_min: -5 +homing_speed: 20 + +[extruder] +max_extrude_only_distance: 101.0 +step_pin: PA4 +dir_pin: PA6 +enable_pin: !PA2 +microsteps: 16 +rotation_distance: 22.222 +nozzle_diameter: 0.400 +filament_diameter: 1.750 +heater_pin: PB4 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PK5 +#control: pid +min_temp: 0 +max_temp: 250 +#pid_kp = 21.801 +#pid_ki = 1.546 +#pid_kd = 76.848 + +[heater_bed] +heater_pin: PH5 +sensor_type: EPCOS 100K B57560G104F +sensor_pin: PK6 +control: watermark +min_temp: 0 +max_temp: 110 +;pid_kp = 72.814 +;pid_ki = 1.634 +;pid_kd = 810.970 + +[fan] +pin: PH6 + +[printer] +kinematics: cartesian +max_velocity: 300 +max_accel: 3000 +max_z_velocity: 5 +max_z_accel: 100 +square_corner_velocity: 20.0 + +[display] +lcd_type: st7920 +cs_pin: EXP1_4 +sclk_pin: EXP1_5 +sid_pin: EXP1_3 +encoder_pins: ^EXP2_3, ^EXP2_5 +click_pin: ^!EXP1_2 + +;[output_pin BEEPER_pin] +;ipin: EXP1_1 + +# Common EXP1 / EXP2 (display) pins +[board_pins] +aliases: + # Common EXP1 header found on many "all-in-one" ramps clones + EXP1_1=PC0, EXP1_3=PH0, EXP1_5=PA1, EXP1_7=PA5, EXP1_9=, + EXP1_2=PC2, EXP1_4=PH1, EXP1_6=PA3, EXP1_8=PA7, EXP1_10=<5V>, + # EXP2 header + EXP2_1=PB3, EXP2_3=PC6, EXP2_5=PC4, EXP2_7=PL0, EXP2_9=, + EXP2_2=PB1, EXP2_4=PB0, EXP2_6=PB2, EXP2_8=PG0, EXP2_10= + # Pins EXP2_1, EXP2_6, EXP2_2 are also MISO, MOSI, SCK of bus "spi" + # Note, some boards wire: EXP2_8=, EXP2_10=PG0 + +#*# <---------------------- SAVE_CONFIG ----------------------> +#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. +#*# +#*# [extruder] +#*# control = pid +#*# pid_kp = 28.696 +#*# pid_ki = 2.035 +#*# pid_kd = 101.153 +#*# +#*# [stepper_z] +#*# position_endstop = 4.180 +#*# +#*# [bed_mesh default] +#*# version = 1 +#*# points = +#*# 0.410000, 0.500000, 0.390000 +#*# 0.380000, 0.360000, 0.190000 +#*# 0.330000, 0.410000, 0.320000 +#*# x_count = 3 +#*# y_count = 3 +#*# mesh_x_pps = 2 +#*# mesh_y_pps = 2 +#*# algo = lagrange +#*# tension = 0.2 +#*# min_x = 15.0 +#*# max_x = 180.0 +#*# min_y = 15.0 +#*# max_y = 180.0 diff --git a/ender_data/config/shell_command.cfg b/steel_data/config/shell_command.cfg similarity index 100% rename from ender_data/config/shell_command.cfg rename to steel_data/config/shell_command.cfg diff --git a/steel_data/config/telegram.conf b/steel_data/config/telegram.conf new file mode 100644 index 0000000..2a6131e --- /dev/null +++ b/steel_data/config/telegram.conf @@ -0,0 +1,40 @@ +# Please refer to the wiki(https://github.com/nlef/moonraker-telegram-bot/wiki) for detailed information on how to configure the bot + +#[bot] +#server: localhost +#bot_token: AweSomeBotToken +#chat_id: 0 +# +#[camera] +#host: http://localhost:8080/?action=streamhttps://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config$0 +# +#[progress_notification] +#percent: 5 +#height: 5 +#time: 5 +# +#[timelapse] +#cleanup: true +#height: 0.2 +#time: 5 +#target_fps: 30 + + +[bot] +server: 192.168.77.44:7126 +bot_token: 5171688404:AAH1P9RgT1AsICfVjhjC7jTjL7W_iFKnUhM +chat_id: 158812314 + +[camera] +host: http://192.168.77.44/webcam2/?action=stream + +[progress_notification] +percent: 5 +height: 5.0 +time: 5 + +#[timelapse] +#cleanup: true +#height: 0.2 +#time: 5 +#target_fps: 30