From d8213ad133c42fb59a052326659e2cbfde3db6d6 Mon Sep 17 00:00:00 2001 From: sigmahour <111950404+sigmahour@users.noreply.github.com> Date: Thu, 25 Aug 2022 18:55:44 -0400 Subject: [PATCH 01/12] removal of unused import causing error in protoc (#193) * removal of unused import causing error is protoc * removed unused import Co-authored-by: sigmahour <> --- module_config.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/module_config.proto b/module_config.proto index ae45d72..db00c98 100644 --- a/module_config.proto +++ b/module_config.proto @@ -1,5 +1,4 @@ syntax = "proto3"; -import "telemetry.proto"; option java_package = "com.geeksville.mesh"; option java_outer_classname = "ModuleConfigProtos"; From f68db84414c93fcaac3053a4667bab5cf848bdbb Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Wed, 31 Aug 2022 20:23:40 +1000 Subject: [PATCH 02/12] Update `hop_limit` comment --- config.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.proto b/config.proto index 61a2ee9..e899945 100644 --- a/config.proto +++ b/config.proto @@ -565,8 +565,8 @@ message Config { RegionCode region = 7; /* - * Overrides HOPS_RELIABLE and sets the maximum number of hops. This can't be greater than 7. - * 0 for default of 3 + * Maximum number of hops. This can't be greater than 7. + * Default of 3 */ uint32 hop_limit = 8; From 99e4eaf66c2918ce43869b79a7f65270550ea0c2 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 3 Sep 2022 07:54:37 -0500 Subject: [PATCH 03/12] Mqtt json_enabled --- module_config.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module_config.proto b/module_config.proto index db00c98..592790a 100644 --- a/module_config.proto +++ b/module_config.proto @@ -49,6 +49,11 @@ message ModuleConfig { * Decrypted packets may be useful for external systems that want to consume meshtastic packets */ bool encryption_enabled = 5; + + /* + * Whether to send / consume json packets on MQTT + */ + bool json_enabled = 6; } /* From da5df89939d0a52cb7debe2503151688b27e26f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 7 Sep 2022 21:01:20 +0200 Subject: [PATCH 04/12] Add ENUM for a new TBEAM --- mesh.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mesh.proto b/mesh.proto index a795047..41205cd 100644 --- a/mesh.proto +++ b/mesh.proto @@ -290,6 +290,11 @@ enum HardwareModel { */ HELTEC_V1 = 11; + /* + * New T-BEAM with ESP32-S3 CPU + */ + LILYGO_TBEAM_S3_CORE = 12; + /* * Less common/prototype boards listed here (needs one more byte over the air) */ From 59e3b65b5d9aaf98a9c448f751c3de4e80056bdb Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Wed, 7 Sep 2022 11:04:18 +0930 Subject: [PATCH 05/12] Use consistant naming + wifiConfig rename --- admin.options | 2 +- admin.proto | 2 +- config.proto | 121 ++++++++++++++++-------------------------- deviceonly.proto | 5 -- mesh.options | 8 +-- mesh.proto | 70 +++++++++++------------- module_config.proto | 26 ++++----- notused/future.proto | 36 ------------- portnums.proto | 11 ---- remote_hardware.proto | 2 +- telemetry.proto | 2 +- 11 files changed, 96 insertions(+), 189 deletions(-) delete mode 100644 notused/future.proto diff --git a/admin.options b/admin.options index 2a87e5f..0873a92 100644 --- a/admin.options +++ b/admin.options @@ -1,4 +1,4 @@ -*AdminMessage.variant anonymous_oneof:true +*AdminMessage.payload_variant anonymous_oneof:true *AdminMessage.set_canned_message_module_messages max_size:201 *AdminMessage.get_canned_message_module_messages_response max_size:201 diff --git a/admin.proto b/admin.proto index 522a76e..0c7deda 100644 --- a/admin.proto +++ b/admin.proto @@ -104,7 +104,7 @@ message AdminMessage { /* * TODO: REPLACE */ - oneof variant { + oneof payload_variant { /* * Set the owner for this node diff --git a/config.proto b/config.proto index e899945..de3f357 100644 --- a/config.proto +++ b/config.proto @@ -18,26 +18,26 @@ message Config { /* * Client device role */ - Client = 0; + CLIENT = 0; /* * Client Mute device role * Same as a client except packets will not hop over this node, does not contribute to routing packets for mesh. */ - ClientMute = 1; + CLIENT_MUTE = 1; /* * Router device role. * Mesh packets will prefer to be routed over this node. This node will not be used by client apps. * The wifi/ble radios and the oled screen will be put to sleep. */ - Router = 2; + ROUTER = 2; /* * Router Client device role * Mesh packets will prefer to be routed over this node. The Router Client can be used as both a Router and an app connected Client. */ - RouterClient = 3; + ROUTER_CLIENT = 3; } @@ -84,61 +84,61 @@ message Config { /* * Required for compilation */ - POS_UNDEFINED = 0x0000; + UNSET = 0x0000; /* * Include an altitude value (if available) */ - POS_ALTITUDE = 0x0001; + ALTITUDE = 0x0001; /* * Altitude value is MSL */ - POS_ALT_MSL = 0x0002; + ALTITUDE_MSL = 0x0002; /* * Include geoidal separation */ - POS_GEO_SEP = 0x0004; + GEOIDAL_SEPERATION = 0x0004; /* * Include the DOP value ; PDOP used by default, see below */ - POS_DOP = 0x0008; + DOP = 0x0008; /* * If POS_DOP set, send separate HDOP / VDOP values instead of PDOP */ - POS_HVDOP = 0x0010; + HVDOP = 0x0010; /* * Include number of "satellites in view" */ - POS_SATINVIEW = 0x0020; + SATINVIEW = 0x0020; /* * Include a sequence number incremented per packet */ - POS_SEQ_NOS = 0x0040; + SEQ_NO = 0x0040; /* * Include positional timestamp (from GPS solution) */ - POS_TIMESTAMP = 0x0080; + TIMESTAMP = 0x0080; /* * Include positional heading * Intended for use with vehicle not walking speeds * walking speeds are likely to be error prone like the compass */ - POS_HEADING = 0x0100; + HEADING = 0x0100; /* * Include positional speed * Intended for use with vehicle not walking speeds * walking speeds are likely to be error prone like the compass */ - POS_SPEED = 0x0200; + SPEED = 0x0200; } /* @@ -193,37 +193,6 @@ message Config { */ message PowerConfig { - /* - * Sets the charge control current of devices with a battery charger that can be configured - * **TBEAM 1.1 Only** - */ - 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; - } - - /* - * Sets the current of the battery charger - * TBEAM 1.1 Only - */ - ChargeCurrent charge_current = 1; - /* * 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. @@ -286,48 +255,48 @@ message Config { } /* - * WiFi Config + * Network Config */ - message WiFiConfig { + message NetworkConfig { enum WiFiMode { /* * This mode is used to connect to an external WiFi network */ - Client = 0; + CLIENT = 0; /* * In this mode the node will operate as an AP (and DHCP server) */ - AccessPoint = 1; + ACCESS_POINT = 1; /* * If set, the node AP will broadcast as a hidden SSID */ - AccessPointHidden = 2; + ACCESS_POINT_HIDDEN = 2; } /* * Enable WiFi (disables Bluetooth) */ - bool enabled = 1; + bool wifi_enabled = 1; /* * If set, this node will try to join the specified wifi network and * acquire an address via DHCP */ - WiFiMode mode = 2; + WiFiMode wifi_mode = 2; /* * If set, this node will try to join the specified wifi network and * acquire an address via DHCP */ - string ssid = 3; + string wifi_ssid = 3; /* * If set, will be use to authenticate to the named wifi */ - string psk = 4; + string wifi_psk = 4; } /* @@ -343,38 +312,38 @@ message Config { * GPS coordinates are displayed in the normal decimal degrees format: * DD.DDDDDD DDD.DDDDDD */ - GpsFormatDec = 0; + DEC = 0; /* * GPS coordinates are displayed in the degrees minutes seconds format: * DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant */ - GpsFormatDMS = 1; + DMS = 1; /* * Universal Transverse Mercator format: * ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing */ - GpsFormatUTM = 2; + UTM = 2; /* * Military Grid Reference System format: * ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square, * E is easting, N is northing */ - GpsFormatMGRS = 3; + MGRS = 3; /* * Open Location Code (aka Plus Codes). */ - GpsFormatOLC = 4; + OLC = 4; /* * Ordnance Survey Grid Reference (the National Grid System of the UK). * Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square, * E is the easting, N is the northing */ - GpsFormatOSGR = 5; + OSGR = 5; } /* @@ -411,7 +380,7 @@ message Config { /* * Region is not set */ - Unset = 0; + UNSET = 0; /* * United States @@ -421,12 +390,12 @@ message Config { /* * European Union 433mhz */ - EU433 = 2; + EU_433 = 2; /* * European Union 433mhz */ - EU868 = 3; + EU_868 = 3; /* * China @@ -466,7 +435,7 @@ message Config { /* * New Zealand 865mhz */ - NZ865 = 11; + NZ_865 = 11; /* * Thailand @@ -483,37 +452,37 @@ message Config { /* * Long Range - Fast */ - LongFast = 0; + LONG_FAST = 0; /* * Long Range - Slow */ - LongSlow = 1; + LONG_SLOW = 1; /* * Very Long Range - Slow */ - VLongSlow = 2; + VERY_LONG_SLOW = 2; /* * Medium Range - Slow */ - MedSlow = 3; + MEDIUM_SLOW = 3; /* * Medium Range - Fast */ - MedFast = 4; + MEDIUM_FAST = 4; /* * Short Range - Slow */ - ShortSlow = 5; + SHORT_SLOW = 5; /* * Short Range - Fast */ - ShortFast = 6; + SHORT_FAST = 6; } /* @@ -591,17 +560,17 @@ message Config { /* * Device generates a random pin that will be shown on the screen of the device for pairing */ - RandomPin = 0; + RANDOM_PIN = 0; /* * Device requires a specified fixed pin for pairing */ - FixedPin = 1; + FIXED_PIN = 1; /* * Device requires no pin for pairing */ - NoPin = 2; + NO_PIN = 2; } /* @@ -624,7 +593,7 @@ message Config { /* * Payload Variant */ - oneof payloadVariant { + oneof payload_variant { DeviceConfig device = 1; PositionConfig position = 2; diff --git a/deviceonly.proto b/deviceonly.proto index f77ac15..a43ac0d 100644 --- a/deviceonly.proto +++ b/deviceonly.proto @@ -18,11 +18,6 @@ option java_outer_classname = "DeviceOnly"; */ message DeviceState { - /* - * Was secondary_channels before 1.2 - */ - reserved 12; - /* * Read only settings/info about this node */ diff --git a/mesh.options b/mesh.options index fe42949..8554239 100644 --- a/mesh.options +++ b/mesh.options @@ -13,7 +13,7 @@ # outside of this envelope *Data.payload max_size:237 *Data.payload_compressed max_size:237 -*Data.payloadVariant anonymous_oneof:true +*Data.payload_variant anonymous_oneof:true # Big enough for 1.2.28.568032c-d *MyNodeInfo.firmware_version max_size:18 @@ -26,13 +26,13 @@ # Note: the actual limit (because of header bytes) on the size of encrypted payloads is 251 bytes, but I use 256 # here because we might need to fill with zeros for padding to encryption block size (16 bytes per block) *MeshPacket.encrypted max_size:256 -*MeshPacket.payloadVariant anonymous_oneof:true +*MeshPacket.payload_variant anonymous_oneof:true *MeshPacket.hop_limit int_size:8 *MeshPacket.channel int_size:8 -*ToRadio.payloadVariant anonymous_oneof:true +*ToRadio.payload_variant anonymous_oneof:true -*FromRadio.payloadVariant anonymous_oneof:true +*FromRadio.payload_variant anonymous_oneof:true *Routing.variant anonymous_oneof:true diff --git a/mesh.proto b/mesh.proto index 41205cd..e3c9b11 100644 --- a/mesh.proto +++ b/mesh.proto @@ -54,27 +54,22 @@ message Position { /* * TODO: REPLACE */ - LOCSRC_UNSPECIFIED = 0; + UNSET = 0; /* * TODO: REPLACE */ - LOCSRC_MANUAL_ENTRY = 1; + MANUAL = 1; /* * TODO: REPLACE */ - LOCSRC_GPS_INTERNAL = 2; + GPS_INTERNAL = 2; /* * TODO: REPLACE */ - LOCSRC_GPS_EXTERNAL = 3; - /* - * More location sources can be added here when available: - * GSM, radio beacons (BLE etc), location fingerprinting etc - * TODO: REMOVE/INTEGRATE - */ + GPS_EXTERNAL = 3; } /* @@ -91,27 +86,27 @@ message Position { /* * TODO: REPLACE */ - ALTSRC_UNSPECIFIED = 0; + UNSET = 0; /* * TODO: REPLACE */ - ALTSRC_MANUAL_ENTRY = 1; + MANUAL = 1; /* * TODO: REPLACE */ - ALTSRC_GPS_INTERNAL = 2; + GPS_INTERNAL = 2; /* * TODO: REPLACE */ - ALTSRC_GPS_EXTERNAL = 3; + GPS_EXTERNAL = 3; /* * TODO: REPLACE */ - ALTSRC_BAROMETRIC = 4; + BAROMETRIC = 4; } /* @@ -213,11 +208,6 @@ message Position { * detect lost updates if needed */ uint32 pos_seq_number = 41; - - /* - * END precision positioning elements - * TODO: REMOVE/INTEGRATE - */ } /* @@ -246,7 +236,7 @@ enum HardwareModel { /* * TODO: REPLACE */ - TLORA_V2_1_1p6 = 3; + TLORA_V2_1_1P6 = 3; /* * TODO: REPLACE @@ -262,7 +252,7 @@ enum HardwareModel { /* * TODO: REPLACE */ - TBEAM0p7 = 6; + TBEAM_V0P7 = 6; /* * TODO: REPLACE @@ -272,7 +262,7 @@ enum HardwareModel { /* * TODO: REPLACE */ - TLORA_V1_1p3 = 8; + TLORA_V1_1P3 = 8; /* * TODO: REPLACE @@ -640,7 +630,7 @@ message Waypoint { /* * A packet envelope sent/received over the mesh - * only payloadVariant is sent in the payload portion of the LORA packet. + * only payload_variant is sent in the payload portion of the LORA packet. * The other fields are either not sent at all, or sent in the special 16 byte LORA header. */ message MeshPacket { @@ -748,7 +738,7 @@ message MeshPacket { * Therefore channel_index is inherently a local concept and meaningless to send between nodes. * Very briefly, while sending and receiving deep inside the device Router code, this field instead * contains the 'channel hash' instead of the index. - * This 'trick' is only used while the payloadVariant is an 'encrypted'. + * This 'trick' is only used while the payload_variant is an 'encrypted'. */ uint32 channel = 3; @@ -761,7 +751,7 @@ message MeshPacket { * The numeric IDs for these fields were selected to keep backwards compatibility with old applications. */ - oneof payloadVariant { + oneof payload_variant { /* * TODO: REPLACE @@ -851,7 +841,7 @@ enum Constants { * First enum must be zero, and we are just using this enum to * pass int constants between two very different environments */ - Unused = 0; + UNSET = 0; /* * From mesh.options @@ -951,63 +941,63 @@ enum CriticalErrorCode { /* * TODO: REPLACE */ - None = 0; + NONE = 0; /* * A software bug was detected while trying to send lora */ - TxWatchdog = 1; + TX_WATCHDOG = 1; /* * A software bug was detected on entry to sleep */ - SleepEnterWait = 2; + SLEEP_ENTER_WAIT = 2; /* * No Lora radio hardware could be found */ - NoRadio = 3; + NO_RADIO = 3; /* * Not normally used */ - Unspecified = 4; + UNSPECIFIED = 4; /* * We failed while configuring a UBlox GPS */ - UBloxInitFailed = 5; + UBLOX_UNIT_FAILED = 5; /* * This board was expected to have a power management chip and it is missing or broken */ - NoAXP192 = 6; + NO_AXP192 = 6; /* * The channel tried to set a radio setting which is not supported by this chipset, * radio comms settings are now undefined. */ - InvalidRadioSetting = 7; + INVALID_RADIO_SETTING = 7; /* * Radio transmit hardware failure. We sent data to the radio chip, but it didn't * reply with an interrupt. */ - TransmitFailed = 8; + TRANSMIT_FAILED = 8; /* * We detected that the main CPU voltage dropped below the minumum acceptable value */ - Brownout = 9; + BROWNOUT = 9; /* Selftest of SX1262 radio chip failed */ - SX1262Failure = 10; + SX1262_FAILURE = 10; /* * A (likely software but possibly hardware) failure was detected while trying to send packets. * If this occurs on your board, please post in the forum so that we can ask you to collect some information to allow fixing this bug */ - RadioSpiBug = 11; + RADIO_SPI_BUG = 11; } /* @@ -1203,7 +1193,7 @@ message FromRadio { /* * Log levels, chosen to match python logging conventions. */ - oneof payloadVariant { + oneof payload_variant { /* * Log levels, chosen to match python logging conventions. @@ -1292,7 +1282,7 @@ message ToRadio { /* * Log levels, chosen to match python logging conventions. */ - oneof payloadVariant { + oneof payload_variant { /* * Send this packet on the mesh diff --git a/module_config.proto b/module_config.proto index 592790a..ad7b645 100644 --- a/module_config.proto +++ b/module_config.proto @@ -65,7 +65,7 @@ message ModuleConfig { * TODO: REPLACE */ enum Serial_Baud { - BAUD_Default = 0; + Default = 0; BAUD_110 = 1; BAUD_300 = 2; BAUD_600 = 3; @@ -87,9 +87,9 @@ message ModuleConfig { * TODO: REPLACE */ enum Serial_Mode { - MODE_Default = 0; - MODE_SIMPLE = 1; - MODE_PROTO = 2; + DEFAULT = 0; + SIMPLE = 1; + PROTO = 2; }; /* @@ -270,42 +270,42 @@ message ModuleConfig { /* * TODO: REPLACE */ - KEY_NONE = 0; + NONE = 0; /* * TODO: REPLACE */ - KEY_UP = 17; + UP = 17; /* * TODO: REPLACE */ - KEY_DOWN = 18; + DOWN = 18; /* * TODO: REPLACE */ - KEY_LEFT = 19; + LEFT = 19; /* * TODO: REPLACE */ - KEY_RIGHT = 20; + RIGHT = 20; /* * '\n' */ - KEY_SELECT = 10; + SELECT = 10; /* * TODO: REPLACE */ - KEY_BACK = 27; + BACK = 27; /* * TODO: REPLACE */ - KEY_CANCEL = 24; + CANCEL = 24; } /* @@ -369,7 +369,7 @@ message ModuleConfig { /* * TODO: REPLACE */ - oneof payloadVariant { + oneof payload_variant { /* * TODO: REPLACE diff --git a/notused/future.proto b/notused/future.proto deleted file mode 100644 index 902b0d8..0000000 --- a/notused/future.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; - -/* - * This file documents protobufs that are being considered but are not yet in use - */ - -/* - * Placeholder for data we will eventually set during initial programming. - * This will allow us to stop having a load for each region. - */ -message ManufacturingData { - - /* - * center frequency for the radio hardware that was stuffed - */ - uint32 fradioFreq = 1; - - /* - * TBEAM, HELTEC, etc... - */ - string hw_model = 2; - - /* - * Hardware version number - */ - string hw_version = 3; - - /* - * This code is written during manfacturing time and allows users to confirm that - * the initial manufacturing tests succeeded. - * 0 means no test performed. - * 1 means all tests passed - * negative numbers indicate particular error codes - */ - sint32 selftest_result = 4; -} \ No newline at end of file diff --git a/portnums.proto b/portnums.proto index c43ab8b..14c5eef 100644 --- a/portnums.proto +++ b/portnums.proto @@ -35,16 +35,6 @@ enum PortNum { */ TEXT_MESSAGE_APP = 1; - /* - * A message receive acknowledgment, sent in cleartext - allows radio to - * show user that a message has been read by the recipient, optional - * Note: this concept has been removed for now. - * Once READACK is implemented, use the new packet type/port number stuff? - * @exclude - * CLEAR_READACK = 2; - * TODO: REMOVE/INTEGRATE - */ - /* * Reserved for built-in GPIO/example app. * See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number @@ -75,7 +65,6 @@ enum PortNum { */ ADMIN_APP = 6; - /* * Compressed TEXT_MESSAGE payloads. */ diff --git a/remote_hardware.proto b/remote_hardware.proto index e411fcf..5a5a060 100644 --- a/remote_hardware.proto +++ b/remote_hardware.proto @@ -59,7 +59,7 @@ message HardwareMessage { /* * What type of HardwareMessage is this? */ - Type typ = 1; + Type type = 1; /* * What gpios are we changing. Not used for all MessageTypes, see MessageType for details diff --git a/telemetry.proto b/telemetry.proto index 66355c5..d35fe60 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -99,7 +99,7 @@ enum TelemetrySensorType { /* * No external telemetry sensor explicitly set */ - NotSet = 0; + UNSET = 0; /* * High accuracy temperature, pressure, humidity From ad4f75a5b14c62e945d166089d8e4e10b83b53fd Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Wed, 7 Sep 2022 11:43:54 +0930 Subject: [PATCH 06/12] re-index & reorder --- admin.proto | 177 +++++++++++++++++++++++--------------------- channel.proto | 12 +-- config.proto | 43 +++++------ mesh.proto | 147 ++++++++++++++++-------------------- module_config.proto | 4 +- 5 files changed, 183 insertions(+), 200 deletions(-) diff --git a/admin.proto b/admin.proto index 0c7deda..89d6e5b 100644 --- a/admin.proto +++ b/admin.proto @@ -106,85 +106,110 @@ message AdminMessage { */ oneof payload_variant { - /* - * Set the owner for this node - */ - User set_owner = 2; - - /* - * Set channels (using the new API). - * A special channel is the "primary channel". - * The other records are secondary channels. - * Note: only one channel can be marked as primary. - * If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically. - */ - Channel set_channel = 3; - /* * Send the specified channel in the response to this message * NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present) */ - uint32 get_channel_request = 6; + uint32 get_channel_request = 1; /* - * TODO: REPLACE - */ - Channel get_channel_response = 7; - + * TODO: REPLACE + */ + Channel get_channel_response = 2; + /* - * Send the current owner data in the response to this message. - */ - bool get_owner_request = 8; - + * Send the current owner data in the response to this message. + */ + bool get_owner_request = 3; + /* - * TODO: REPLACE - */ - User get_owner_response = 9; + * TODO: REPLACE + */ + User get_owner_response = 4; + + /* + * Ask for the following config data to be sent + */ + ConfigType get_config_request = 5; + + /* + * Send the current Config in the response to this message. + */ + Config get_config_response = 6; /* * Ask for the following config data to be sent */ - ConfigType get_config_request = 10; + ModuleConfigType get_module_config_request = 7; /* * Send the current Config in the response to this message. */ - Config get_config_response = 11; - - /* - * Set the current Config - */ - Config set_config = 12; - - /* - * Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins - */ - bool confirm_set_config = 13; - - /* - * Ask for the following config data to be sent - */ - ModuleConfigType get_module_config_request = 14; - - /* - * Send the current Config in the response to this message. - */ - ModuleConfig get_module_config_response = 15; - - /* - * Set the current Config - */ - ModuleConfig set_module_config = 16; - - /* - * Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins - */ - bool confirm_set_module_config = 17; + ModuleConfig get_module_config_response = 8; /* * Send all channels in the response to this message */ - bool get_all_channel_request = 18; + bool get_all_channel_request = 9; + + /* + * Get the Canned Message Module messages in the response to this message. + */ + bool get_canned_message_module_messages_request = 10; + + /* + * Get the Canned Message Module messages in the response to this message. + */ + string get_canned_message_module_messages_response = 11; + + /* + * Request the node to send device metadata (firmware, protobuf version, etc) + */ + uint32 get_device_metadata_request = 12; + + /* + * Device metadata response + */ + DeviceMetadata get_device_metadata_response = 13; + + /* + * Set the owner for this node + */ + User set_owner = 32; + + /* + * Set channels (using the new API). + * A special channel is the "primary channel". + * The other records are secondary channels. + * Note: only one channel can be marked as primary. + * If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically. + */ + Channel set_channel = 33; + + /* + * Set the current Config + */ + Config set_config = 34; + + /* + * Set the current Config + */ + ModuleConfig set_module_config = 35; + + /* + * Set the Canned Message Module messages text. + */ + string set_canned_message_module_messages = 36; + + /* + * Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins + */ + bool confirm_set_config = 64; + + /* + * Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins + */ + bool confirm_set_module_config = 65; /* * Setting channels/radio config remotely carries the risk that you might send an invalid config and the radio never talks to your mesh again. @@ -192,52 +217,32 @@ message AdminMessage { * If you fail to do so, the radio will assume loss of comms and revert your changes. * These messages are optional when changing the local node. */ - bool confirm_set_channel = 32; + bool confirm_set_channel = 66; /* * TODO: REPLACE */ - bool confirm_set_radio = 33; + bool confirm_set_radio = 67; /* * This message is only supported for the simulator porduino build. * If received the simulator will exit successfully. */ - bool exit_simulator = 34; + bool exit_simulator = 96; /* * Tell the node to reboot in this many seconds (or <0 to cancel reboot) */ - int32 reboot_seconds = 35; - - /* - * Get the Canned Message Module messages in the response to this message. - */ - bool get_canned_message_module_messages_request = 36; - - /* - * Get the Canned Message Module messages in the response to this message. - */ - string get_canned_message_module_messages_response = 37; - - /* - * Set the Canned Message Module messages text. - */ - string set_canned_message_module_messages = 44; + int32 reboot_seconds = 97; /* * Tell the node to shutdown in this many seconds (or <0 to cancel shutdown) */ - int32 shutdown_seconds = 51; + int32 shutdown_seconds = 98; /* - * Request the node to send device metadata (firmware, protobuf version, etc) + * Tell the node to factory reset, all device settings will be returned to factory defaults. */ - uint32 get_device_metadata_request = 52; - - /* - * Device metadata response - */ - DeviceMetadata get_device_metadata_response = 53; + int32 factory_reset = 99; } } diff --git a/channel.proto b/channel.proto index 94c91de..19afc19 100644 --- a/channel.proto +++ b/channel.proto @@ -50,7 +50,7 @@ message ChannelSettings { * return hash; * } */ - uint32 channel_num = 9; + uint32 channel_num = 1; /* * A simple pre-shared key for now for crypto. @@ -64,7 +64,7 @@ message ChannelSettings { * `2` through 10 = The default channel key, except with 1 through 9 added to the last byte. * Shown to user as simple1 through 10 */ - bytes psk = 4; + bytes psk = 2; /* * A SHORT name that will be packed into the URL. @@ -76,7 +76,7 @@ message ChannelSettings { * For channel_num hashing empty string will be treated as "X". * Where "X" is selected based on the English words listed above for ModemPreset */ - string name = 5; + string name = 3; /* * Used to construct a globally unique channel ID. @@ -91,17 +91,17 @@ message ChannelSettings { * a table of well known IDs. * (see Well Known Channels FIXME) */ - fixed32 id = 10; + fixed32 id = 4; /* * If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe */ - bool uplink_enabled = 16; + bool uplink_enabled = 5; /* * If true, messages seen on the internet will be forwarded to the local mesh. */ - bool downlink_enabled = 17; + bool downlink_enabled = 6; } /* diff --git a/config.proto b/config.proto index de3f357..01ca397 100644 --- a/config.proto +++ b/config.proto @@ -51,21 +51,11 @@ message Config { */ bool serial_disabled = 2; - /* - * This setting is never saved to disk, but if set, all device settings will be returned to factory defaults. - */ - bool factory_reset = 3; - /* * 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 = 4; - - /* - * NTP server to use if WiFi is conneced, defaults to `0.pool.ntp.org` - */ - string ntp_server = 5; + bool debug_log_enabled = 3; } @@ -162,14 +152,14 @@ message Config { /* * Should the GPS be disabled for this node? */ - bool gps_disabled = 5; + bool gps_disabled = 4; /* * How often should we try to get GPS position (in seconds) * 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 = 6; + uint32 gps_update_interval = 5; /* * How long should we try to get our position during each gps_update_interval attempt? (in seconds) @@ -177,13 +167,13 @@ message Config { * 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 = 7; + uint32 gps_attempt_time = 6; /* * Bit field of boolean configuration options for POSITION messages * (bitwise OR of PositionFlags) */ - uint32 position_flags = 10; + uint32 position_flags = 7; } @@ -199,12 +189,12 @@ message Config { * YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case). * Advanced Option */ - bool is_power_saving = 2; + bool is_power_saving = 1; /* * If non-zero, the device will fully power off this many seconds after external power is removed. */ - uint32 on_battery_shutdown_after_secs = 4; + uint32 on_battery_shutdown_after_secs = 2; /* * Ratio of voltage divider for battery pin eg. 3.20 (R1=100k, R2=220k) @@ -212,14 +202,14 @@ message Config { * Should be set to floating point value between 2 and 4 * Fixes issues on Heltec v2 */ - float adc_multiplier_override = 6; + float adc_multiplier_override = 3; /* * Wait Bluetooth Seconds * The number of seconds for to wait before turning off BLE in No Bluetooth states * 0 for default of 1 minute */ - uint32 wait_bluetooth_secs = 7; + uint32 wait_bluetooth_secs = 4; /* * Mesh Super Deep Sleep Timeout Seconds @@ -227,7 +217,7 @@ message Config { * for sds_secs (default 1 year) or a button press * 0 for default of two hours, MAXUINT for disabled */ - uint32 mesh_sds_timeout_secs = 9; + uint32 mesh_sds_timeout_secs = 5; /* * Super Deep Sleep Seconds @@ -235,7 +225,7 @@ message Config { * for this value (default 1 year) or a button press * 0 for default of one year */ - uint32 sds_secs = 10; + uint32 sds_secs = 6; /* * Light Sleep Seconds @@ -243,14 +233,14 @@ message Config { * ESP32 Only * 0 for default of 300 */ - uint32 ls_secs = 11; + uint32 ls_secs = 7; /* * Minimum Wake Seconds * While in light sleep when we receive packets on the LoRa radio we will wake and handle them and stay awake in no BLE mode for this value * 0 for default of 10 seconds */ - uint32 min_wake_secs = 12; + uint32 min_wake_secs = 8; } @@ -297,6 +287,11 @@ message Config { * If set, will be use to authenticate to the named wifi */ string wifi_psk = 4; + + /* + * NTP server to use if WiFi is conneced, defaults to `0.pool.ntp.org` + */ + string ntp_server = 5; } /* @@ -598,7 +593,7 @@ message Config { DeviceConfig device = 1; PositionConfig position = 2; PowerConfig power = 3; - WiFiConfig wifi = 4; + NetworkConfig network = 4; DisplayConfig display = 5; LoRaConfig lora = 6; BluetoothConfig bluetooth = 7; diff --git a/mesh.proto b/mesh.proto index e3c9b11..e8116e3 100644 --- a/mesh.proto +++ b/mesh.proto @@ -38,13 +38,7 @@ message Position { * be sent by devices which has a hardware GPS clock. * seconds since 1970 */ - fixed32 time = 9; - - /* - * Precision positioning elements - optional and usually not included - * ------------------------------------------------------------------ - * TODO: REMOVE/INTEGRATE - */ + fixed32 time = 4; /* * How the location was acquired: manual, onboard GPS, external (EUD) GPS @@ -75,7 +69,7 @@ message Position { /* * TODO: REPLACE */ - LocSource location_source = 10; + LocSource location_source = 5; /* * How the altitude was acquired: manual, GPS int/ext, etc @@ -112,27 +106,27 @@ message Position { /* * TODO: REPLACE */ - AltSource altitude_source = 11; + AltSource altitude_source = 6; /* * Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds */ - fixed32 pos_timestamp = 12; + fixed32 timestamp = 7; /* * Pos. timestamp milliseconds adjustment (rarely available or required) */ - int32 pos_time_millis = 13; + int32 timestamp_millis_adjust = 8; /* * HAE altitude in meters - can be used instead of MSL altitude */ - sint32 altitude_hae = 14; + sint32 altitude_hae = 9; /* * Geoidal separation in meters */ - sint32 alt_geoid_sep = 15; + sint32 altitude_geoidal_seperation = 10; /* * Horizontal, Vertical and Position Dilution of Precision, in 1/100 units @@ -141,24 +135,24 @@ message Position { * in which case PDOP becomes redundant (PDOP=sqrt(HDOP^2 + VDOP^2)) * TODO: REMOVE/INTEGRATE */ - uint32 PDOP = 16; + uint32 PDOP = 11; /* * TODO: REPLACE */ - uint32 HDOP = 17; + uint32 HDOP = 12; /* * TODO: REPLACE */ - uint32 VDOP = 18; + uint32 VDOP = 13; /* * GPS accuracy (a hardware specific constant) in mm * multiplied with DOP to calculate positional accuracy * Default: "'bout three meters-ish" :) */ - uint32 gps_accuracy = 19; + uint32 gps_accuracy = 14; /* * Ground speed in m/s and True North TRACK in 1/100 degrees @@ -168,32 +162,32 @@ message Position { * - "yaw" indicates a relative rotation about the vertical axis * TODO: REMOVE/INTEGRATE */ - uint32 ground_speed = 20; + uint32 ground_speed = 15; /* * TODO: REPLACE */ - uint32 ground_track = 21; + uint32 ground_track = 16; /* * GPS fix quality (from NMEA GxGGA statement or similar) */ - uint32 fix_quality = 22; + uint32 fix_quality = 17; /* * GPS fix type 2D/3D (from NMEA GxGSA statement) */ - uint32 fix_type = 23; + uint32 fix_type = 18; /* * GPS "Satellites in View" number */ - uint32 sats_in_view = 24; + uint32 sats_in_view = 19; /* * Sensor ID - in case multiple positioning sensors are being used */ - uint32 sensor_id = 25; + uint32 sensor_id = 20; /* * Estimated/expected time (in seconds) until next update: @@ -201,13 +195,13 @@ message Position { * - if we update at dynamic intervals (based on relative movement etc), * but "AT LEAST every Y seconds", use Y */ - uint32 pos_next_update = 40; + uint32 next_update = 21; /* * A sequence number, incremented with each Position message to help * detect lost updates if needed */ - uint32 pos_seq_number = 41; + uint32 seq_number = 22; } /* @@ -288,72 +282,72 @@ enum HardwareModel { /* * Less common/prototype boards listed here (needs one more byte over the air) */ - LORA_RELAY_V1 = 32; + LORA_RELAY_V1 = 12; /* * TODO: REPLACE */ - NRF52840DK = 33; + NRF52840DK = 13; /* * TODO: REPLACE */ - PPR = 34; + PPR = 14; /* * TODO: REPLACE */ - GENIEBLOCKS = 35; + GENIEBLOCKS = 15; /* * TODO: REPLACE */ - NRF52_UNKNOWN = 36; + NRF52_UNKNOWN = 16; /* * TODO: REPLACE */ - PORTDUINO = 37; + PORTDUINO = 17; /* * The simulator built into the android app */ - ANDROID_SIM = 38; + ANDROID_SIM = 18; /* * Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics */ - DIY_V1 = 39; + DIY_V1 = 19; /* * RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */ - RAK11200 = 40; + RAK11200 = 20; /* * B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */ - NANO_G1 = 41; + NANO_G1 = 21; /* * nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ */ - NRF52840_PCA10059 = 42; + NRF52840_PCA10059 = 22; /* * Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 */ - DR_DEV = 43; + DR_DEV = 23; /* * M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */ - M5STACK = 44; + M5STACK = 24; /* * B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ - STATION_G1 = 45; + STATION_G1 = 25; /* * Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. @@ -416,14 +410,14 @@ message User { * Apps will still need the string here for older builds * (so OTA update can find the right image), but if the enum is available it will be used instead. */ - HardwareModel hw_model = 6; + HardwareModel hw_model = 5; /* * In some regions Ham radio operators have different bandwidth limitations than others. * If this user is a licensed operator, set this flag. * Also, "long_name" should be their licence number. */ - bool is_licensed = 7; + bool is_licensed = 6; } /* @@ -434,7 +428,7 @@ message RouteDiscovery { /* * The list of nodenums this packet has visited so far */ - repeated fixed32 route = 2; + repeated fixed32 route = 1; } /* @@ -799,7 +793,7 @@ message MeshPacket { * For our usecase real world topologies probably have a max of about 3. * This field is normally placed into a few of bits in the header. */ - uint32 hop_limit = 10; + uint32 hop_limit = 9; /* * This packet is being sent as a reliable message, we would prefer it to arrive at the destination. @@ -812,23 +806,23 @@ message MeshPacket { * If after some time we don't hear anyone rebroadcast our packet, we will timeout and retransmit, using the regular resend logic. * Note: This flag is normally sent in a flag bit in the header when sent over the wire */ - bool want_ack = 11; + bool want_ack = 10; /* * The priority of this message for sending. * See MeshPacket.Priority description for more details. */ - Priority priority = 12; + Priority priority = 11; /* * rssi of received packet. Only sent to phone for dispay purposes. */ - int32 rx_rssi = 13; + int32 rx_rssi = 12; /* * Describe if this message is delayed */ - Delayed delayed = 15; + Delayed delayed = 13; } @@ -1022,12 +1016,12 @@ message MyNodeInfo { /* * The maximum number of 'software' channels that can be set on this node. */ - uint32 max_channels = 15; + uint32 max_channels = 3; /* * 0.0.5 etc... */ - string firmware_version = 6; + string firmware_version = 4; /* * An error message we'd like to report back to the mothership through analytics. @@ -1037,29 +1031,29 @@ message MyNodeInfo { * (i.e. it will only be reported once) * a numeric error code to go with error message, zero means no error */ - CriticalErrorCode error_code = 7; + CriticalErrorCode error_code = 5; /* * A numeric error address (nonzero if available) */ - uint32 error_address = 8; + uint32 error_address = 6; /* * The total number of errors this node has ever encountered * (well - since the last time we discarded preferences) */ - uint32 error_count = 9; + uint32 error_count = 7; /* * The total number of reboots this node has ever encountered * (well - since the last time we discarded preferences) */ - uint32 reboot_count = 10; + uint32 reboot_count = 8; /* * Calculated bitrate of the current channel (in Bytes Per Second) */ - float bitrate = 11; + float bitrate = 9; /* * How long before we consider a message abandoned and we can clear our @@ -1067,38 +1061,38 @@ message MyNodeInfo { * message delivery time, 5 minutes. * Formerly called FLOOD_EXPIRE_TIME in the device code */ - uint32 message_timeout_msec = 13; + uint32 message_timeout_msec = 10; /* * The minimum app version that can talk to this device. * Phone/PC apps should compare this to their build number and if too low tell the user they must update their app */ - uint32 min_app_version = 14; + uint32 min_app_version = 11; /* * 24 time windows of 1hr each with the airtime transmitted out of the device per hour. */ - repeated uint32 air_period_tx = 16; + repeated uint32 air_period_tx = 12; /* * 24 time windows of 1hr each with the airtime of valid packets for your mesh. */ - repeated uint32 air_period_rx = 17; + repeated uint32 air_period_rx = 13; /* * Is the device wifi capable? */ - bool has_wifi = 18; + bool has_wifi = 14; /* * Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise). */ - float channel_utilization = 19; + float channel_utilization = 15; /* * Percent of airtime for transmission used within the last hour. */ - float air_util_tx = 20; + float air_util_tx = 16; } /* @@ -1179,11 +1173,6 @@ message LogRecord { */ message FromRadio { - /* - * In the <1.2 versions packet had ID 2, to prevent confusing old apps with our new packets, we've changed - */ - reserved 2; - /* * The packet id, used to allow the phone to request missing read packets from the FIFO, * see our bluetooth docs @@ -1198,7 +1187,7 @@ message FromRadio { /* * Log levels, chosen to match python logging conventions. */ - MeshPacket packet = 11; + MeshPacket packet = 2; /* * Tells the phone what our node number is, can be -1 if we've not yet joined a mesh. @@ -1215,12 +1204,12 @@ message FromRadio { /* * Include a part of the config (was: RadioConfig radio) */ - Config config = 6; + Config config = 5; /* * Set to send debug console output over our protobuf stream */ - LogRecord log_record = 7; + LogRecord log_record = 6; /* * Sent as true once the device has finished sending all of the responses to want_config @@ -1228,7 +1217,7 @@ message FromRadio { * not, it means your config responses haven't started yet. * NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ - uint32 config_complete_id = 8; + uint32 config_complete_id = 7; /* * Sent to tell clients the radio has just rebooted. @@ -1236,13 +1225,13 @@ message FromRadio { * Not used on all transports, currently just used for the serial console. * NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */ - bool rebooted = 9; + bool rebooted = 8; /* * Include module config */ - ModuleConfig moduleConfig = 10; + ModuleConfig moduleConfig = 9; } } @@ -1273,12 +1262,6 @@ message ToRadio { bool mqtt_gateway = 2; } - /* - * In the <1.2 versions packet had ID 2, to prevent confusing old apps with our new packets, we've changed. - * 101-103 were used for set_radio, set_owner, set_channel - */ - reserved 1, 101, 102, 103; - /* * Log levels, chosen to match python logging conventions. */ @@ -1287,13 +1270,13 @@ message ToRadio { /* * Send this packet on the mesh */ - MeshPacket packet = 2; + MeshPacket packet = 1; /* * Information about the peer, sent after the phone sneds want_config_id. * Old clients do not send this, which is fine. */ - PeerInfo peer_info = 3; + PeerInfo peer_info = 2; /* * Phone wants radio to send full node db to the phone, This is @@ -1305,14 +1288,14 @@ message ToRadio { * config_complete_id response this allows clients to never be confused by * a stale old partially sent config. */ - uint32 want_config_id = 100; + uint32 want_config_id = 3; /* * Tell API server we are disconnecting now. * This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link. * (Sending this message is optional for clients) */ - bool disconnect = 104; + bool disconnect = 4; } } diff --git a/module_config.proto b/module_config.proto index ad7b645..ce98780 100644 --- a/module_config.proto +++ b/module_config.proto @@ -65,7 +65,7 @@ message ModuleConfig { * TODO: REPLACE */ enum Serial_Baud { - Default = 0; + DEFAULT = 0; BAUD_110 = 1; BAUD_300 = 2; BAUD_600 = 3; @@ -254,7 +254,7 @@ message ModuleConfig { * We'll always read the sensor in Celsius, but sometimes we might want to * display the results in Fahrenheit as a "user preference". */ - bool environment_display_fahrenheit = 7; + bool environment_display_fahrenheit = 5; } /* From e72af95951ba4664f34374de492469a024dc64c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 9 Sep 2022 10:51:11 +0200 Subject: [PATCH 07/12] fix linter errors in protobuf setup, and restore hardware enum to put less used hardware at 32+ --- localonly.proto | 2 +- mesh.proto | 134 ++++++++++++++++++++++---------------------- module_config.proto | 2 +- telemetry.proto | 2 +- 4 files changed, 70 insertions(+), 70 deletions(-) diff --git a/localonly.proto b/localonly.proto index 6d07c87..0e4fcbe 100644 --- a/localonly.proto +++ b/localonly.proto @@ -33,7 +33,7 @@ message LocalConfig { /* * The part of the config that is specific to the Wifi Settings */ - Config.WiFiConfig wifi = 4; + Config.NetworkConfig network = 4; /* * The part of the config that is specific to the Display diff --git a/mesh.proto b/mesh.proto index e8116e3..7cbd407 100644 --- a/mesh.proto +++ b/mesh.proto @@ -48,22 +48,22 @@ message Position { /* * TODO: REPLACE */ - UNSET = 0; + LOC_UNSET = 0; /* * TODO: REPLACE */ - MANUAL = 1; + LOC_MANUAL = 1; /* * TODO: REPLACE */ - GPS_INTERNAL = 2; + LOC_INTERNAL = 2; /* * TODO: REPLACE */ - GPS_EXTERNAL = 3; + LOC_EXTERNAL = 3; } /* @@ -80,27 +80,27 @@ message Position { /* * TODO: REPLACE */ - UNSET = 0; + ALT_UNSET = 0; /* * TODO: REPLACE */ - MANUAL = 1; + ALT_MANUAL = 1; /* * TODO: REPLACE */ - GPS_INTERNAL = 2; + ALT_INTERNAL = 2; /* * TODO: REPLACE */ - GPS_EXTERNAL = 3; + ALT_EXTERNAL = 3; /* * TODO: REPLACE */ - BAROMETRIC = 4; + ALT_BAROMETRIC = 4; } /* @@ -278,77 +278,77 @@ enum HardwareModel { * New T-BEAM with ESP32-S3 CPU */ LILYGO_TBEAM_S3_CORE = 12; - - /* - * Less common/prototype boards listed here (needs one more byte over the air) - */ - LORA_RELAY_V1 = 12; - - /* - * TODO: REPLACE - */ - NRF52840DK = 13; - - /* - * TODO: REPLACE - */ - PPR = 14; - - /* - * TODO: REPLACE - */ - GENIEBLOCKS = 15; - - /* - * TODO: REPLACE - */ - NRF52_UNKNOWN = 16; - - /* - * TODO: REPLACE - */ - PORTDUINO = 17; - - /* - * The simulator built into the android app - */ - ANDROID_SIM = 18; - - /* - * Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics - */ - DIY_V1 = 19; /* * RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */ - RAK11200 = 20; + RAK11200 = 13; /* * B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */ - NANO_G1 = 21; - - /* - * nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ - */ - NRF52840_PCA10059 = 22; + NANO_G1 = 14; - /* - * Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 - */ - DR_DEV = 23; - - /* - * M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ - */ - M5STACK = 24; - /* * B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */ STATION_G1 = 25; + + /* + * Less common/prototype boards listed here (needs one more byte over the air) + */ + LORA_RELAY_V1 = 32; + /* + * TODO: REPLACE + */ + NRF52840DK = 33; + + /* + * TODO: REPLACE + */ + PPR = 34; + + /* + * TODO: REPLACE + */ + GENIEBLOCKS = 35; + + /* + * TODO: REPLACE + */ + NRF52_UNKNOWN = 36; + + /* + * TODO: REPLACE + */ + PORTDUINO = 37; + + /* + * The simulator built into the android app + */ + ANDROID_SIM = 38; + + /* + * Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics + */ + DIY_V1 = 39; + + /* + * nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ + */ + NRF52840_PCA10059 = 40; + + /* + * Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 + */ + DR_DEV = 41; + + /* + * M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ + */ + M5STACK = 42; + /* * Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */ @@ -835,7 +835,7 @@ enum Constants { * First enum must be zero, and we are just using this enum to * pass int constants between two very different environments */ - UNSET = 0; + ZERO = 0; /* * From mesh.options diff --git a/module_config.proto b/module_config.proto index ce98780..264916e 100644 --- a/module_config.proto +++ b/module_config.proto @@ -65,7 +65,7 @@ message ModuleConfig { * TODO: REPLACE */ enum Serial_Baud { - DEFAULT = 0; + BAUD_DEFAULT = 0; BAUD_110 = 1; BAUD_300 = 2; BAUD_600 = 3; diff --git a/telemetry.proto b/telemetry.proto index d35fe60..72f1a9d 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -99,7 +99,7 @@ enum TelemetrySensorType { /* * No external telemetry sensor explicitly set */ - UNSET = 0; + SENSOR_UNSET = 0; /* * High accuracy temperature, pressure, humidity From fdfa8209ca51020dc4f46ec5598c50fb205e8201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Fri, 9 Sep 2022 11:53:20 +0200 Subject: [PATCH 08/12] Update config.options --- config.options | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.options b/config.options index 2ec4332..0290b2d 100644 --- a/config.options +++ b/config.options @@ -1,7 +1,7 @@ -*WiFiConfig.ssid max_size:33 -*WiFiConfig.psk max_size:64 +*NetworkConfig.wifi_ssid max_size:33 +*NetworkConfig.wifi_psk max_size:64 # Max of three ignored nodes for our testing *LoRaConfig.ignore_incoming max_count:3 -*DeviceConfig.ntp_server max_size:33 \ No newline at end of file +*NetworkConfig.ntp_server max_size:33 From f3c4aff7a9f164b10680b8504f0036b4ed84404e Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Fri, 9 Sep 2022 20:42:18 +1000 Subject: [PATCH 09/12] Change enum member `WIFI_CONFIG` to `NETWORK_CONFIG` --- admin.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin.proto b/admin.proto index 89d6e5b..3dc9f21 100644 --- a/admin.proto +++ b/admin.proto @@ -42,7 +42,7 @@ message AdminMessage { /* * TODO: REPLACE */ - WIFI_CONFIG = 3; + NETWORK_CONFIG = 3; /* * TODO: REPLACE From 3d4c8278311045f4781af7063e9159b3724761d3 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 10 Sep 2022 14:21:53 -0500 Subject: [PATCH 10/12] Update telemetry.proto --- telemetry.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/telemetry.proto b/telemetry.proto index 72f1a9d..0842467 100644 --- a/telemetry.proto +++ b/telemetry.proto @@ -130,4 +130,14 @@ enum TelemetrySensorType { * High accuracy temperature and pressure */ BMP280 = 6; + + /* + * High accuracy temperature and humidity + */ + SHTC3 = 7; + + /* + * High accuracy pressure + */ + LPS22 = 8; }; From 5e255c01ed8883c9e68d3d4574b300ca609407c5 Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Sun, 11 Sep 2022 10:54:57 +1000 Subject: [PATCH 11/12] Add & swap more fields to enabled by default --- config.proto | 32 +++++++++++++++++++------------- module_config.proto | 1 - 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/config.proto b/config.proto index 01ca397..63fb0a4 100644 --- a/config.proto +++ b/config.proto @@ -47,9 +47,9 @@ message Config { Role role = 1; /* - * If set, this will disable the SerialConsole by not initilizing the StreamAPI + * Disabling this will disable the SerialConsole by not initilizing the StreamAPI */ - bool serial_disabled = 2; + bool serial_enabled = 2; /* * By default we turn off logging as soon as an API client connects (to keep shared serial link quiet). @@ -138,9 +138,9 @@ message Config { uint32 position_broadcast_secs = 1; /* - * Disable adaptive position braoadcast, which is now the default. + * Adaptive position braoadcast, which is now the default. */ - bool position_broadcast_smart_disabled = 2; + bool position_broadcast_smart_enabled = 2; /* * If set, this node is at a fixed position. @@ -150,9 +150,9 @@ message Config { bool fixed_position = 3; /* - * Should the GPS be disabled for this node? + * Is GPS enabled for this node? */ - bool gps_disabled = 4; + bool gps_enabled = 4; /* * How often should we try to get GPS position (in seconds) @@ -481,12 +481,10 @@ message Config { } /* - * If zero then, use default max legal continuous power (ie. something that won't - * burn out the radio hardware) - * In most cases you should use zero here. - * Units are in dBm. - */ - int32 tx_power = 1; + * When enabled, the `modem_preset` fields will be adheared to, else the `bandwidth`/`spread_factor`/`coding_rate` + * will be taked from their respective manually defined fields + */ + bool use_preset = 1; /* * Either modem_config or bandwidth/spreading/coding will be specified - NOT BOTH. @@ -538,7 +536,15 @@ message Config { * Disable TX from the LoRa radio. Useful for hot-swapping antennas and other tests. * Defaults to false */ - bool tx_disabled = 9; + bool tx_enabled = 9; + + /* + * If zero then, use default max legal continuous power (ie. something that won't + * burn out the radio hardware) + * In most cases you should use zero here. + * Units are in dBm. + */ + int32 tx_power = 10; /* * For testing it is useful sometimes to force a node to never listen to diff --git a/module_config.proto b/module_config.proto index 264916e..9a54122 100644 --- a/module_config.proto +++ b/module_config.proto @@ -18,7 +18,6 @@ message ModuleConfig { /* * 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 enabled = 1; From 742152daebe41d034a9b214974a79f91b4860d38 Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Mon, 12 Sep 2022 00:08:19 +1000 Subject: [PATCH 12/12] Missing protos for requests --- admin.proto | 5 +++++ config.proto | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/admin.proto b/admin.proto index 3dc9f21..87cf0e6 100644 --- a/admin.proto +++ b/admin.proto @@ -244,5 +244,10 @@ message AdminMessage { * Tell the node to factory reset, all device settings will be returned to factory defaults. */ int32 factory_reset = 99; + + /* + * Tell the node to reset the nodedb. + */ + int32 nodedb_reset = 100; } } diff --git a/config.proto b/config.proto index 63fb0a4..4a024a9 100644 --- a/config.proto +++ b/config.proto @@ -341,6 +341,22 @@ message Config { OSGR = 5; } + /* + * Unit display preference + */ + enum DisplayUnits { + + /* + * Metric (Default) + */ + METRIC = 0; + + /* + * Imperial + */ + IMPERIAL = 1; + } + /* * Number of seconds the screen stays on after pressing the user button or receiving a message * 0 for default of one minute MAXUINT for always on @@ -363,6 +379,16 @@ message Config { * (top of display is heading direction) is used. */ bool compass_north_top = 4; + + /* + * Flip screen vertically, for cases that mount the screen upside down + */ + bool flip_screen = 5; + + /* + * Perferred display units + */ + DisplayUnits units = 6; } /*