33 Commits
Author SHA1 Message Date
Alexey Cluster 67e994bee3 Advanced debug logging for BambuSource
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-09-29 17:51:07 +02:00
Alexey Cluster 970633f92e Add handshake logging and byte description for improved debugging
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-09-29 10:53:26 +02:00
Alexey Cluster 77849e4d5b File transfer over TUTK
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-09-28 00:27:32 +02:00
Alexey Cluster 36fa964b9f Fixed storage browser
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-09-27 23:35:53 +02:00
Alexey Cluster 913ac68811 camera: don't use port 6000 when LAN liveview is off
prefer_rtsp treated an open CTRL port as a camera and handed Studio a
LAN URL with no RTSP hint, so BambuSource spoke MJPEG. A printer that
reports rtsp_url "disable" now falls through to TUTK instead.
2026-09-27 21:43:48 +02:00
Alexey Cluster 133aef5509 Test RTSP before connect (for TUTK fallback)
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-09-27 05:46:59 +02:00
Alexey Cluster 1f5995cb67 BambuSource: recover the serial by IP when device= is missing
Studio builds upload and part-skip tunnel URLs without device=, which
left LAN TLS verification without a serial and disabled the TUTK
fallback. Look the serial up in the local IP registry, then through a
new obn_get_lan_serial plugin export, and document the private exports.
2026-09-27 05:46:59 +02:00
Alexey Cluster c60f0e6254 camera/tutk: restructure into obn::camera::tutk
Move the TUTK client to src/camera/tutk (IotcClient, IotcProtocol,
TutkSession) and the camera source to src/camera/TutkCameraSource,
all under obn::camera. Split the DTLS-PSK handshake into small
functions with RAII-owned OpenSSL objects, share the record
additional-data builder between EtM and AEAD, drop reverse-engineering
leftovers from comments, and trim log noise.

TutkCameraSource hands frames over through a condition variable
instead of sleep-polling. The DirectShow filter now picks the media
subtype from the codec of the actual TUTK stream.
2026-09-27 05:46:59 +02:00
Alexey Cluster b5ba40be7f camera: prefer_rtsp option, TUTK only with slicer PoP, LAN CTRL for TUTK tunnels
get_camera_url returns the LAN URL right away when prefer_rtsp = 1 or
when TUTK is unreachable (block_cloud, no session, or no slicer key/cert:
/user/ttcode answers 403 unless both PoP headers are present).

BambuSource defers the TUTK connect until it knows whether the tunnel is
for video or for the file browser; CTRL switches to the printer's LAN
:6000 route via the new obn_get_lan_camera_url export.
2026-09-27 05:46:59 +02:00
persano b1dd3ab696 feat(camera): clean-room off-LAN liveview client (TUTK/Agora) (#100)
Squash of PR #100 onto master after #97. Conflicts in agent.cpp,
abi_camera.cpp, signing.cpp and research/10.03 resolved in favour of the
get_camera_url).

