syntax = "proto3"; /* * Meshtastic protobufs * * For more information on protobufs (and tools to use them with the language of your choice) see * https://developers.google.com/protocol-buffers/docs/proto3 * * We are not placing any of these defs inside a package, because if you do the * resulting nanopb version is super verbose package mesh. * * Protobuf build instructions: * * To build java classes for reading writing: * protoc -I=. --java_out /tmp mesh.proto * * To generate Nanopb c code: * /home/kevinh/packages/nanopb-0.4.0-linux-x86/generator-bin/protoc --nanopb_out=/tmp -I=app/src/main/proto mesh.proto * * Nanopb binaries available here: https://jpa.kapsi.fi/nanopb/download/ use nanopb 0.4.0 */ option java_package = "com.geeksville.mesh"; option java_outer_classname = "RadioConfigProtos"; option optimize_for = LITE_RUNTIME; /* * The frequency/regulatory region the user has selected. * * Note: In 1.0 builds (which must still be supported by the android app for a * long time) this field will be unpopulated. * * If firmware is ever upgraded from an old 1.0ish build, the old * MyNodeInfo.region string will be used to set UserPreferences.region and the * old value will be no longer set. */ enum RegionCode { Unset = 0; US = 1; EU433 = 2; EU865 = 3; CN = 4; JP = 5; ANZ = 6; KR = 7; TW = 8; RU = 9; /* * Add new regions here */ } /* * Sets the charge control current of devices with a battery charger that can be * configured. This is passed into the axp power management chip like on the tbeam. */ enum ChargeCurrent { MAUnset = 0; MA100 = 1; MA190 = 2; MA280 = 3; MA360 = 4; MA450 = 5; MA550 = 6; MA630 = 7; MA700 = 8; MA780 = 9; MA880 = 10; MA960 = 11; MA1000 = 12; MA1080 = 13; MA1160 = 14; MA1240 = 15; MA1320 = 16; } /* * How the GPS hardware in this unit is operated. * Note: This is independent of how our location is shared with other devices. * For that see LocationSharing */ enum GpsOperation { /* * This is treated as GpsOpMobile - it is the default setting */ GpsOpUnset = 0; /* * Note: This mode was removed, because it is identical go GpsOpMobile with a gps_update_rate of once per day * This node is mostly stationary, we should try to get location only once per day, * Once we have that position we should turn the GPS to sleep mode * This is the recommended configuration for stationary 'router' nodes */ GpsOpStationary = 1; /* * This node is mobile and we should get GPS position at a rate governed by gps_update_rate */ GpsOpMobile = 2; /* * We should only use the GPS to get time (no location data should be acquired/stored) * Once we have the time we treat gps_update_interval as MAXINT (i.e. sleep forever) */ GpsOpTimeOnly = 3; /* * GPS is always turned off - this mode is not recommended - use GpsOpTimeOnly instead */ GpsOpDisabled = 4; } /* * How our location is shared with other nodes (or the local phone) */ enum LocationSharing { /* * This is the default and treated as LocEnabled. */ LocUnset = 0; /* * We are sharing our location */ LocEnabled = 1; /* * We are not sharing our location (if the unit has a GPS it will default to only get time - i.e. GpsOpTimeOnly) */ LocDisabled = 2; } /* * The entire set of user settable/readable settings for our radio device. * Includes both the current channel settings and any preferences the user has * set for behavior of their node */ message RadioConfig { /* * see sw-design.md for more information on these preferences */ message UserPreferences { /* * We should send our position this often (but only if it has changed significantly) * Defaults to 15 minutes */ uint32 position_broadcast_secs = 1; /* * Send our owner info at least this often (also we always send once at boot - to rejoin the mesh) */ uint32 send_owner_interval = 2; /* * If we miss this many owner messages from a node, we declare the node * offline (defaults to 3 - to allow for some lost packets) (FIXME not yet used) * * uint32 num_missed_to_fail = 3; */ /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of 1 minute */ uint32 wait_bluetooth_secs = 4; /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of one minute */ uint32 screen_on_secs = 5; /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of 15 minutes */ uint32 phone_timeout_secs = 6; /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of two hours, MAXUINT for disabled */ uint32 phone_sds_timeout_sec = 7; /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of two hours, MAXUINT for disabled */ uint32 mesh_sds_timeout_secs = 8; /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of one year */ uint32 sds_secs = 9; /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of 3600 */ uint32 ls_secs = 10; /* * Power management state machine option. * See https://github.com/meshtastic/Meshtastic-device/blob/master/docs/software/power.md for details. * 0 for default of 10 seconds */ uint32 min_wake_secs = 11; /* * If set, this node will try to join the specified wifi network and * acquire an address via DHCP */ string wifi_ssid = 12; /* * If set, will be use to authenticate to the named wifi */ string wifi_password = 13; /* * If set, the node will operate as an AP (and DHCP server), otherwise it * will be a station */ bool wifi_ap_mode = 14; /* * The region code for my radio (US, CN, EU433, etc...) */ RegionCode region = 15; /* * Sets the current of the battery charger */ ChargeCurrent charge_current = 16; /* * Are we operating as a router. * Changes behavior in the following ways: * The device will only sleep for critically low battery level (i.e. always tries to stay alive for the mesh) * In the future routing decisions will preferentially route packets through nodes with this attribute (because assumed * good line of sight) */ bool is_router = 37; /* * If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in * we should try to minimize power consumption as much as possible. * YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case). */ bool is_low_power = 38; /* * If set, this node is at a fixed position. * We will generate GPS position updates at the regular interval, but use whatever the last lat/lon/alt we have for the node. * The lat/lon/alt can be set by an internal GPS or with the help of the app. */ bool fixed_position = 39; /* * If set, this will disable the SerialConsole by not initilizing the StreamAPI */ bool serial_disabled = 40; /* * How our location is shared with other nodes (or the local phone) */ LocationSharing location_share = 32; /* * How the GPS hardware in this unit is operated. * Note: This is independent of how our location is shared with other devices. * For that see LocationSharing */ GpsOperation gps_operation = 33; /* * How often should we try to get GPS position (in seconds) when we are in GpsOpMobile mode? * or zero for the default of once every 30 seconds * or a very large value (maxint) to update only once at boot. */ uint32 gps_update_interval = 34; /* * How long should we try to get our position during each gps_update_interval attempt? (in seconds) * Or if zero, use the default of 30 seconds. * If we don't get a new gps fix in that time, the gps will be put into sleep until the next gps_update_rate * window. */ uint32 gps_attempt_time = 36; /* * This parameter is for advanced users with advanced test equipment, we do not recommend most users use it. * A frequency offset that is added to to the calculated band center frequency. * Used to correct for crystal calibration errors. */ float frequency_offset = 41; /* * The server to use for our MQTT global message gateway feature. * If not set, the default server will be used */ string mqtt_server = 42; /* * If a meshtastic node is able to reach the internet it will normally attempt to gateway any channels that are marked as * is_uplink_enabled or is_downlink_enabled. * But if this flag is set, all MQTT features will be disabled and no servers will be contacted. */ bool mqtt_disabled = 43; /* * This setting is never saved to disk, but if set, all device settings will be returned to factory defaults. * (Region, serial number etc... will be preserved) */ bool factory_reset = 100; /* * By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). * Set this to true to leave the debug log outputting even when API is active. */ bool debug_log_enabled = 101; /* * If true, radio should not try to be smart about what packets to queue to * the phone * bool keep_all_packets = 101; * If true, we will try to capture all the packets sent on the mesh, not just the ones destined to our node. * bool promiscuous_mode = 102; * For testing it is useful sometimes to force a node to never listen to * particular other nodes (simulating radio out of range). All nodenums listed * in ignore_incoming will have packets they send droped on receive (by router.cpp) */ repeated uint32 ignore_incoming = 103; /* * Preferences for the SerialPlugin * FIXME - Move this out of UserPreferences and into a section for plugin configuration. */ bool serialplugin_enabled = 120; bool serialplugin_echo = 121; uint32 serialplugin_rxd = 122; uint32 serialplugin_txd = 123; uint32 serialplugin_timeout = 124; uint32 serialplugin_mode = 125; /* * Preferences for the ExternalNotificationPlugin * FIXME - Move this out of UserPreferences and into a section for plugin configuration. */ bool ext_notification_plugin_enabled = 126; uint32 ext_notification_plugin_output_ms = 127; uint32 ext_notification_plugin_output = 128; bool ext_notification_plugin_active = 129; bool ext_notification_plugin_alert_message = 130; bool ext_notification_plugin_alert_bell = 131; /* *Preferences for the RangeTestPlugin * FIXME - Move this out of UserPreferences and into a section for plugin configuration. */ bool range_test_plugin_enabled = 132; uint32 range_test_plugin_sender = 133; bool range_test_plugin_save = 134; /* * Preferences for the StoreForwardPlugin *FIXME - Move this out of UserPreferences and into a section for plugin configuration. (was 136) */ bool store_forward_plugin_enabled = 148; uint32 store_forward_plugin_records = 137; reserved 136; /* * Preferences for the EnvironmentalMeasurement Plugin * FIXME - Move this out of UserPreferences and into a section for plugin configuration. * Enable/Disable the environmental measurement plugin measurement collection */ bool environmental_measurement_plugin_measurement_enabled = 140; /* * Enable/Disable the environmental measurement plugin on-device display */ bool environmental_measurement_plugin_screen_enabled = 141; /* * Sometimes sensor reads can fail. * If this happens, we will retry a configurable number of attempts, * each attempt will be delayed by the minimum required refresh rate for that sensor */ uint32 environmental_measurement_plugin_read_error_count_threshold = 142; /* * Interval in seconds of how often we should try to send our * measurements to the mesh */ uint32 environmental_measurement_plugin_update_interval = 143; /* * Sometimes we can end up with more than read_error_count_threshold failures. * In this case, we will stop trying to read from the sensor for a while. * Wait this long until trying to read from the sensor again */ uint32 environmental_measurement_plugin_recovery_interval = 144; /* * We'll always read the sensor in Celsius, but sometimes we might want to * display the results in Farenheit as a "user preference". */ bool environmental_measurement_plugin_display_farenheit = 145; enum EnvironmentalMeasurementSensorType { DHT11 = 0; }; /* * Specify the sensor type */ EnvironmentalMeasurementSensorType environmental_measurement_plugin_sensor_type = 146; /* * Specify the peferred GPIO Pin for sensor readings */ uint32 environmental_measurement_plugin_sensor_pin = 147; } UserPreferences preferences = 1; }