Deploying to gh-pages from @ Klipper3d/klipper@5a409d5d31 🚀

This commit is contained in:
KevinOConnor committed 2022-04-07 16:31:41 +00:00
1 parent e142268cbe
commit f949f3208e
12 files changed
+38 -33

No files matched your search

+2
View File
@@ -1248,6 +1248,8 @@ are not backwards compatible. It is a good idea to review this
document when upgrading the Klipper software.</p>
<p>All dates in this document are approximate.</p>
<h2 id="changes">Changes<a class="headerlink" href="#changes" title="Permanent link">&para;</a></h2>
<p>20220407: The temperature_fan <code>pid_integral_max</code> config option has
been removed (it was deprecated on 20210612).</p>
<p>20220407: The default color order for pca9632 LEDs is now "RGBW". Add
an explicit <code>color_order: RBGW</code> setting to the pca9632 config section
to obtain the previous behavior.</p>
+9 -6
View File
@@ -4115,14 +4115,17 @@ control:
# Control algorithm (either pid or watermark). This parameter must
# be provided.
pid_Kp:
# Kp is the &quot;proportional&quot; constant for the pid. This parameter must
# be provided for PID heaters.
pid_Ki:
# Ki is the &quot;integral&quot; constant for the pid. This parameter must be
# provided for PID heaters.
pid_Kd:
# Kd is the &quot;derivative&quot; constant for the pid. This parameter must
# be provided for PID heaters.
# The proportional (pid_Kp), integral (pid_Ki), and derivative
# (pid_Kd) settings for the PID feedback control system. Klipper
# evaluates the PID settings with the following general formula:
# heater_pwm = (Kp*error + Ki*integral(error) - Kd*derivative(error)) / 255
# Where &quot;error&quot; is &quot;requested_temperature - measured_temperature&quot;
# and &quot;heater_pwm&quot; is the requested heating rate with 0.0 being full
# off and 1.0 being full on. Consider using the PID_CALIBRATE
# command to obtain these parameters. The pid_Kp, pid_Ki, and pid_Kd
# parameters must be provided for PID heaters.
#max_delta: 2.0
# On &#39;watermark&#39; controlled heaters this is the number of degrees in
# Celsius above the target temperature before disabling the heater
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. 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 containing a dictionary with \"endpoint\" specific contents to the response template and then send that template. If a \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. 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 containing a dictionary with \"endpoint\" specific contents to the response template and then send that template. If a \Line truncated
BIN
View File
Binary file not shown.
Binary file not shown.
+4 -4
View File
@@ -1146,7 +1146,7 @@
<li class="md-nav__item">
<a href="#_1" class="md-nav__link">
设备硬件
硬件设备
</a>
</li>
@@ -1250,7 +1250,7 @@
<li class="md-nav__item">
<a href="#_1" class="md-nav__link">
设备硬件
硬件设备
</a>
</li>
@@ -1302,8 +1302,8 @@
<h1 id="can">CAN 总线<a class="headerlink" href="#can" title="Permanent link">&para;</a></h1>
<p>本文档描述了 Klipper 的 CAN 总线支持。</p>
<h2 id="_1">设备硬件<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h2>
<p>Klipper目前只支持 stm32 芯片的CAN。此外,微控制器芯片必须支持 CAN,而且你使用的主板必须有 CAN 收发器。</p>
<h2 id="_1">硬件设备<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h2>
<p>Klipper目前只支持 stm32 芯片的CAN。此外,微控制器芯片必须支持 CAN并且你使用的主板必须有 CAN 收发器。</p>
<p>要针对 CAN 进行编译,请运行 <code>make menuconfig</code>并选择"CAN Bus"作为通信接口。最后,编译微控制器代码并将其刷写到目标控制版上。</p>
<h2 id="_2">主机硬件<a class="headerlink" href="#_2" title="Permanent link">&para;</a></h2>
<p>为了使用 CAN 总线,主机需要一个适配器。目前有两种常见的选择:</p>
+21 -21
View File
@@ -950,15 +950,15 @@
<li class="md-nav__item">
<a href="#generating-steps" class="md-nav__link">
Generating steps
生成步数(Generating steps)
</a>
<nav class="md-nav" aria-label="Generating steps">
<nav class="md-nav" aria-label="生成步数(Generating steps)">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#cartesian-robots" class="md-nav__link">
Cartesian Robots
<a href="#_5" class="md-nav__link">
笛卡尔机器
</a>
</li>
@@ -971,8 +971,8 @@
</li>
<li class="md-nav__item">
<a href="#delta-robots" class="md-nav__link">
Delta Robots
<a href="#_6" class="md-nav__link">
三角洲机器
</a>
</li>
@@ -992,7 +992,7 @@
</li>
<li class="md-nav__item">
<a href="#_5" class="md-nav__link">
<a href="#_7" class="md-nav__link">
压力提前
</a>
@@ -1338,15 +1338,15 @@
<li class="md-nav__item">
<a href="#generating-steps" class="md-nav__link">
Generating steps
生成步数(Generating steps)
</a>
<nav class="md-nav" aria-label="Generating steps">
<nav class="md-nav" aria-label="生成步数(Generating steps)">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#cartesian-robots" class="md-nav__link">
Cartesian Robots
<a href="#_5" class="md-nav__link">
笛卡尔机器
</a>
</li>
@@ -1359,8 +1359,8 @@
</li>
<li class="md-nav__item">
<a href="#delta-robots" class="md-nav__link">
Delta Robots
<a href="#_6" class="md-nav__link">
三角洲机器
</a>
</li>
@@ -1380,7 +1380,7 @@
</li>
<li class="md-nav__item">
<a href="#_5" class="md-nav__link">
<a href="#_7" class="md-nav__link">
压力提前
</a>
@@ -1443,24 +1443,24 @@
<p>在上述情况下,从加速到减速的频繁变化会导致机器振动并且会对机器造成压力和加噪音。为了减少这种情况,Klipper既跟踪常规的移动加速度并且也跟踪虚拟的"加减速率"。利用这个系统,这些短的"zigzag"移动的最高速度被限制以使得打印机的运动可以更加平滑:</p>
<p><img alt="smoothed" src="img/smoothed.svg.png" /></p>
<p>Specifically, the code calculates what the velocity of each move would be if it were limited to this virtual "acceleration to deceleration" rate (half the normal acceleration rate by default). In the above picture the dashed gray lines represent this virtual acceleration rate for the first move. If a move can not reach its full cruising speed using this virtual acceleration rate then its top speed is reduced to the maximum speed it could obtain at this virtual acceleration rate. For most moves the limit will be at or above the move's existing limits and no change in behavior is induced. For short zigzag moves, however, this limit reduces the top speed. Note that it does not change the actual acceleration within the move - the move continues to use the normal acceleration scheme up to its adjusted top-speed.</p>
<h2 id="generating-steps">Generating steps<a class="headerlink" href="#generating-steps" title="Permanent link">&para;</a></h2>
<h2 id="generating-steps">生成步数(Generating steps)<a class="headerlink" href="#generating-steps" title="Permanent link">&para;</a></h2>
<p>Once the look-ahead process completes, the print head movement for the given move is fully known (time, start position, end position, velocity at each point) and it is possible to generate the step times for the move. This process is done within "kinematic classes" in the Klipper code. Outside of these kinematic classes, everything is tracked in millimeters, seconds, and in cartesian coordinate space. It's the task of the kinematic classes to convert from this generic coordinate system to the hardware specifics of the particular printer.</p>
<p>Klipper uses an <a href="https://en.wikipedia.org/wiki/Root-finding_algorithm">iterative solver</a> to generate the step times for each stepper. The code contains the formulas to calculate the ideal cartesian coordinates of the head at each moment in time, and it has the kinematic formulas to calculate the ideal stepper positions based on those cartesian coordinates. With these formulas, Klipper can determine the ideal time that the stepper should be at each step position. The given steps are then scheduled at these calculated times.</p>
<p>The key formula to determine how far a move should travel under constant acceleration is:</p>
<div class="highlight"><pre><span></span><code>move_distance = (start_velocity + .5 * accel * move_time) * move_time
</code></pre></div>
<p>and the key formula for movement with constant velocity is:</p>
<p>并且匀速运动的关键公式是:</p>
<div class="highlight"><pre><span></span><code>move_distance = cruise_velocity * move_time
</code></pre></div>
<p>The key formulas for determining the cartesian coordinate of a move given a move distance is:</p>
<p>在给定移动距离的情况下用于确定移动的笛卡尔坐标的关键公式为:</p>
<div class="highlight"><pre><span></span><code>cartesian_x_position = start_x + move_distance * total_x_movement / total_movement
cartesian_y_position = start_y + move_distance * total_y_movement / total_movement
cartesian_z_position = start_z + move_distance * total_z_movement / total_movement
</code></pre></div>
<h3 id="cartesian-robots">Cartesian Robots<a class="headerlink" href="#cartesian-robots" title="Permanent link">&para;</a></h3>
<h3 id="_5">笛卡尔机器<a class="headerlink" href="#_5" title="Permanent link">&para;</a></h3>
<p>Generating steps for cartesian printers is the simplest case. The movement on each axis is directly related to the movement in cartesian space.</p>
<p>Key formulas:</p>
<div class="highlight"><pre><span></span><code>stepper_x_position = cartesian_x_position
@@ -1475,7 +1475,7 @@ stepper_b_position = cartesian_x_position - cartesian_y_position
stepper_z_position = cartesian_z_position
</code></pre></div>
<h3 id="delta-robots">Delta Robots<a class="headerlink" href="#delta-robots" title="Permanent link">&para;</a></h3>
<h3 id="_6">三角洲机器<a class="headerlink" href="#_6" title="Permanent link">&para;</a></h3>
<p>Step generation on a delta robot is based on Pythagoras's theorem:</p>
<div class="highlight"><pre><span></span><code>stepper_position = (sqrt(arm_length^2
@@ -1493,7 +1493,7 @@ stepper_z_position = cartesian_z_position
<div class="highlight"><pre><span></span><code>stepper_position = requested_e_position
</code></pre></div>
<h3 id="_5">压力提前<a class="headerlink" href="#_5" title="Permanent link">&para;</a></h3>
<h3 id="_7">压力提前<a class="headerlink" href="#_7" title="Permanent link">&para;</a></h3>
<p>Experimentation has shown that it's possible to improve the modeling of the extruder beyond the basic extruder formula. In the ideal case, as an extrusion move progresses, the same volume of filament should be deposited at each point along the move and there should be no volume extruded after the move. Unfortunately, it's common to find that the basic extrusion formulas cause too little filament to exit the extruder at the start of extrusion moves and for excess filament to extrude after extrusion ends. This is often referred to as "ooze".</p>
<p><img alt="ooze" src="img/ooze.svg.png" /></p>
<p>The "pressure advance" system attempts to account for this by using a different model for the extruder. Instead of naively believing that each mm^3 of filament fed into the extruder will result in that amount of mm^3 immediately exiting the extruder, it uses a model based on pressure. Pressure increases when filament is pushed into the extruder (as in <a href="https://en.wikipedia.org/wiki/Hooke%27s_law">Hooke's law</a>) and the pressure necessary to extrude is dominated by the flow rate through the nozzle orifice (as in <a href="https://en.wikipedia.org/wiki/Poiseuille_law">Poiseuille's law</a>). The key idea is that the relationship between filament, pressure, and flow rate can be modeled using a linear coefficient:</p>
@@ -1505,7 +1505,7 @@ stepper_z_position = cartesian_z_position
<p><img alt="pressure-advance" src="img/pressure-velocity.png" /></p>
<p>The above graph shows an example of two extrusion moves with a non-zero cornering velocity between them. Note that the pressure advance system causes additional filament to be pushed into the extruder during acceleration. The higher the desired filament flow rate, the more filament must be pushed in during acceleration to account for pressure. During head deceleration the extra filament is retracted (the extruder will have a negative velocity).</p>
<p>The "smoothing" is implemented using a weighted average of the extruder position over a small time period (as specified by the <code>pressure_advance_smooth_time</code> config parameter). This averaging can span multiple g-code moves. Note how the extruder motor will start moving prior to the nominal start of the first extrusion move and will continue to move after the nominal end of the last extrusion move.</p>
<p>Key formula for "smoothed pressure advance":</p>
<p>"平滑压力提前"的关键公式:</p>
<div class="highlight"><pre><span></span><code>smooth_pa_position(t) =
( definitive_integral(pa_position(x) * (smooth_time/2 - abs(t - x)) * dx,
from=t-smooth_time/2, to=t+smooth_time/2)
+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\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 \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\u8bef\uff0c\u5219\u54cd\u5e94\u6d88\u606f\u5c06\u5305\u542b\"error\"\u5b57\u6bb5\uff0c\u800c\u4e0d\u662f\"result\"\u5b57Line truncated
{"config":{"indexing":"full","lang":["en"],"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 \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\u8bef\uff0c\u5219\u54cd\u5e94\u6d88\u606f\u5c06\u5305\u542b\"error\"\u5b57\u6bb5\uff0c\u800c\u4e0d\u662f\"result\"\u5b57Line truncated
BIN
View File
Binary file not shown.