Files
OrcaSlicer-KX/resources/plugins
DeathKhan 1eaf3f71d5 fix(ElegooLink): pass printer SN to CC2 device panel URL (#13878)
* fix(ElegooLink): pass printer SN to CC2 device panel URL

The CC2 panel subscribes to MQTT topics keyed by the printer serial number.
Without sn= in the URL it uses a wrong hardcoded fallback SN, subscribes to
the wrong topics, and shows Offline permanently even though the printer is
reachable.

- Cache the SN in elegoo_cc2_test() (already fetches it, was discarding it)
- Look up cache in get_print_host_webui(); fall back to a short LAN HTTP
  call on first use before the test has run
- Append sn= to the panel URL
- Clear the wrong hardcoded fallback SN/IP from the panel bundle
- Add a small synchronous boot script to the panel that fetches the SN
  from the printer before the bundle reads URLSearchParams, as a fallback
  for unpatched binaries

* fix(ElegooLink): persist CC2 serial number in AppConfig dev_sn section

Store the printer SN under [dev_sn] keyed by normalized print_host after
a successful connection test or system/info fetch. Reuse it on later
sessions before hitting the network, matching how access_code is keyed by
dev_id for other LAN printers.

* fix(ElegooLink): answer get_sn IPC instantly from dev_sn cache

The CC2 panel always calls get_sn with a 10s timeout. Remove the HTTP
fallback from get_sn() and resolve IPC from dev_sn/memory only so Device
tab load is not blocked after sn= is already in the URL.

* fix(ElegooLink): skip get_sn IPC when URL already has sn

The CC2 device panel calls get_sn with a 10s timeout on every MQTT
connect even when Orca passes sn= in the query string. Use the URL
serial immediately and only fall back to IPC when it is missing.

* refactor(ElegooLink): resolve CC2 SN via PrintHost::get_sn in GUI

Drop the ElegooLink.hpp include from PrinterWebViewHandler; the webview
IPC handler uses the existing PrintHost virtual instead. Keep CC2 serial
lookup helpers file-local in ElegooLink.cpp and share them between
get_sn() and get_print_host_webui().

* chore: drop redundant <memory> include in PrinterWebViewHandler

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-05-28 19:45:03 +08:00
..