Usage¶
Astoria is designed to be deployed on robots that do not have a traditional keyboard or mouse interface. This page describes the requirements for it to be deployed on such a system. Reference to packages available in Debian Buster will be made, although it is possible for Astoria to be deployed on any Linux system.
System Requirements¶
Python 3.6 + library Requirements
DBus
UDisks 2
- UDiskie (should be run as the same user as Astoria)
It is possible to use other automounting programs, as long as they are compatible with UDisks
MQTT Broker supporting MQTT 3 or later. Mosquitto is recommended
Astoria is targeted for Linux-based OSes, although it may be possible to run on other POSIX-compatible operating systems.
Configuration¶
Astoria is configured using the astoria.toml
config file. All components will look for this config file and the location can be specified using the -c
command line option.
# Astoria Default Config File
[mqtt]
host = "::1"
port = 1883
enable_tls = false
force_protocol_version_3_1 = true
topic_prefix = "astoria"
[wifi]
interface = "wlan0"
bridge = "br0"
enable_wpa3 = false
[astdiskd]
ignored_mounts = [
"/",
"/boot",
"/boot/efi",
]
[astprocd]
default_usercode_entrypoint = "robot.py"
[system]
cache_dir = ".cache_dir" # Use a directory in /var for production
[env]
EXAMPLE_ENV_VAR=123
Running¶
State Managers should be installed in the path once the package is installed.
For the recommended setup, you will need to run at least astdiskd
, astmetad
and astprocd
.
The state managers should be managed using systemd in a proper deployment, although that is outside of the scope of this documentation. tmux
is good for testing.
Command Line Usage¶
astctl¶
Astoria Command Line Utility.
astctl [OPTIONS] COMMAND [ARGS]...
Commands
- list-disks
List information about mounted disks.
- metadata
Interact with metadata.
- static-disk
Interact with metadata.
- usercode
Interact with Usercode.
Metadata USBs¶
Metadata USBs contain a high priority Metadata Source.
The source data should be stored in a file called astoria.json
in JSON format.
There should ideally not be any other files on the Metadata USB.
Caution
If a robot.zip
is placed on the Metadata USB, the robot will not recognise the Metadata USB as Astdiskd will
recognise it as a usercode disk. See Disk Identification for an explanation of this process.
Example override file:
{"arena": "A", "zone": 2, "mode": "COMP", "game_timeout": 120, "wifi_enabled": false}