Client Startup and Configuration
Starting the SOTA client
In general, the SOTA client should be run at startup, as a service. For example, if you’re using systemd you would want a service file like this:
[Unit] Description=SOTA Client Wants=network-online.target After=network.target network-online.target Requires=network-online.target [Service] RestartSec=5 Restart=on-failure Environment="RUST_LOG=info" DefaultTimeoutStopSec=5 ExecStart=/usr/bin/sota_client --config /etc/sota.toml [Install] WantedBy=multi-user.target
Systemd is not a requirement, of course; you can use whatever startup system you like, or just run directly from the command line to test.
SOTA Client config file guide
The config file for the SOTA client is in TOML format, and can be invoked at startup with
sota_client --config /path/to/config_file.toml. Example config files for use with RVI or HTTP transport are available in the rvi_sota_client repo. If you’re using a commercial service like ATS Garage, you’ve already been provided with a config file; you can use that as a basis for any changes you need to make.
This section is required for connection to a SOTA server that implements authentication. It needs to be the first section of the config file. If you are not using authentication, or if you are using RVI transport for authentication, you should delete this section entirely.
[auth] server = "https://auth-plus.gw.prod01.advancedtelematic.com" (1) client_id = "bf66425f-d4d6-422b-b510-7c7f178af9fe" (2) client_secret = "hr8nEWzQc9" (2)
|1||The URL of the auth server. Example given is from ATS Garage.|
|2||A unique client ID and secret for this device.|
This section contains configuration for communicating with the Core server.
[core] server = "https://sota-core.gw.prod01.advancedtelematic.com" (1) polling = true (2) polling_sec = 10 (3)
|1||The URL of the Core server. Example given is from ATS Garage.|
|2||Boolean indicating whether the Core server should be polled for new updates. You should turn this off if you are using RVI, or if there is an external component on your device using the GetUpdateRequests command.|
|3||Set the polling frequency in seconds. This will have no effect if polling is off.|
This section contains device-specific configuration.
[device] uuid = "123e4567-e89b-12d3-a456-426655440000" (1) system_info = "system_info.sh" (2) packages_dir = "/tmp/" (3) package_manager = "off" (4) auto_download = true (5) certificates_path = "/tmp/sota_certificates" (6)
|1||The UUID of the device. This is usually assigned by the Core server on device creation. With ATS Garage, this will be provided in the config file available for download.|
|2||The script to use to gather system information. By default, this uses system_info.sh.|
|3||The location SOTA Client should use for temporary package storage until they are processed by the software loading manager.|
|4||The software loading manager backend to use. Possible values are
|5||Boolean indicating whether the client should automatically start downloading new packages. If this is set to false then an external mechanism will need to trigger the start of the download instead.|
|6||The certificate authorities SOTA Client trusts. Defaults are taken from Mozilla Servo.|
The SOTA Client communicates with the device’s software loading manager (or other interested parties) through various gateways. For more details on how this works, please see the Client commands and events API reference.
[gateway] console = false (1) dbus = false (2) http = false (3) rvi = false (4) socket = false (5) websocket = true (6)
|1||Start a basic REPL that can send any command to the client. This gateway is used for testing only.|
|2||Send a message to D-Bus on available updates, and listen for replies to trigger a download or forward an installation report.|
|3||Start a basic HTTP server that will accept new commands and reply with the final event. This gateway is primarily used for testing.|
|4||Start an RVI HTTP server that can receive packages from an RVI Erlang client.|
|5||Listen on a socket for incoming commands, and broadcast all download events.|
|6||Broadcast events to each connected websocket client.|
This section contains network configuration information. Some values may be ignored if the corresponding communication methods aren’t enabled.
[network] http_server = "127.0.0.1:8888" (1) socket_commands_path = "/tmp/sota-commands.socket" (2) socket_events_path = "/tmp/sota-events.socket" (3) websocket_server = "127.0.0.1:9081" (4) rvi_edge_server = "127.0.0.1:9080" (5)
|1||The host and port the client should listen on for receiving commands (if the http gateway is enabled).|
|2||The name of the unix domain socket to be used for receiving commands (if the socket gateway is enabled).|
|3||The name of the unix domain socket to be used for listening to
|4||The host and port to listen for new websocket clients (if the websocket gateway is enabled).|
|5||The host and port the client should listen for RVI messages on (if the rvi gateway is enabled).|
Optional gateway: [rvi]
Remote Vehicle Interaction (RVI) is an open source infrastructure developed by GENIVI and Jaguar Land Rover to power the next generation of connected vehicle services. This section contains values for configuration of RVI nodes. Note that having this section defined does not imply that RVI will be used; if the RVI gateway is turned off in the
[gateway] section, this is ignored.
[rvi] client = "http://127.0.0.1:8901" storage_dir = "/var/sota" timeout = 20
Optional gateway: [dbus]
This section contains values for dbus configuration, using the GENIVI software loading manager’s names as the default. Note that having this section defined does not imply that dbus will be used; if the dbus gateway is turned off in the
[gateway] section, this is ignored.
[dbus] name = "org.genivi.SotaClient" path = "/org/genivi/SotaClient" interface = "org.genivi.SotaClient" software_manager = "org.genivi.SoftwareLoadingManager" software_manager_path = "/org/genivi/SoftwareLoadingManager" timeout = 60