4// Toby Schneider <toby@gobysoft.org>
7// This file is part of the JaiaBot Project Libraries
8// ("The Jaia Libraries").
10// The Jaia Libraries are free software: you can redistribute them and/or modify
11// them under the terms of the GNU Lesser General Public License as published by
12// the Free Software Foundation, either version 2.1 of the License, or
13// (at your option) any later version.
15// The Jaia Libraries are distributed in the hope that they will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU Lesser General Public License for more details.
20// You should have received a copy of the GNU Lesser General Public License
21// along with the Jaia Libraries. If not, see <http://www.gnu.org/licenses/>.
24import "jaiabot/messages/option_extensions.proto";
26package jaiabot.protobuf;
28// Fleet config contract version: see "Fleet configuration versioning" in
29// page091_major_upgrade.md. Bump it together with a migration in
30// jaia-fleet-config.py when the build-time contract check reports a breaking
31// change. Fields and enum values are never removed or renamed, only marked
32// [deprecated = true], so that every earlier version still parses.
33option (jaia.file).fleet_config_version = 2;
35// The bot/hub settings that debconf asks for on first boot and on
36// "dpkg-reconfigure jaiabot-embedded". debian/jaiabot-embedded.templates and
37// .config are generated from this message: fields are asked in declaration
38// order, grouped by (jaia.field).debconf.group, and enum values map to debconf
39// values by dropping the enum name prefix and lowercasing (BOT_TYPE_PAM -> pam).
42 option (jaia.msg).debconf = {
43 package: "jaiabot-embedded"
44 node_type_field: "type"
52 optional NodeType type = 1 [(jaia.field).debconf = {
55 description: "Is this a bot or a hub?"
56 extended_description: "This choice will determine which applications will be configured to launch with systemd."
59 optional int32 fleet_id = 2 [default = 0, (jaia.field).debconf = {
63 description: "Fleet identification number"
64 extended_description: "This is used to set the correct value in the jaiabot configuration.\nValid fleet ids are 0 to 4000, as reported by \"jaia admin bounds --fleet_id\";\nthose above 250 are addressed with IPv6 rather than IPv4.\nTo change in the future, run \"sudo dpkg-reconfigure jaiabot-embedded\""
72 optional LedType led_type = 3 [
73 default = LED_TYPE_NONE,
74 (jaia.field).debconf = {
76 description: "What type of leds does your system have?"
80 optional int32 electronics_stack = 4 [
82 (jaia.field).debconf = {
84 choices: [ "0", "1", "2" ]
85 description: "What type of electronics stack do you have?"
89 optional string rf_encryption_password = 5 [
91 (jaia.field).debconf = {
93 description: "Encryption key for XBee radio: 128-bit value (up to 16 bytes) as hex"
97 optional string dccl_encryption_password = 6 [
99 (jaia.field).debconf = {
101 description: "Encryption passphrase for DCCL (intervehicle) messages: can be any string."
109 COMMS_LINK_IRIDIUM = 2;
111 repeated CommsLink comms_links = 7 [(jaia.field).debconf = {
114 description: "Which comms links to activate?"
122 optional Mode mode = 8 [
123 default = MODE_RUNTIME,
124 (jaia.field).debconf = {
127 description: "Is this bot or hub to be run in runtime (operational) or simulation mode?"
128 extended_description: "This choice will determine which applications will be configured to launch with systemd."
132 optional int32 warp = 9 [
134 (jaia.field).debconf = {
136 choices: [ "1", "2", "5", "10", "20", "30", "40", "50" ]
137 ask_if { field: "mode" equals: "simulation" }
138 description: "At what multiple of real speed should this simulation be run?"
139 extended_description: "A value of 1 is normal speed, 10 is 10x the real clock, etc."
143 optional int32 bot_id = 10 [default = 0, (jaia.field).debconf = {
147 description: "Bot identification number"
148 extended_description: "This is used to set the hostname of the computer and set the correct value in the jaiabot configuration.\nValid bot_ids are 0 to 150, as reported by \"jaia admin bounds --bot_id\".\nTo change in the future, run \"sudo dpkg-reconfigure jaiabot-embedded\""
151 optional string bot_vin = 24 [
153 (jaia.field).debconf = {
156 description: "Bot Vehicle Identification Number (VIN)"
157 extended_description: "Unique identifier for this physical bot.\nTo change in the future, run \"sudo dpkg-reconfigure jaiabot-embedded\""
163 ARDUINO_TYPE_SPI = 0;
164 ARDUINO_TYPE_USB = 1;
165 ARDUINO_TYPE_NONE = 2;
166 ARDUINO_TYPE_USB_OLD = 3 [deprecated = true, (jaia.ev).debconf.replaced_by = "usb"];
167 ARDUINO_TYPE_USB_NEW = 4 [deprecated = true, (jaia.ev).debconf.replaced_by = "usb"];
169 optional ArduinoType arduino_type = 11 [
170 default = ARDUINO_TYPE_NONE,
171 (jaia.field).debconf = {
173 description: "What type of Arduino connection does this bot have?"
177 optional string tail_serial_number = 25 [
179 (jaia.field).debconf = {
182 description: "What is the serial number of this bot's tail unit?"
193 BOT_TYPE_ECHO = 4 [deprecated = true, (jaia.ev).debconf.replaced_by = "pam"];
195 optional BotType bot_type = 12 [
196 default = BOT_TYPE_HYDRO,
197 (jaia.field).debconf = {
199 unasked_value: "none"
200 description: "What type of bot is your system?"
204 enum PamConnectionType
206 PAM_CONNECTION_TYPE_UART = 0;
207 PAM_CONNECTION_TYPE_USB = 1;
208 PAM_CONNECTION_TYPE_NONE = 2;
210 optional PamConnectionType pam_connection_type = 13 [
211 default = PAM_CONNECTION_TYPE_NONE,
212 (jaia.field).debconf = {
214 ask_if { field: "bot_type" equals: "pam" }
215 unasked_value: "none"
216 description: "What type of PAM connection does this bot have?"
222 // No replaced_by: the hardware has to be swapped, so a fleet still on one
223 // is refused rather than migrated (see check-imu-type.yml)
224 IMU_TYPE_BNO055 = 0 [deprecated = true];
228 optional ImuType imu_type = 14 [
229 default = IMU_TYPE_BNO085,
230 (jaia.field).debconf = {
232 description: "What type of imu does your system have?"
236 enum DataOffloadIgnoreType
238 DATA_OFFLOAD_IGNORE_TYPE_GOBY = 0;
239 DATA_OFFLOAD_IGNORE_TYPE_TASKPACKET = 1;
240 DATA_OFFLOAD_IGNORE_TYPE_NONE = 2;
242 optional DataOffloadIgnoreType data_offload_ignore_type = 15 [
243 default = DATA_OFFLOAD_IGNORE_TYPE_NONE,
244 (jaia.field).debconf = {
246 description: "What data types to ignore when sending data to the hub?"
252 IMU_INSTALL_TYPE_EMBEDDED = 0;
253 IMU_INSTALL_TYPE_RETROFIT = 1;
254 IMU_INSTALL_TYPE_NONE = 2;
256 optional ImuInstallType imu_install_type = 16 [
257 default = IMU_INSTALL_TYPE_EMBEDDED,
258 (jaia.field).debconf = {
260 description: "What type of imu installation does your system have?"
264 enum TemperatureSensorType
266 TEMPERATURE_SENSOR_TYPE_BAR02 = 0;
267 TEMPERATURE_SENSOR_TYPE_BAR30 = 1;
268 TEMPERATURE_SENSOR_TYPE_TSYS01 = 2;
269 TEMPERATURE_SENSOR_TYPE_NONE = 3;
271 optional TemperatureSensorType temperature_sensor_type = 17 [
272 default = TEMPERATURE_SENSOR_TYPE_BAR30,
273 (jaia.field).debconf = {
275 description: "What temperature sensor do you want to use?"
279 enum PressureSensorType
281 PRESSURE_SENSOR_TYPE_BAR02 = 0;
282 PRESSURE_SENSOR_TYPE_BAR30 = 1;
283 PRESSURE_SENSOR_TYPE_NONE = 2;
285 optional PressureSensorType pressure_sensor_type = 18 [
286 default = PRESSURE_SENSOR_TYPE_BAR30,
287 (jaia.field).debconf = {
289 description: "What pressure sensor do you have?"
293 enum MotorHarnessType
295 MOTOR_HARNESS_TYPE_RPM_AND_THERMISTOR = 0;
296 MOTOR_HARNESS_TYPE_NONE = 1;
298 optional MotorHarnessType motor_harness_type = 19 [
299 default = MOTOR_HARNESS_TYPE_NONE,
300 (jaia.field).debconf = {
302 description: "What type of motor harness does your bot have?"
308 CAMERA_POSITION_AFT = 0;
309 CAMERA_POSITION_FORE = 1;
310 CAMERA_POSITION_OUTWARD = 2;
311 CAMERA_POSITION_NONE = 3;
313 repeated CameraPosition camera_positions = 20 [(jaia.field).debconf = {
316 description: "Which camera positions?"
319 enum AdditionalSensor
321 ADDITIONAL_SENSOR_TURNER_C_FLOUR = 0 [deprecated = true, (jaia.ev).debconf.replaced_by = "turner_c_fluor"];
322 ADDITIONAL_SENSOR_TURNER_C_FLUOR = 4;
323 ADDITIONAL_SENSOR_TURNER_C_FLUOR_2 = 5;
324 ADDITIONAL_SENSOR_AML = 1;
325 ADDITIONAL_SENSOR_PPK = 2;
326 ADDITIONAL_SENSOR_NONE = 3;
328 repeated AdditionalSensor additional_sensors = 21 [(jaia.field).debconf = {
331 description: "Which additional sensors?"
332 extended_description: "Select turner_c_fluor_2 only if a second fluorometer is physically installed:\nthe BIO payload board announces two fluorometer channels regardless of what is\nwired, so an unselected second channel is not read or reported."
335 optional int32 hub_id = 22 [default = 0, (jaia.field).debconf = {
339 description: "Hub identification number"
340 extended_description: "This is used to set the hostname of the computer and set the correct value in the jaiabot configuration.\nValid hub_ids are 0 to 30, as reported by \"jaia admin bounds --hub_id\".\nTo change in the future, run \"sudo dpkg-reconfigure jaiabot-embedded\""
346 USER_ROLE_ADVANCED = 1;
347 USER_ROLE_DEVELOPER = 2;
349 optional UserRole user_role = 23 [
350 default = USER_ROLE_USER,
351 (jaia.field).debconf = {
353 description: "The user role to be set in the Upgrade UI (this sets which Ansible playbooks are visible to the user)."
360 // Version of the contract this file was written for; files that predate
361 // the field are version 1
362 optional uint32 version = 10 [default = 1];
364 required int32 fleet = 1;
365 repeated int32 hubs = 2;
366 repeated int32 bots = 3;
370 repeated string permanent_authorized_keys = 1;
373 required int32 id = 1;
374 // The Yubikey's key handle; empty for the CloudHub, whose key never leaves it
375 required string private_key = 2;
376 required string public_key = 3;
378 repeated HubKey hub = 2;
381 required string private_key = 2;
382 required string public_key = 3;
384 optional VPNTempKey vpn_tmp = 3;
386 required SSHKeys ssh = 4;
388 // Settings common to every node in the fleet; identity fields (type, ids,
389 // mode) are supplied per node and must not be set here
390 optional NodeSettings settings = 12;
394 required DebconfOverride.NodeType type = 1;
395 required int32 id = 2;
396 // Fields set here replace the common value for this node
397 required NodeSettings settings = 3;
399 repeated NodeOverride override = 13;
401 // Version 1 form of settings and override, migrated to NodeSettings
415 required string key = 1;
416 optional DebconfType type = 2 [default = SELECT];
417 required string value = 3;
419 repeated Debconf debconf = 5 [deprecated = true];
420 required string wlan_password = 6;
421 required bool service_vpn_enabled = 7;
423 message DebconfOverride
431 required NodeType type = 1;
432 required int32 id = 2;
433 repeated Debconf debconf = 3;
435 repeated DebconfOverride debconf_override = 8 [deprecated = true];
438 message Communications
444 required int32 id = 1;
445 required string imei = 2;
447 repeated BotToIMEI bot = 1;
448 // Matches enum in Goby driver
454 required SBDType sbd_type = 2;
455 message RockBLOCKParams
457 required string username = 1;
458 required string password = 2;
460 optional RockBLOCKParams rockblock = 3;
462 optional IridiumSBD iridium_sbd = 1;
464 optional Communications comms = 9;
466 // 10 is version, at the top of the message
468 // What a CloudHub needs that cannot be asked of AWS afterwards. Region, VPC,
469 // subnets, security groups, account and the Elastic IP are all discoverable from
470 // the instance, so they are deliberately absent: a major upgrade rebuilds them
471 // rather than carrying cloud.env across the rootfs swap.
474 // Authentication front end: Authelia behind Caddy
475 required string base_uri = 1;
476 required string admin_email = 2;
477 required string smtp_address = 3;
479 // S3 bucket holding the bot offload; unset means jaia--cloudhub-data--fleet<fleet>
480 optional string data_bucket = 4;
482 // Unset means noreply@auth.jaia.tech; it must be verified with the SMTP provider
483 optional string smtp_sender = 5;
484 // SSM SecureString (name or ARN) holding {"username": ..., "password": ...};
485 // unset means /jaia/cloudhub/smtp_credentials in the CloudHub's own account and region
486 optional string smtp_credentials_ssm_parameter = 6;
488 optional CloudHub cloudhub = 11;
490 // Value of the jaia_customer tag on every AWS resource the fleet owns
491 optional string customer = 14 [default = "jaia"];
493 // A simulation has no CloudHub to reach, so the rule requiring one applies
494 // only to real fleets. Inferring this from the absence of hub 30 would make
495 // a misconfigured real fleet indistinguishable from a VirtualFleet.
499 FLEET_TYPE_SIMULATION = 1;
501 optional FleetType fleet_type = 15 [default = FLEET_TYPE_REAL];
503 // Stated rather than inferred, for the same reason: a real fleet built
504 // without one and a real fleet that has lost hub 30 by mistake look alike,
505 // and only one of them should pass validation. A simulation never has one,
506 // so this says nothing about it either way.
508 // Not has_cloudhub: protobuf already generates that accessor for the
509 // optional cloudhub field above, and the two would not compile together.
510 optional bool includes_cloudhub = 16 [default = true];