Skip to content

seho85/MoonrakerClientApiExamples

Repository files navigation

Moonraker Client API Access Examples

This example show how to use the Moonraker Client API per Python.

A complete description of the Moonraker Client API can be found here

The ClientAPI can be used in two different ways:

  • per HTTP Requests
  • per Websocket
    • Websocket uses JSON RPC

The posted examples using the websocket-client python library. This library has to be installed to use this examples.

read_http.py

This example shows how to use the MoonrakerAPI per HTTP requests

read_websocket_simple.py

This example show how to use the websocket in a simple way.

  1. Connect to Websocket
  2. Request Data
  3. Disconnect from Websocket

read_websocket_app.py

This example uses the more complex websocketapp from the websocket-client library.

  1. Connect to Websocket
  2. Request Data
  3. Stay connected
  4. Status Updates published from Moonraker are also shown in this example

read_websocket_app_subscribe.py

Show how to subscribe to printer objects. The subscribed objects were periodically send on the websocket from moonraker to the script.

Warning: Only values that have changed are transmitted.

read_websocket_app_query_and_subscribe.py

Query some printer objects and subsscribe afterwards and update global variables with data which was delivered periodically.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages