Deploying to gh-pages from @ Klipper3d/klipper@55d1c3728d 🚀

This commit is contained in:
KevinOConnor committed 2022-06-16 22:39:53 +00:00
1 parent 15d55e15fc
commit 9f6e4bed3e
12 files changed
+14 -7

No files matched your search

+9 -2
View File
@@ -7280,6 +7280,12 @@ SPI bus.</p>
<h3 id="common-i2c-settings">Common I2C settings<a class="headerlink" href="#common-i2c-settings" title="Permanent link">&para;</a></h3>
<p>The following parameters are generally available for devices using an
I2C bus.</p>
<p>Note that Klipper's current micro-controller support for i2c is
generally not tolerant to line noise. Unexpected errors on the i2c
wires may result in Klipper raising a run-time error. Klipper's
support for error recovery varies between each micro-controller type.
It is generally recommended to only use i2c devices that are on the
same printed circuit board as the micro-controller.</p>
<div class="highlight"><pre><span></span><code>#i2c_address:
# The i2c address of the device. This must specified as a decimal
# number (not in hex). The default depends on the type of device.
@@ -7292,8 +7298,9 @@ I2C bus.</p>
# the type of micro-controller.
#i2c_speed:
# The I2C speed (in Hz) to use when communicating with the device.
# On some micro-controllers changing this value has no effect. The
# default is 100000.
# The Klipper implementation on most micro-controllers is hard-coded
# to 100000 and changing this value has no effect. The default is
# 100000.
</code></pre></div>
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"Klipper is a 3d-Printer firmware. It combines the power of a general purpose computer with one or more micro-controllers. See the features document for more information on why you should use Klipper. To begin using Klipper start by installing it. Klipper is Free Software. Read the documentation or view the Klipper code on github .","title":"Welcome"},{"location":"API_Server.html","text":"API server \u00b6 This document describes Klipper's Application Programmer Interface (API). This interface enables external applications to query and control the Klipper host software. Enabling the API socket \u00b6 In order to use the API server, the klippy.py host software must be started with the -a parameter. For example: ~/klippy-env/bin/python ~/klipper/klippy/klippy.py ~/printer.cfg -a /tmp/klippy_uds -l /tmp/klippy.log This causes the host software to create a Unix Domain Socket. A client can then open a connection on that socket and send commands to Klipper. See the Moonraker project for a popular tool that can forward HTTP requests to Klipper's API Server Unix Domain Socket. Request format \u00b6 Messages sent and received on the socket are JSON encoded strings terminated by an ASCII 0x03 character: <json_object_1><0x03><json_object_2><0x03>... Klipper contains a scripts/whconsole.py tool that can perform the above message framing. For example: ~/klipper/scripts/whconsole.py /tmp/klippy_uds This tool can read a series of JSON commands from stdin, send them to Klipper, and report the results. The tool expects each JSON command to be on a single line, and it will automatically append the 0x03 terminator when transmitting a request. (The Klipper API server does not have a newline requirement.) API Protocol \u00b6 The command protocol used on the communication socket is inspired by json-rpc . A request might look like: {\"id\": 123, \"method\": \"info\", \"params\": {}} and a response might look like: {\"id\": 123, \"result\": {\"state_message\": \"Printer is ready\", \"klipper_path\": \"/home/pi/klipper\", \"config_file\": \"/home/pi/printer.cfg\", \"software_version\": \"v0.8.0-823-g883b1cb6\", \"hostname\": \"octopi\", \"cpu_info\": \"4 core ARMv7 Processor rev 4 (v7l)\", \"state\": \"ready\", \"python_path\": \"/home/pi/klippy-env/bin/python\", \"log_file\": \"/tmp/klippy.log\"}} Each request must be a JSON dictionary. (This document uses the Python term \"dictionary\" to describe a \"JSON object\" - a mapping of key/value pairs contained within {} .) The request dictionary must contain a \"method\" parameter that is the string name of an available Klipper \"endpoint\". The request dictionary may contain a \"params\" parameter which must be of a dictionary type. The \"params\" provide additional parameter information to the Klipper \"endpoint\" handling the request. Its content is specific to the \"endpoint\". The request dictionary may contain an \"id\" parameter which may be of any JSON type. If \"id\" is present then Klipper will respond to the request with a response message containing that \"id\". If \"id\" is omitted (or set to a JSON \"null\" value) then Klipper will not provide any response to the request. A response message is a JSON dictionary containing \"id\" and \"result\". The \"result\" is always a dictionary - its contents are specific to the \"endpoint\" handling the request. If the processing of a request results in an error, then the response message will contain an \"error\" field instead of a \"result\" field. For example, the request: {\"id\": 123, \"method\": \"gcode/script\", \"params\": {\"script\": \"G1 X200\"}} might result in an error response such as: {\"id\": 123, \"error\": {\"message\": \"Must home axis first: 200.000 0.000 0.000 [0.000]\", \"error\": \"WebRequestError\"}} Klipper will always start processing requests in the order that they are received. However, some request may not complete immediately, which could cause the associated response to be sent out of order with respect to responses from other requests. A JSON request will never pause the processing of future JSON requests. Subscriptions \u00b6 Some Klipper \"endpoint\" requests allow one to \"subscribe\" to future asynchronous update messages. For example: {\"id\": 123, \"method\": \"gcode/subscribe_output\", \"params\": {\"response_template\":{\"key\": 345}}} may initially respond with: {\"id\": 123, \"result\": {}} and cause Klipper to send future messages similar to: {\"params\": {\"response\": \"ok B:22.8 /0.0 T0:22.4 /0.0\"}, \"key\": 345} A subscription request accepts a \"response_template\" dictionary in the \"params\" field of the request. That \"response_template\" dictionary is used as a template for future asynchronous messages - it may contain arbitrary key/value pairs. When sending these future asynchronous messages, Klipper will add a \"params\" field Line truncated
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"Klipper is a 3d-Printer firmware. It combines the power of a general purpose computer with one or more micro-controllers. See the features document for more information on why you should use Klipper. To begin using Klipper start by installing it. Klipper is Free Software. Read the documentation or view the Klipper code on github .","title":"Welcome"},{"location":"API_Server.html","text":"API server \u00b6 This document describes Klipper's Application Programmer Interface (API). This interface enables external applications to query and control the Klipper host software. Enabling the API socket \u00b6 In order to use the API server, the klippy.py host software must be started with the -a parameter. For example: ~/klippy-env/bin/python ~/klipper/klippy/klippy.py ~/printer.cfg -a /tmp/klippy_uds -l /tmp/klippy.log This causes the host software to create a Unix Domain Socket. A client can then open a connection on that socket and send commands to Klipper. See the Moonraker project for a popular tool that can forward HTTP requests to Klipper's API Server Unix Domain Socket. Request format \u00b6 Messages sent and received on the socket are JSON encoded strings terminated by an ASCII 0x03 character: <json_object_1><0x03><json_object_2><0x03>... Klipper contains a scripts/whconsole.py tool that can perform the above message framing. For example: ~/klipper/scripts/whconsole.py /tmp/klippy_uds This tool can read a series of JSON commands from stdin, send them to Klipper, and report the results. The tool expects each JSON command to be on a single line, and it will automatically append the 0x03 terminator when transmitting a request. (The Klipper API server does not have a newline requirement.) API Protocol \u00b6 The command protocol used on the communication socket is inspired by json-rpc . A request might look like: {\"id\": 123, \"method\": \"info\", \"params\": {}} and a response might look like: {\"id\": 123, \"result\": {\"state_message\": \"Printer is ready\", \"klipper_path\": \"/home/pi/klipper\", \"config_file\": \"/home/pi/printer.cfg\", \"software_version\": \"v0.8.0-823-g883b1cb6\", \"hostname\": \"octopi\", \"cpu_info\": \"4 core ARMv7 Processor rev 4 (v7l)\", \"state\": \"ready\", \"python_path\": \"/home/pi/klippy-env/bin/python\", \"log_file\": \"/tmp/klippy.log\"}} Each request must be a JSON dictionary. (This document uses the Python term \"dictionary\" to describe a \"JSON object\" - a mapping of key/value pairs contained within {} .) The request dictionary must contain a \"method\" parameter that is the string name of an available Klipper \"endpoint\". The request dictionary may contain a \"params\" parameter which must be of a dictionary type. The \"params\" provide additional parameter information to the Klipper \"endpoint\" handling the request. Its content is specific to the \"endpoint\". The request dictionary may contain an \"id\" parameter which may be of any JSON type. If \"id\" is present then Klipper will respond to the request with a response message containing that \"id\". If \"id\" is omitted (or set to a JSON \"null\" value) then Klipper will not provide any response to the request. A response message is a JSON dictionary containing \"id\" and \"result\". The \"result\" is always a dictionary - its contents are specific to the \"endpoint\" handling the request. If the processing of a request results in an error, then the response message will contain an \"error\" field instead of a \"result\" field. For example, the request: {\"id\": 123, \"method\": \"gcode/script\", \"params\": {\"script\": \"G1 X200\"}} might result in an error response such as: {\"id\": 123, \"error\": {\"message\": \"Must home axis first: 200.000 0.000 0.000 [0.000]\", \"error\": \"WebRequestError\"}} Klipper will always start processing requests in the order that they are received. However, some request may not complete immediately, which could cause the associated response to be sent out of order with respect to responses from other requests. A JSON request will never pause the processing of future JSON requests. Subscriptions \u00b6 Some Klipper \"endpoint\" requests allow one to \"subscribe\" to future asynchronous update messages. For example: {\"id\": 123, \"method\": \"gcode/subscribe_output\", \"params\": {\"response_template\":{\"key\": 345}}} may initially respond with: {\"id\": 123, \"result\": {}} and cause Klipper to send future messages similar to: {\"params\": {\"response\": \"ok B:22.8 /0.0 T0:22.4 /0.0\"}, \"key\": 345} A subscription request accepts a \"response_template\" dictionary in the \"params\" field of the request. That \"response_template\" dictionary is used as a template for future asynchronous messages - it may contain arbitrary key/value pairs. When sending these future asynchronous messages, Klipper will add a \"params\" field Line truncated
BIN
View File
Binary file not shown.
Binary file not shown.
+3 -3
View File
@@ -1336,7 +1336,7 @@
<p>最好是在Z轴与加热床面之间使用Z限位开关(远离床面的限位开关更加稳定安全,因为这样的话,Z轴的原点通常是安全的)。然而,如果必须向加热床归位,建议调整限位开关,使其在加热床床面上方一小段距离(例如0.5毫米)触发。几乎所有的限位开关都可以在触发点以外的一小段距离安全地压下。当这样做时,你会发现<code>Z_ENDSTOP_CALIBRATE</code>命令输出一个小的正值(比如0.5毫米)的Z限位位置。</p>
<p>某些打印机能够手动调整限位开关的物理位置,但是建议使用 Klipper 在软件中执行 Z 限位定位-在将限位的物理位置固定于方便微调的位置,就可以通过运行 Z_ENDSTOP_CALIBRATE 或通过手动更新配置文件中的 Z position_endstop 来进行进一步的调整。</p>
<h2 id="_2">调整打印调平螺丝<a class="headerlink" href="#_2" title="Permanent link">&para;</a></h2>
<p>The secret to getting good bed leveling with bed leveling screws is to utilize the printer's high precision motion system during the bed leveling process itself. This is done by commanding the nozzle to a position near each bed screw and then adjusting that screw until the bed is a set distance from the nozzle. Klipper has a tool to assist with this. In order to use the tool it is necessary to specify each screw XY location.</p>
<p>使用打印床调平螺丝获得平整打印床的秘诀是在床身调平过程中利用打印机高精度的运动系统,通过将喷嘴命令到每个调平螺丝附近的位置,然后调整该螺丝直到床与喷嘴保持固定的距离。Klipper 的一个内置工具可以协助解决这个问题。为了使用该工具,必须指定每个螺丝的XY坐标。</p>
<p>这是通过创建一个<code>[bed_screws]</code>配置部分来实现的。例如,它可能看起来类似于以下内容:</p>
<div class="highlight"><pre><span></span><code>[bed_screws]
screw1: 100, 50
@@ -1356,8 +1356,8 @@ screw3: 150, 100
<p>如果打印机使用三个热床调平螺丝,并且所有三个调平螺丝都在热床下面,那么就有可能执行第二个"高精度"热床调平步骤。这是通过命令喷头到热床当在每次调整床身时移动较大距离的位置来实现的。</p>
<p>例如,考虑一张在A B C位置有螺丝的打印平台:</p>
<p><img alt="bed_screws" src="img/bed_screws.svg.png" /></p>
<p>For each adjustment made to the bed screw at location C, the bed will swing along a pendulum defined by the remaining two bed screws (shown here as a green line). In this situation, each adjustment to the bed screw at C will move the bed at position D a further amount than directly at C. It is thus possible to make an improved C screw adjustment when the nozzle is at position D.</p>
<p>To enable this feature, one would determine the additional nozzle coordinates and add them to the config file. For example, it might look like:</p>
<p>在位于C位置的螺丝每次调整间,打印床/打印头将沿着由其余两个螺丝定义的坐标摆锤摆动(此处显示为绿线)。在这种情况下,每次调整C处的床螺钉都会使打印床在位置D处移动比在C处移动更多的量。因此,可以通过将喷嘴置于D位置进行对C位置螺丝的精确调整。</p>
<p>要启用此功能,需要定义额外的喷嘴坐标并将其添加到配置文件中。例如:</p>
<div class="highlight"><pre><span></span><code>[bed_screws]
screw1: 100, 50
screw1_fine_adjust: 0, 0
+1 -1
View File
@@ -1 +1 @@
{"config":{"indexing":"full","lang":["ja"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"Klipper\u662f3D\u6253\u5370\u673a\u56fa\u4ef6\u3002\u5b83\u5c06\u901a\u7528\u8ba1\u7b97\u673a\u7684\u8fd0\u7b97\u80fd\u529b\u4e0e\u4e00\u4e2a\u6216\u591a\u4e2a\u5fae\u63a7\u5236\u5668\u76f8\u7ed3\u5408\u3002\u6709\u5173Klipper\u7684\u4f18\u52bf\uff0c\u8bf7\u53c2\u9605 \u529f\u80fd \u6587\u6863\u3002 \u8981\u5f00\u59cb\u4f7f\u7528 Klipper\uff0c\u8bf7\u4ece \u5b89\u88c5\u6587\u6863 \u5f00\u59cb\u3002 Klipper\u662f\u81ea\u7531\u8f6f\u4ef6\u3002\u9605\u8bfb \u6587\u6863 \u6216\u67e5\u770b GitHub\u4e0a\u7684Klipper\u4ee3\u7801 \u3002","title":"\u6b22\u8fce"},{"location":"API_Server.html","text":"API \u670d\u52a1\u5668 \u00b6 \u8be5\u6587\u6863\u4ecb\u7ecdKlipper\u7684\u5e94\u7528\u5f00\u53d1\u8005\u63a5\u53e3\uff08API\uff09\u529f\u80fd\u3002\u8be5\u63a5\u53e3\u5141\u8bb8\u5916\u90e8\u5e94\u7528\u7a0b\u5e8f\u8bbf\u95ee\u548c\u63a7\u5236Klipper\u4e3b\u673a\u3002 \u542f\u7528API\u5957\u63a5\u5b57 \u00b6 \u8981\u542f\u7528API\u670d\u52a1\u5668\uff0cklipper.py\u8fd0\u884c\u65f6\u5e94\u52a0\u4e0a -a \u53c2\u6570\u3002\u4f8b\u5982\uff1a ~/klippy-env/bin/python ~/klipper/klippy/klippy.py ~/printer.cfg -a /tmp/klippy_uds -l /tmp/klippy.log \u4e0a\u8ff0\u64cd\u4f5c\u4f1a\u4f7f\u4e3b\u673a\u521b\u5efa\u4e00\u4e2aUnix\u672c\u5730\u5957\u63a5\u5b57\u3002\u4e4b\u540e\uff0c\u5ba2\u6237\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u5957\u63a5\u5b57\u94fe\u63a5\uff0c\u4ece\u800c\u7ed9Klipper\u53d1\u9001\u547d\u4ee4\u3002 See the Moonraker project for a popular tool that can forward HTTP requests to Klipper's API Server Unix Domain Socket. \u8bf7\u6c42\u683c\u5f0f \u00b6 \u5957\u63a5\u5b57\u8fdb\u51fa\u7684\u6570\u636e\u5305\u5e94\u4f7f\u7528JSON\u7f16\u7801\u7684\u5b57\u7b26\u4e32\uff0c\u5e76\u4ee5ASCII\u5b57\u7b260x03\u4f5c\u4e3a\u7ed3\u5c3e\uff1a <json_object_1><0x03><json_object_2><0x03>... Klipper\u4f7f\u7528 scripts/whconsole.py \u7684\u4ee3\u7801\u8fdb\u884c\u4e0a\u8ff0\u7684\u6570\u636e\u5e27\u6253\u5305\u3002\u4f8b\u5982\uff1a ~/klipper/scripts/whconsole.py /tmp/klippy_uds \u8be5\u5de5\u5177\u4f1a\u4ecestdin\u4e2d\u8bfb\u53d6\u4e00\u7cfb\u5217\u7684JSON\u547d\u4ee4\uff0c\u53d1\u9001\u5230Klipper\u6267\u884c\uff0c\u5e76\u5c06\u7ed3\u679c\u9001\u51fa\u3002\u8be5\u5de5\u5177\u9ed8\u8ba4\u8f93\u5165\u7684\u6bcf\u6761Json\u547d\u4ee4\u4e2d\u4e0d\u5b58\u5728\u6362\u884c\uff0c\u5e76\u81ea\u52a8\u5730\u5728\u53d1\u9001\u547d\u4ee4\u65f6\u5728\u7ed3\u5c3e\u9644\u4e0a0x03\u3002\uff08Klipper API\u670d\u52a1\u5668\u6ca1\u6709\u6362\u884c\u7b26\u8981\u6c42\u3002\uff09 API\u534f\u8bae \u00b6 \u5957\u63a5\u5b57\u7684\u547d\u4ee4\u534f\u8bae\u53d7 json-rpc \u542f\u53d1\u3002 \u4e00\u4e2a\u8bf7\u6c42\u547d\u4ee4\u7c7b\u4f3c\uff1a {\"id\": 123, \"method\": \"info\", \"params\": {}} \u4e00\u4e2a\u56de\u5e94\u5e27\u7c7b\u4f3c\uff1a {\"id\": 123, \"result\": {\"state_message\": \"Printer is ready\", \"klipper_path\": \"/home/pi/klipper\", \"config_file\": \"/home/pi/printer.cfg\", \"software_version\": \"v0.8.0-823-g883b1cb6\", \"hostname\": \"octopi\", \"cpu_info\": \"4 core ARMv7 Processor rev 4 (v7l)\", \"state\": \"ready\", \"python_path\": \"/home/pi/klippy-env/bin/python\", \"log_file\": \"/tmp/klippy.log\"}} \u6bcf\u4e2a\u8bf7\u6c42\u5e94\u4e3a\u4e00\u4e2aJSON\u5b57\u5178\u3002\uff08\u672c\u6587\u6863\u4f7f\u7528Python\u4e2d\u7684\u672f\u8bed\u201c\u5b57\u5178\u201d\u63cf\u8ff0\u4ee5 {} \u4e3a\u8fb9\u754c\u7684\u201c\u952e-\u503c\u201dJSON\u5bf9\u8c61\u3002\uff09 \u8bf7\u6c42\u5b57\u5178\u4e2d\u5fc5\u987b\u5305\u542b\u4e00\u4e2a\u201dmethod\u201d\u5b57\u6bb5\uff0c\u5176\u503c\u5e94\u5305\u542b\u4e00\u4e2a\u53ef\u7528\u7684Klipper\u7aef\u70b9\u201dendpoint\u201d\u540d\u79f0\u5b57\u7b26\u4e32\u3002 \u8bf7\u6c42\u5b57\u5178\u53ef\u80fd\u5305\u542b\u201dparams\u201d\u53c2\u6570\uff0c\u5e76\u5176\u503c\u5e94\u4e3a\u4e00\u4e2a\u5b57\u5178\u7c7b\u578b\u3002\u201dparams\u201d\u63d0\u4f9bKlipper\u201dendpoint\u201d\u5904\u7406\u8bf7\u6c42\u6240\u9700\u7684\u989d\u5916\u6570\u636e\uff0c\u5176\u5185\u5bb9\u4f9d\u201dendpoint\u201d\u800c\u5b9a\u3002 \u8bf7\u6c42\u7684\u5b57\u5178\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u53ef\u4ee5\u662f\u4efb\u4f55 JSON\u7c7b\u578b\u7684\"id\"\u53c2\u6570\u3002\u5982\u679c\"id\"\u5b58\u5728\uff0c\u90a3\u4e48 Klipper \u5c06\u7528\u4e00\u4e2a\u5305\u542b\u8be5\"id\"\u7684\u54cd\u5e94\u4fe1\u606f\u6765\u56de\u5e94\u8bf7\u6c42\u3002\u5982\u679c\"id\"\u88ab\u7701\u7565\uff08\u6216\u8bbe\u7f6e\u4e3a JSON \u7684 \"null\" \u503c\uff09\uff0c\u90a3\u4e48 Klipper \u5c06\u4e0d\u4f1a\u5bf9\u8be5\u8bf7\u6c42\u8fdb\u884c\u4efb\u4f55\u54cd\u5e94\u3002\u54cd\u5e94\u4fe1\u606f\u662f\u4e00\u4e2a \u5305\u542b \"id\" \u548c \"result\"\u7684 JSON \u5b57\u5178\u3002\"result\"\u603b\u662f\u4e00\u4e2a\u5b57\u5178--\u5b83\u7684\u5185\u5bb9\u662f\u7279\u5b9a\u4e8e\u5904\u7406\u8bf7\u6c42\u7684\"endstop\"\u3002 \u5982\u679c\u5904\u7406\u7684\u8bf7\u6c42\u9020\u6210\u4e86\u9519\Line truncated
{"config":{"indexing":"full","lang":["ja"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"Klipper\u662f3D\u6253\u5370\u673a\u56fa\u4ef6\u3002\u5b83\u5c06\u901a\u7528\u8ba1\u7b97\u673a\u7684\u8fd0\u7b97\u80fd\u529b\u4e0e\u4e00\u4e2a\u6216\u591a\u4e2a\u5fae\u63a7\u5236\u5668\u76f8\u7ed3\u5408\u3002\u6709\u5173Klipper\u7684\u4f18\u52bf\uff0c\u8bf7\u53c2\u9605 \u529f\u80fd \u6587\u6863\u3002 \u8981\u5f00\u59cb\u4f7f\u7528 Klipper\uff0c\u8bf7\u4ece \u5b89\u88c5\u6587\u6863 \u5f00\u59cb\u3002 Klipper\u662f\u81ea\u7531\u8f6f\u4ef6\u3002\u9605\u8bfb \u6587\u6863 \u6216\u67e5\u770b GitHub\u4e0a\u7684Klipper\u4ee3\u7801 \u3002","title":"\u6b22\u8fce"},{"location":"API_Server.html","text":"API \u670d\u52a1\u5668 \u00b6 \u8be5\u6587\u6863\u4ecb\u7ecdKlipper\u7684\u5e94\u7528\u5f00\u53d1\u8005\u63a5\u53e3\uff08API\uff09\u529f\u80fd\u3002\u8be5\u63a5\u53e3\u5141\u8bb8\u5916\u90e8\u5e94\u7528\u7a0b\u5e8f\u8bbf\u95ee\u548c\u63a7\u5236Klipper\u4e3b\u673a\u3002 \u542f\u7528API\u5957\u63a5\u5b57 \u00b6 \u8981\u542f\u7528API\u670d\u52a1\u5668\uff0cklipper.py\u8fd0\u884c\u65f6\u5e94\u52a0\u4e0a -a \u53c2\u6570\u3002\u4f8b\u5982\uff1a ~/klippy-env/bin/python ~/klipper/klippy/klippy.py ~/printer.cfg -a /tmp/klippy_uds -l /tmp/klippy.log \u4e0a\u8ff0\u64cd\u4f5c\u4f1a\u4f7f\u4e3b\u673a\u521b\u5efa\u4e00\u4e2aUnix\u672c\u5730\u5957\u63a5\u5b57\u3002\u4e4b\u540e\uff0c\u5ba2\u6237\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u5957\u63a5\u5b57\u94fe\u63a5\uff0c\u4ece\u800c\u7ed9Klipper\u53d1\u9001\u547d\u4ee4\u3002 See the Moonraker project for a popular tool that can forward HTTP requests to Klipper's API Server Unix Domain Socket. \u8bf7\u6c42\u683c\u5f0f \u00b6 \u5957\u63a5\u5b57\u8fdb\u51fa\u7684\u6570\u636e\u5305\u5e94\u4f7f\u7528JSON\u7f16\u7801\u7684\u5b57\u7b26\u4e32\uff0c\u5e76\u4ee5ASCII\u5b57\u7b260x03\u4f5c\u4e3a\u7ed3\u5c3e\uff1a <json_object_1><0x03><json_object_2><0x03>... Klipper\u4f7f\u7528 scripts/whconsole.py \u7684\u4ee3\u7801\u8fdb\u884c\u4e0a\u8ff0\u7684\u6570\u636e\u5e27\u6253\u5305\u3002\u4f8b\u5982\uff1a ~/klipper/scripts/whconsole.py /tmp/klippy_uds \u8be5\u5de5\u5177\u4f1a\u4ecestdin\u4e2d\u8bfb\u53d6\u4e00\u7cfb\u5217\u7684JSON\u547d\u4ee4\uff0c\u53d1\u9001\u5230Klipper\u6267\u884c\uff0c\u5e76\u5c06\u7ed3\u679c\u9001\u51fa\u3002\u8be5\u5de5\u5177\u9ed8\u8ba4\u8f93\u5165\u7684\u6bcf\u6761Json\u547d\u4ee4\u4e2d\u4e0d\u5b58\u5728\u6362\u884c\uff0c\u5e76\u81ea\u52a8\u5730\u5728\u53d1\u9001\u547d\u4ee4\u65f6\u5728\u7ed3\u5c3e\u9644\u4e0a0x03\u3002\uff08Klipper API\u670d\u52a1\u5668\u6ca1\u6709\u6362\u884c\u7b26\u8981\u6c42\u3002\uff09 API\u534f\u8bae \u00b6 \u5957\u63a5\u5b57\u7684\u547d\u4ee4\u534f\u8bae\u53d7 json-rpc \u542f\u53d1\u3002 \u4e00\u4e2a\u8bf7\u6c42\u547d\u4ee4\u7c7b\u4f3c\uff1a {\"id\": 123, \"method\": \"info\", \"params\": {}} \u4e00\u4e2a\u56de\u5e94\u5e27\u7c7b\u4f3c\uff1a {\"id\": 123, \"result\": {\"state_message\": \"Printer is ready\", \"klipper_path\": \"/home/pi/klipper\", \"config_file\": \"/home/pi/printer.cfg\", \"software_version\": \"v0.8.0-823-g883b1cb6\", \"hostname\": \"octopi\", \"cpu_info\": \"4 core ARMv7 Processor rev 4 (v7l)\", \"state\": \"ready\", \"python_path\": \"/home/pi/klippy-env/bin/python\", \"log_file\": \"/tmp/klippy.log\"}} \u6bcf\u4e2a\u8bf7\u6c42\u5e94\u4e3a\u4e00\u4e2aJSON\u5b57\u5178\u3002\uff08\u672c\u6587\u6863\u4f7f\u7528Python\u4e2d\u7684\u672f\u8bed\u201c\u5b57\u5178\u201d\u63cf\u8ff0\u4ee5 {} \u4e3a\u8fb9\u754c\u7684\u201c\u952e-\u503c\u201dJSON\u5bf9\u8c61\u3002\uff09 \u8bf7\u6c42\u5b57\u5178\u4e2d\u5fc5\u987b\u5305\u542b\u4e00\u4e2a\u201dmethod\u201d\u5b57\u6bb5\uff0c\u5176\u503c\u5e94\u5305\u542b\u4e00\u4e2a\u53ef\u7528\u7684Klipper\u7aef\u70b9\u201dendpoint\u201d\u540d\u79f0\u5b57\u7b26\u4e32\u3002 \u8bf7\u6c42\u5b57\u5178\u53ef\u80fd\u5305\u542b\u201dparams\u201d\u53c2\u6570\uff0c\u5e76\u5176\u503c\u5e94\u4e3a\u4e00\u4e2a\u5b57\u5178\u7c7b\u578b\u3002\u201dparams\u201d\u63d0\u4f9bKlipper\u201dendpoint\u201d\u5904\u7406\u8bf7\u6c42\u6240\u9700\u7684\u989d\u5916\u6570\u636e\uff0c\u5176\u5185\u5bb9\u4f9d\u201dendpoint\u201d\u800c\u5b9a\u3002 \u8bf7\u6c42\u7684\u5b57\u5178\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u53ef\u4ee5\u662f\u4efb\u4f55 JSON\u7c7b\u578b\u7684\"id\"\u53c2\u6570\u3002\u5982\u679c\"id\"\u5b58\u5728\uff0c\u90a3\u4e48 Klipper \u5c06\u7528\u4e00\u4e2a\u5305\u542b\u8be5\"id\"\u7684\u54cd\u5e94\u4fe1\u606f\u6765\u56de\u5e94\u8bf7\u6c42\u3002\u5982\u679c\"id\"\u88ab\u7701\u7565\uff08\u6216\u8bbe\u7f6e\u4e3a JSON \u7684 \"null\" \u503c\uff09\uff0c\u90a3\u4e48 Klipper \u5c06\u4e0d\u4f1a\u5bf9\u8be5\u8bf7\u6c42\u8fdb\u884c\u4efb\u4f55\u54cd\u5e94\u3002\u54cd\u5e94\u4fe1\u606f\u662f\u4e00\u4e2a \u5305\u542b \"id\" \u548c \"result\"\u7684 JSON \u5b57\u5178\u3002\"result\"\u603b\u662f\u4e00\u4e2a\u5b57\u5178--\u5b83\u7684\u5185\u5bb9\u662f\u7279\u5b9a\u4e8e\u5904\u7406\u8bf7\u6c42\u7684\"endstop\"\u3002 \u5982\u679c\u5904\u7406\u7684\u8bf7\u6c42\u9020\u6210\u4e86\u9519\Line truncated
BIN
View File
Binary file not shown.