When SD card support is disabled on the server, remove any client side
filtering to just SD files since there aren't any and there won't be UI
turn remove the filter either. Should address #1300
We don't want to wait indefinitely for our send and command queues to empty, so
we don't use .join but instead a busy timeout wait routine.
Also fixed a couple of small issues found while preparing comm unit tests.
Added parameter "wait" to "close" method, defaults to True. Will have the
close method wait for all lines to be sent that are currently in the send queue.
In case of an error, no waiting will be done.
Made it necessary to correctly track task completion in the send queue, also
made that change to the command queue while at it.
Backported from devel, commit 7f2476e513
"Error:" lines can also be produced by OctoPrint itself in case of serial exceptions or
connection failures, so "the firmware reported" was misleading.
That way no M105 cascades can be triggered by the M105 polling timer (or the M27
polling timer).
Adjusted logging output to make clear which queue rejected typed entry.
Made timeout handler send M105 with type "temperature" as well to make sure
we don't suddenly have two M105 directly after each other in the send_queue,
one from the polling timer, one from the timeout handler.
Fixes#1275
put and get are now overwritten to create t-tuple out of provided item
and item_type on put, and to only return item on get.
_put and _get extract item_type and use that for managing the
lookup set.
Running comm.py with parameters port, baudrate, local file, remote file will
upload local file to remote file on the printer's sd using the provided connection
parameters.
Example:
python -m octoprint.util.comm /dev/ttyUSB0 115200 /path/to/some.gcode test.gco
No plugin support! Only regular serial connection supported.
Had to reorder message processing a bit in order to be able to
properly handle further resends in timeout situations.
Has the added benefit that "ok" now gets processed very early
and now extra state based processing is needed anymore.
Should prevent slicing result to contain bed temperature settings even if
printer has a heated bed configured unless slicing profile also contains a
temperature.
Fixes#1268
Option to log last terminal lines before a resend (defaults to off for now),
more exception logging in octoprint.log in various error cases, also log
unsolvable resend requests with requested and current line number.
Also pushed more advanced config option into an initially hidden
"Advanced Options" section, similar to other places.
(cherry picked from commit 84b343a)
"Hello" command sent to printer to trigger initial handshake can now be
configured. Commands that _always_ necessitate to be sent with checksum/
line number (e.g. M110 on Marlin) can be configured as such too.
Also fixed an issue causing the "Hello" command to not be actually enqueued
first thing on opening a connection. Seems to not have caused harm in the
wild, but was unintentional.
(cherry picked from commit 5c2ae37)