From 110323e24c24f680016a10c599e2dfbbe9d5aa6d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Jun 2023 08:57:01 -0500 Subject: [PATCH 1/3] PositionLite draft --- meshtastic/mesh.proto | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 12af211..17f6d66 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -15,6 +15,36 @@ option java_outer_classname = "MeshProtos"; option java_package = "com.geeksville.mesh"; option swift_prefix = ""; +/* + * Position with static location information only + */ +message PositionLite { + /* + * The new preferred location encoding, multiply by 1e-7 to get degrees + * in floating point + */ + sfixed32 latitude_i = 1; + + /* + * TODO: REPLACE + */ + sfixed32 longitude_i = 2; + + /* + * In meters above MSL (but see issue #359) + */ + int32 altitude = 3; + + /* + * This is usually not sent over the mesh (to save space), but it is sent + * from the phone so that the local device can set its RTC If it is sent over + * the mesh (because there are devices on the mesh without GPS), it will only + * be sent by devices which has a hardware GPS clock. + * seconds since 1970 + */ + fixed32 time = 4; +} + /* * a gps position */ From 407fb6d6a2a58078fadcc4989621753d17abef32 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Jun 2023 09:01:54 -0500 Subject: [PATCH 2/3] Move to deviceonly --- meshtastic/deviceonly.proto | 32 +++++++++++++++++++++++++++++++- meshtastic/mesh.proto | 30 ------------------------------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index 4655e04..871894f 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -79,6 +79,36 @@ message DeviceState { repeated NodeRemoteHardwarePin node_remote_hardware_pins = 13; } +/* + * Position with static location information only for NodeDBLite + */ +message PositionLite { + /* + * The new preferred location encoding, multiply by 1e-7 to get degrees + * in floating point + */ + sfixed32 latitude_i = 1; + + /* + * TODO: REPLACE + */ + sfixed32 longitude_i = 2; + + /* + * In meters above MSL (but see issue #359) + */ + int32 altitude = 3; + + /* + * This is usually not sent over the mesh (to save space), but it is sent + * from the phone so that the local device can set its RTC If it is sent over + * the mesh (because there are devices on the mesh without GPS), it will only + * be sent by devices which has a hardware GPS clock. + * seconds since 1970 + */ + fixed32 time = 4; +} + /* * The on-disk saved channels */ @@ -175,4 +205,4 @@ message NodeRemoteHardwarePin { * The the available gpio pin for usage with RemoteHardware module */ RemoteHardwarePin pin = 2; -} +} \ No newline at end of file diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 17f6d66..12af211 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -15,36 +15,6 @@ option java_outer_classname = "MeshProtos"; option java_package = "com.geeksville.mesh"; option swift_prefix = ""; -/* - * Position with static location information only - */ -message PositionLite { - /* - * The new preferred location encoding, multiply by 1e-7 to get degrees - * in floating point - */ - sfixed32 latitude_i = 1; - - /* - * TODO: REPLACE - */ - sfixed32 longitude_i = 2; - - /* - * In meters above MSL (but see issue #359) - */ - int32 altitude = 3; - - /* - * This is usually not sent over the mesh (to save space), but it is sent - * from the phone so that the local device can set its RTC If it is sent over - * the mesh (because there are devices on the mesh without GPS), it will only - * be sent by devices which has a hardware GPS clock. - * seconds since 1970 - */ - fixed32 time = 4; -} - /* * a gps position */ From 8eca15acd05fe93fdc5d54e2053591538a216769 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 7 Jun 2023 09:46:37 -0500 Subject: [PATCH 3/3] Moar lite --- meshtastic/deviceonly.options | 5 +++- meshtastic/deviceonly.proto | 49 +++++++++++++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/meshtastic/deviceonly.options b/meshtastic/deviceonly.options index a4588a5..c164888 100644 --- a/meshtastic/deviceonly.options +++ b/meshtastic/deviceonly.options @@ -3,6 +3,7 @@ # FIXME pick a higher number someday? or do dynamic alloc in nanopb? *DeviceState.node_db max_count:80 +*DeviceState.node_db_lite max_count:80 # FIXME - max_count is actually 32 but we save/load this as one long string of preencoded MeshPacket bytes - not a big array in RAM *DeviceState.receive_queue max_count:1 @@ -13,4 +14,6 @@ *OEMStore.oem_icon_bits max_size:2048 *OEMStore.oem_aes_key max_size:32 -*DeviceState.node_remote_hardware_pins max_count:12 \ No newline at end of file +*DeviceState.node_remote_hardware_pins max_count:12 + +*NodeInfoLite.channel int_size:8 \ No newline at end of file diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index 871894f..96d0831 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -5,6 +5,7 @@ package meshtastic; import "meshtastic/channel.proto"; import "meshtastic/localonly.proto"; import "meshtastic/mesh.proto"; +import "meshtastic/telemetry.proto"; import "meshtastic/module_config.proto"; option csharp_namespace = "Meshtastic.Protobufs"; @@ -32,9 +33,10 @@ message DeviceState { User owner = 3; /* - * TODO: REPLACE + * Deprecated in 2.1.x + * Old node_db. See NodeInfoLite node_db_lite */ - repeated NodeInfo node_db = 4; + repeated NodeInfo node_db = 4 [deprecated = true]; /* * Received packets saved for delivery to the phone @@ -77,6 +79,49 @@ message DeviceState { * The mesh's nodes with their available gpio pins for RemoteHardware module */ repeated NodeRemoteHardwarePin node_remote_hardware_pins = 13; + + /* + * New lite version of NodeDB to decrease + */ + repeated NodeInfoLite node_db_lite = 14; +} + +message NodeInfoLite { + /* + * The node number + */ + uint32 num = 1; + + /* + * The user info for this node + */ + User user = 2; + + /* + * This position data. Note: before 1.2.14 we would also store the last time we've heard from this node in position.time, that is no longer true. + * Position.time now indicates the last time we received a POSITION from that node. + */ + PositionLite position = 3; + + /* + * Returns the Signal-to-noise ratio (SNR) of the last received message, + * as measured by the receiver. Return SNR of the last received message in dB + */ + float snr = 4; + + /* + * Set to indicate the last time we received a packet from this node + */ + fixed32 last_heard = 5; + /* + * The latest device metrics for the node. + */ + DeviceMetrics device_metrics = 6; + + /* + * local channel index we heard that node on. Only populated if its not the default channel. + */ + uint32 channel = 7; } /*