Fix: LAN-only printer unreachable when Studio stays on cloud MQTT#11557
Draft
ClusterM wants to merge 1 commit into
Draft
Fix: LAN-only printer unreachable when Studio stays on cloud MQTT#11557ClusterM wants to merge 1 commit into
ClusterM wants to merge 1 commit into
Conversation
…plied when printer is LAN only Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
BambulabRobot
requested review from
XinZhangBambu,
tonghao-bbl and
walterwongbbl
July 15, 2026 16:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: LAN-only printer unreachable when Studio stays on cloud MQTT
Summary
This happens when the printer is in LAN-only mode (real LAN-only: no
path to Bambu cloud MQTT) while the user is logged into a Bambu account.
Studio can still put the device on the cloud MQTT path; the printer cannot
answer there, so a usable connection cannot be established at all — Studio
waits for cloud replies that the printer can never send.
Even with a working local path (SSDP + access code) — and even though Studio
largely knows the printer is local — it still waits for replies on cloud
MQTT and effectively ignores the matching LAN replies for UI readiness.
Local MQTT delivers
get_version/push_status, but the UI never becomesready.
Symptom: replies are parsed in logs, but
is_info_ready()reportsfailed to check versionbecause it checks a differentMachineObjectwhose
module_versis still empty. Logging out of the account removes thecloud object and the problem disappears.
This PR prefers the LAN path whenever a direct LAN machine entry exists for
the same
dev_id, and routes selected-machine / MQTT handling through thatsame object so Studio no longer depends on cloud MQTT that a LAN-only printer
cannot reach.
Root cause
Studio keeps two maps of printers:
userMachineList— devices from the logged-in account (cloud)localMachineList— devices discovered on the LAN (SSDP), with access codeFor the same serial/
dev_id, both maps can hold separateMachineObjectinstances.
Previously:
get_my_machine_list()preferred the cloud entry when both existed, andonly added the LAN entry if the cloud key was absent.
get_selected_machine()always looked upuserMachineListfirst.set_on_local_message_fn) parsed intoget_my_machine()(often thelocal object after SSDP marked connection type as
lan).publish_json()also followedis_lan_mode_printer()on the objectused by the send dialog — so commands went out on local MQTT.
is_info_ready(), sidebar sync) usedget_selected_machine()—the cloud object — whose
module_vers/ push counters never updated.Timeline matching the bug logs:
When the printer is LAN-only (no Internet / no cloud MQTT), cloud state never
arrives, so the cloud object stays empty indefinitely. Logging out removes
userMachineList, so only the LAN object remains and everything works.Change
1. Prefer LAN in
get_my_machine_list()Build the list from
localMachineListfirst (LAN + access code + available).Only then add cloud entries from
userMachineList, and do not override anexisting LAN entry for the same
dev_id.2. Align
get_selected_machine()with that listReturn
get_my_machine(selected_machine)first so the selected printer is thesame
MachineObjectused for LAN publish/parse and for UI readiness checks.3. Ignore cloud MQTT while the device is on the LAN path
In
GUI_App::init_networking_callbacks()cloud message handler: ifget_my_machine(dev_id)is a LAN-mode printer, skip applying cloud payloads touserMachineList. Direct LAN connection owns device state.4. Match LAN UI updates by
dev_id, not pointer equalityLAN message handler previously required
get_selected_machine() == obj. Afterthe dual-object split that comparison failed even for the correct device.
Compare
sel->get_dev_id() == dev_idinstead.Files changed
src/slic3r/GUI/DeviceCore/DevManager.cpp— prefer LAN in machine list;get_selected_machine()uses the canonicalget_my_machine()object.src/slic3r/GUI/GUI_App.cpp— skip cloud MQTT for LAN-owned devices; fix LANsidebar update matching by
dev_id.Test plan
no Internet to Bambu MQTT) on the same LAN with a valid access code.
is_info_ready(). Confirm it becomes ready (no stuck "Reading…" /timeout) after
get_version+push_status.publish_jsonand matchingget_versionparse,and that
is_info_readyno longer reportsfailed to check versionimmediately after a successful parse.
path), confirm Device tab / send still update via cloud MQTT as before.
sync badges between devices.