Add camera snapshot messages and flag for P1/A1 cameras
camera_snapshot_request (cloud to gateway) and camera_snapshot (gateway to cloud) carry one JPEG frame at a time; telemetry gains camera_snapshot and the app view gains cameraSnapshot.
This commit is contained in:
@@ -62,6 +62,10 @@
|
||||
"type": ["string", "null"],
|
||||
"description": "The go2rtc stream name, when this printer has a camera that can actually be restreamed. Null is the common case - only Bambu's X1/H2 class publishes an RTSP URL. Present means it is worth calling GET /printers/:id/stream; null means render no player."
|
||||
},
|
||||
"cameraSnapshot": {
|
||||
"type": "boolean",
|
||||
"description": "True when the camera can only be read as refreshing JPEG frames (Bambu P1/A1); GET /printers/:id/stream then answers kind 'snapshot'."
|
||||
},
|
||||
"lastSeenAt": {
|
||||
"type": ["string", "null"],
|
||||
"format": "date-time",
|
||||
|
||||
@@ -183,6 +183,18 @@
|
||||
"message"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"title": "CameraSnapshot",
|
||||
"description": "The answer to a CameraSnapshotRequest: one JPEG frame (base64), or the reason there is none.",
|
||||
"properties": {
|
||||
"type": { "const": "camera_snapshot" },
|
||||
"request_id": { "type": "string" },
|
||||
"jpeg_base64": { "type": "string" },
|
||||
"error": { "type": "string", "description": "Set instead of jpeg_base64 when no frame could be read." }
|
||||
},
|
||||
"required": ["type", "request_id"]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"title": "DiscoveredPrinters",
|
||||
|
||||
@@ -108,7 +108,11 @@
|
||||
},
|
||||
"camera_stream": {
|
||||
"type": "string",
|
||||
"description": "The stream name to ask the gateway's stream_base_url for, when this printer has a camera the gateway could restream. Absent means no stream: either the printer reports no camera source, or it is a model whose camera is not reachable this way. That second case is the common one today - a Bambu P1/A1 does not publish an RTSP URL at all (confirmed: a P1P's ipcam block has ipcam_dev and ipcam_record and no rtsp_url), and only the X1/H2 class does. Those need Bambu's proprietary port-6000 JPEG stream instead, which is a separate client this gateway does not have yet."
|
||||
"description": "The stream name to ask the gateway's stream_base_url for, when this printer has a camera the gateway could restream. Absent means no stream: either the printer reports no camera source, or it is a model whose camera is not reachable this way. That second case is the common one today - a Bambu P1/A1 does not publish an RTSP URL at all (confirmed: a P1P's ipcam block has ipcam_dev and ipcam_record and no rtsp_url), and only the X1/H2 class does. Those are served by camera_snapshot instead."
|
||||
},
|
||||
"camera_snapshot": {
|
||||
"type": "boolean",
|
||||
"description": "True when this printer's camera can only be read as single JPEG frames (a Bambu P1/A1: proprietary TLS stream on port 6000, no RTSP) and the gateway will answer a CameraSnapshotRequest for it. Mutually exclusive with camera_stream in practice. Absent means false."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
||||
@@ -110,6 +110,18 @@
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"title": "CameraSnapshotRequest",
|
||||
"description": "Read one JPEG frame from a printer's camera and send it back as a CameraSnapshot. For the printers whose camera is not RTSP (Bambu P1/A1, telemetry camera_snapshot true). Unlike WebrtcOffer this DOES carry the picture through the cloud, which is acceptable only because the frames are small, low-rate and requested one at a time.",
|
||||
"properties": {
|
||||
"type": { "const": "camera_snapshot_request" },
|
||||
"request_id": { "type": "string" },
|
||||
"printer_id": { "type": "string", "description": "The gateway's own printer id." }
|
||||
},
|
||||
"required": ["type", "request_id", "printer_id"],
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"title": "ProvisionPrinter",
|
||||
|
||||
Reference in New Issue
Block a user