#graphql #systems #remote #robots #query-language #tritium-os

tritium_remote

A library for connecting to remote Robots running TritiumOS

10 stable releases

1.5.1 Oct 22, 2024
1.5.0 Jun 11, 2024
1.4.1 Sep 18, 2023
1.3.0 Aug 30, 2023
1.0.1 Dec 13, 2022

#45 in WebSocket

Download history 12/week @ 2024-09-22 139/week @ 2024-10-20 12/week @ 2024-10-27

565 downloads per month

MIT/Apache

44KB
1K SLoC

tritium_remote

A library for interacting with Tritium systems. Hosted docs are here (require login).

  • Connects to a running Tritium system by WebSocket
  • Uses GraphQL to send commands and request data

Implemented in Rust with bindings to other languages:

  • Python NB DEPRECATED in favour of the pure Python tritium-remote-py

This library is currently only published and tested on Linux. However the rust crate ought to work on other platforms.

This is only to be used on a trusted local network. The Tritium system will be accessed over LAN without encryption.

APIs

Sequence playback

  • Start & stop sequence

Scripting

  • Start & stop scripts
  • Post messages to named channels to which scripts may subscribe

Generic Queries and Mutations

  • Execute user-supplied GraphQL query or mutation documents
  • Optional variables, supplied as JSON
  • Any response is returned as a JSON encoded object

Running Examples

The Rust and Python examples use the TRITIUM_AUTH_TOKEN environment variable to get the JWT access token they need.

To generate an access token...

  1. Log into the Tritium cloud UI
  2. Connect to your locally-running system
  3. Go to the "Scripts" page
  4. Select the API Keys tab
  5. Click "CREATE AN API KEY"
$ export TRITIUM_AUTH_TOKEN="{paste token here}"
$ cargo run --example system_info

License

This project is licensed under either of

at your option.

Dependencies

~6–15MB
~190K SLoC