Ozobot WebRTC library
Project description
ozobot-webrtc
A Python library for establishing WebRTC connections with Ozobot devices, enabling real-time communication through data channels. This is a backend library implementing bare WebRTC functionality. Consult your robot documentation to learn which user library can control your robot.
Features
- WebRTC peer-to-peer connections with Ozobot devices
- AMQP-based signaling through WebSocket or TCP transports to estabilish the connection
- Built on aiortc for WebRTC functionality
Basic Usage
import asyncio
from ozobot.webrtc.signaling import SignalingCaller
from ozobot.webrtc.messaging import create_channel_factory, MessagingChannelConfig
async def main() -> None:
# Configure messaging
config = MessagingChannelConfig(
device_id="your-connection-key",
username="your-username",
password="your-password"
)
# Establish connection
async with create_channel_factory(config) as factory:
caller = SignalingCaller(factory, "your-queue-name")
connection, channels = await caller.signal(channels=("control",))
# Use the data channels
data_channel = channels[0]
await data_channel.send(b"Hello Ozobot!")
async for data in channel.receive_str():
print(data)
if __name__ == "__main__":
asyncio.run(main())
jwt authentication
If you don't have an username and password, you need to use jwt for authentication. In that case, use get_jwt_token from ozobot.webrtc.signaling.token
and use the resulting value as password. Keep username empty:
from ozobot.webrtc.signaling.token import get_jwt_token, TOKEN_ENDPOINT_URL
await token = await get_jwt_token(TOKEN_ENDPOINT_URL, "your-connection-key", "server")
config = MessagingChannelConfig(
device_id="your-connection-key",
username="",
password=token,
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ozobot_webrtc-0.1.2.tar.gz.
File metadata
- Download URL: ozobot_webrtc-0.1.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35df80aaf1be3561f7e53bb20e2ace9d07abba17108f502ae307d591f9cbead9
|
|
| MD5 |
23abcdc9ecd72217c2877fb0c6e3cefb
|
|
| BLAKE2b-256 |
6ac41447c5a15cf590401fb0ca76d333544e9fb3a3a24dfdc8553b28b1173777
|
Provenance
The following attestation bundles were made for ozobot_webrtc-0.1.2.tar.gz:
Publisher:
publish.yml on ozobot/python-libraries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ozobot_webrtc-0.1.2.tar.gz -
Subject digest:
35df80aaf1be3561f7e53bb20e2ace9d07abba17108f502ae307d591f9cbead9 - Sigstore transparency entry: 753623357
- Sigstore integration time:
-
Permalink:
ozobot/python-libraries@9a5603ab3854b5bb3b773f99faf6d102d3c6497f -
Branch / Tag:
refs/tags/webrtc-v0.1.2 - Owner: https://github.com/ozobot
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a5603ab3854b5bb3b773f99faf6d102d3c6497f -
Trigger Event:
push
-
Statement type:
File details
Details for the file ozobot_webrtc-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ozobot_webrtc-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afff5bbd13757cbf447f6a0aefddea714883d9f2aeb1ce578963218e5bf6056f
|
|
| MD5 |
f39bff5ca6cbdd66f231b7483ca9e285
|
|
| BLAKE2b-256 |
e84ade8c536ec557ec4a90e7ac02cb872c78471eb85c579a33439a3051d6ac46
|
Provenance
The following attestation bundles were made for ozobot_webrtc-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on ozobot/python-libraries
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ozobot_webrtc-0.1.2-py3-none-any.whl -
Subject digest:
afff5bbd13757cbf447f6a0aefddea714883d9f2aeb1ce578963218e5bf6056f - Sigstore transparency entry: 753623362
- Sigstore integration time:
-
Permalink:
ozobot/python-libraries@9a5603ab3854b5bb3b773f99faf6d102d3c6497f -
Branch / Tag:
refs/tags/webrtc-v0.1.2 - Owner: https://github.com/ozobot
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a5603ab3854b5bb3b773f99faf6d102d3c6497f -
Trigger Event:
push
-
Statement type: