Arksine / moonraker

Web API Server for Klipper
https://moonraker.readthedocs.io
GNU General Public License v3.0
1.07k stars 407 forks source link

Can not access virtual sd card #16

Closed zellneralex closed 4 years ago

zellneralex commented 4 years ago

Hi I am running out of ideas. I can not access the virtual SD Card. I already reinstalled everything twice.

Printer.cfg [virtual_sdcard] path: ~/sdcard

klippy.log [virtual_sdcard] path = ~/sdcard

moonraker.log

2020-09-09 07:26:50,594 [websockets.py:dispatch()] - Websocket Response::{"jsonrpc": "2.0", "result": {"status": {"temperature_sensor bed": {"measured_min_temp": -94.543263861882, "measured_max_temp": 0.0, "temperature": -94.543263861882}, "heaters": {"available_sensors": ["heater_bed", "temperature_sensor bed", "temperature_fan chamber", "extruder"], "available_heaters": ["heater_bed", "extruder"]}, "fan": {"speed": 0.0}, "bed_mesh": {"mesh_max": [0.0, 0.0], "mesh_matrix": [[]], "profile_name": "", "mesh_min": [0.0, 0.0], "probed_matrix": [[]]}, "pause_resume": {"is_paused": false}, "display_status": {"progress": 0.0, "message": null}, "gcode_move": {"homing_origin": [0.0, 0.0, 0.0, 0.0], "speed_factor": 1.0, "gcode_position": [0.0, 0.0, 0.0, 0.0], "absolute_extrude": true, "absolute_coordinates": true, "position": [0.0, 0.0, 0.0, 0.0], "speed": 1500.0, "extrude_factor": 1.0}, "print_stats": {"print_duration": 0.0, "total_duration": 0.0, "filament_used": 0.0, "filename": "", "state": "standby", "message": ""}, "heater_fan controller_fan": {"speed": 0.0}, "temperature_fan chamber": {"speed": 0.0, "temperature": -94.543263861882, "target": 50.0}, "idle_timeout": {"state": "Idle", "printing_time": 0.0}, "query_endstops": {"last_query": {}}, "toolhead": {"square_corner_velocity": 5.0, "max_accel": 3000.0, "homed_axes": "", "estimated_print_time": 612.4568908583333, "max_velocity": 300.0, "print_time": 0.001, "max_accel_to_decel": 1500.0, "position": [0.0, 0.0, 0.0, 0.0], "extruder": "extruder"}, "configfile": {"config": {"tmc2209 extruder": {"sense_resistor": "0.110", "interpolate": "false", "stealthchop_threshold": "0", "run_current": "0.5", "microsteps": "16", "uart_pin": "P1.4", "hold_current": "0.4"}, "display_data voron_display printing_time": {"position": "2, 10", "text": "\n{% set ptime = printer.idle_timeout.printing_time %}\n{ \"%02d:%02d\" % (ptime // (60 * 60), (ptime // 60) % 60) }"}, "display_data __voron_display progress_text2": {"position": "1, 10", "text": "\n{% set progress = printer.display_status.progress %}\n{ draw_progress_bar(1, 10, 6, progress) }"}, "probe": {"samples_tolerance_retries": "3", "x_offset": "0", "pin": "^z:P0.10", "sample_retract_dist": "3.0", "samples_tolerance": "0.006", "samples_result": "median", "y_offset": "25.0", "samples": "3", "z_offset": "0", "speed": "10.0"}, "stepper_z2": {"step_pin": "z:P0.22", "step_distance": "0.00125", "dir_pin": "!z:P2.11", "enable_pin": "!z:P0.21"}, "neopixel neo_display": {"pin": "z:P1.21", "chain_count": "3", "color_order_grb": "False", "initial_red": "0.1", "initial_green": "0.5", "initial_blue": "0.0"}, "gcode_macro UNLOAD_FILAMENT": {"gcode": "\n{% if printer.toolhead.status == \"Ready\" %}\nM83 ; set extruder to relative\nG1 E10 F300 ; extrude a little to soften tip\nG1 E-780 F1800 ; retract filament completely\nM82 ; set extruder to absolute\n{% else %}\n{ printer.gcode.action_respond_info(\"Filament unloading disabled while printing!\") }\n{% endif %}"}, "mcu rpi": {"serial": "/tmp/klipper_host_mcu"}, "display_data voron_display chamber": {"position": "2, 0", "text": "\n{% set chamber = printer['temperature_fan chamber'] %}\n~chamber~\n{ \"%3.0f\" % (chamber.temperature,) }\n~degrees~"}, "heater_bed": {"control": "pid", "pid_kp": "58.437", "sensor_pin": "z:P0.25", "pid_kd": "363.769", "heater_pin": "z:P2.3", "sensor_type": "NTC 100K MGB18-104F39050L32", "max_power": "0.6", "pid_ki": "2.347", "min_temp": "0", "max_temp": "120"}, "pause_resume": {}, "virtual_sdcard": {"path": "~/sdcard"}, "stepper_z1": {"step_pin": "z:P0.19", "step_distance": "0.00125", "dir_pin": "z:P0.20", "enable_pin": "!z:P2.8"}, "gcode_macro LOAD_FILAMENT": {"gcode": "\n{% if printer.toolhead.status == \"Ready\" %}\nM83 ; set extruder to relative\nG1 E750 F1800 ; quickly load filament to down bowden\nG1 E30 F300 ; slower extrusion for hotend path\nG1 E15 F150 ; prime nozzle with filament\nM82 ; set extruder to absolute\n{% else %}\n{ printer.gcode.action_respond_info(\"Filament loading disabled while printing!\") }\n{% endif %}"}, "verify_heater extruder": {"max_error": "120", "check_gain_time": "20", "heating_gain": "2", "hysteresis": "5"}, "display_data voron_display bed": {"position": "1, 0", "text": "{ render(\"_vheater_temperature\", param_heater_name=\"heater_bed\") }"}, "stepper_z": {"homing_retract_dist": "3.0", "position_endstop": "-0.5", "position_max": "340", "endstop_pin": "z:P1.27", "second_homing_speed": "3.0", "step_pin": "z:P2.2", "position_min": "-5", "homing_speed": "15.0", "dir_pin": "!z:P2.6", "step_distance": "0.00125", "enable_pin": "!z:P2.1"}, "stepper_y": {"homing_positive_dir": "true", "homing_retract_dist": "5", "position_endstop": "350", "position_max": "350", "endstop_pin": "^!P1.28", "step_pin": "P0.19", "position_min": "0", "homing_speed": "25", "dir_pin": "!P0.20", "step_distance": "0.00625", "enable_pin": "!P2.8"}, "stepper_x": {"homing_positive_dir": "true", "homing_retract_dist": "5", "position_endstop": "350", "position_max": "350", "endstop_pin": "^!P1.29", "step_pin": "P2.2", "position_min": "0", "homing_speed": "25", "dir_pin": "!P2.6", "step_distance": "0.00625", "enable_pin": "!P2.1"}, "tmc2209 stepper_x": {"sense_resistor": "0.110", "interpolate": "True", "stealthchop_threshold": "0", "run_current": "0.8", "microsteps": "16", "uart_pin": "P1.10", "hold_current": "0.7"}, "display_data __voron_display print_status": {"position": "3, 0", "text": "\n{% if printer.display_status.message %}\n{ printer.display_status.message }\n{% elif printer.idle_timeout.printing_time %}\n{% set pos = printer.toolhead.position %}\n{ \"X%-4.0fY%-4.0fZ%-5.2f\" % (pos.x, pos.y, pos.z) }\n{% else %}\n{ \"VX.xxx \" }\n~voron~\n{% endif %}"}, "heater_fan controller_fan": {"heater": "heater_bed", "kick_start_time": "0.5", "pin": "z:P2.4", "heater_temp": "45.0"}, "display_data voron_display progress_text": {"position": "1, 10", "text": "\n{% set progress = printer.display_status.progress %}\n{ \"{:^6.0%}\".format(progress) }"}, "display_glyph chamber": {"data": "\n0000000000000000\n1111111111111111\n1000010000100001\n1000010000100001\n1000011111100001\n1000000000000001\n1000000000000001\n1000001111000001\n1011101001011101\n1000001111000001\n1000000110000001\n1000000000000001\n1011111111111101\n1000100000010001\n1111111111111111\n0000000000000000"}, "display_glyph voroninv": {"data": "\n0000001110000000\n0000111111100000\n0001111111110000\n0111111111111100\n1111100111001110\n1111001110011110\n1110011100111110\n1100111001111110\n1111110011100110\n1111100111001110\n1111001110011110\n1110011100111110\n0111111111111100\n0001111111110000\n0000111111100000\n0000001110000000"}, "tmc2209 stepper_z1": {"sense_resistor": "0.110", "interpolate": "true", "stealthchop_threshold": "0", "run_current": "0.8", "microsteps": "16", "uart_pin": "z:P1.9", "hold_current": "0.8"}, "tmc2209 stepper_z3": {"sense_resistor": "0.110", "interpolate": "true", "stealthchop_threshold": "0", "run_current": "0.8", "microsteps": "16", "uart_pin": "z:P1.4", "hold_current": "0.8"}, "tmc2209 stepper_z2": {"sense_resistor": "0.110", "interpolate": "true", "stealthchop_threshold": "0", "run_current": "0.8", "microsteps": "16", "uart_pin": "z:P1.8", "hold_current": "0.8"}, "temperature_sensor bed": {"min_temp": "0", "sensor_type": "ATC Semitec 104GT-2", "gcode_id": "1B", "sensor_pin": "z:P0.23", "max_temp": "120"}, "gcode_macro PRINT_END": {"gcode": "\nM400 ; wait for buffer to clear\nG92 E0 ; zero the extruder\nG1 E-4.0 F3600 ; retract filament\nG91 ; relative positioning\nG0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing\nTURN_OFF_HEATERS\nM107 ; turn off fan\nG1 Z5 F3000 ; move nozzle up 5mm\nG90 ; absolute positioning\nG0 X175 Y350 F3600 ; park nozzle at rear\nM117 Finished! ; display message\nBED_MESH_CLEAR"}, "printer": {"square_corner_velocity": "5.0", "max_accel": "3000", "max_z_accel": "350", "max_velocity": "300", "max_z_velocity": "15", "kinematics": "corexy"}, "display_data __voron_display fan": {"position": "0, 10", "text": "\n{% if 'fan' in printer %}\n{% set speed = printer.fan.speed %}\n{% if speed %}\n{% set frame = (printer.toolhead.estimated_print_time|int % 2) + 1 %}\n~fan{frame}~\n{% else %}\n~fan1~\n{% endif %}\n{ \"{:>4.0%}\".format(speed) }\n{% endif %}"}, "gcode_macro RESUME": {"rename_existing": "BASE_RESUME", "gcode": "\nG91\nG1 E1.7 F2100\nG91\nRESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1\nBASE_RESUME"}, "display_data __voron_display extruder": {"position": "0, 0", "text": "{ render(\"_vheater_temperature\", param_heater_name=\"extruder\") }"}, "display_glyph voron": {"data": "\n1111111001111111\n1111100000011111\n1111000000001111\n1100000000000011\n1000001100110001\n1000011001100001\n1000110011000001\n1001100110000001\n1000000110011001\n1000001100110001\n1000011001100001\n1000110011000001\n1110000000000111\n1111000000001111\n1111100000011111\n1111111001111111"}, "gcode_macro PAUSE": {"default_parameter_y": "230", "rename_existing": "BASE_PAUSE", "default_parameter_z": "10", "gcode": "\nSAVE_GCODE_STATE NAME=PAUSE_state\nBASE_PAUSE\nG91\nG1 E-1.7 F2100\nG1 Z{Z}\nG90\nG1 X{X} Y{Y} F6000\nG91", "default_parameter_x": "230"}, "homing_override": {"gcode": "\nG90\nG0 Z5 F600\nG28 X Y\nG0 X0 Y0 F3600\nG28 Z\nG0 Z10 F1800\nG0 X175 Y175 Z30 F3600", "axes": "z", "set_position_z": "0"}, "idle_timeout": {"gcode": "\nTURN_OFF_HEATERS\nM84 ; disable steppers", "timeout": "1800"}, "fan": {"off_below": "0.10", "kick_start_time": "0.5", "pin": "P2.3"}, "tmc2209 stepper_z": {"sense_resistor": "0.110", "interpolate": "true", "stealthchop_threshold": "0", "run_current": "0.8", "microsteps": "16", "uart_pin": "z:P1.10", "hold_current": "0.8"}, "stepper_z3": {"step_pin": "z:P2.13", "step_distance": "0.00125", "dir_pin": "z:P0.11", "enable_pin": "!z:P2.12"}, "mcu": {"serial": "/dev/serial/by-id/usb-Klipper_lpc1769_1840010F871C4AAF863E7C5DC32000F5-if00"}, "tmc2209 stepper_y": {"sense_resistor": "0.110", "interpolate": "True", "stealthchop_threshold": "0", "run_current": "0.8", "microsteps": "16", "uart_pin": "P1.9", "hold_current": "0.7"}, "delayed_gcode setdisplayneopixel": {"gcode": "\nSET_LED LED=neo_display RED=1 GREEN=1 BLUE=1 INDEX=1\nSET_LED LED=neo_display RED=1 GREEN=0 BLUE=0 INDEX=2\nSET_LED LED=neo_display RED=1 GREEN=0 BLUE=0 INDEX=3 TRANSMIT=0", "initial_duration": "1"}, "gcode_macro G32": {"gcode": "\n{% if printer.toolhead.status == \"Ready\" %}\nBED_MESH_CLEAR\nG28\nQUAD_GANTRY_LEVEL\nG28 Z0\nG0 X175 Y175 Z20 F6000\n{% else %}\n{ printer.gcode.action_respond_info(\"G32 is disabled while printing!\") }\n{% endif %}"}, "temperature_fan chamber": {"control": "pid", "pid_kp": "40", "max_speed": "1.0", "cycle_time": "0.05", "pin": "z:P2.7", "pid_kd": "0.1", "sensor_pin": "z:P0.24", "shutdown_speed": "0", "min_speed": "0", "sensor_type": "ATC Semitec 104GT-2", "target_temp": "50", "pid_deriv_time": "2.0", "max_power": "0.6", "kick_start_time": "0.500", "min_temp": "0", "pid_ki": "0.2", "hardware_pwm": "false", "gcode_id": "C", "max_temp": "70"}, "display_status": {}, "bed_mesh": {"mesh_pps": "4,4", "horizontal_move_z": "6", "mesh_min": "25,25", "algorithm": "bicubic", "mesh_max": "325,325", "split_delta_z": "0.0125", "probe_count": "7,7", "move_check_distance": "3", "speed": "300", "relative_reference_index": "24"}, "gcode_macro CANCEL_PRINT": {"default_parameter_y": "230", "rename_existing": "BASE_CANCEL_PRINT", "default_parameter_z": "10", "gcode": "\nM104 S0\nM140 S0\nM141 S0\nM106 S0\nCLEAR_PAUSE\nSDCARD_RESET_FILE\nBASE_CANCEL_PRINT", "default_parameter_x": "230"}, "gcode_macro PRINT_START": {"gcode": "\nM117 Homing... ; display message\nG28 ; home all axes\nG1 Z20 F3000 ; move nozzle away from bed\nM117 Preheat (Print) ; display message"}, "display_template _vheater_temperature": {"text": "\n{% if param_heater_name in printer %}\n{% set heater = printer[param_heater_name] %}\n{% if param_heater_name == \"heater_bed\" %}\n{% if heater.target %}\n{% set frame = (printer.toolhead.estimated_print_time|int % 2) + 1 %}\n~bed_heat{frame}~\n{% else %}\n~bed~\n{% endif %}\n{% else %}\n~extruder~\n{% endif %}\n{ \"%3.0f\" % (heater.temperature,) }\n{% if heater.target and (heater.temperature - heater.target)|abs > 2 %}\n~right_arrow~\n{ \"%0.0f\" % (heater.target,) }\n{% endif %}\n~degrees~\n{% endif %}", "param_heater_name": "\"extruder\""}, "heater_fan hotend_fan": {"kick_start_time": "0.5", "heater_temp": "50.0", "max_power": "1.0", "pin": "P2.4", "heater": "extruder"}, "verify_heater heater_bed": {"max_error": "120", "check_gain_time": "60", "heating_gain": "2", "hysteresis": "5"}, "quad_gantry_level": {"retries": "5", "horizontal_move_z": "10", "retry_tolerance": "0.0075", "gantry_corners": "\n-60,-10\n410,420", "points": "\n50,25\n50,275\n300,275\n300,25", "speed": "100", "max_adjust": "10"}, "display": {"a0_pin": "z:P1.19", "cs_pin": "z:P1.18", "encoder_pins": "^z:P3.25,^z:P3.26", "lcd_type": "uc1701", "contrast": "63", "click_pin": "^!z:P0.28"}, "mcu z": {"serial": "/dev/serial/by-id/usb-Klipper_lpc1769_07300110871C4AAFBF427C5DC72000F5-if00"}, "extruder": {"control": "pid", "pid_kp": "26.213", "sensor_type": "SliceEngineering 450", "sensor_pin": "P0.24", "nozzle_diameter": "0.400", "pid_kd": "131.721", "pressure_advance_smooth_time": "0.040", "heater_pin": "P2.7", "min_extrude_temp": "170", "step_pin": "P2.13", "pressure_advance": "0.05", "max_power": "1.0", "min_temp": "10", "pid_ki": "1.304", "filament_diameter": "1.75", "dir_pin": "!P0.11", "max_temp": "270", "step_distance": "0.00120", "enable_pin": "!P2.12"}}}, "heater_fan hotend_fan": {"speed": 0.0}, "webhooks": {"state": "shutdown", "state_message": "MCU 'mcu' shutdown: ADC out of range\nThis generally occurs when a heater temperature exceeds\nits configured min_temp or max_temp.\nOnce the underlying issue is corrected, use the\n\"FIRMWARE_RESTART\" command to reset the firmware, reload the\nconfig, and restart the host software.\nPrinter is shutdown\n"}, "virtual_sdcard": {"progress": 0.0, "is_active": false, "file_position": 0}, "heater_bed": {"temperature": -88.51899597407109, "target": 0.0}, "extruder": {"pressure_advance": 0.05, "target": 0.0, "temperature": -90.85125769678834, "smooth_time": 0.04}}, "eventtime": 606.86352749}, "id": 1852}

but if I try to access the sdcard or write the gui.json I see:

2020-09-09 07:26:56,297 [websockets.py:dispatch()] - Websocket Request::{"jsonrpc":"2.0","method":"server.files.get_directory","params":{"path":"gcodes"},"id":6376} 2020-09-09 07:26:56,298 [websockets.py:dispatch()] - Websocket Response::{"jsonrpc": "2.0", "error": {"code": 400, "message": "Invalid base path (gcodes)"}, "id": 6376} 2020-09-09 07:27:07,379 [web.py:log_exception()] - 400 POST /server/files/upload (192.168.178.32): Gcodes root not available 2020-09-09 07:27:07,392 [web.py:log_request()] - 400 POST /server/files/upload (192.168.178.32) 14.94ms

The folder ~/sdcard is there and accesable with the user pi

klippy.log moonraker.log

I have no idea where to look next

zellneralex commented 4 years ago

output of http://voron350.local/server/files/list?root=gcodes

Traceback (most recent call last): File "/home/pi/moonraker/moonraker/plugins/file_manager.py", line 385, in get_file_list filelist = self._update_file_list(base) File "/home/pi/moonraker/moonraker/plugins/file_manager.py", line 263, in _update_file_list raise self.server.error(msg) utils.ServerError: No known path for root: gcodes

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pi/moonraker/moonraker/app.py", line 311, in _process_http_request result = await self.callback(self.request.path, method, args) File "/home/pi/moonraker/moonraker/plugins/file_manager.py", line 104, in _handle_filelist_request return self.get_file_list(format_list=True, base=root) File "/home/pi/moonraker/moonraker/plugins/file_manager.py", line 389, in get_file_list raise self.server.error(msg) utils.ServerError: Unable to update file list

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/pi/moonraker-env/lib/python3.7/site-packages/tornado/web.py", line 1703, in _execute result = await result File "/home/pi/moonraker/moonraker/app.py", line 290, in get await self._process_http_request('GET') File "/home/pi/moonraker/moonraker/app.py", line 314, in _process_http_request e.status_code, str(e)) from e tornado.web.HTTPError: HTTP 400: Bad Request (Unable to update file list)

jakep82 commented 4 years ago

I searched the klippy.log file you've posted, and I don't see virtual_sdcard anywhere in it. Are you sure you edited the printer.cfg in the correct location when you defined that section?

zellneralex commented 4 years ago

I have it working again! Root Cause if klipper is in error state Moonraker seams not to read the virtual_sdcard location. As soon I did a few tweaks to get klipper (temporarily) to pass, I am able to access the gcode folder and save modifications to the gui. So you need a working klipper. Maybe you could add a note to the install doc

zellneralex commented 4 years ago

Jakep82 I find the virtual_sdcard 2 times in the log (2 klipper restarts) always near the end of the config section [virtual_sdcard] path = ~/sdcard

[pause_resume]

[display_status]

Extruder max_extrude_ratio=0.266081

But as already mentioned problem solved klipper must have The Status ready for moonraker to read that location

zellneralex commented 4 years ago

This can be closed, as soon you modify the manual or decide as it good as is

Arksine commented 4 years ago

I have advised meteyou to use the config folder for storing gui.json, as it is available immediately if configured. I will update the docs and close this issue when that is complete.

zellneralex commented 4 years ago

Thank you