### Run install-moonraker.sh to install dependencies Source: https://moonraker.readthedocs.io/en/latest/installation Run the install script with no options to make sure that all new dependencies are installed. Use this after installing the PolKit rules if you still get warnings. ```bash cd ~/moonraker/scripts ./install-moonraker.sh ``` -------------------------------- ### Get settings - Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/integrations Example response for the settings endpoint, showing plugin, feature, and webcam configuration. The webcam route is hardcoded to Fluidd/Mainsail default path. ```json { "plugins": { "UltimakerFormatPackage": { "align_inline_thumbnail": false, "inline_thumbnail": false, "inline_thumbnail_align_value": "left", "inline_thumbnail_scale_value": "50", "installed": true, "installed_version": "0.2.2", "scale_inline_thumbnail": false, "state_panel_thumbnail": true } }, "feature": { "sdSupport": false, "temperatureGraph": false }, "webcam": { "flipH": false, "flipV": false, "rotate90": false, "streamUrl": "/webcam/?action=stream", "webcamEnabled": true } } ``` -------------------------------- ### Get Database Item Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/database Example response showing the namespace, key, and retrieved value. ```json { "namespace": "moonraker", "key": "file_manager.metadata_version", "value": 2 } ``` -------------------------------- ### Example Response for Get Current User Source: https://moonraker.readthedocs.io/en/latest/external_api/authorization Example response containing the username, source, and created_on timestamp. ```json { "username": "my_user", "source": "moonraker", "created_on": 1618876783.8896716 } ``` -------------------------------- ### Get Directory Information Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/file_manager Example response for a directory information request. Contains dirs, files, disk_usage, and root_info objects. ```json { "dirs": [ { "modified": 1615768162.0412788, "size": 4096, "permissions": "rw", "dirname": "test" }, { "modified": 1613569827.489749, "size": 4096, "permissions": "rw", "dirname": "Cura" }, { "modified": 1615767459.6265886, "size": 4096, "permissions": "rw", "dirname": "thumbs" } ], "files": [ { "modified": 1615578004.9639666, "size": 730069, "permissions": "rw", "filename": "Funnel_0.2mm_PLA_Ender2_2h4m.gcode" }, { "modified": 1589156863.9726968, "size": 4214831, "permissions": "rw", "filename": "CE2_Pi3_A+_CaseLID.gcode" }, { "modified": 1615030592.7722695, "size": 2388774, "permissions": "rw", "filename": "CE2_calicat.gcode" } ], "disk_usage": { "total": 7522213888, "used": 4280369152, "free": 2903625728 }, "root_info": { "name": "gcodes", "permissions": "rw" } } ``` -------------------------------- ### Get GCode Help - Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/printer?q= Example response for the G-Code help endpoint. It lists available extended G-Code commands with their descriptions. Use this to understand the command set returned by the API. ```json { "RESTART": "Reload config file and restart host software", "FIRMWARE_RESTART": "Restart firmware, host, and reload config", "STATUS": "Report the printer status", "HELP": "Report the list of available extended G-Code commands", "SAVE_CONFIG": "Overwrite config file and restart", "SHUTDOWN_MACHINE": "G-Code macro", "SET_GCODE_VARIABLE": "Set the value of a G-Code macro variable", "REBOOT_MACHINE": "G-Code macro", "UPDATE_DELAYED_GCODE": "Update the duration of a delayed_gcode", "TURN_OFF_HEATERS": "Turn off all heaters", "TEMPERATURE_WAIT": "Wait for a temperature on a sensor", "QUERY_ADC": "Report the last value of an analog pin", "QUERY_FILAMENT_SENSOR": "Query the status of the Filament Sensor", "SET_FILAMENT_SENSOR": "Sets the filament sensor on/off", "SET_PIN": "Set the value of an output pin", "BED_MESH_CALIBRATE": "Perform Mesh Bed Leveling", "BED_MESH_PROFILE": "Bed Mesh Persistent Storage management", "BED_MESH_OUTPUT": "Retrieve interpolated grid of probed z-points", "BED_MESH_MAP": "Serialize mesh and output to terminal", "BED_MESH_CLEAR": "Clear the Mesh so no z-adjustment is made", "BED_MESH_OFFSET": "Add X/Y offsets to the mesh lookup", "SET_GCODE_OFFSET": "Set a virtual offset to g-code positions", "SAVE_GCODE_STATE": "Save G-Code coordinate state", "RESTORE_GCODE_STATE": "Restore a previously saved G-Code state", "GET_POSITION": "Return information on the current location of the toolhead", "EXCLUDE_OBJECT_START": "Marks the beginning the current object as labeled", "EXCLUDE_OBJECT_END": "Marks the end the current object", "EXCLUDE_OBJECT": "Cancel moves inside a specified objects", "EXCLUDE_OBJECT_DEFINE": "Provides a summary of an object", "TURN_OFF_MOTORS": "G-Code macro", "CLEAR_PAUSE": "Clears the current paused state without resuming the print", "SET_PRINT_STATS_INFO": "Pass slicer info like layer act and total to klipper", "SDCARD_RESET_FILE": "Clears a loaded SD File. Stops the print if necessary", "SDCARD_PRINT_FILE": "Loads a SD file and starts the print. May include files in subdirectories.", "RESPOND": "Echo the message prepended with a prefix", "PROBE": "Probe Z-height at current XY position", "QUERY_PROBE": "Return the status of the z-probe", "PROBE_CALIBRATE": "Calibrate the probe's z_offset", "PROBE_ACCURACY": "Probe Z-height accuracy at current XY position", "Z_OFFSET_APPLY_PROBE": "Adjust the probe's z_offset", "GET_CURRENT_SKEW": "Report current printer skew", "CALC_MEASURED_SKEW": "Calculate skew from measured print", "SET_SKEW": "Set skew based on lengths of measured object", "SKEW_PROFILE": "Profile management for skew_correction", "SET_STEPPER_ENABLE": "Enable/disable individual stepper by name", "SET_TMC_FIELD": "Set a register field of a TMC driver", "INIT_TMC": "Initialize TMC stepper driver registers", "SET_TMC_CURRENT": "Set the current of a TMC driver", "DUMP_TMC": "Read and display TMC stepper driver registers", "PID_CALIBRATE": "Run PID calibration test", "SET_HEATER_TEMPERATURE": "Sets a heater temperature", "SET_DISPLAY_TEXT": "Set or clear the display message", "SET_DISPLAY_GROUP": "Set the active display group", "STEPPER_BUZZ": "Oscillate a given stepper to help id it", "FORCE_MOVE": "Manually move a stepper; invalidates kinematics", "SET_KINEMATIC_POSITION": "Force a low-level kinematic position", "SET_IDLE_TIMEOUT": "Set the idle timeout in seconds", "QUERY_ENDSTOPS": "Report on the status of each endstop", "SET_VELOCITY_LIMIT": "Set printer velocity limits", "MANUAL_PROBE": "Start manual probe helper script", "TUNING_TOWER": "Tool to adjust a parameter at each Z height", "SET_PRESSURE_ADVANCE": "Set pressure advance parameters", "SET_EXTRUDER_ROTATION_DISTANCE": "Set extruder rotation distance", "SYNC_EXTRUDER_MOTION": "Set extruder stepper motion queue", "SET_EXTRUDER_STEP_DISTANCE": "Set extruder step distance", "SYNC_STEPPER_TO_EXTRUDER": "Set extruder stepper", "ACTIVATE_EXTRUDER": "Change the active extruder", "BASE_PAUSE": "Renamed builtin of 'PAUSE'", "BASE_RESUME": "Renamed builtin of 'RESUME'", "BASE_CANCEL_PRINT": "Renamed builtin of 'CANCEL_PRINT'", "ACCEPT": "Accept the current Z position", "ABORT": "Abort manual Z probing tool", "TESTZ": "Move to new Z height" } ``` -------------------------------- ### Get Sensor List Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/devices?q= Example JSON response for the Get Sensor List endpoint. Shows sensor details including type, values, parameter_info, and history_fields. ```json { "sensors": { "sensor1": { "id": "sensor1", "friendly_name": "Sensor 1", "type": "mqtt", "values": { "value1": 0, "value2": 119.8 }, "parameter_info": [ { "units": "kWh", "name": "value1" }, { "units": "V", "name": "value2" } ], "history_fields": [ { "field": "power_consumption", "provider": "sensor sensor1", "description": "Printer Power Consumption", "strategy": "delta", "units": "kWh", "init_tracker": true, "exclude_paused": false, "report_total": true, "report_maximum": true, "precision": 6, "parameter": "value1" }, { "field": "max_voltage", "provider": "sensor sensor1", "description": "Maximum voltage", "strategy": "maximum", "units": "V", "init_tracker": true, "exclude_paused": false, "report_total": false, "report_maximum": false, "precision": 6, "parameter": "value2" } ] } } } ``` -------------------------------- ### Start the job queue (POST /server/job_queue/start and server.job_queue.start) Source: https://moonraker.readthedocs.io/en/latest/external_api/job_queue Starts the job queue. If Klipper is ready to start a print, the next job is loaded; otherwise the queue enters the 'ready' state and the job loads after the current job completes. The HTTP request uses POST /server/job_queue/start; the JSON-RPC request uses the server.job_queue.start method. The response shows the current queued_jobs and queue_state. ```http POST /server/job_queue/start ``` ```json { "jsonrpc": "2.0", "method": "server.job_queue.start", "id": 4654 } ``` ```json { "queued_jobs": [ { "filename": "job1.gcode", "job_id": "0000000066D99C90", "time_added": 1636151050.7666452, "time_in_queue": 21.89680004119873 }, { "filename": "job2.gcode", "job_id": "0000000066D991F0", "time_added": 1636151050.7766452, "time_in_queue": 21.88680004119873 }, { "filename": "subdir/job3.gcode", "job_id": "0000000066D99D80", "time_added": 1636151050.7866452, "time_in_queue": 21.90680004119873 } ], "queue_state": "loading" } ``` -------------------------------- ### POST /machine/services/start Source: https://moonraker.readthedocs.io/en/latest/external_api/machine?q= Commands a service to start. Pre-requisites: provider must NOT be none, service must be in allowed_services, and Moonraker must have permissions to manage services. ```APIDOC ## POST /machine/services/start ### Description Commands a service to start. Pre-requisites: the `provider` must NOT be `none`, the service must be present in the list of `allowed_services`, and Moonraker must have the necessary permissions to manage services. ### Method POST ### Endpoint /machine/services/start ### Parameters #### Request Body - **service** (string) - Required - The name of the service to start. ### Request Example { "service": "klipper" } ### Response #### Success Response (200) - Response body: "ok" #### Response Example "ok" ``` -------------------------------- ### Configfile Object Example Source: https://moonraker.readthedocs.io/en/latest/printer_objects Example of the raw configuration structure parsed from Klipper's config file. ```json { "max_extrude_only_accel": 1250, "max_extrude_only_distance": 500, "instantaneous_corner_velocity": 1, "step_pin": "PC3", "pressure_advance": 0, "pressure_advance_smooth_time": 0.04, "dir_pin": "PL6", "rotation_distance": 6.53061216, "microsteps": 8, "full_steps_per_rotation": 400, "gear_ratio": [], "enable_pin": "!PA4" }, "verify_heater extruder": { "hysteresis": 5, "max_error": 120, "heating_gain": 2, "check_gain_time": 20 } } } ``` -------------------------------- ### Get Printer status - HTTP request and example response Source: https://moonraker.readthedocs.io/en/latest/external_api/integrations?q= Gets the current printer status from the OctoPrint API. The JSON-RPC request is not available. The example response shows temperature readings and state flags. ```http GET /api/printer ``` ```json Not Available ``` ```json { "temperature": { "tool0": { "actual": 22.25, "offset": 0, "target": 0 }, "bed": { "actual": 22.25, "offset": 0, "target": 0 }, ... }, "state": { "text": "state", "flags": { "operational": true, "paused": false, "printing": false, "cancelling": false, "pausing": false, "error": false, "ready": false, "closedOrError": false } } } ``` -------------------------------- ### Example Component Implementation Source: https://moonraker.readthedocs.io/en/latest/components A basic example of a Moonraker component structure, demonstrating configuration access and endpoint registration. ```python # Example Component # # Copyright (C) 2021 Eric Callahan # # This file may be distributed under the terms of the GNU GPLv3 license. class Example: def __init__(self, config): self.server = config.get_server() self.name = config.get_name() # Raises an error if "example_int_option" is not configured in # the [example] section self.example_int_opt = config.getint("example_int_option") # Returns a NoneType if "example_float_option is not configured # in the config self.example_float_opt = config.getfloat("example_float_option", None) self.server.register_endpoint("/server/example", ['GET'], self._handle_example_request) async def request_some_klippy_state(self): klippy_apis = self.server.lookup_component('klippy_apis') return await klippy_apis.query_objects({'print_stats': None}) async def _handle_example_request(self, web_request): web_request.get_int("required_request_param") web_request.get_float("optional_request_param", None) state = await self.request_some_klippy_state() return {"example_return_value": state} def load_component(config): return Example(config) ``` -------------------------------- ### Get Spoolman Status Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/integrations Example response showing connection status and pending reports. ```json { "spoolman_connected": false, "pending_reports": [ { "spool_id": 1, "filament_used": 10 } ], "spool_id": 2 } ``` -------------------------------- ### List Database Info Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/database Example response containing lists of namespaces and backup filenames. ```json { "namespaces": [ "gcode_metadata", "webcams", "update_manager", "announcements", "database", "moonraker" ], "backups": [ "sqldb-backup-20240513-134542.db", "testbackup.db", "testbackup2.db" ] } ``` -------------------------------- ### List Database Info (debug) Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/database Example response containing namespaces, backups, and tables. ```json { "namespaces": [ "gcode_metadata", "webcams", "update_manager", "announcements", "database", "moonraker" ], "backups": [ "sqldb-backup-20240513-134542.db", "testbackup.db", "testbackup2.db" ], "tables": [ "job_history", "job_totals", "namespace_store", "table_registry", "authorized_users" ] } ``` -------------------------------- ### Query Server Info - Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/server Example response from the Moonraker server info query. Shows the full configuration object with both the effective 'config' and the raw 'orig' values, plus the list of configuration files and their sections. Useful for verifying the server's current settings and the source of each value. ```json { "config": { "server": { "host": "0.0.0.0", "port": 7125, "ssl_port": 7130, "enable_debug_logging": true, "enable_asyncio_debug": false, "klippy_uds_address": "/tmp/klippy_uds", "max_upload_size": 210, "ssl_certificate_path": null, "ssl_key_path": null }, "dbus_manager": {}, "database": { "database_path": "~/.moonraker_database", "enable_database_debug": false }, "file_manager": { "enable_object_processing": true, "queue_gcode_uploads": true, "config_path": "~/printer_config", "log_path": "~/logs" }, "klippy_apis": {}, "machine": { "provider": "systemd_dbus" }, "shell_command": {}, "data_store": { "temperature_store_size": 1200, "gcode_store_size": 1000 }, "proc_stats": {}, "job_state": {}, "job_queue": { "load_on_startup": true, "automatic_transition": false, "job_transition_delay": 2, "job_transition_gcode": "\nM118 Transitioning to next job..." }, "http_client": {}, "announcements": { "dev_mode": false, "subscriptions": [] }, "authorization": { "login_timeout": 90, "force_logins": false, "cors_domains": [ "*.home", "http://my.mainsail.xyz", "http://app.fluidd.xyz", "*://localhost:*" ], "trusted_clients": [ "192.168.1.0/24" ] }, "zeroconf": {}, "octoprint_compat": { "enable_ufp": true, "flip_h": false, "flip_v": false, "rotate_90": false, "stream_url": "/webcam/?action=stream", "webcam_enabled": true }, "history": {}, "secrets": { "secrets_path": "~/moonraker_secrets.ini" }, "mqtt": { "address": "eric-work.home", "port": 1883, "username": "{secrets.mqtt_credentials.username}", "password_file": null, "password": "{secrets.mqtt_credentials.password}", "mqtt_protocol": "v3.1.1", "instance_name": "pi-debugger", "default_qos": 0, "status_objects": { "webhooks": null, "toolhead": "position,print_time", "idle_timeout": "state", "gcode_macro M118": null }, "api_qos": 0, "enable_moonraker_api": true }, "template": {} }, "orig": { "DEFAULT": {}, "server": { "enable_debug_logging": "True", "max_upload_size": "210" }, "file_manager": { "config_path": "~/printer_config", "log_path": "~/logs", "queue_gcode_uploads": "True", "enable_object_processing": "True" }, "machine": { "provider": "systemd_dbus" }, "announcements": {}, "job_queue": { "job_transition_delay": "2.", "job_transition_gcode": "\nM118 Transitioning to next job...", "load_on_startup": "True" }, "authorization": { "trusted_clients": "\n192.168.1.0/24", "cors_domains": "\n*.home\nhttp://my.mainsail.xyz\nhttp://app.fluidd.xyz\n*://localhost:*" }, "zeroconf": {}, "octoprint_compat": {}, "history": {}, "secrets": { "secrets_path": "~/moonraker_secrets.ini" }, "mqtt": { "address": "eric-work.home", "port": "1883", "username": "{secrets.mqtt_credentials.username}", "password_file": null, "password": "{secrets.mqtt_credentials.password}", "mqtt_protocol": "v3.1.1", "instance_name": "pi-debugger", "default_qos": 0, "status_objects": { "webhooks": null, "toolhead": "position,print_time", "idle_timeout": "state", "gcode_macro M118": null }, "api_qos": 0, "enable_moonraker_api": true }, "template": {} }, "files": [ { "filename": "moonraker.conf", "sections": [ "server", "file_manager", "machine", "announcements", "job_queue", "authorization", "zeroconf", "octoprint_compat", "history", "secrets" ] }, { "filename": "include/extras.conf", "sections": [ "mqtt" ] } ] } ``` -------------------------------- ### Get Job status - HTTP request and example response Source: https://moonraker.readthedocs.io/en/latest/external_api/integrations?q= Gets the current job status from the OctoPrint API. The JSON-RPC request is not available. The example response shows null values for job and progress fields when the printer is offline. ```http GET /api/job ``` ```json Not Available ``` ```json { "job": { "file": {"name": null}, "estimatedPrintTime": null, "filament": {"length": null}, "user": null }, "progress": { "completion": null, "filepos": null, "printTime": null, "printTimeLeft": null, "printTimeOrigin": null }, "state": "Offline" } ``` -------------------------------- ### Get Printer status - Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/integrations Example response for the printer status endpoint, showing temperature and state flags. ```json { "temperature": { "tool0": { "actual": 22.25, "offset": 0, "target": 0 }, "bed": { "actual": 22.25, "offset": 0, "target": 0 }, ... }, "state": { "text": "state", "flags": { "operational": true, "paused": false, "printing": false, "cancelling": false, "pausing": false, "error": false, "ready": false, "closedOrError": false } } } ``` -------------------------------- ### Get Job status - Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/integrations Example response for the job status endpoint, showing job details, progress, and state. ```json { "job": { "file": {"name": null}, "estimatedPrintTime": null, "filament": {"length": null}, "user": null }, "progress": { "completion": null, "filepos": null, "printTime": null, "printTimeLeft": null, "printTimeOrigin": null }, "state": "Offline" } ``` -------------------------------- ### Example Response: List available files Source: https://moonraker.readthedocs.io/en/latest/external_api/file_manager Example response for listing files, showing an array of File Info objects with fields: path, modified, size, and permissions. ```json [ { "path": "3DBenchy_0.15mm_PLA_MK3S_2h6m.gcode", "modified": 1615077020.2025201, "size": 4926481, "permissions": "rw" }, { "path": "Shape-Box_0.2mm_PLA_Ender2_20m.gcode", "modified": 1614910966.946807, "size": 324236, "permissions": "rw" }, { "path": "test_dir/A-Wing.gcode", "modified": 1605202259, "size": 1687387, "permissions": "rw" }, { "path": "test_dir/CE2_CubeTest.gcode", "modified": 1614644445.4025, "size": 1467339, "permissions": "rw" }, { "path": "test_dir/V350_Engine_Block_-_2_-_Scaled.gcode", "modified": 1615768477.5133543, "size": 189713016, "permissions": "rw" } ] ``` -------------------------------- ### Turn strip on: Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/devices?q= Example response showing the status of each strip after turning them on. Each strip object includes status, chain_count, preset, brightness, intensity, speed, and error fields. ```json { "lights": { "strip": "lights", "status": "on", "chain_count": 79, "preset": -1, "brightness": 255, "intensity": -1, "speed": -1, "error": null }, "desk": { "strip": "desk", "status": "on", "chain_count": 60, "preset": 8, "brightness": -1, "intensity": -1, "speed": -1, "error": null } } ``` -------------------------------- ### Get Analysis Status Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/integrations?q= Example response for the analysis status endpoint. Shows fields like `estimator_executable`, `estimator_ready`, `estimator_version`, `estimator_config_exists`, and `using_default_config`. ```json { "estimator_executable": "klipper_estimator_rpi", "estimator_ready": true, "estimator_version": "v3.7.3", "estimator_config_exists": true, "using_default_config": false } ``` -------------------------------- ### POST /machine/services/start Source: https://moonraker.readthedocs.io/en/latest/external_api/machine Commands a service to start. Requires the service to be in the allowed_services list and appropriate permissions. ```APIDOC ## POST /machine/services/start ### Description Commands a service to start. The following pre-requisites must be met to successfully perform this action: the provider must NOT be none, the service must be present in the list of allowed_services, and Moonraker must have the necessary permissions to manage services. ### Method POST ### Endpoint /machine/services/start ### Parameters #### Request Body - **service** (string) - Required - The name of the service to start. ### Request Example { "service": "klipper" } ### Response #### Success Response (200) - **response** (string) - The response is "ok". #### Response Example "ok" ``` -------------------------------- ### Start a System Service (machine.services.start) Source: https://moonraker.readthedocs.io/en/latest/external_api/machine?q= Starts a system service. Requires the provider to NOT be none, the service to be in allowed_services, and Moonraker to have permissions. The HTTP request is POST /machine/services/start with a JSON body containing the service name; the JSON-RPC method is machine.services.start. The response is "ok". ```http POST /machine/services/start Content-Type: application/json { "service": "klipper" } ``` ```json { "jsonrpc": "2.0", "method": "machine.services.start", "params": { "service": "klipper" }, "id": 4645 } ``` ```json "ok" ``` -------------------------------- ### Get job queue status - Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/job_queue Example response from the status endpoint, showing queued jobs with filenames, job IDs, timestamps, and queue state. ```json { "queued_jobs": [ { "filename": "job1.gcode", "job_id": "0000000066D99C90", "time_added": 1636151050.7666452, "time_in_queue": 21.89680004119873 }, { "filename": "job2.gcode", "job_id": "0000000066D991F0", "time_added": 1636151050.7766452, "time_in_queue": 21.88680004119873 }, { "filename": "subdir/job3.gcode", "job_id": "0000000066D99D80", "time_added": 1636151050.7866452, "time_in_queue": 21.90680004119873 } ], "queue_state": "ready" } ``` -------------------------------- ### POST /server/job_queue/start Source: https://moonraker.readthedocs.io/en/latest/external_api/job_queue Starts the job queue, loading the next job if Klipper is ready, or setting the queue to 'ready' state to load after the current job completes. ```APIDOC ## POST /server/job_queue/start ### Description Starts the job queue. If Klipper is ready to start a print, the next job in the queue will be loaded. Otherwise, the queue will be put into the "ready" state, where the job will be loaded after the current job completes. ### Method POST ### Endpoint /server/job_queue/start ### Parameters None ### Request Example POST /server/job_queue/start ### Response #### Success Response (200) - **queued_jobs** (array of objects) - The list of jobs in the queue. - **queue_state** (string) - The current state of the queue, will be "loading" or "ready". #### Response Example { "queued_jobs": [ { "filename": "job1.gcode", "job_id": "0000000066D99C90", "time_added": 1636151050.7666452, "time_in_queue": 21.89680004119873 }, { "filename": "job2.gcode", "job_id": "0000000066D991F0", "time_added": 1636151050.7766452, "time_in_queue": 21.88680004119873 }, { "filename": "subdir/job3.gcode", "job_id": "0000000066D99D80", "time_added": 1636151050.7866452, "time_in_queue": 21.90680004119873 } ], "queue_state": "loading" } ``` -------------------------------- ### Get Webcam Information Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/webcams?q= Example response for the Get Webcam Information request. Shows the structure of a Webcam Entry object, including fields like name, location, service, enabled, icon, target_fps, stream_url, snapshot_url, flip_horizontal, flip_vertical, rotation, aspect_ratio, extra_data, source, and uid. ```json { "webcam": { "name": "TestCam", "location": "printer", "service": "mjpegstreamer", "enabled": true, "icon": "mdiWebcam", "target_fps": 15, "target_fps_idle": 5, "stream_url": "/webcam/?action=stream", "snapshot_url": "/webcam/?action=snapshot", "flip_horizontal": false, "flip_vertical": false, "rotation": 0, "aspect_ratio": "4:3", "extra_data": {}, "source": "database", "uid": "341778f9-387f-455b-8b69-ff68442d41d9" } } ``` -------------------------------- ### Device State Response Example Source: https://moonraker.readthedocs.io/en/latest/external_api/devices?q= Example response showing the state of the requested device. ```json { "green_led": "off" } ``` -------------------------------- ### Get Sudo Info Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/machine Example response for the sudo info request. Shows sudo_access as null when not checked, the linux_user, whether sudo was requested, and any request messages. ```json { "sudo_access": null, "linux_user": "pi", "sudo_requested": false, "request_messages": [] } ``` -------------------------------- ### uhubctl command output example Source: https://moonraker.readthedocs.io/en/latest/configuration Example output from running `uhubctl` with no arguments on a Raspberry Pi 3B+, showing the current status of compatible hubs and ports. Use this to identify the location and port values for the `location` and `port` options in the uhubctl configuration. ```text Current status for hub 1-1.1 [0424:2514, USB 2.00, 3 ports, ppps] Port 1: 0503 power highspeed enable connect [0424:7800] Port 2: 0100 power Port 3: 0100 power Current status for hub 1-1 [0424:2514, USB 2.00, 4 ports, ppps] Port 1: 0503 power highspeed enable connect [0424:2514, USB 2.00, 3 ports, ppps] Port 2: 0100 power Port 3: 0103 power enable connect [1d50:614e Klipper rp2040 45503571290B1068] Port 4: 0100 power Current status for hub 1 [1d6b:0002 Linux 6.6.28+rpt-rpi-v7 dwc_otg_hcd DWC OTG Controller 3f980000.usb, USB 2.00, 1 ports, ppps] Port 1: 0503 power highspeed enable connect [0424:2514, USB 2.00, 4 ports, ppps] ``` -------------------------------- ### Get individual strip state: Example Response Source: https://moonraker.readthedocs.io/en/latest/external_api/devices?q= Example response showing the current status of the requested strip, including status, chain_count, preset, brightness, intensity, speed, and error. ```json { "lights": { "strip": "lights", "status": "on", "chain_count": 79, "preset": 1, "brightness": 50, "intensity": 255, "speed": 255, "error": null } } ``` -------------------------------- ### Home Assistant Power Device Configuration Example Source: https://moonraker.readthedocs.io/en/latest/configuration Complete moonraker.conf example for a Home Assistant switch power device. Includes required address, device, and token parameters, with optional protocol, port, domain, and status_delay settings. ```ini # moonraker.conf [power homeassistant_switch] type: homeassistant protocol: http address: 192.168.1.126 port: 8123 device: switch.1234567890abcdefghij token: home-assistant-very-long-token domain: switch ``` -------------------------------- ### Example response for GET /machine/update/status Source: https://moonraker.readthedocs.io/en/latest/external_api/update_manager Example response from the update status endpoint. Shows the structure of version_info for system, web, and git_repo components, including fields like channel, remote_version, commits_behind, and anomalies. ```json { "busy": false, "github_rate_limit": 60, "github_requests_remaining": 57, "github_limit_reset_time": 1615836932, "version_info": { "system": { "name": "system", "configured_type": "system", "package_count": 4, "package_list": [ "libtiff5", "raspberrypi-sys-mods", "rpi-eeprom-images", "rpi-eeprom" ] }, "moonraker": { "channel": "dev", "debug_enabled": true, "is_valid": true, "configured_type": "git_repo", "corrupt": false, "info_tags": [], "detected_type": "git_repo", "name": "moonraker", "remote_alias": "arksine", "branch": "master", "owner": "arksine", "repo_name": "moonraker", "version": "v0.7.1-364", "remote_version": "v0.7.1-364", "rollback_version": "v0.7.1-360", "current_hash": "ecfad5cff15fff1d82cb9bdc64d6b548ed53dfaf", "remote_hash": "ecfad5cff15fff1d82cb9bdc64d6b548ed53dfaf", "repo_detected": true, "is_dirty": false, "detached": true, "commits_behind": [], "git_messages": [], "full_version_string": "v0.7.1-364-gecfad5c", "pristine": true, "recovery_url": "https://github.com/Arksine/moonraker.git", "remote_url": "https://github.com/Arksine/moonraker.git", "warnings": [], "anomalies": [ "Unofficial remote url: https://github.com/Arksine/moonraker-fork.git", "Repo not on official remote/branch, expected: origin/master, detected: altremote/altbranch", "Detached HEAD detected" ] }, "mainsail": { "name": "mainsail", "owner": "mainsail-crew", "version": "v2.1.1", "remote_version": "v2.1.1", "rollback_version": "v2.0.0", "configured_type": "web", "channel": "stable", "info_tags": [ "desc=Mainsail Web Client", "action=some_action" ], "warnings": [], "anomalies": [], "is_valid": true }, "fluidd": { "name": "fluidd", "owner": "fluidd-core", "version": "v1.16.2", "remote_version": "v1.16.2", "rollback_version": "v1.15.0", "configured_type": "web", "channel": "beta", "info_tags": [], "warnings": [], "anomalies": [], "is_valid": true }, "klipper": { "channel": "dev", "debug_enabled": true, "is_valid": true, "configured_type": "git_repo", "corrupt": false, "info_tags": [], "detected_type": "git_repo", "name": "klipper", "remote_alias": "origin", "branch": "master", "owner": "Klipper3d", "repo_name": "klipper", "version": "v0.10.0-1", "remote_version": "v0.10.0-41", "rollback_version": "v0.9.1-340", "current_hash": "4c8d24ae03eadf3fc5a28efb1209ce810251d02d", "remote_hash": "e3cbe7ea3663a8cd10207a9aecc4e5458aeb1f1f", "repo_detected": true, "is_dirty": false, "detached": false, "commits_behind": [ { "sha": "e3cbe7ea3663a8cd10207a9aecc4e5458aeb1f1f", "author": "Kevin O'Connor", "date": "1644534721", "subject": "stm32: Clear SPE flag on a change to SPI CR1 register", } ] } } } ```