docs: Add documentation for new service and power features

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-10-24 11:37:27 -04:00
parent 47999e24c4
commit f086f75c07
2 changed files with 71 additions and 12 deletions

View File

@ -213,6 +213,13 @@ restart_klipper_when_powered: False
# If set to True, Moonraker will issue a "FIRMWARE_RESTART" to Klipper # If set to True, Moonraker will issue a "FIRMWARE_RESTART" to Klipper
# after the device has been powered on. The default is False, thus no # after the device has been powered on. The default is False, thus no
# attempt to made to restart Klipper after power on. # attempt to made to restart Klipper after power on.
bound_service:
# Can be set to any service Moonraker is authorized to manage with the
# exception of the moonraker service itself. See the tip below this section
# for details on what services are authorized. When a bound service has
# been set the service will be started when the device powers on and stopped
# when the device powers off. The default is no service is bound to the
# device.
restart_delay: 1. restart_delay: 1.
# If "restart_klipper_when_powered" is set, this option specifies the amount # If "restart_klipper_when_powered" is set, this option specifies the amount
# of time (in seconds) to delay the restart. Default is 1 second. # of time (in seconds) to delay the restart. Default is 1 second.
@ -310,8 +317,21 @@ off_code:
# The above options are used for "rf" devices. The # The above options are used for "rf" devices. The
# codes should be valid binary codes that are send via the RF transmitter. # codes should be valid binary codes that are send via the RF transmitter.
# For example: 1011. # For example: 1011.
``` ```
!!! Tip
Moonraker is authorized to manage the `klipper`, `klipper_mcu`,
`webcamd`, `MoonCord`, `KlipperScreen`, and `moonraker-telegram-bot`
services. It can also manage multiple instances of a service, ie:
`klipper_1`, `klipper_2`. Keep in mind that service names are case
sensitive.
!!! Note
If a device has been bound to the `klipper` service and the
`restart_klipper_when_powered` option is set to `True`, the restart
will be scheduled to execute after Klipper reports that its startup
sequence is complete.
Below are some potential examples: Below are some potential examples:
```ini ```ini
# moonraker.conf # moonraker.conf

View File

@ -833,27 +833,26 @@ Returns: Information about the host system in the following format:
```json ```json
{ {
"system_info": { "system_info": {
"available_services": ["moonraker", "klipper"],
"cpu_info": { "cpu_info": {
"cpu_count": 1, "cpu_count": 4,
"bits": "32bit", "bits": "32bit",
"processor": "armv6l", "processor": "armv7l",
"cpu_desc": "ARMv6-compatible processor rev 7 (v6l)", "cpu_desc": "ARMv7 Processor rev 4 (v7l)",
"hardware_desc": "BCM2835", "hardware_desc": "BCM2835",
"model": "Raspberry Pi Zero W Rev 1.1", "model": "Raspberry Pi 3 Model B Rev 1.2",
"total_memory": 439276, "total_memory": 945364,
"memory_units": "kB" "memory_units": "kB"
}, },
"sd_info": { "sd_info": {
"manufacturer_id": "03", "manufacturer_id": "03",
"manufacturer": "Sandisk", "manufacturer": "Sandisk",
"oem_id": "5344", "oem_id": "5344",
"product_name": "SS08G", "product_name": "SU32G",
"product_revision": "8.0", "product_revision": "8.0",
"serial_number": "00112233", "serial_number": "46ba46",
"manufacturer_date": "9/2017", "manufacturer_date": "4/2018",
"capacity": "7.4 GiB", "capacity": "29.7 GiB",
"total_bytes": 7948206080 "total_bytes": 31914983424
}, },
"distribution": { "distribution": {
"name": "Raspbian GNU/Linux 10 (buster)", "name": "Raspbian GNU/Linux 10 (buster)",
@ -866,6 +865,25 @@ Returns: Information about the host system in the following format:
}, },
"like": "debian", "like": "debian",
"codename": "buster" "codename": "buster"
},
"available_services": [
"klipper",
"klipper_mcu",
"moonraker"
],
"service_state": {
"klipper": {
"active_state": "active",
"sub_state": "running"
},
"klipper_mcu": {
"active_state": "active",
"sub_state": "running"
},
"moonraker": {
"active_state": "active",
"sub_state": "running"
}
} }
} }
} }
@ -3349,6 +3367,27 @@ sent when an existing user is deleted.
} }
``` ```
#### Service State Changed
Moonraker monitors the state of systemd services it is authorized to track.
When the state of a service changes the following notification is sent:
```json
{
"jsonrpc": "2.0",
"method": "notify_service_state_changed",
"params": [
{
"klipper": {
"active_state": "inactive",
"sub_state": "dead"
}
}
]
}
```
The example above shows that the `klipper` service has changed to `inactive`.
### Appendix ### Appendix
#### Websocket setup #### Websocket setup