Skip to content

Commit

Permalink
Increase upload timeout for Flashforge printers to 10 minutes (#8536)
Browse files Browse the repository at this point in the history
Co-authored-by: kbondar80 <[email protected]>
  • Loading branch information
kbondar80 and kbondar80 authored Feb 26, 2025
1 parent 71b40f9 commit afab94f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/slic3r/Utils/Flashforge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ bool Flashforge::upload(PrintHostUpload upload_data, ProgressFn progress_fn, Err
bool res = true;

Utils::TCPConsole client(m_host, m_console_port);
//sometimes FF AD5M is very slow in data upload, so timeout is increased to 10 minutes
client.set_write_timeout(std::chrono::minutes(10));
client.set_read_timeout(std::chrono::minutes(10));
client.enqueue_cmd(controlCommand);

client.enqueue_cmd(connect5MCommand);
Expand Down
8 changes: 8 additions & 0 deletions src/slic3r/Utils/TCPConsole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ class TCPConsole
m_read_timeout = std::chrono::milliseconds(10000);
}

void set_write_timeout(std::chrono::steady_clock::duration timeout) {
m_write_timeout = timeout;
}

void set_read_timeout(std::chrono::steady_clock::duration timeout) {
m_read_timeout = timeout;
}

void set_line_delimiter(const std::string& newline) {
m_newline = newline;
}
Expand Down

0 comments on commit afab94f

Please sign in to comment.