Carry camera stream information on the edge protocol
Two optional fields so a user can be pointed at a printer's camera. `hello.stream_base_url` is where the gateway serves restreams - the base of the go2rtc instance it already supervises. Reported by the gateway rather than configured in the cloud, because only the gateway knows the address it is actually reachable at. That address is a LAN one, and the schema says so where someone will read it rather than leaving it to be discovered in a support ticket. A browser on the same network as the gateway can play the stream; one outside it cannot, and the relay that would fix it does not exist. For a print farm whose operator is in the workshop this is the normal case and it works; for anyone else it is a limit, and anything surfacing the field has to cope with it being unreachable. `printer_telemetry.camera_stream` is the stream's name, present only when there is one. Absent is the common answer today and the reason is worth recording: a Bambu P1/A1 publishes no RTSP URL at all - a real P1P's ipcam block carries `ipcam_dev` and `ipcam_record` and nothing to connect to - while an H2C reports `rtsps://<ip>:322/streaming/live/1`. So RTSP restreaming covers the X1/H2 class and nothing else; the rest need Bambu's proprietary port-6000 JPEG stream, which is a client no gateway has yet. Both optional and additive, so existing gateways are unaffected.
This commit is contained in:
@@ -54,6 +54,17 @@ export const PrinterTelemetrySchema = Type.Object({
|
||||
* stage looks stuck.
|
||||
*/
|
||||
stage: Maybe(Type.Integer()),
|
||||
/**
|
||||
* The stream name to ask the gateway's `stream_base_url` for, when this
|
||||
* printer has a camera the gateway can restream. Absent means no stream.
|
||||
*
|
||||
* Absent is the common answer today: a Bambu P1/A1 publishes no RTSP URL
|
||||
* at all - a real P1P's ipcam block has `ipcam_dev` and `ipcam_record` and
|
||||
* nothing to connect to - so only the X1/H2 class works this way. The rest
|
||||
* need Bambu's proprietary port-6000 JPEG stream, which no gateway
|
||||
* implements yet.
|
||||
*/
|
||||
camera_stream: Maybe(Type.String()),
|
||||
layer: Maybe(Type.Integer({ minimum: 0 })),
|
||||
total_layers: Maybe(Type.Integer({ minimum: 0 })),
|
||||
remaining_minutes: Maybe(Type.Integer({ minimum: 0 })),
|
||||
@@ -156,6 +167,17 @@ export const EdgeClientMessageSchema = Type.Union([
|
||||
gateway_id: Type.String(),
|
||||
farm_id: Type.String(),
|
||||
token: Type.String(),
|
||||
/**
|
||||
* Where this gateway serves camera restreams, e.g.
|
||||
* `http://gateway.local:1984`. Omitted by a gateway with no cameras or
|
||||
* no go2rtc.
|
||||
*
|
||||
* Reported rather than configured, because only the gateway knows the
|
||||
* address it is reachable at - and note what that address is: a LAN one.
|
||||
* A browser on the same network can play the stream; one outside it
|
||||
* cannot, and a relay for that does not exist yet.
|
||||
*/
|
||||
stream_base_url: Maybe(Type.String()),
|
||||
}),
|
||||
Type.Object({
|
||||
type: Type.Literal("heartbeat"),
|
||||
|
||||
Reference in New Issue
Block a user