Add support for Saturn 4 Ultra
Opened this issue · 3 comments
S4U uses protocol version 3.0.0 and has more extensive features from what I can see (file listing! access to the camera feed!) but work will be needed.
The protocol seems to have changed. It's now a websockets based thing, using the same structure as before. The broadcast reply includes the IP address, and the host can make a HTTP request to port 3030 to upgrade to a websocket connection. After that, command requests/replies proceed much like they did with MQTT (including leftover "topics"; maybe there's still a MQTT way to do this, but this is much simpler). Here's a stream of ChituManager talking to my S4 Ultra, including enabling the video:
UDP broadcast reply:
{"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Name":"3D Printer","MachineName":"Saturn 4 Ultra","BrandName":"ELEGOO","MainboardIP":"192.168.7.199","MainboardID":"ed5847f5c1d70100","ProtocolVersion":"V3.0.0","FirmwareVersion":"V1.1.9"}}
Port 3030 is the http port; used for a websocket upgrade, as well as to fetch data from the printer
Hypertext Transfer Protocol
GET /websocket HTTP/1.1\r\n
Host: 192.168.7.199:3030\r\n
Connection: Upgrade\r\n
Pragma: no-cache\r\n
Cache-Control: no-cache\r\n
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/6.3.2 Chrome/94.0.4606.126 Safari/537.36\r\n
Upgrade: websocket\r\n
Origin: http://127.0.0.1:32679\r\n
Sec-WebSocket-Version: 13\r\n
Accept-Encoding: gzip, deflate\r\n
Sec-WebSocket-Key: O9d+RlPt8fvhZ72+tNFo/w==\r\n
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n
\r\n
[Full request URI: http://192.168.7.199:3030/websocket]
[HTTP request 1/1]
[Response in frame: 142]
HOST: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":0,"Data":{},"RequestID":"8f36df9dc0af4aaaaeb7a31b464e4220","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737313,"From":1}}
PRINTER SENDS: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":0,"Data":{"Ack":0},"RequestID":"8f36df9dc0af4aaaaeb7a31b464e4220","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276736},"Topic":"sdcp/response/ed5847f5c1d70100"}
PRINTER SENDS:(?) {"Status":{"CurrentStatus":[1],"PrintScreen":3129.9820052452087,"ReleaseFilm":1034,"TempOfUVLED":42.6506004333496,"TimeLapseStatus":0,"PrintInfo":{"Status":4,"CurrentLayer":34,"TotalLayer":157,"CurrentTicks":652287,"TotalTicks":1718167,"ErrorNumber":0,"Filename":"Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31"}},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737,"Topic":"sdcp/status/ed5847f5c1d70100"}
HOST: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":1,"Data":{},"RequestID":"b4e78e3e25264e1298437c0feb3f7fe4","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737313,"From":1}}
PRINTER SENDS:
{"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":1,"Data":{"Ack":0},"RequestID":"b4e78e3e25264e1298437c0feb3f7fe4","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737},"Topic":"sdcp/response/ed5847f5c1d70100"}
HOST: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":386,"Data":{"Enable":1},"RequestID":"065a0c0976a0488c81919367eca64d60","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737314,"From":1}}
PRINTER SENDS:(?)
{"Attributes":{"Name":"3D Printer","MachineName":"Saturn 4 Ultra","BrandName":"ELEGOO","ProtocolVersion":"V3.0.0","FirmwareVersion":"V1.1.9","Resolution":"11520x5120","XYZsize":"218.88x128.88x220","MainboardIP":"192.168.7.199","MainboardID":"ed5847f5c1d70100","SDCPStatus":0,"MaximumCloudSDCPSercicesAllowed":0,"NumberOfCloudSDCPServicesConnected":0,"NumberOfVideoStreamConnected":0,"MaximumVideoStreamAllowed":2,"NetworkStatus":"wlan","UsbDiskStatus":1,"Capabilities":["FILE_TRANSFER","PRINT_CONTROL","VIDEO_STREAM"],"SupportFileType":["CTB","GOO"],"DevicesStatus":{"TempSensorStatusOfUVLED":1,"LCDStatus":1,"SgStatus":1,"ZMotorStatus":1,"RotateMotorStatus":1,"RelaseFilmState":1},"ReleaseFilmMax":60000,"CameraStatus":1,"RemainingMemory":6741819392,"TLPNoCapPos":50,"TLPStartCapPos":30,"TLPInterLayers":10},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737,"Topic":"sdcp/attributes/ed5847f5c1d70100"}
PRINTER SENDS: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":386,"Data":{"Ack":0,"VideoUrl":"rtsp://192.168.7.199:554/video"},"RequestID":"065a0c0976a0488c81919367eca64d60","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737},"Topic":"sdcp/response/ed5847f5c1d70100"}
HOST: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":320,"Data":{},"RequestID":"3ad241563c944b159b1c401ededc332b","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737315,"From":1}}
PRINTER SENDS:
{"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":320,"Data":{"Ack":0,"HistoryData":["d676bd90-3971-11ef-99d5-a8960913eb31"]},"RequestID":"3ad241563c944b159b1c401ededc332b","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737},"Topic":"sdcp/response/ed5847f5c1d70100"}
PRINTER SENDS:
{"Status":{"CurrentStatus":[1],"PrintScreen":3129.9820052452087,"ReleaseFilm":1035,"TempOfUVLED":42.416477203369141,"TimeLapseStatus":0,"PrintInfo":{"Status":2,"CurrentLayer":35,"TotalLayer":157,"CurrentTicks":657397,"TotalTicks":1718167,"ErrorNumber":0,"Filename":"Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31"}},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737,"Topic":"sdcp/status/ed5847f5c1d70100"}
HOST: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":321,"Data":{"Id":["eb56d498-44bb-11ef-99d5-a8960913eb31"]},"RequestID":"4e2cee69a4304a67a091476c793be7cf","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276738389,"From":1}}
PRINTER SENDS:
{"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":321,"Data":{"Ack":0,"HistoryDetailList":[{"Thumbnail":"http://192.168.7.199:3030/media/mmcblk0p1/history_image/eb56d498-44bb-11ef-99d5-a8960913eb31.bmp","TaskName":"/media/sda1/Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","BeginTime":1721275936,"EndTime":1721275936,"TaskStatus":0,"SliceInformation":{"resolution_x":11520,"resolution_y":5120,"layer_height":0.05000000074505806,"total_layer_numbers":157,"machine_size_x":218.8800048828125,"machine_size_y":122.87999725341797,"machine_size_z":220,"model_size_x":0,"model_size_y":0,"model_size_z":0,"volume":7.8483929634094238,"weight":8.63323211669922,"price":0.25899696350097656,"print_time":1498,"machine_name":"ELEGOO Saturn 4 Ultra","independent_supports":0,"resin_color":7830394,"resin_type":"normal","resin_name":"normal","profile_name":"Profile","resin_density":1.1000000238418579,"bottom_layer_numbers":5,"transition_layer_numbers":5,"transition_type":0,"bottom_layer_lift_height":0.05000000074505806,"bottom_layer_lift_height2":0,"bottom_layer_drop_height2":0,"bottom_layer_lift_speed":0.000833333353511989,"bottom_layer_lift_speed2":0,"bottom_layer_drop_speed":0.000833333353511989,"bottom_layer_drop_speed2":0,"bottom_layer_exposure_time":35000,"bottom_layer_pwm":255,"bottom_layer_light_off_time":0,"bottom_layer_rest_time_after_drop":500,"bottom_layer_rest_time_after_lift":0,"bottom_layer_rest_time_before_lift":0,"normal_layer_lift_height":0.05000000074505806,"normal_layer_lift_height2":0,"normal_layer_drop_height2":0,"normal_layer_lift_speed":0.000833333353511989,"normal_layer_lift_speed2":0,"normal_layer_drop_speed":0.000833333353511989,"normal_layer_drop_speed2":0,"normal_layer_exposure_time":2500,"normal_layer_pwm":255,"normal_layer_light_off_time":0,"normal_layer_rest_time_after_drop":1000,"normal_layer_rest_time_after_lift":0,"normal_layer_rest_time_before_lift":0},"AlreadyPrintLayer":34,"TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31","MD5":"55216cd9ee711ac59390f7fca454a1e4","CurrentLayerTalVolume":5.16835355758667,"TimeLapseVideoStatus":0,"TimeLapseVideoUrl":"","ErrorStatusReason":0}]},"RequestID":"4e2cee69a4304a67a091476c793be7cf","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737},"Topic":"sdcp/response/ed5847f5c1d70100"}
HOST: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":386,"Data":{"Enable":1},"RequestID":"a88ddc9fe88b438ca4d925ff4f28776c","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276738400,"From":1}}
PRINTER SENDS: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":386,"Data":{"Ack":0,"VideoUrl":"rtsp://192.168.7.199:554/video"},"RequestID":"a88ddc9fe88b438ca4d925ff4f28776c","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737},"Topic":"sdcp/response/ed5847f5c1d70100"}
HOST: {"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":321,"Data":{"Id":["d676bd90-3971-11ef-99d5-a8960913eb31"]},"RequestID":"5f1a6fb423104a1e8958ee29a1060546","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276738411,"From":1}}
PRINTER SENDS:
{"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":321,"Data":{"Ack":0,"HistoryDetailList":[{"Thumbnail":"http://192.168.7.199:3030/media/mmcblk0p1/history_image/d676bd90-3971-11ef-99d5-a8960913eb31.bmp","TaskName":"/media/sda1/Printing Test//ROOK.goo","BeginTime":1720034656,"EndTime":1720041145,"TaskStatus":1,"SliceInformation":{"resolution_x":11520,"resolution_y":5120,"layer_height":0.05000000074505806,"total_layer_numbers":1000,"machine_size_x":218.8800048828125,"machine_size_y":122.87999725341797,"machine_size_z":260,"model_size_x":0,"model_size_y":0,"model_size_z":0,"volume":11.708434104919434,"weight":12.8792781829834,"price":0.38637834787368774,"print_time":123662,"machine_name":"ELEGOO Saturn 3 Ultra","independent_supports":0,"resin_color":0,"resin_type":"","resin_name":"","profile_name":"","resin_density":0,"bottom_layer_numbers":5,"transition_layer_numbers":8,"transition_type":0,"bottom_layer_lift_height":0.05000000074505806,"bottom_layer_lift_height2":0,"bottom_layer_drop_height2":0,"bottom_layer_lift_speed":0.000833333353511989,"bottom_layer_lift_speed2":0,"bottom_layer_drop_speed":0.000833333353511989,"bottom_layer_drop_speed2":0,"bottom_layer_exposure_time":35000,"bottom_layer_pwm":255,"bottom_layer_light_off_time":0,"bottom_layer_rest_time_after_drop":1000,"bottom_layer_rest_time_after_lift":0,"bottom_layer_rest_time_before_lift":0,"normal_layer_lift_height":0.05000000074505806,"normal_layer_lift_height2":0,"normal_layer_drop_height2":0,"normal_layer_lift_speed":0.000833333353511989,"normal_layer_lift_speed2":0,"normal_layer_drop_speed":0.000833333353511989,"normal_layer_drop_speed2":0,"normal_layer_exposure_time":2500,"normal_layer_pwm":255,"normal_layer_light_off_time":0,"normal_layer_rest_time_after_drop":1000,"normal_layer_rest_time_after_lift":0,"normal_layer_rest_time_before_lift":0},"AlreadyPrintLayer":999,"TaskId":"d676bd90-3971-11ef-99d5-a8960913eb31","MD5":"e5a3ac486cb6f766a9364e78ba875719","CurrentLayerTalVolume":0,"TimeLapseVideoStatus":0,"TimeLapseVideoUrl":"","ErrorStatusReason":0}]},"RequestID":"5f1a6fb423104a1e8958ee29a1060546","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276737},"Topic":"sdcp/response/ed5847f5c1d70100"}
HOST:
{"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":321,"Data":{"Id":["eb56d498-44bb-11ef-99d5-a8960913eb31"]},"RequestID":"9862d89050e64eaebd9d96b13107d59e","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276738428,"From":1}}
PRINTER SENDS:
{"Id":"f25273b12b094c5a8b9513a30ca60049","Data":{"Cmd":321,"Data":{"Ack":0,"HistoryDetailList":[{"Thumbnail":"http://192.168.7.199:3030/media/mmcblk0p1/history_image/eb56d498-44bb-11ef-99d5-a8960913eb31.bmp","TaskName":"/media/sda1/Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","BeginTime":1721275936,"EndTime":1721275936,"TaskStatus":0,"SliceInformation":{"resolution_x":11520,"resolution_y":5120,"layer_height":0.05000000074505806,"total_layer_numbers":157,"machine_size_x":218.8800048828125,"machine_size_y":122.87999725341797,"machine_size_z":220,"model_size_x":0,"model_size_y":0,"model_size_z":0,"volume":7.8483929634094238,"weight":8.63323211669922,"price":0.25899696350097656,"print_time":1498,"machine_name":"ELEGOO Saturn 4 Ultra","independent_supports":0,"resin_color":7830394,"resin_type":"normal","resin_name":"normal","profile_name":"Profile","resin_density":1.1000000238418579,"bottom_layer_numbers":5,"transition_layer_numbers":5,"transition_type":0,"bottom_layer_lift_height":0.05000000074505806,"bottom_layer_lift_height2":0,"bottom_layer_drop_height2":0,"bottom_layer_lift_speed":0.000833333353511989,"bottom_layer_lift_speed2":0,"bottom_layer_drop_speed":0.000833333353511989,"bottom_layer_drop_speed2":0,"bottom_layer_exposure_time":35000,"bottom_layer_pwm":255,"bottom_layer_light_off_time":0,"bottom_layer_rest_time_after_drop":500,"bottom_layer_rest_time_after_lift":0,"bottom_layer_rest_time_before_lift":0,"normal_layer_lift_height":0.05000000074505806,"normal_layer_lift_height2":0,"normal_layer_drop_height2":0,"normal_layer_lift_speed":0.000833333353511989,"normal_layer_lift_speed2":0,"normal_layer_drop_speed":0.000833333353511989,"normal_layer_drop_speed2":0,"normal_layer_exposure_time":2500,"normal_layer_pwm":255,"normal_layer_light_off_time":0,"normal_layer_rest_time_after_drop":1000,"normal_layer_rest_time_after_lift":0,"normal_layer_rest_time_before_lift":0},"AlreadyPrintLayer":34,"TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31","MD5":"55216cd9ee711ac59390f7fca454a1e4","CurrentLayerTalVolume":5.16835355758667,"TimeLapseVideoStatus":0,"TimeLapseVideoUrl":"","ErrorStatusReason":0}]},"RequestID":"9862d89050e64eaebd9d96b13107d59e","MainboardID":"ed5847f5c1d70100","TimeStamp":1721276738},"Topic":"sdcp/response/ed5847f5c1d70100"}
PRINTER SENDS:
{"Status":{"CurrentStatus":[1],"PrintScreen":3129.9820052452087,"ReleaseFilm":1035,"TempOfUVLED":41.059421539306641,"TimeLapseStatus":0,"PrintInfo":{"Status":3,"CurrentLayer":35,"TotalLayer":157,"CurrentTicks":660718,"TotalTicks":1716171,"ErrorNumber":0,"Filename":"Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31"}},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276741,"Topic":"sdcp/status/ed5847f5c1d70100"}
PRINTER SENDS:
{"Status":{"CurrentStatus":[1],"PrintScreen":3132.4820052452087,"ReleaseFilm":1035,"TempOfUVLED":41.946769714355469,"TimeLapseStatus":0,"PrintInfo":{"Status":4,"CurrentLayer":35,"TotalLayer":157,"CurrentTicks":664228,"TotalTicks":1716171,"ErrorNumber":0,"Filename":"Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31"}},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276744,"Topic":"sdcp/status/ed5847f5c1d70100"}
PRINTER SENDS:
{"Attributes":{"Name":"3D Printer","MachineName":"Saturn 4 Ultra","BrandName":"ELEGOO","ProtocolVersion":"V3.0.0","FirmwareVersion":"V1.1.9","Resolution":"11520x5120","XYZsize":"218.88x128.88x220","MainboardIP":"192.168.7.199","MainboardID":"ed5847f5c1d70100","SDCPStatus":0,"MaximumCloudSDCPSercicesAllowed":0,"NumberOfCloudSDCPServicesConnected":0,"NumberOfVideoStreamConnected":0,"MaximumVideoStreamAllowed":2,"NetworkStatus":"","UsbDiskStatus":1,"Capabilities":["FILE_TRANSFER","PRINT_CONTROL","VIDEO_STREAM"],"SupportFileType":["CTB","GOO"],"DevicesStatus":{"TempSensorStatusOfUVLED":1,"LCDStatus":1,"SgStatus":1,"ZMotorStatus":1,"RotateMotorStatus":1,"RelaseFilmState":1},"ReleaseFilmMax":60000,"CameraStatus":1,"RemainingMemory":6741819392,"TLPNoCapPos":50,"TLPStartCapPos":30,"TLPInterLayers":10},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276745,"Topic":"sdcp/attributes/ed5847f5c1d70100"}
PRINTER SENDS:
{"Attributes":{"Name":"3D Printer","MachineName":"Saturn 4 Ultra","BrandName":"ELEGOO","ProtocolVersion":"V3.0.0","FirmwareVersion":"V1.1.9","Resolution":"11520x5120","XYZsize":"218.88x128.88x220","MainboardIP":"192.168.7.199","MainboardID":"ed5847f5c1d70100","SDCPStatus":0,"MaximumCloudSDCPSercicesAllowed":0,"NumberOfCloudSDCPServicesConnected":0,"NumberOfVideoStreamConnected":0,"MaximumVideoStreamAllowed":2,"NetworkStatus":"wlan","UsbDiskStatus":1,"Capabilities":["FILE_TRANSFER","PRINT_CONTROL","VIDEO_STREAM"],"SupportFileType":["CTB","GOO"],"DevicesStatus":{"TempSensorStatusOfUVLED":1,"LCDStatus":1,"SgStatus":1,"ZMotorStatus":1,"RotateMotorStatus":1,"RelaseFilmState":1},"ReleaseFilmMax":60000,"CameraStatus":1,"RemainingMemory":6741819392,"TLPNoCapPos":50,"TLPStartCapPos":30,"TLPInterLayers":10},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276751,"Topic":"sdcp/attributes/ed5847f5c1d70100"}
PRINTER SENDS:
{"Status":{"CurrentStatus":[1],"PrintScreen":3132.4820052452087,"ReleaseFilm":1036,"TempOfUVLED":41.930145263671875,"TimeLapseStatus":0,"PrintInfo":{"Status":2,"CurrentLayer":36,"TotalLayer":157,"CurrentTicks":669355,"TotalTicks":1716171,"ErrorNumber":0,"Filename":"Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31"}},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276751,"Topic":"sdcp/status/ed5847f5c1d70100"}
PRINTER SENDS:
{"Status":{"CurrentStatus":[1],"PrintScreen":3132.4820052452087,"ReleaseFilm":1036,"TempOfUVLED":41.0344581604004,"TimeLapseStatus":0,"PrintInfo":{"Status":3,"CurrentLayer":36,"TotalLayer":157,"CurrentTicks":672608,"TotalTicks":1714197,"ErrorNumber":0,"Filename":"Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31"}},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276753,"Topic":"sdcp/status/ed5847f5c1d70100"}
PRINTER SENDS:
{"Status":{"CurrentStatus":[1],"PrintScreen":3134.9820052452087,"ReleaseFilm":1036,"TempOfUVLED":41.832637786865234,"TimeLapseStatus":0,"PrintInfo":{"Status":4,"CurrentLayer":36,"TotalLayer":157,"CurrentTicks":676127,"TotalTicks":1714197,"ErrorNumber":0,"Filename":"Button.stl_0.05_2.5_2024_07_17_21_10_00.ctb","TaskId":"eb56d498-44bb-11ef-99d5-a8960913eb31"}},"MainboardID":"ed5847f5c1d70100","TimeStamp":1721276757,"Topic":"sdcp/status/ed5847f5c1d70100"}
Hey, I'm also interested in creating a utility to print wirelessly on my s4u.
Seems like they opensourced the protocol:
https://www.chitubox.com/en/page/sdcp
Hopefully this is of use to you :)
@Metal-spoon oh hey, that's awesome, thank you! Saves me from continuing the reverse engineering, which was going to be annoying because Chitu Manager just completely stopped working for me :)