meshtastic-protobuf/meshtastic/mesh.proto

1791 wiersze
44 KiB
Protocol Buffer

2020-03-02 17:47:10 +00:00
syntax = "proto3";
2023-01-17 11:03:10 +00:00
package meshtastic;
import "meshtastic/channel.proto";
import "meshtastic/config.proto";
import "meshtastic/module_config.proto";
import "meshtastic/portnums.proto";
import "meshtastic/telemetry.proto";
import "meshtastic/xmodem.proto";
2023-01-17 11:03:10 +00:00
2023-05-20 09:29:34 +00:00
option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
option java_outer_classname = "MeshProtos";
option java_package = "com.geeksville.mesh";
option swift_prefix = "";
2021-01-29 02:11:10 +00:00
/*
* a gps position
*/
2020-03-02 17:47:10 +00:00
message Position {
2021-01-29 02:11:10 +00:00
/*
* The new preferred location encoding, multiply by 1e-7 to get degrees
* in floating point
2021-01-29 02:11:10 +00:00
*/
sfixed32 latitude_i = 1;
2021-01-29 02:11:10 +00:00
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
sfixed32 longitude_i = 2;
2021-01-29 02:11:10 +00:00
/*
* In meters above MSL (but see issue #359)
2021-01-29 02:11:10 +00:00
*/
int32 altitude = 3;
2020-07-06 05:09:43 +00:00
2021-01-29 02:11:10 +00:00
/*
* This is usually not sent over the mesh (to save space), but it is sent
2023-09-12 18:44:46 +00:00
* from the phone so that the local device can set its time if it is sent over
2023-09-12 18:42:57 +00:00
* the mesh (because there are devices on the mesh without GPS or RTC).
2021-01-29 02:11:10 +00:00
* seconds since 1970
*/
2022-09-07 02:13:54 +00:00
fixed32 time = 4;
2021-10-05 12:44:10 +00:00
/*
* How the location was acquired: manual, onboard GPS, external (EUD) GPS
*/
enum LocSource {
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
LOC_UNSET = 0;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
LOC_MANUAL = 1;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
LOC_INTERNAL = 2;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
LOC_EXTERNAL = 3;
2021-10-05 12:44:10 +00:00
}
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2022-09-07 02:13:54 +00:00
LocSource location_source = 5;
2021-10-05 12:44:10 +00:00
/*
* How the altitude was acquired: manual, GPS int/ext, etc
2021-10-05 12:44:10 +00:00
* Default: same as location_source if present
*/
enum AltSource {
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
ALT_UNSET = 0;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
ALT_MANUAL = 1;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
ALT_INTERNAL = 2;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
ALT_EXTERNAL = 3;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
ALT_BAROMETRIC = 4;
2021-10-05 12:44:10 +00:00
}
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2022-09-07 02:13:54 +00:00
AltSource altitude_source = 6;
2021-10-05 12:44:10 +00:00
/*
* Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds
*/
2022-09-07 02:13:54 +00:00
fixed32 timestamp = 7;
2021-10-05 12:44:10 +00:00
/*
* Pos. timestamp milliseconds adjustment (rarely available or required)
*/
2022-09-07 02:13:54 +00:00
int32 timestamp_millis_adjust = 8;
2021-10-05 12:44:10 +00:00
/*
* HAE altitude in meters - can be used instead of MSL altitude
*/
2022-09-07 02:13:54 +00:00
sint32 altitude_hae = 9;
2021-10-05 12:44:10 +00:00
/*
* Geoidal separation in meters
2021-10-05 12:44:10 +00:00
*/
2022-09-11 20:32:40 +00:00
sint32 altitude_geoidal_separation = 10;
2021-10-05 12:44:10 +00:00
/*
* Horizontal, Vertical and Position Dilution of Precision, in 1/100 units
* - PDOP is sufficient for most cases
* - for higher precision scenarios, HDOP and VDOP can be used instead,
2021-10-05 12:44:10 +00:00
* in which case PDOP becomes redundant (PDOP=sqrt(HDOP^2 + VDOP^2))
2022-02-21 07:48:42 +00:00
* TODO: REMOVE/INTEGRATE
2021-10-05 12:44:10 +00:00
*/
2022-09-07 02:13:54 +00:00
uint32 PDOP = 11;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2022-09-07 02:13:54 +00:00
uint32 HDOP = 12;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2022-09-07 02:13:54 +00:00
uint32 VDOP = 13;
2021-10-05 12:44:10 +00:00
/*
* GPS accuracy (a hardware specific constant) in mm
* multiplied with DOP to calculate positional accuracy
2021-10-05 12:44:10 +00:00
* Default: "'bout three meters-ish" :)
*/
2022-09-07 02:13:54 +00:00
uint32 gps_accuracy = 14;
2021-10-05 12:44:10 +00:00
/*
* Ground speed in m/s and True North TRACK in 1/100 degrees
* Clarification of terms:
* - "track" is the direction of motion (measured in horizontal plane)
* - "heading" is where the fuselage points (measured in horizontal plane)
* - "yaw" indicates a relative rotation about the vertical axis
2022-02-21 07:48:42 +00:00
* TODO: REMOVE/INTEGRATE
2021-10-05 12:44:10 +00:00
*/
2022-09-07 02:13:54 +00:00
uint32 ground_speed = 15;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2022-09-07 02:13:54 +00:00
uint32 ground_track = 16;
2021-10-05 12:44:10 +00:00
/*
* GPS fix quality (from NMEA GxGGA statement or similar)
*/
2022-09-07 02:13:54 +00:00
uint32 fix_quality = 17;
2021-10-05 12:44:10 +00:00
/*
* GPS fix type 2D/3D (from NMEA GxGSA statement)
*/
2022-09-07 02:13:54 +00:00
uint32 fix_type = 18;
2021-10-05 12:44:10 +00:00
/*
* GPS "Satellites in View" number
*/
2022-09-07 02:13:54 +00:00
uint32 sats_in_view = 19;
2021-10-05 12:44:10 +00:00
/*
* Sensor ID - in case multiple positioning sensors are being used
*/
2022-09-07 02:13:54 +00:00
uint32 sensor_id = 20;
2021-10-05 12:44:10 +00:00
/*
* Estimated/expected time (in seconds) until next update:
* - if we update at fixed intervals of X seconds, use X
* - if we update at dynamic intervals (based on relative movement etc),
* but "AT LEAST every Y seconds", use Y
*/
2022-09-07 02:13:54 +00:00
uint32 next_update = 21;
2021-10-05 12:44:10 +00:00
/*
* A sequence number, incremented with each Position message to help
* detect lost updates if needed
*/
2022-09-07 02:13:54 +00:00
uint32 seq_number = 22;
/*
* Indicates the bits of precision set by the sending node
*/
uint32 precision_bits = 23;
2020-03-02 17:47:10 +00:00
}
/*
2023-05-20 09:29:34 +00:00
* Note: these enum names must EXACTLY match the string used in the device
* bin/build-all.sh script.
* Because they will be used to find firmware filenames in the android app for OTA updates.
* To match the old style filenames, _ is converted to -, p is converted to .
*/
enum HardwareModel {
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
UNSET = 0;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
TLORA_V2 = 1;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
TLORA_V1 = 2;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
TLORA_V2_1_1P6 = 3;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
TBEAM = 4;
2021-05-11 01:42:57 +00:00
2022-02-21 07:48:42 +00:00
/*
* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13
* (see HELTEC_V2 for the new version).
*/
HELTEC_V2_0 = 5;
2021-05-11 01:42:57 +00:00
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
TBEAM_V0P7 = 6;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
T_ECHO = 7;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
TLORA_V1_1P3 = 8;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
RAK4631 = 9;
2022-02-21 07:48:42 +00:00
/*
* The new version of the heltec WiFi_Lora_32_V2 board that has battery sensing hooked to GPIO 37.
* Sadly they did not update anything on the silkscreen to identify this board
*/
HELTEC_V2_1 = 10;
2023-05-20 09:29:34 +00:00
2022-02-21 07:48:42 +00:00
/*
* Ancient heltec WiFi_Lora_32 board
*/
HELTEC_V1 = 11;
2023-05-20 09:29:34 +00:00
2022-09-07 19:01:20 +00:00
/*
* New T-BEAM with ESP32-S3 CPU
*/
LILYGO_TBEAM_S3_CORE = 12;
/*
* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/
*/
RAK11200 = 13;
/*
* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano
*/
2022-11-02 09:44:58 +00:00
NANO_G1 = 14;
/*
* TODO: REPLACE
*/
TLORA_V2_1_1P8 = 15;
2022-12-28 12:52:50 +00:00
/*
* TODO: REPLACE
*/
TLORA_T3_S3 = 16;
2023-05-20 09:29:34 +00:00
/*
* B&Q Consulting Nano G1 Explorer: https://wiki.uniteng.com/en/meshtastic/nano-g1-explorer
*/
NANO_G1_EXPLORER = 17;
2022-12-28 12:52:50 +00:00
/*
* B&Q Consulting Nano G2 Ultra: https://wiki.uniteng.com/en/meshtastic/nano-g2-ultra
*/
NANO_G2_ULTRA = 18;
2023-08-11 18:23:15 +00:00
/*
* LoRAType device: https://loratype.org/
*/
LORA_TYPE = 19;
2024-05-04 18:37:16 +00:00
/*
* wiphone https://www.wiphone.io/
*/
WIPHONE = 20;
2024-06-04 12:54:28 +00:00
/*
* WIO Tracker WM1110 family from Seeed Studio. Includes wio-1110-tracker and wio-1110-sdk
*/
WIO_WM1110 = 21;
2024-06-16 12:03:00 +00:00
/*
* RAK2560 Solar base station based on RAK4630
*/
RAK2560 = 22;
/*
* Heltec HRU-3601: https://heltec.org/project/hru-3601/
*/
HELTEC_HRU_3601 = 23;
/*
* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station
*/
2023-05-20 09:29:34 +00:00
STATION_G1 = 25;
/*
* RAK11310 (RP2040 + SX1262)
*/
RAK11310 = 26;
2023-12-06 21:50:46 +00:00
/*
* Makerfabs SenseLoRA Receiver (RP2040 + RFM96)
*/
SENSELORA_RP2040 = 27;
/*
* Makerfabs SenseLoRA Industrial Monitor (ESP32-S3 + RFM96)
*/
SENSELORA_S3 = 28;
2024-01-30 15:26:17 +00:00
/*
2024-03-29 09:23:22 +00:00
* Canary Radio Company - CanaryOne: https://canaryradio.io/products/canaryone
*/
2024-01-30 15:26:17 +00:00
CANARYONE = 29;
2024-02-10 02:35:35 +00:00
/*
* Waveshare RP2040 LoRa - https://www.waveshare.com/rp2040-lora.htm
*/
RP2040_LORA = 30;
2024-02-24 19:58:08 +00:00
/*
* B&Q Consulting Station G2: https://wiki.uniteng.com/en/meshtastic/station-g2
*/
STATION_G2 = 31;
/*
* ---------------------------------------------------------------------------
* Less common/prototype boards listed here (needs one more byte over the air)
* ---------------------------------------------------------------------------
*/
LORA_RELAY_V1 = 32;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
NRF52840DK = 33;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
PPR = 34;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
GENIEBLOCKS = 35;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
NRF52_UNKNOWN = 36;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
PORTDUINO = 37;
2021-04-20 09:08:28 +00:00
/*
* 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;
2022-04-05 15:33:24 +00:00
/*
2022-04-05 13:22:34 +00:00
* 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;
2023-05-20 09:29:34 +00:00
/*
* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/
*/
M5STACK = 42;
2022-11-13 13:41:37 +00:00
/*
* New Heltec LoRA32 with ESP32-S3 CPU
*/
HELTEC_V3 = 43;
/*
* New Heltec Wireless Stick Lite with ESP32-S3 CPU
*/
2022-11-13 14:35:16 +00:00
HELTEC_WSL_V3 = 44;
2023-05-20 09:29:34 +00:00
2023-01-09 09:10:22 +00:00
/*
* New BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU
*/
2023-01-09 09:10:22 +00:00
BETAFPV_2400_TX = 45;
2023-05-20 09:29:34 +00:00
/*
* BetaFPV ExpressLRS "Nano" TX Module 900MHz with ESP32 CPU
*/
BETAFPV_900_NANO_TX = 46;
2023-05-20 09:29:34 +00:00
/*
* Raspberry Pi Pico (W) with Waveshare SX1262 LoRa Node Module
*/
RPI_PICO = 47;
2023-07-07 12:00:23 +00:00
/*
* Heltec Wireless Tracker with ESP32-S3 CPU, built-in GPS, and TFT
2024-02-09 01:50:39 +00:00
* Newer V1.1, version is written on the PCB near the display.
2023-07-07 12:00:23 +00:00
*/
HELTEC_WIRELESS_TRACKER = 48;
2023-07-07 12:00:23 +00:00
/*
* Heltec Wireless Paper with ESP32-S3 CPU and E-Ink display
*/
HELTEC_WIRELESS_PAPER = 49;
/*
2023-08-07 17:04:17 +00:00
* LilyGo T-Deck with ESP32-S3 CPU, Keyboard and IPS display
2023-07-07 12:00:23 +00:00
*/
T_DECK = 50;
/*
* LilyGo T-Watch S3 with ESP32-S3 CPU and IPS display
*/
T_WATCH_S3 = 51;
2024-03-29 09:23:22 +00:00
2023-08-07 17:04:17 +00:00
/*
* Bobricius Picomputer with ESP32-S3 CPU, Keyboard and IPS display
*/
PICOMPUTER_S3 = 52;
2024-03-29 09:23:22 +00:00
/*
2023-08-22 14:47:27 +00:00
* Heltec HT-CT62 with ESP32-C3 CPU and SX1262 LoRa
*/
2023-08-22 14:49:55 +00:00
HELTEC_HT62 = 53;
2023-10-04 10:01:23 +00:00
/*
2023-10-10 23:35:57 +00:00
* EBYTE SPI LoRa module and ESP32-S3
2023-10-04 10:01:23 +00:00
*/
2023-10-10 23:33:57 +00:00
EBYTE_ESP32_S3 = 54;
2024-01-11 17:27:25 +00:00
/*
* Waveshare ESP32-S3-PICO with PICO LoRa HAT and 2.9inch e-Ink
*/
2024-01-11 19:10:26 +00:00
ESP32_S3_PICO = 55;
/*
* CircuitMess Chatter 2 LLCC68 Lora Module and ESP32 Wroom
* Lora module can be swapped out for a Heltec RA-62 which is "almost" pin compatible
* with one cut and one jumper Meshtastic works
2024-03-29 09:23:22 +00:00
*/
CHATTER_2 = 56;
/*
* Heltec Wireless Paper, With ESP32-S3 CPU and E-Ink display
* Older "V1.0" Variant, has no "version sticker"
* E-Ink model is DEPG0213BNS800
* Tab on the screen protector is RED
* Flex connector marking is FPC-7528B
*/
HELTEC_WIRELESS_PAPER_V1_0 = 57;
2024-02-09 01:50:39 +00:00
/*
* Heltec Wireless Tracker with ESP32-S3 CPU, built-in GPS, and TFT
* Older "V1.0" Variant
*/
HELTEC_WIRELESS_TRACKER_V1_0 = 58;
2024-03-29 09:23:22 +00:00
/*
* unPhone with ESP32-S3, TFT touchscreen, LSM6DS3TR-C accelerometer and gyroscope
*/
UNPHONE = 59;
2024-04-03 11:48:23 +00:00
/*
* Teledatics TD-LORAC NRF52840 based M.2 LoRA module
* Compatible with the TD-WRLS development board
*/
TD_LORAC = 60;
2024-04-15 19:30:25 +00:00
/*
* CDEBYTE EoRa-S3 board using their own MM modules, clone of LILYGO T3S3
*/
CDEBYTE_EORA_S3 = 61;
/*
2024-04-23 10:10:02 +00:00
* TWC_MESH_V4
* Adafruit NRF52840 feather express with SX1262, SSD1306 OLED and NEO6M GPS
*/
TWC_MESH_V4 = 62;
2024-05-05 11:55:33 +00:00
/*
2024-05-05 13:34:11 +00:00
* NRF52_PROMICRO_DIY
2024-05-05 11:55:33 +00:00
* Promicro NRF52840 with SX1262/LLCC68, SSD1306 OLED and NEO6M GPS
*/
2024-05-05 13:34:11 +00:00
NRF52_PROMICRO_DIY = 63;
/*
* RadioMaster 900 Bandit Nano, https://www.radiomasterrc.com/products/bandit-nano-expresslrs-rf-module
* ESP32-D0WDQ6 With SX1276/SKY66122, SSD1306 OLED and No GPS
*/
RADIOMASTER_900_BANDIT_NANO = 64;
2024-06-12 11:25:00 +00:00
/*
* Heltec Capsule Sensor V3 with ESP32-S3 CPU, Portable LoRa device that can replace GNSS modules or sensors
*/
HELTEC_CAPSULE_SENSOR_V3 = 65;
2024-06-28 08:29:17 +00:00
/*
* Heltec Vision Master T190 with ESP32-S3 CPU, and a 1.90 inch TFT display
*/
HELTEC_VISION_MASTER_T190 = 66;
/*
* Heltec Vision Master E213 with ESP32-S3 CPU, and a 2.13 inch E-Ink display
*/
HELTEC_VISION_MASTER_E213 = 67;
/*
* Heltec Vision Master E290 with ESP32-S3 CPU, and a 2.9 inch E-Ink display
*/
HELTEC_VISION_MASTER_E290 = 68;
/*
2024-07-01 06:10:05 +00:00
* Heltec Mesh Node T114 board with nRF52840 CPU, and a 1.14 inch TFT display, Ultimate low-power design,
2024-06-28 08:29:17 +00:00
* specifically adapted for the Meshtatic project
*/
HELTEC_MESH_NODE_T114 = 69;
2024-07-22 14:01:59 +00:00
/*
* Sensecap Indicator from Seeed Studio. ESP32-S3 device with TFT and RP2040 coprocessor
*/
SENSECAP_INDICATOR = 70;
2024-07-26 11:25:03 +00:00
/*
* Seeed studio T1000-E tracker card. NRF52840 w/ LR1110 radio, GPS, button, buzzer, and sensors.
*/
TRACKER_T1000_E = 71;
2024-06-28 08:29:17 +00:00
/*
* ------------------------------------------------------------------------------------------------------------------------------------------
* 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.
* ------------------------------------------------------------------------------------------------------------------------------------------
*/
PRIVATE_HW = 255;
}
2021-01-29 02:11:10 +00:00
/*
* Broadcast when a newly powered mesh node wants to find a node num it can use
* Sent from the phone over bluetooth to set the user id for the owner of this node.
* Also sent from nodes to each other when a new node signs on (so all clients can have this info)
* The algorithm is as follows:
* when a node starts up, it broadcasts their user and the normal flow is for all
* other nodes to reply with their User as well (so the new node can build its nodedb)
* If a node ever receives a User (not just the first broadcast) message where
* the sender node number equals our node number, that indicates a collision has
* occurred and the following steps should happen:
* If the receiving node (that was already in the mesh)'s macaddr is LOWER than the
2021-04-20 09:08:28 +00:00
* new User who just tried to sign in: it gets to keep its nodenum.
* We send a broadcast message of OUR User (we use a broadcast so that the other node can
2021-01-29 02:11:10 +00:00
* receive our message, considering we have the same id - it also serves to let
* observers correct their nodedb) - this case is rare so it should be okay.
* If any node receives a User where the macaddr is GTE than their local macaddr,
* they have been vetoed and should pick a new random nodenum (filtering against
* whatever it knows about the nodedb) and rebroadcast their User.
* A few nodenums are reserved and will never be requested:
* 0xff - broadcast
* 0 through 3 - for future use
*/
2020-03-02 17:47:10 +00:00
message User {
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* A globally unique ID string for this user.
* In the case of Signal that would mean +16504442323, for the default macaddr derived id it would be !<8 hexidecimal bytes>.
2021-03-11 03:11:45 +00:00
* Note: app developers are encouraged to also use the following standard
* node IDs "^all" (for broadcast), "^local" (for the locally connected node)
2021-01-29 02:11:10 +00:00
*/
string id = 1;
2021-01-29 02:11:10 +00:00
/*
* A full name for this user, i.e. "Kevin Hester"
*/
string long_name = 2;
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* A VERY short name, ideally two characters.
* Suitable for a tiny OLED screen
2021-01-29 02:11:10 +00:00
*/
string short_name = 3;
2021-01-29 02:11:10 +00:00
/*
2023-06-07 00:36:57 +00:00
* Deprecated in Meshtastic 2.1.x
2021-04-20 09:08:28 +00:00
* This is the addr of the radio.
* Not populated by the phone, but added by the esp32 when broadcasting
2021-01-29 02:11:10 +00:00
*/
2023-06-07 00:36:57 +00:00
bytes macaddr = 4 [deprecated = true];
/*
* TBEAM, HELTEC, etc...
2021-04-20 09:08:28 +00:00
* Starting in 1.2.11 moved to hw_model enum in the NodeInfo object.
* 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.
*/
2022-09-07 02:13:54 +00:00
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.
*/
2022-09-07 02:13:54 +00:00
bool is_licensed = 6;
2023-11-26 20:10:31 +00:00
/*
* Indicates that the user's role in the mesh
*/
Config.DeviceConfig.Role role = 7;
/*
* The public key of the user's device.
* This is sent out to other nodes on the mesh to allow them to compute a shared secret key.
*/
bytes public_key = 8;
2022-08-16 01:20:42 +00:00
}
2021-10-26 14:14:49 +00:00
2021-01-29 02:11:10 +00:00
/*
* A message used in our Dynamic Source Routing protocol (RFC 4728 based)
*/
2020-04-17 16:48:14 +00:00
message RouteDiscovery {
2021-01-29 02:11:10 +00:00
/*
2021-03-07 08:28:48 +00:00
* The list of nodenums this packet has visited so far
*/
2022-09-07 02:13:54 +00:00
repeated fixed32 route = 1;
2020-04-17 16:48:14 +00:00
}
2021-03-07 08:28:48 +00:00
/*
* A Routing control Data packet handled by the routing module
2021-03-07 08:28:48 +00:00
*/
2021-02-17 05:05:46 +00:00
message Routing {
/*
2021-03-07 08:28:48 +00:00
* A failure in delivering a message (usually used for routing control messages, but might be provided in addition to ack.fail_id to provide
* details on the type of failure).
*/
2021-02-17 05:05:46 +00:00
enum Error {
2021-03-07 08:28:48 +00:00
/*
* This message is not a failure
*/
2021-02-17 05:05:46 +00:00
NONE = 0;
2020-05-23 22:39:38 +00:00
2021-02-17 05:05:46 +00:00
/*
2021-03-07 08:28:48 +00:00
* Our node doesn't have a route to the requested destination anymore.
*/
2021-02-17 05:05:46 +00:00
NO_ROUTE = 1;
2020-05-23 22:39:38 +00:00
2021-02-17 05:05:46 +00:00
/*
2021-03-07 08:28:48 +00:00
* We received a nak while trying to forward on your behalf
*/
2021-02-17 05:05:46 +00:00
GOT_NAK = 2;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2021-02-17 05:05:46 +00:00
TIMEOUT = 3;
2020-05-24 00:38:49 +00:00
2021-01-29 02:11:10 +00:00
/*
2021-03-07 08:28:48 +00:00
* No suitable interface could be found for delivering this packet
*/
2021-02-17 05:05:46 +00:00
NO_INTERFACE = 4;
2021-01-29 02:11:10 +00:00
/*
2021-03-07 08:28:48 +00:00
* We reached the max retransmission count (typically for naive flood routing)
*/
2021-02-17 05:05:46 +00:00
MAX_RETRANSMIT = 5;
2021-02-22 04:16:03 +00:00
2021-03-07 08:28:48 +00:00
/*
* No suitable channel was found for sending this packet (i.e. was requested channel index disabled?)
*/
2021-02-22 04:16:03 +00:00
NO_CHANNEL = 6;
2021-03-07 08:28:48 +00:00
/*
* The packet was too big for sending (exceeds interface MTU after encoding)
*/
2021-02-22 04:16:03 +00:00
TOO_LARGE = 7;
2021-03-12 06:09:22 +00:00
/*
* The request had want_response set, the request reached the destination node, but no service on that node wants to send a response
* (possibly due to bad channel permissions)
*/
NO_RESPONSE = 8;
2021-03-23 03:54:07 +00:00
2022-11-26 19:45:30 +00:00
/*
* Cannot send currently because duty cycle regulations will be violated.
*/
2023-05-20 09:29:34 +00:00
DUTY_CYCLE_LIMIT = 9;
2022-11-26 19:45:30 +00:00
2021-03-23 03:54:07 +00:00
/*
* The application layer service on the remote node received your request, but considered your request somehow invalid
*/
BAD_REQUEST = 32;
/*
2022-02-21 07:48:42 +00:00
* The application layer service on the remote node received your request, but considered your request not authorized
* (i.e you did not send the request on the required bound channel)
2021-03-23 03:54:07 +00:00
*/
2021-04-05 00:55:39 +00:00
NOT_AUTHORIZED = 33;
2021-02-17 05:05:46 +00:00
}
oneof variant {
/*
2021-03-07 08:28:48 +00:00
* A route request going from the requester
*/
2021-02-17 05:05:46 +00:00
RouteDiscovery route_request = 1;
/*
2021-03-07 08:28:48 +00:00
* A route reply
*/
RouteDiscovery route_reply = 2;
2021-02-17 05:05:46 +00:00
/*
* A failure in delivering a message (usually used for routing control messages, but might be provided
* in addition to ack.fail_id to provide details on the type of failure).
2021-03-07 08:28:48 +00:00
*/
2021-02-17 05:05:46 +00:00
Error error_reason = 3;
}
2020-05-23 22:39:38 +00:00
}
2021-03-07 08:28:48 +00:00
/*
* (Formerly called SubPacket)
2021-01-29 02:11:10 +00:00
* The payload portion fo a packet, this is the actual bytes that are sent
* inside a radio packet (because from/to are broken out by the comms library)
*/
2021-02-17 05:05:46 +00:00
message Data {
2021-01-29 02:11:10 +00:00
/*
2021-02-17 05:05:46 +00:00
* Formerly named typ and of type Type
2021-01-29 02:11:10 +00:00
*/
PortNum portnum = 1;
2020-05-11 22:40:04 +00:00
/*
2023-05-20 09:29:34 +00:00
* TODO: REPLACE
*/
bytes payload = 2;
2020-04-17 16:48:14 +00:00
2021-01-29 02:11:10 +00:00
/*
* Not normally used, but for testing a sender can request that recipient
* responds in kind (i.e. if it received a position, it should unicast back it's position).
* Note: that if you set this on a broadcast you will receive many replies.
*/
2021-02-17 08:17:18 +00:00
bool want_response = 3;
2020-04-17 16:48:14 +00:00
2021-01-29 02:11:10 +00:00
/*
* The address of the destination node.
* This field is is filled in by the mesh radio device software, application
2021-01-29 02:11:10 +00:00
* layer software should never need it.
2021-04-20 09:08:28 +00:00
* RouteDiscovery messages _must_ populate this.
* Other message types might need to if they are doing multihop routing.
2021-01-29 02:11:10 +00:00
*/
2021-02-17 08:17:18 +00:00
fixed32 dest = 4;
2020-05-23 22:39:38 +00:00
2021-01-29 02:11:10 +00:00
/*
* The address of the original sender for this message.
* This field should _only_ be populated for reliable multihop packets (to keep
* packets small).
*/
2021-02-17 08:17:18 +00:00
fixed32 source = 5;
2021-02-26 12:30:04 +00:00
/*
2021-04-20 09:08:28 +00:00
* Only used in routing or response messages.
* Indicates the original message ID that this message is reporting failure on. (formerly called original_id)
2021-02-26 12:30:04 +00:00
*/
fixed32 request_id = 6;
2022-01-23 17:02:39 +00:00
/*
* If set, this message is intened to be a reply to a previously sent message with the defined id.
*/
fixed32 reply_id = 7;
2022-01-23 17:08:45 +00:00
/*
* Defaults to false. If true, then what is in the payload should be treated as an emoji like giving
* a message a heart or poop emoji.
*/
2022-03-26 05:29:26 +00:00
fixed32 emoji = 8;
}
/*
2022-08-19 23:39:31 +00:00
* Waypoint message, used to share arbitrary locations across the mesh
2022-03-26 05:29:26 +00:00
*/
2022-08-19 23:39:31 +00:00
message Waypoint {
2022-03-26 05:29:26 +00:00
/*
2022-08-19 23:39:31 +00:00
* Id of the waypoint
2022-03-26 05:29:26 +00:00
*/
uint32 id = 1;
/*
* latitude_i
*/
sfixed32 latitude_i = 2;
/*
* longitude_i
*/
sfixed32 longitude_i = 3;
/*
2022-08-19 23:39:31 +00:00
* Time the waypoint is to expire (epoch)
2022-03-26 05:29:26 +00:00
*/
uint32 expire = 4;
/*
2023-01-15 23:50:21 +00:00
* If greater than zero, treat the value as a nodenum only allowing them to update the waypoint.
* If zero, the waypoint is open to be edited by any member of the mesh.
2022-03-26 05:29:26 +00:00
*/
2023-01-16 00:12:06 +00:00
uint32 locked_to = 5;
2022-03-26 05:29:26 +00:00
2022-08-09 02:06:15 +00:00
/*
2022-08-19 23:39:31 +00:00
* Name of the waypoint - max 30 chars
2022-08-09 02:06:15 +00:00
*/
string name = 6;
2023-01-10 17:32:33 +00:00
/*
2022-08-19 23:39:31 +00:00
* Description of the waypoint - max 100 chars
2022-08-09 02:06:15 +00:00
*/
string description = 7;
2023-01-10 17:32:33 +00:00
/*
* Designator icon for the waypoint in the form of a unicode emoji
*/
2023-01-12 00:01:47 +00:00
fixed32 icon = 8;
2020-03-02 17:47:10 +00:00
}
/*
2023-07-03 12:42:56 +00:00
* This message will be proxied over the PhoneAPI for the client to deliver to the MQTT server
*/
2024-03-29 09:23:22 +00:00
message MqttClientProxyMessage {
/*
* The MQTT topic this message will be sent /received on
*/
string topic = 1;
2023-07-01 13:53:13 +00:00
/*
2023-07-03 12:42:56 +00:00
* The actual service envelope payload or text for mqtt pub / sub
*/
2023-07-01 13:53:13 +00:00
oneof payload_variant {
/*
* Bytes
*/
bytes data = 2;
/*
* Text
*/
string text = 3;
}
/*
* Whether the message should be retained (or not)
*/
bool retained = 4;
}
2021-01-29 02:11:10 +00:00
/*
2021-02-17 08:17:18 +00:00
* A packet envelope sent/received over the mesh
* only payload_variant is sent in the payload portion of the LORA packet.
2021-02-21 04:59:22 +00:00
* The other fields are either not sent at all, or sent in the special 16 byte LORA header.
2021-01-29 02:11:10 +00:00
*/
2020-03-02 17:47:10 +00:00
message MeshPacket {
2021-03-07 08:28:48 +00:00
/*
2021-04-20 09:08:28 +00:00
* The priority of this message for sending.
* Higher priorities are sent first (when managing the transmit queue).
2021-03-07 08:28:48 +00:00
* This field is never sent over the air, it is only used internally inside of a local device node.
* API clients (either on the local node or connected directly to the node)
* can set this parameter if necessary.
* (values must be <= 127 to keep protobuf field to one byte in size.
* Detailed background on this field:
* I noticed a funny side effect of lora being so slow: Usually when making
* a protocol there isnt much need to use message priority to change the order
* of transmission (because interfaces are fairly fast).
* But for lora where packets can take a few seconds each, it is very important
* to make sure that critical packets are sent ASAP.
* In the case of meshtastic that means we want to send protocol acks as soon as possible
* (to prevent unneeded retransmissions), we want routing messages to be sent next,
* then messages marked as reliable and finally 'background' packets like periodic position updates.
2021-03-07 08:28:48 +00:00
* So I bit the bullet and implemented a new (internal - not sent over the air)
* field in MeshPacket called 'priority'.
2021-03-07 08:28:48 +00:00
* And the transmission queue in the router object is now a priority queue.
*/
enum Priority {
2021-03-07 08:28:48 +00:00
/*
* Treated as Priority.DEFAULT
*/
UNSET = 0;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
MIN = 1;
2021-03-07 08:28:48 +00:00
/*
* Background position updates are sent with very low priority -
* if the link is super congested they might not go out at all
*/
BACKGROUND = 10;
2021-03-07 08:28:48 +00:00
/*
* This priority is used for most messages that don't have a priority set
*/
DEFAULT = 64;
2021-03-07 08:28:48 +00:00
/*
* If priority is unset but the message is marked as want_ack,
* assume it is important and use a slightly higher priority
*/
2021-02-12 01:39:35 +00:00
RELIABLE = 70;
2021-03-07 08:28:48 +00:00
/*
* Ack/naks are sent with very high priority to ensure that retransmission
* stops as soon as possible
*/
ACK = 120;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
MAX = 127;
}
/*
* Identify if this is a delayed packet
*/
enum Delayed {
/*
* If unset, the message is being sent in real time.
*/
NO_DELAY = 0;
/*
* The message is delayed and was originally a broadcast
*/
DELAYED_BROADCAST = 1;
/*
* The message is delayed and was originally a direct message
*/
DELAYED_DIRECT = 2;
}
2021-01-29 02:11:10 +00:00
/*
* The sending node number.
2021-04-20 09:08:28 +00:00
* Note: Our crypto implementation uses this field as well.
* See [crypto](/docs/overview/encryption) for details.
2021-01-29 02:11:10 +00:00
*/
fixed32 from = 1;
2020-04-17 16:48:14 +00:00
2021-01-29 02:11:10 +00:00
/*
2024-02-24 16:52:01 +00:00
* The (immediate) destination for this packet
2021-01-29 02:11:10 +00:00
*/
2021-02-17 05:05:46 +00:00
fixed32 to = 2;
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* (Usually) If set, this indicates the index in the secondary_channels table that this packet was sent/received on.
* If unset, packet was on the primary channel.
* A particular node might know only a subset of channels in use on the mesh.
* Therefore channel_index is inherently a local concept and meaningless to send between nodes.
2021-02-22 04:16:03 +00:00
* Very briefly, while sending and receiving deep inside the device Router code, this field instead
2021-04-20 09:08:28 +00:00
* contains the 'channel hash' instead of the index.
* This 'trick' is only used while the payload_variant is an 'encrypted'.
2021-01-29 02:11:10 +00:00
*/
2021-02-22 04:16:03 +00:00
uint32 channel = 3;
2021-01-29 02:11:10 +00:00
/*
2022-03-09 22:23:22 +00:00
* Internally to the mesh radios we will route SubPackets encrypted per [this](docs/developers/firmware/encryption).
2021-04-20 09:08:28 +00:00
* However, when a particular node has the correct
2021-01-29 02:11:10 +00:00
* key to decode a particular packet, it will decode the payload into a SubPacket protobuf structure.
* Software outside of the device nodes will never encounter a packet where
* "decoded" is not populated (i.e. any encryption/decryption happens before reaching the applications)
* The numeric IDs for these fields were selected to keep backwards compatibility with old applications.
*/
oneof payload_variant {
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2021-02-21 04:59:22 +00:00
Data decoded = 4;
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
2021-02-21 04:59:22 +00:00
bytes encrypted = 5;
}
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* A unique ID for this packet.
* Always 0 for no-ack packets or non broadcast packets (and therefore take zero bytes of space).
* Otherwise a unique ID for this packet, useful for flooding algorithms.
2021-01-29 02:11:10 +00:00
* ID only needs to be unique on a _per sender_ basis, and it only
* needs to be unique for a few minutes (long enough to last for the length of
* any ACK or the completion of a mesh broadcast flood).
2021-04-20 09:08:28 +00:00
* Note: Our crypto implementation uses this id as well.
* See [crypto](/docs/overview/encryption) for details.
2021-01-29 02:11:10 +00:00
*/
fixed32 id = 6;
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* The time this message was received by the esp32 (secs since 1970).
* Note: this field is _never_ sent on the radio link itself (to save space) Times
2021-01-29 02:11:10 +00:00
* are typically not sent over the mesh, but they will be added to any Packet
* (chain of SubPacket) sent to the phone (so the phone can know exact time of reception)
*/
2021-02-21 04:59:22 +00:00
fixed32 rx_time = 7;
2020-05-11 22:40:04 +00:00
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* *Never* sent over the radio links.
* Set during reception to indicate the SNR of this packet.
* Used to collect statistics on current link quality.
2021-01-29 02:11:10 +00:00
*/
2021-02-21 04:59:22 +00:00
float rx_snr = 8;
2021-01-29 02:11:10 +00:00
/*
* If unset treated as zero (no forwarding, send to adjacent nodes only)
2021-02-21 04:59:22 +00:00
* if 1, allow hopping through one node, etc...
* 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.
*/
2022-09-07 02:13:54 +00:00
uint32 hop_limit = 9;
2021-02-21 04:59:22 +00:00
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* This packet is being sent as a reliable message, we would prefer it to arrive at the destination.
* We would like to receive a ack packet in response.
2021-01-29 02:11:10 +00:00
* Broadcasts messages treat this flag specially: Since acks for broadcasts would
2021-04-20 09:08:28 +00:00
* rapidly flood the channel, the normal ack behavior is suppressed.
* Instead, the original sender listens to see if at least one node is rebroadcasting this packet (because naive flooding algorithm).
* If it hears that the odds (given typical LoRa topologies) the odds are very high that every node should eventually receive the message.
* So FloodingRouter.cpp generates an implicit ack which is delivered to the original sender.
* If after some time we don't hear anyone rebroadcast our packet, we will timeout and retransmit, using the regular resend logic.
2021-01-29 02:11:10 +00:00
* Note: This flag is normally sent in a flag bit in the header when sent over the wire
2021-02-21 04:59:22 +00:00
*/
2022-09-07 02:13:54 +00:00
bool want_ack = 10;
2021-03-07 08:28:48 +00:00
/*
* The priority of this message for sending.
2021-03-07 08:28:48 +00:00
* See MeshPacket.Priority description for more details.
*/
2022-09-07 02:13:54 +00:00
Priority priority = 11;
2021-03-23 02:01:04 +00:00
/*
* rssi of received packet. Only sent to phone for dispay purposes.
*/
2022-09-07 02:13:54 +00:00
int32 rx_rssi = 12;
/*
* Describe if this message is delayed
*/
2024-01-09 20:22:56 +00:00
Delayed delayed = 13 [deprecated = true];
2024-01-20 09:46:07 +00:00
/*
* Describes whether this packet passed via MQTT somewhere along the path it currently took.
*/
bool via_mqtt = 14;
2024-03-29 09:23:22 +00:00
/*
* Hop limit with which the original packet started. Sent via LoRa using three bits in the unencrypted header.
* When receiving a packet, the difference between hop_start and hop_limit gives how many hops it traveled.
2024-03-29 09:23:22 +00:00
*/
uint32 hop_start = 15;
/*
* Records the public key the packet was encrypted with, if applicable.
*/
bytes public_key = 16;
/*
* Indicates whether the packet was en/decrypted using PKI
*/
bool pki_encrypted = 17;
2020-03-02 17:47:10 +00:00
}
2021-01-29 02:11:10 +00:00
/*
* Shared constants between device and phone
*/
2020-03-02 17:47:10 +00:00
enum Constants {
2021-01-29 02:11:10 +00:00
/*
* First enum must be zero, and we are just using this enum to
* pass int constants between two very different environments
*/
ZERO = 0;
2021-01-29 02:11:10 +00:00
/*
* From mesh.options
* note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
* outside of this envelope
2021-01-29 02:11:10 +00:00
*/
DATA_PAYLOAD_LEN = 237;
2020-03-02 17:47:10 +00:00
}
2021-01-29 02:11:10 +00:00
/*
* The bluetooth to device link:
* Old BTLE protocol docs from TODO, merge in above and make real docs...
* use protocol buffers, and NanoPB
* messages from device to phone:
* POSITION_UPDATE (..., time)
* TEXT_RECEIVED(from, text, time)
* OPAQUE_RECEIVED(from, payload, time) (for signal messages or other applications)
* messages from phone to device:
* SET_MYID(id, human readable long, human readable short) (send down the unique ID
* string used for this node, a human readable string shown for that id, and a very
* short human readable string suitable for oled screen) SEND_OPAQUE(dest, payload)
* (for signal messages or other applications) SEND_TEXT(dest, text) Get all
* nodes() (returns list of nodes, with full info, last time seen, loc, battery
* level etc) SET_CONFIG (switches device to a new set of radio params and
* preshared key, drops all existing nodes, force our node to rejoin this new group)
* Full information about a node on the mesh
*/
message NodeInfo {
/*
* The node number
2021-01-29 02:11:10 +00:00
*/
uint32 num = 1;
2020-03-02 17:47:10 +00:00
2021-01-29 02:11:10 +00:00
/*
* The user info for this node
*/
User user = 2;
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* 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.
2021-01-29 02:11:10 +00:00
*/
Position position = 3;
2021-01-29 02:11:10 +00:00
/*
* 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
2021-01-29 02:11:10 +00:00
*/
2022-03-04 13:26:16 +00:00
float snr = 4;
2021-01-29 02:11:10 +00:00
/*
2023-05-20 09:29:34 +00:00
* TODO: REMOVE/INTEGRATE
2021-01-29 02:11:10 +00:00
* Returns the last measured frequency error.
* The LoRa receiver estimates the frequency offset between the receiver
* center frequency and that of the received LoRa signal. This function
2021-01-29 02:11:10 +00:00
* returns the estimates offset (in Hz) of the last received message.
* Caution: this measurement is not absolute, but is measured relative to the
* local receiver's oscillator. Apparent errors may be due to the
* transmitter, the receiver or both. \return The estimated center frequency
2021-01-29 02:11:10 +00:00
* offset in Hz of the last received message.
* int32 frequency_error = 6;
* enum RouteState {
* Invalid = 0;
* Discovering = 1;
* Valid = 2;
* }
* Not needed?
* RouteState route = 4;
*/
/*
2022-02-21 07:48:42 +00:00
* TODO: REMOVE/INTEGRATE
* Not currently used (till full DSR deployment?) Our current preferred node node for routing - might be the same as num if
2021-01-29 02:11:10 +00:00
* we are adjacent Or zero if we don't yet know a route to this node.
* fixed32 next_hop = 5;
*/
/*
* Set to indicate the last time we received a packet from this node
*/
2022-03-15 12:24:53 +00:00
fixed32 last_heard = 5;
2022-03-19 13:46:40 +00:00
/*
2022-04-01 23:13:30 +00:00
* The latest device metrics for the node.
2022-03-19 13:46:40 +00:00
*/
2022-04-01 23:13:30 +00:00
DeviceMetrics device_metrics = 6;
2023-03-25 11:03:40 +00:00
/*
2023-03-25 12:16:58 +00:00
* local channel index we heard that node on. Only populated if its not the default channel.
2023-03-25 11:03:40 +00:00
*/
uint32 channel = 7;
/*
* True if we witnessed the node over MQTT instead of LoRA transport
*/
bool via_mqtt = 8;
/*
* Number of hops away from us this node is (0 if adjacent)
*/
uint32 hops_away = 9;
2024-03-29 09:23:22 +00:00
2024-03-21 12:27:30 +00:00
/*
* True if node is in our favorites list
2024-03-21 12:30:10 +00:00
* Persists between NodeDB internal clean ups
2024-03-21 12:27:30 +00:00
*/
bool is_favorite = 10;
2020-03-02 17:47:10 +00:00
}
2021-03-07 08:28:48 +00:00
/*
* Error codes for critical errors
* The device might report these fault codes on the screen.
* If you encounter a fault code, please post on the meshtastic.discourse.group
* and we'll try to help.
*/
enum CriticalErrorCode {
2022-02-21 07:48:42 +00:00
/*
* TODO: REPLACE
*/
NONE = 0;
2021-01-29 02:11:10 +00:00
/*
* A software bug was detected while trying to send lora
*/
TX_WATCHDOG = 1;
2021-01-29 02:11:10 +00:00
/*
* A software bug was detected on entry to sleep
*/
SLEEP_ENTER_WAIT = 2;
2021-01-29 02:11:10 +00:00
/*
* No Lora radio hardware could be found
*/
NO_RADIO = 3;
2021-01-29 02:11:10 +00:00
/*
* Not normally used
*/
UNSPECIFIED = 4;
2021-01-29 02:11:10 +00:00
/*
* We failed while configuring a UBlox GPS
*/
UBLOX_UNIT_FAILED = 5;
2021-01-29 02:11:10 +00:00
/*
* This board was expected to have a power management chip and it is missing or broken
*/
NO_AXP192 = 6;
2021-01-29 02:11:10 +00:00
/*
* The channel tried to set a radio setting which is not supported by this chipset,
* radio comms settings are now undefined.
*/
INVALID_RADIO_SETTING = 7;
2021-02-02 10:19:47 +00:00
/*
* Radio transmit hardware failure. We sent data to the radio chip, but it didn't
* reply with an interrupt.
*/
TRANSMIT_FAILED = 8;
2020-03-02 17:47:10 +00:00
2021-04-20 09:08:28 +00:00
/*
2023-08-13 13:12:14 +00:00
* We detected that the main CPU voltage dropped below the minimum acceptable value
2021-04-20 09:08:28 +00:00
*/
BROWNOUT = 9;
2021-03-08 10:10:38 +00:00
2021-05-01 03:22:19 +00:00
/* Selftest of SX1262 radio chip failed */
SX1262_FAILURE = 10;
2021-05-01 03:22:19 +00:00
2022-02-21 07:48:42 +00:00
/*
* 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
*/
RADIO_SPI_BUG = 11;
/*
* Corruption was detected on the flash filesystem but we were able to repair things.
* If you see this failure in the field please post in the forum because we are interested in seeing if this is occurring in the field.
*/
FLASH_CORRUPTION_RECOVERABLE = 12;
/*
* Corruption was detected on the flash filesystem but we were unable to repair things.
* NOTE: Your node will probably need to be reconfigured the next time it reboots (it will lose the region code etc...)
* If you see this failure in the field please post in the forum because we are interested in seeing if this is occurring in the field.
*/
FLASH_CORRUPTION_UNRECOVERABLE = 13;
2021-01-29 02:11:10 +00:00
}
2020-03-02 17:47:10 +00:00
2021-01-29 02:11:10 +00:00
/*
* Unique local debugging info for this node
* Note: we don't include position or the user info, because that will come in the
* Sent to the phone in response to WantNodes.
*/
2020-03-02 17:47:10 +00:00
message MyNodeInfo {
2021-01-29 02:11:10 +00:00
/*
* Tells the phone what our node number is, default starting value is
* lowbyte of macaddr, but it will be fixed if that is already in use
2021-01-29 02:11:10 +00:00
*/
2020-05-22 03:30:56 +00:00
uint32 my_node_num = 1;
2021-03-27 07:41:20 +00:00
/*
* The total number of reboots this node has ever encountered
* (well - since the last time we discarded preferences)
*/
2022-09-07 02:13:54 +00:00
uint32 reboot_count = 8;
2021-03-27 07:41:20 +00:00
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* 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
2021-01-29 02:11:10 +00:00
*/
2023-06-07 15:05:51 +00:00
uint32 min_app_version = 11;
2020-03-02 17:47:10 +00:00
}
2021-03-07 08:28:48 +00:00
/*
* Debug output from the device.
* To minimize the size of records inside the device code, if a time/source/level is not set
* on the message it is assumed to be a continuation of the previously sent message.
* This allows the device code to use fixed maxlen 64 byte strings for messages,
* and then extend as needed by emitting multiple records.
2021-01-29 02:11:10 +00:00
*/
2020-12-27 02:55:13 +00:00
message LogRecord {
2021-01-29 02:11:10 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
enum Level {
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
UNSET = 0;
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
CRITICAL = 50;
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
ERROR = 40;
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
WARNING = 30;
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
INFO = 20;
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
DEBUG = 10;
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2020-12-27 02:55:13 +00:00
TRACE = 5;
}
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
string message = 1;
2021-01-29 02:11:10 +00:00
/*
* Seconds since 1970 - or 0 for unknown/unset
*/
2020-12-27 02:55:13 +00:00
fixed32 time = 2;
2021-01-29 02:11:10 +00:00
/*
* Usually based on thread name - if known
*/
2020-12-27 02:55:13 +00:00
string source = 3;
2021-01-29 02:11:10 +00:00
/*
* Not yet set
*/
2020-12-27 02:55:13 +00:00
Level level = 4;
}
message QueueStatus {
/* Last attempt to queue status, ErrorCode */
int32 res = 1;
/* Free entries in the outgoing queue */
uint32 free = 2;
/* Maximum entries in the outgoing queue */
uint32 maxlen = 3;
/* What was mesh packet id that generated this response? */
uint32 mesh_packet_id = 4;
}
2021-01-29 02:11:10 +00:00
/*
* Packets from the radio to the phone will appear on the fromRadio characteristic.
* It will support READ and NOTIFY. When a new packet arrives the device will BLE notify?
* It will sit in that descriptor until consumed by the phone,
* at which point the next item in the FIFO will be populated.
2021-01-29 02:11:10 +00:00
*/
2020-03-02 17:47:10 +00:00
message FromRadio {
2021-01-29 02:11:10 +00:00
/*
2022-03-20 00:29:26 +00:00
* The packet id, used to allow the phone to request missing read packets from the FIFO,
* see our bluetooth docs
2021-01-29 02:11:10 +00:00
*/
2022-03-20 00:29:26 +00:00
uint32 id = 1;
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
oneof payload_variant {
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
2022-09-07 02:13:54 +00:00
MeshPacket packet = 2;
2021-01-29 02:11:10 +00:00
/*
* Tells the phone what our node number is, can be -1 if we've not yet joined a mesh.
* NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps.
2021-01-29 02:11:10 +00:00
*/
MyNodeInfo my_info = 3;
2021-01-29 02:11:10 +00:00
/*
* One packet is sent for each node in the on radio DB
* starts over with the first node in our DB
2021-01-29 02:11:10 +00:00
*/
2021-03-02 04:44:29 +00:00
NodeInfo node_info = 4;
/*
* Include a part of the config (was: RadioConfig radio)
*/
2022-09-07 02:13:54 +00:00
Config config = 5;
2021-01-29 02:11:10 +00:00
/*
* Set to send debug console output over our protobuf stream
2021-01-29 02:11:10 +00:00
*/
2022-09-07 02:13:54 +00:00
LogRecord log_record = 6;
2021-01-29 02:11:10 +00:00
/*
* Sent as true once the device has finished sending all of the responses to want_config
2021-01-29 02:11:10 +00:00
* recipient should check if this ID matches our original request nonce, if
* not, it means your config responses haven't started yet.
2021-04-20 09:08:28 +00:00
* NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps.
2021-01-29 02:11:10 +00:00
*/
2022-09-07 02:13:54 +00:00
uint32 config_complete_id = 7;
2021-01-29 02:11:10 +00:00
/*
2021-04-20 09:08:28 +00:00
* Sent to tell clients the radio has just rebooted.
* Set to true if present.
2021-01-29 02:11:10 +00:00
* 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.
2021-01-29 02:11:10 +00:00
*/
2022-09-07 02:13:54 +00:00
bool rebooted = 8;
2022-02-20 09:31:49 +00:00
/*
* Include module config
*/
2022-09-07 02:13:54 +00:00
ModuleConfig moduleConfig = 9;
/*
* One packet is sent for each channel
*/
Channel channel = 10;
2023-01-08 17:22:22 +00:00
/*
* Queue status info
*/
QueueStatus queueStatus = 11;
2023-01-08 17:22:22 +00:00
/*
* File Transfer Chunk
*/
XModem xmodemPacket = 12;
2023-02-16 15:02:32 +00:00
/*
* Device metadata message
*/
DeviceMetadata metadata = 13;
/*
2023-07-22 13:44:45 +00:00
* MQTT Client Proxy Message (device sending to client / phone for publishing to MQTT)
*/
MqttClientProxyMessage mqttClientProxyMessage = 14;
2024-06-25 00:37:52 +00:00
/*
* File system manifest messages
*/
FileInfo fileInfo = 15;
}
2020-03-02 17:47:10 +00:00
}
2024-06-25 00:37:52 +00:00
/*
* Individual File info for the device
*/
message FileInfo {
/*
* The fully qualified path of the file
*/
string file_name = 1;
/*
* The size of the file in bytes
*/
uint32 size_bytes = 2;
}
2021-01-29 02:11:10 +00:00
/*
* Packets/commands to the radio will be written (reliably) to the toRadio characteristic.
2021-01-29 02:11:10 +00:00
* Once the write completes the phone can assume it is handled.
*/
2020-03-02 17:47:10 +00:00
message ToRadio {
2022-02-21 07:48:42 +00:00
/*
* Log levels, chosen to match python logging conventions.
*/
oneof payload_variant {
2021-01-29 02:11:10 +00:00
/*
* Send this packet on the mesh
2021-01-29 02:11:10 +00:00
*/
2022-09-07 02:13:54 +00:00
MeshPacket packet = 1;
2021-01-29 02:11:10 +00:00
/*
* Phone wants radio to send full node db to the phone, This is
2021-01-29 02:11:10 +00:00
* typically the first packet sent to the radio when the phone gets a
* bluetooth connection. The radio will respond by sending back a
* MyNodeInfo, a owner, a radio config and a series of
* FromRadio.node_infos, and config_complete
* the integer you write into this field will be reported back in the
* config_complete_id response this allows clients to never be confused by
* a stale old partially sent config.
*/
2022-09-07 02:13:54 +00:00
uint32 want_config_id = 3;
2021-03-24 23:31:31 +00:00
/*
2021-04-20 09:08:28 +00:00
* 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.
2021-03-24 23:31:31 +00:00
* (Sending this message is optional for clients)
*/
2022-09-07 02:13:54 +00:00
bool disconnect = 4;
2023-01-08 17:22:22 +00:00
/*
* File Transfer Chunk
*/
XModem xmodemPacket = 5;
2023-07-02 19:56:32 +00:00
/*
2023-07-22 13:44:45 +00:00
* MQTT Client Proxy Message (for client / phone subscribed to MQTT sending to device)
2023-07-02 19:56:32 +00:00
*/
MqttClientProxyMessage mqttClientProxyMessage = 6;
/*
* Heartbeat message (used to keep the device connection awake on serial)
*/
2024-03-15 17:54:41 +00:00
Heartbeat heartbeat = 7;
2021-02-21 06:03:13 +00:00
}
}
/*
* Compressed message payload
*/
message Compressed {
/*
* PortNum to determine the how to handle the compressed payload.
*/
PortNum portnum = 1;
/*
* Compressed data.
*/
bytes data = 2;
}
2023-03-06 20:08:24 +00:00
/*
2023-05-20 09:29:34 +00:00
* Full info on edges for a single node
*/
2023-03-06 20:08:24 +00:00
message NeighborInfo {
/*
2023-05-20 09:29:34 +00:00
* The node ID of the node sending info on its neighbors
*/
2023-03-06 20:08:24 +00:00
uint32 node_id = 1;
/*
2023-05-20 09:29:34 +00:00
* Field to pass neighbor info for the next sending cycle
*/
2023-03-06 20:08:24 +00:00
uint32 last_sent_by_id = 2;
/*
* Broadcast interval of the represented node (in seconds)
*/
uint32 node_broadcast_interval_secs = 3;
2023-03-06 20:08:24 +00:00
/*
2023-05-20 09:29:34 +00:00
* The list of out edges from this node
*/
repeated Neighbor neighbors = 4;
2023-03-06 20:08:24 +00:00
}
/*
2023-05-20 09:29:34 +00:00
* A single edge in the mesh
*/
2023-03-06 20:08:24 +00:00
message Neighbor {
/*
2023-05-20 09:29:34 +00:00
* Node ID of neighbor
*/
2023-03-06 20:08:24 +00:00
uint32 node_id = 1;
/*
2023-05-20 09:29:34 +00:00
* SNR of last heard message
*/
2023-03-06 20:08:24 +00:00
float snr = 2;
/*
2024-03-29 09:23:22 +00:00
* Reception time (in secs since 1970) of last message that was last sent by this ID.
* Note: this is for local storage only and will not be sent out over the mesh.
*/
fixed32 last_rx_time = 3;
/*
* Broadcast interval of this neighbor (in seconds).
* Note: this is for local storage only and will not be sent out over the mesh.
*/
uint32 node_broadcast_interval_secs = 4;
2023-03-06 20:08:24 +00:00
}
2023-04-08 13:57:37 +00:00
2023-02-16 15:13:48 +00:00
/*
* Device metadata response
*/
2023-05-20 09:29:34 +00:00
message DeviceMetadata {
2023-02-16 15:13:48 +00:00
/*
* Device firmware version string
*/
string firmware_version = 1;
/*
* Device state version
*/
uint32 device_state_version = 2;
/*
* Indicates whether the device can shutdown CPU natively or via power management chip
*/
bool canShutdown = 3;
/*
* Indicates that the device has native wifi capability
*/
bool hasWifi = 4;
/*
* Indicates that the device has native bluetooth capability
*/
bool hasBluetooth = 5;
/*
* Indicates that the device has an ethernet peripheral
*/
bool hasEthernet = 6;
/*
* Indicates that the device's role in the mesh
*/
Config.DeviceConfig.Role role = 7;
/*
* Indicates the device's current enabled position flags
*/
uint32 position_flags = 8;
/*
* Device hardware model
*/
HardwareModel hw_model = 9;
2023-05-15 19:00:29 +00:00
/*
* Has Remote Hardware enabled
*/
bool hasRemoteHardware = 10;
}
2024-03-29 09:23:22 +00:00
/*
* A heartbeat message is sent to the node from the client to keep the connection alive.
* This is currently only needed to keep serial connections alive, but can be used by any PhoneAPI.
*/
2024-03-29 09:23:22 +00:00
message Heartbeat {}
2024-03-25 12:41:06 +00:00
/*
* RemoteHardwarePins associated with a node
*/
message NodeRemoteHardwarePin {
/*
* The node_num exposing the available gpio pin
*/
uint32 node_num = 1;
/*
* The the available gpio pin for usage with RemoteHardware module
*/
RemoteHardwarePin pin = 2;
}
message ChunkedPayload {
/*
* The ID of the entire payload
*/
uint32 payload_id = 1;
/*
* The total number of chunks in the payload
*/
uint32 chunk_count = 2;
/*
* The current chunk index in the total
*/
uint32 chunk_index = 3;
/*
* The binary data of the current chunk
*/
bytes payload_chunk = 4;
}
2024-06-04 13:15:40 +00:00
/*
* Wrapper message for broken repeated oneof support
*/
message resend_chunks {
repeated uint32 chunks = 1;
}
/*
* Responses to a ChunkedPayload request
*/
message ChunkedPayloadResponse {
/*
* The ID of the entire payload
*/
uint32 payload_id = 1;
oneof payload_variant {
/*
* Request to transfer chunked payload
*/
bool request_transfer = 2;
/*
* Accept the transfer chunked payload
*/
bool accept_transfer = 3;
/*
* Request missing indexes in the chunked payload
*/
2024-06-04 13:15:40 +00:00
resend_chunks resend_chunks = 4;
}
2024-06-04 13:15:40 +00:00
}