Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions firmware/src/backend_anycubic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ void AnycubicBackend::begin(const PrinterCfg& cfg) {
// like to the person holding it. Nothing here is worth more than a few
// seconds; a failed attempt is retried anyway.
mqtt_.setSocketTimeout(4);
// And the TCP connect, which neither of those bounds: the client waits
// thirty seconds for a host that does not answer - as long as the loop
// watchdog - so a printer switched off restarted the box.
net_.setTimeout(4);
net_.setHandshakeTimeout(5);
mqtt_.setCallback([this](char*, uint8_t* p, unsigned int l) { onMqtt(p, l); });
status_ = "Anycubic: connecting...";
Expand Down
6 changes: 6 additions & 0 deletions firmware/src/backend_bambu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ void BambuBackend::begin(const PrinterCfg& cfg) {
// like to the person holding it. Nothing here is worth more than a few
// seconds; a failed attempt is retried anyway.
mqtt_.setSocketTimeout(4);
// The TCP connect has its own limit, and it is not either of the two around
// it: WiFiClientSecure waits THIRTY seconds for a host that does not
// answer, which is exactly the loop watchdog. A printer that is switched
// off then froze the panel for half a minute and restarted the box, again
// and again, until somebody turned the printer on.
net_.setTimeout(4);
net_.setHandshakeTimeout(5);
mqtt_.setCallback([this](char*, uint8_t* p, unsigned int l) { onMqtt(p, l); });
lastTry_ = 0;
Expand Down
5 changes: 5 additions & 0 deletions firmware/src/bambu_cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ void open() {
// against, the same situation as a printer on the LAN; trust comes from
// the account session Tiger Studio obtained. See net/tls.h.
s_net->setInsecure();
// The TCP connect is bounded on its own: the client's default is thirty
// seconds, as long as the loop watchdog, and an internet link that has gone
// silent would take the whole box down with it. Longer than a LAN printer's
// four - this is a host across the internet.
s_net->setTimeout(8);
s_net->setHandshakeTimeout(5);
// A full report from a four-unit X1 is about 50 KB and has to fit whole.
// It lands in PSRAM - anything over 4 KB does on this build - so the size
Expand Down
Loading