Skip to content
Platform

From the Quickstart Python project, read a message from your active session in a separate terminal from the controller. Enter the session ID when prompted:

uv run python -c '
from bsln.sdk import Client
session_id = input("Session ID: ").strip()
with Client() as client, client.watch_session(session_id, frames=False) as stream:
message = stream.recv(timeout=10)
if message is not None:
print(message["type"])
'

client.watch_session(session_id, frames=False) opens a read-only stream. client.follow_session(...) follows session messages across supported reconnects. A watcher never keeps a controller session alive. Close the stream when you finish.

Use stream.recv(timeout=...) or session.recv(timeout=...) for the next message, or messages() to iterate. Keep one consumer per stream so readers do not split the queue. The queue keeps the newest 256 messages. For independent readers, open separate watchers.

Enable frames=True for camera JPEGs. A frame message contains a camera name, JPEG bytes in jpeg and the station timestamp t. Use the camera description to check inputs. session.get_state() reads the latest telemetry without consuming a message.

reconnect() clears queued messages. Inspect fresh state before sending more motion. close() closes the connection. Use session.end() to end a session you started. session.view() opens a viewer. Closing the view closes its own stream and leaves the session open.