docs: update documentation with latest changes

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan committed 2025-02-11 08:01:50 -05:00
1 parent f2c564cfb7
commit 2fcc542d85
3 files changed
+1004 -21

No files matched your search

+5
View File
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog].
- **pip_utils**: Use the "upgrade" option when installing python packages.
This will force upgrades to the latest version available as resolved by
the requirement specifier.
- **python_deploy**: Use the "eager" dependency update strategy.
- **wled**: Use the `async_serial` utility for serial comms.
- **paneldue**: Use the `async_serial` utility for serial comms.
- **scripts**: Update `fetch-apikey.sh` to query the SQL database
@@ -38,6 +39,7 @@ The format is based on [Keep a Changelog].
### Fixed
- **python_deploy**: fix "dev" channel updates for GitHub sources.
- **python_deploy**: fix release rollbacks.
- **mqtt**: Publish the result of the Klipper status subscription request.
This fixes issues with MQTT clients missing the initial status updates
after Klippy restarts.
@@ -60,6 +62,9 @@ The format is based on [Keep a Changelog].
simply iterate over the values of the `version_info` object.
- **python_deploy**: Add support for updating python packages with
"extras" installed.
- **update_manager**: Add support for updating `executable` binaries.
- **analysis**: Initial support for gcode file time analysis using
[Klipper Estimator](https://github.com/Annex-Engineering/klipper_estimator).
## [0.9.3] - 2024-09-05
+152 -21
View File
@@ -519,6 +519,46 @@ in the response.
Optional Components are only loaded if present in `moonraker.conf`. This
includes components that may not have any configuration.
### `[analysis]`
The `analysis` component enables gcode file time analysis using
[Klipper Estimator](https://github.com/Annex-Engineering/klipper_estimator).
When enabled, Moonraker will automatically download the `klipper_estimator`
binary and optionally create an [update manger](#update_manager) entry for it.
```ini {title="Moonraker Config Specification"}
# moonraker.conf
platform: auto
# The platform flavor of Klipper Estimator to use. Must be a choice
# from rpi, linux, osx, and auto. Note that "rpi" supports armv7 and
# aarch64 linux platforms, whereas "linux" supports amd64 linux
# platform. The auto choice will attempt to automatically determine
# the correct platform. The default is auto.
estimator_config:
# A path relative to the "config" root specifying a config
# file to use for Klipper Estimator. The default is to
# use a configuration dumped with data retrieved from Klipper's
# current settings.
auto_dump_default_config: false
# When set to true the default configuration for Klipper Estimator
# will be dumped every time Klippy restarts. When false the
# configuration is only dumped if the default configuration file
# does not exist. The default is false.
estimator_timeout: 600
# The maximum amount of time (in seconds) Klipper Esti+mator
# is given to process a gcode file before processing is
# aborted. The default is 600 seconds.
enable_auto_analysis: false
# When set to true Klipper Estimator will be used to perform a time
# analysis for gcode files immediately after metadata is processed.
# The "total_time" result will replace the existing "estimated_time"
# field in the gcode metadata. This automates the time analysis for
# any event that triggers metadata processing. Default is false.
enable_estimator_updates: false
# When true Moonraker will create and register an entry for
# klipper_estimator with the update manager. Default is false.
```
### `[ldap]`
The `ldap` module may be used by `[authorization]` to perform user
@@ -1879,6 +1919,9 @@ down into 4 basic types:
See the note below in reference to unofficial extensions.
- `zip`: This can be used to manage various extensions like the `git_repo`
type, however its updates are deployed via zipped GitHub releases.
- `executable`: Like the `zip` type this can be used to manage applications
and extensions. An executable type must be a pre-built binary executable
file hosted on GitHub.
- `python`: The python type can be used to update python applications installed
using `pip` in a virtual environment.
@@ -1893,27 +1936,57 @@ trackers without first reproducing the issue using pristine versions
of Moonraker and/or Klipper.
///
#### Web type (front-end) configuration
#### The release_info.json file
/// Note
Front-end developers that wish to deploy updates via Moonraker
should host releases on their GitHub repo. In the root of each
release a `release_info.json` file should be present. This
file must contain a JSON object with the following fields:
The `web`, `zip`, and `exectuable` types require that the install
folder contain a `release_info.json` file. This file contains
information the update manager uses to validate the local install.
- `project_name`: The name of the GitHub project
- `project_owner`: The User or Organization that owns the project
- `version`: The current release version
| Field | Description |
| --------------- | ---------------------------------------------------- |
| `project_name` | The name of the GitHub project hosting the software. |
| `project_owner` | The User or Organization that owns the project. |
| `version` | The version of the installed software. This should |
| | match the release tag on GitHub. |^
| `asset_name` | The name of the asset to download on GitHub. This |
| | is optional for `web` and `zip` types, they will |^
| | default to `{config_section_name}.zip`. The |^
| | `executable` type **REQUIRES** this field. |^
{ #release-info-json-spec } Release Info Specification
For example, a `release_info.json` for Mainsail might contain the
following:
```json
```json {title="Web Type Release Info Example"}
{
"project_name": "mainsail",
"project_owner": "mainsail-crew",
"version": "v2.5.1"
}
```
```json {title="Executable Type Release Info Example"}
{
"project_name":"klipper_estimator",
"project_owner":"Annex-Engineering",
"version":"v3.7.3",
"asset_name":"klipper_estimator_rpi"
}
```
/// note
Moonraker automatically creates the above `release_info.json`
file for Klipper Estimator when the [analysis](#analysis)
section is configured in `moonraker.conf`. When the
`enable_updates` option is enabled Moonraker will register
Klipper Estimator with the update manager, so there is no
need to add a `[update manager klipper_estimator]` section
to the configuration.
///
#### Web type (front-end) configuration
/// Note
Software using the `web` type should host their distribution
in a zip file as a GitHub release. The zip file MUST contain
[release_info.json](#the-release_infojson-file).
///
```ini {title="Moonraker Config Specification"}
@@ -2106,17 +2179,21 @@ option must match the case of the systemd unit file.
#### Zip Application Configuration
/// Note
Software using the `zip` type should host their distribution
in a zip file as a GitHub release. The zip file MUST contain
[release_info.json](#the-release_infojson-file).
///
The `zip` type can be used to deploy zipped application updates through GitHub
releases. They can be thought of as a combination of the `web` and `git_repo`
types. Like `web` types, zipped applications must include a `release_info.json`
file (see the [web type](#web-type-front-end-configuration) not for details).
In addition, `zip` types can be configured to update dependencies and manage
types. Like `web` types, the are GitHub hosted zip archives. Like `git_repo`
types, `zip` types can be configured to update dependencies and manage
services.
The `zip` type is ideal for applications that need to be built before deployment.
The thing to keep in mind is that any application updated through Moonraker needs
either be cross-platform, or it needs to deploy binaries for multiple platforms
and be able to choose the correct one based on the system.
The `zip` type is ideal for applications that must bundle multiple files in
a release. If bundling executable files, keep in mind that Moonraker runs
on multiple architectures.
```ini {title="Moonraker Config Specification"}
type: zip
@@ -2152,6 +2229,54 @@ info_tags:
# options.
```
#### Executable Configuration
/// Note
Software using the `executable` type should host their binaries
on GitHub as a release. The initial installer for the executable
MUST create [release_info.json](#the-release_infojson-file) in
the folder containing the executable.
///
The `executable` type can be used to deploy pre-built executable binaries
through GitHub releases. Executable types can be installed as system services
and may specifiy OS package dependencies.
Like `web` and `zip` types, `executuable` types must include a `release_info.json`
file (see the [web type](#web-type-front-end-configuration) not for details).
In addition, `executable` types can be configured to update dependencies and manage
services.
The `executable` type is ideal for applications that need to be built before deployment.
The thing to keep in mind is that any application updated through Moonraker needs
either be cross-platform, or it needs to deploy binaries for multiple platforms
and be able to choose the correct one based on the system.
```ini {title="Moonraker Config Specification"}
type: executable
channel: stable
# May be stable or beta. When beta is specified "pre-release"
# updates are available. The default is stable.
repo:
# This is the GitHub repo of the application, in the format of owner/repo_name.
path:
# The path to folder containing the executable on disk. This folder must contain a
# a previously installed application and a valid release_info.json file.
# The folder must not be located within a git repo and it must not be located
# within a path that Moonraker has reserved, ie: it cannot share a path with
# another extension. This parameter must be provided.
refresh_interval:
# This overrides the refresh_interval set in the primary [update_manager]
# section.
system_dependencies:
is_system_service: True
managed_services:
info_tags:
# See the git_repo type documentation for detailed descriptions of the above
# options.
```
#### Python Application Configuration
The `python` type can be used to update python applications installed via pip
@@ -2201,7 +2326,13 @@ virtualenv: ~/pyapp
```
///
##### The optional release_info file
##### The optional python release_info file
/// note
This file has a different specification than the
[release_info.json](#the-release_infojson-file)
file required by other types.
///
Python applications may include a `release_info` file in the package
folder that provides supplemental information for the application. The
@@ -2226,7 +2357,7 @@ folder that provides supplemental information for the application. The
For example, Moonraker's `release_info` looks similar to the following:
```json
```json {title="Python release_info example"}
{
"project_name": "moonraker",
"package_name": "moonraker",
+847
View File
@@ -510,6 +510,853 @@ proxied directly.
///
## Klipper Estimator time analysis
Moonraker's `analysis` component uses
[Klipper Estimator](https://github.com/Annex-Engineering/klipper_estimator)
to perform gcode file time analysis. The endpoints in this section are available
when the `[analysis]` section has been configured in `moonraker.conf`.
### Get Analysis Status
```{.http .apirequest title="HTTP Request"}
GET /server/analysis/status
```
```{.json .apirequest title="JSON-RPC Request"}
{
"jsonrpc": "2.0",
"method": "server.analysis.status",
"id": 4654
}
```
/// collapse-code
```{.json .apiresponse title="Example Response"}
{
"estimator_executable": "klipper_estimator_rpi",
"estimator_ready": true,
"estimator_version": "v3.7.3",
"estimator_config_exists": true,
"using_default_config": false
}
```
///
/// api-response-spec
open: True
| Field | Type | Description |
| ------------------------- | :----: | -------------------------------------------- |
| `estimator_executable` | string | The name of the Klipper Estimator executable |
| | | file. |^
| `estimator_ready` | bool | A value of `true` indicates that the Klipper |
| | | Estimator binary is present and successfully |^
| | | reports its version. |^
| `estimator_version` | string | The version reported by Klipper Estimator. |
| `estimator_config_exists` | bool | A value of `true` indicates that a valid |
| | | Klipper Estimator config file exists. |^
| `using_default_config` | bool | Reports `true` when Klipper Estimator is |
| | | configured to use the default config. |^
//// note
When Klipper Estimator is first initialized Moonraker downloads the binary
and grants it executable permissions. A default configuration will be
dumped when Klippy reports `ready`. The default configuration will not
exist until Klippy is `ready` and available.
////
///
### Perform a time analysis
```{.http .apirequest title="HTTP Request"}
POST /server/analysis/estimate
Content-Type: application/json
{
"filename": "my_file.gcode",
"estimator_config": "custom_estimator_cfg.json",
"update_metadata": false
}
```
```{.json .apirequest title="JSON-RPC Request"}
{
"jsonrpc": "2.0",
"method": "server.analysis.estimate",
"params": {
"filename": "my_file.gcode",
"estimator_config": "custom_estimator_cfg.json",
"update_metadata": false
}
"id": 4654
}
```
/// api-parameters
open: True
| Name | Type | Default | Description |
| ------------------ | :----: | ------------------ | ----------------------------------------- |
| `filename` | string | **REQUIRED** | The path to the gcode file to perform |
| | | | a time estimate on. This should be a |^
| | | | path relative to the `gcodes` root |^
| | | | folder. |^
| `estimator_config` | string | **CONFIG_DEFAULT** | The path to a Klipper Estimator config |
| | | | file, relative to the `config` root |^
| | | | folder. When omitted the file configured |^
| | | | in the `[analysis]` section of |^
| | | | `moonraker.conf` or the default dumped |^
| | | | config will be used. |^
| `update_metadata` | bool | false | When set to `true` the `estimated_time` |
| | | | field of the gcode file's metadata will |^
| | | | be overwritten with the `total_time` |^
| | | | result from Klipper Estimator. |^
///
/// collapse-code
```{.json .apiresponse title="Example Response"}
{
"total_time": 3086.8131575260686,
"total_distance": 63403.85014049082,
"total_extrude_distance": 2999.883480000007,
"max_flow": 7.593973828405062,
"max_speed": 180,
"num_moves": 19068,
"total_z_time": 122.51358592092325,
"total_output_time": 2789.122405609832,
"total_travel_time": 257.9946362351847,
"total_extrude_only_time": 39.446115681036936,
"phase_times": {
"acceleration": 360.966527738102,
"cruise": 2365.24977575805,
"deceleration": 360.3468540299323
},
"kind_times": {
"Bridge infill": 86.61878955677516,
"Custom": 1.1925285421682654,
"External perimeter": 727.5477605614387,
"Gap fill": 11.412536370727818,
"Internal infill": 1035.7116673043204,
"Overhang perimeter": 0.966786878164481,
"Perimeter": 562.2619470028691,
"Skirt/Brim": 22.540480459569807,
"Solid infill": 573.0419719937473,
"Top solid infill": 65.26868885629558
},
"layer_times": [
[
0,
0.05059644256269407
],
[
0.2,
58.177320509927746
],
[
0.5,
31.954084022391182
],
[
0.6,
0.9089208501630478
],
[
0.8,
33.99706357305071
],
[
1.1,
25.96804446085199
],
[
1.4,
26.479048320454805
],
[
1.7,
26.582581091690333
],
[
2,
27.072868276853875
],
[
2.3,
23.266380178000148
],
[
2.6,
23.32793916103499
],
[
2.9,
22.68151682077201
],
[
3.2,
39.49402504999236
],
[
3.5,
27.195385252006332
],
[
3.8,
28.109438088654816
],
[
4.1,
24.08349852277251
],
[
4.4,
23.917674876902552
],
[
4.7,
23.202091559017017
],
[
5,
23.198343943562456
],
[
5.3,
22.153783595351126
],
[
5.6,
21.808169596228392
],
[
5.9,
21.904068197159418
],
[
6.2,
21.726213600349016
],
[
6.5,
21.555689782559813
],
[
6.8,
21.56001088763045
],
[
7.1,
21.616583527557026
],
[
7.4,
21.587509695967398
],
[
7.7,
21.582874923811257
],
[
8,
21.57728927279966
],
[
8.3,
21.76624101342738
],
[
8.6,
21.450965502680578
],
[
8.9,
21.461465610564524
],
[
9.2,
21.366725852519636
],
[
9.5,
21.362167027170038
],
[
9.8,
25.600580479722474
],
[
10.1,
26.282946643536636
],
[
10.4,
26.693162061300253
],
[
10.7,
25.87730466751283
],
[
11,
25.837521272340645
],
[
11.3,
25.220649143903664
],
[
11.6,
24.91627368335564
],
[
11.9,
24.565979527961527
],
[
12.2,
21.901257609622963
],
[
12.5,
21.26785043389243
],
[
12.8,
21.099317506268335
],
[
13.1,
21.524648538390988
],
[
13.4,
24.108699996006557
],
[
13.7,
24.373866962973825
],
[
14,
25.230795272831255
],
[
14.3,
25.47226683972438
],
[
14.6,
26.051098821629687
],
[
14.9,
26.2540071554197
],
[
15.2,
26.54261709911606
],
[
15.5,
22.769433528123376
],
[
15.8,
22.57337903594234
],
[
16.1,
22.120135631848644
],
[
16.4,
22.302142435605443
],
[
16.7,
22.490758568112852
],
[
17,
22.216297455855806
],
[
17.3,
22.241988841558136
],
[
17.6,
22.030502249189826
],
[
17.9,
21.442566629762368
],
[
18.2,
21.537227968334165
],
[
18.5,
21.187671992912446
],
[
18.8,
21.176477375060422
],
[
19.1,
21.176107665494644
],
[
19.4,
21.164450306340775
],
[
19.7,
21.211793185762044
],
[
20,
21.049079879215107
],
[
20.3,
21.018544238429598
],
[
20.6,
20.833976711167224
],
[
20.9,
20.833976711167224
],
[
21.2,
20.833976711167224
],
[
21.5,
20.833976711167224
],
[
21.8,
20.833976711167224
],
[
22.1,
20.833976711167224
],
[
22.4,
21.258875428281975
],
[
22.7,
21.303045487271195
],
[
23,
21.54997891912768
],
[
23.3,
21.4000724519804
],
[
23.6,
21.172838007877022
],
[
23.9,
21.89326824952405
],
[
24.2,
22.260210513833638
],
[
24.5,
22.34815676766725
],
[
24.8,
23.018360476759195
],
[
25.1,
22.83742910264808
],
[
25.4,
21.884928399224517
],
[
25.7,
21.16791844379882
],
[
26,
21.062339082163817
],
[
26.3,
20.497926920922225
],
[
26.6,
20.441458670088437
],
[
26.9,
20.497926920922225
],
[
27.2,
21.411213211524064
],
[
27.5,
21.205564835097203
],
[
27.8,
21.403735651236662
],
[
28.1,
21.72317504502876
],
[
28.4,
20.83804429637327
],
[
28.7,
20.992445860036398
],
[
29,
20.96056166031732
],
[
29.3,
20.96056166031732
],
[
29.6,
20.96056166031732
],
[
29.9,
20.96056166031732
],
[
30.2,
21.163385361246583
],
[
30.5,
21.375398470771565
],
[
30.8,
21.845443716854845
],
[
31.1,
21.003381151310677
],
[
31.4,
20.660669538703793
],
[
31.7,
20.497926920922225
],
[
32,
20.441458670088437
],
[
32.3,
20.497926920922225
],
[
32.6,
20.441458670088437
],
[
32.9,
20.497926920922225
],
[
33.2,
20.441458670088437
],
[
33.5,
20.497926920922225
],
[
33.8,
20.441458670088437
],
[
34.1,
36.85516926371657
],
[
34.4,
23.906291084020573
],
[
34.7,
24.10243730191063
],
[
35,
29.058094876089566
],
[
35.3,
21.585307365265763
],
[
35.6,
21.977729818546266
],
[
35.9,
21.982243563755652
],
[
36.2,
21.84660060776076
],
[
36.5,
21.852866392888306
],
[
36.8,
21.809194828486756
],
[
37.1,
20.510222555418448
],
[
37.4,
19.19335211292996
],
[
37.7,
17.170142031218244
],
[
38,
15.027435648219916
],
[
38.3,
12.070425871333898
],
[
38.6,
9.187916276700111
],
[
38.9,
8.965728773112703
],
[
39.2,
6.353229978247989
],
[
39.5,
6.225660195566472
],
[
39.8,
0.5801244322591914
],
[
40.1,
0.2925785856185972
]
]
}
```
///
/// api-response-spec
open: True
//// Note
This specification applies to the values returned by
Klipper Estimator version `v3.7.3`.
All time estimates are reported in seconds.
////
| Field | Type | Description |
| ------------------------- | :-------: | ------------------------------------------------------ |
| `total_time` | float | The total estimated time spent on the job. |
| `total_distance` | float | The total estimated travel distance of the tool in mm. |
| `total_extrude_distance` | float | The total estimated extrude distance in mm. |
| `max_flow` | float | The maximum flow rate detected in mm^3^/s. |
| `max_speed` | float | The maximum tool movement speed detected in mm/s. |
| `num_moves` | int | The total number of moves detected. |
| `total_z_time` | float | The estimated amount of time spent moving on the |
| | | Z axis. |^
| `total_output_time` | float | The estimated amount of time moving while extruding. |
| `total_travel_time` | float | The estimated amount of time the tool spent traveling. |
| `total_extrude_only_time` | float | The estimated amount of time the tool spent extruding |
| | | without other movement. |^
| `phase_times` | object | A `Phase Times` object. |
| | | #phase-times-object-spec |+
| `kind_times` | object | A `Kind Times` object. |
| | | #kind-times-object-spec |+
| `layer_times` | [[float]] | An array of 2-element arrays. The first element |
| | | is the layer height, the second is the estimated |^
| | | time spent printing the layer. |^
| Field | Type | Description |
| -------------- | :---: | ----------------------------------------------------- |
| `acceleration` | float | The amount of time the tool spent accelerating during |
| | | the print job. |^
| `cruise` | float | The amount of time the tool spent at cruise velocity |
| | | during the print job. |^
| `deceleration` | float | The amount of time the tool spent decelerating during |
| | | the print job. |^
{ #phase-times-object-spec } Phase Times
| Field | Type | Description |
| ----------- | :---: | ----------------------------------------------------------------- |
| *kind_desc* | float | An entry where the key is a description of the "kind" of item |
| | | being printed and its value is the total time spent printing |^
| | | this "kind". The "kind" is determined by comments in the slicer. |^
| | | For example `Perimeter` and `Bridge infill` are "kinds" reported |^
| | | by PrusaSlicer. If the "kind" is not available Klipper Estimator |^
| | | will report it under `Other`. The `Kind Times` object may have |^
| | | multiple *kind_desc* entries. |^
{ #kind-times-object-spec } Kind Times
///
### Dump the current configuration
Create a Klipper Estimator configuration file using Klippy's
current settings.
/// note
Klippy must be connected and in the `ready` state to run
this request.
///
```{.http .apirequest title="HTTP Request"}
POST /server/analysis/dump_config
Content-Type: application/json
{
"dest_config": "custom_estimator_cfg.json"
}
```
```{.json .apirequest title="JSON-RPC Request"}
{
"jsonrpc": "2.0",
"method": "server.analysis.dump_config",
"params": {
"dest_config": "custom_estimator_cfg.json"
}
"id": 4654
}
```
/// api-parameters
open: True
| Name | Type | Default | Description |
| ------------- | :----: | ------- | ----------------------------------------- |
| `dest_config` | string | null | The name of the destination config file |
| | | | for the dump. This should be a path |^
| | | | relative to the `config` root folder. |^
| | | | If omitted the result of the dump will |^
| | | | be saved to the default Klipper Estimator |^
| | | | configuration file. |^
//// Note
The default configuration for Klipper Estimator is stored in the same
folder as the binary.
```
<data_path>/tools/klipper_estimator/default_estimator_cfg.json
```
////
///
/// collapse-code
```{.json .apiresponse title="Example Response"}
{
"dest_root": "config",
"dest_config_path": "est_cfg_test.json",
"klipper_estimator_config": {
"max_velocity": 300,
"max_acceleration": 1500,
"minimum_cruise_ratio": 0.5,
"square_corner_velocity": 5,
"instant_corner_velocity": 1,
"move_checkers": [
{
"axis_limiter": {
"axis": [
0,
0,
1
],
"max_velocity": 15,
"max_accel": 200
}
},
{
"extruder_limiter": {
"max_velocity": 120,
"max_accel": 1250
}
}
]
}
}
```
///
/// api-response-spec
open: True
| Field | Type | Description |
| -------------------------- | :------------: | ----------------------------------------- |
| `dest_root` | string \| null | The destination root folder of the dumped |
| | | configuration file. Will be `null` if |^
| | | the dumped file is the default config. |^
| `dest_config` | sting | The path of the dumped configuration file |
| | | relative to the `dest_root`. If the |^
| | | `dest_root` is null then this will be |^
| | | the default configuration's file name. |^
| `klipper_estimator_config` | object | An object containing the output of the |
| | | dump command. |^
///
## OctoPrint API emulation