Closes #100
2026-09-27 05:46:59 +02:00
Alexey Cluster f5833d84c2 Fixed "skip parts" dialog while disable_camera_preview = 1
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-09-24 02:56:59 +02:00
Alexey Cluster 5ef86b200b Implement deadline-aware SSL read functions for RTSP client (#74)
* Implement deadline-aware SSL read functions for RTSP client

- Added `ssl_read_full_timeout` and `ssl_read_line_timeout` to handle timeouts during SSL reads, preventing indefinite blocking on read operations.
- Updated `read_response` in `rtsp_client.cpp` to utilize the new timeout functions, ensuring that responses are read within specified deadlines.
- Enhanced error handling for RTSP sessions to log errors when a stream dies mid-session.
- Introduced `SpsGeometry` struct and `parse_sps_geometry` function to decode display geometry from SPS NAL units, improving video stream handling.
- Updated `BambuSource` and `Passthrough` implementations to utilize the new geometry parsing for better video parameter management.

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-08-11 21:34:54 +02:00
Alexey Cluster be2a6db397 Added macOS BambuPlayer adapter and H.264 AVCC support (#72)
* Added macOS BambuPlayer adapter and H.264 AVCC support

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* macOS video fixes

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

---------

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-08-04 20:29:31 +02:00
Alexey Cluster 62b4d18485 Redirect lv-hinted video to RTSP(S) in libBambuSource
The LAN URL minted by get_camera_url serves three consumers with one
string: PrinterFileSystem (CTRL over :6000), the device image flow
(mem:/N) and gstbambusrc video. On X1/P1S/P2S-class printers LAN video
is RTSP(S) :322, not MJPEG :6000, so a plain local URL would break
liveview. Honour the lv=rtsps/rtsp query hint: when the VIDEO stream
starts (Bambu_StartStream, not the CTRL channel), drop the :6000 TLS
session and open the existing RTSP(S) passthrough instead. URLs minted
by Studio itself carry no hint and behave as before. Needs verification
on hardware.
2026-07-13 18:55:42 +02:00
Alexey Cluster 98cf31306f BambuSource logging fixes
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-06-27 05:23:02 +02:00
Alexey Cluster f4e3eb8ba7 disable_camera_preview option
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-06-09 18:16:42 +02:00
Alexey Cluster 3272d853c5 New options, force FTPS, fun/fun2 patching (#43)
* New options, force FTPS, `fun`/`fun2` patching

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* Fixes

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* Update CI/CD workflow to conditionally build macOS x64

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* Fixes

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* CI/CD fixes

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* Fixes

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* FTPS fixes

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

* Fixed IPC

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>

---------

Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-06-03 21:22:00 +02:00
Alexey Cluster cc6bb423f9 More options
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-05-30 03:30:54 +02:00
Alexey Cluster 8579ebe915 Removed legacy code
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-05-26 07:49:51 +02:00
Alexey Cluster 4cff7997bf Port 6000 protocol support
* Documented :6000 protocol
* Documented print flow
* Print job naming research
* Native file browser
* Native `send to printer`
* Camera preview
* Cover thumbnail fast path
* Fixes
2026-05-26 02:41:17 +02:00
Alexey Cluster edc0709ec0 Strict certificate validation and other security stuff 2026-05-21 10:01:05 +02:00
Алексей Авдюхин ff8840d41e Windows build (both Bambu Studio and Orca Slicer) 2026-05-12 13:49:45 +02:00
Alexey Cluster 1c07ff6973 No video transcoding at all
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-05-08 20:48:41 +02:00
Alexey Cluster ab85dd429b Refactor image handling to use vendored stb_image for PNG and JPEG decoding/encoding
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-04-28 16:16:33 +02:00
Alexey Cluster c9c246823c LiveView: ffmpeg support (default now), Mac support (not tested)
Signed-off-by: Alexey Cluster <cluster@cluster.wtf>
2026-04-28 14:53:34 +02:00
Alexey Cluster 31728b291e BambuSource: reconnect FTPS on stale control connection
Bambu firmware drops the FTPS control channel after ~5 min of idle
(observed: '221 Service closing' on PASV after ~6 min in the file
panel). The stale session caused LIST_INFO to surface as an empty
directory, SUB_FILE to fail thumbnail fetches, and FILE_DOWNLOAD /
FILE_DEL to report "file not exist" until the user reopened the
panel.

Adds a reconnect_ftp() helper (quit + reset + ensure_ftp) and wires
it into LIST_INFO, SUB_FILE (zip + thumbnails via download_blob),
FILE_DOWNLOAD (only while no chunk has been pushed yet), and
FILE_DEL on the first error. Retries once and falls through to the
old "empty / not-exist" reply if the second attempt also fails.

Made-with: Cursor
2026-04-27 18:34:23 +02:00
Alexey Cluster 90da8f8781 BambuSource: env-configurable log file and level 2026-04-27 18:24:12 +02:00
Alexey Cluster 330d32d6cf BambuSource: fix tunnel_close use-after-free vs SSL_read 2026-04-27 18:24:07 +02:00
Alexey Cluster 35103210db Camera stream tuning, connection fixes 2026-04-20 22:17:15 +02:00
Alexey Cluster 6e693b6cb6 Model preview image (it was tough one!) 2026-04-20 21:54:05 +02:00
Alexey Cluster 00d08579ab Storage features (mostly workaround) 2026-04-20 16:33:54 +02:00
Alexey Cluster e55333c2d4 Camera support 2026-04-20 04:57:17 +02:00
Alexey Cluster 1cd29b3947 Bambu network plugin stub 2026-04-19 22:20:34 +02:00