From 9a7d8a03cb051eb42787d4a06836b109677d8ef1 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sun, 27 Dec 2020 11:07:58 +0800 Subject: [PATCH] move error code defs to .proto so that other platforms can easily parse --- docs/docs.md | 23 ++++++++++++++++++++++- mesh.proto | 29 ++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/docs/docs.md b/docs/docs.md index 1c629f6..ff2a1a5 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -22,6 +22,7 @@ - [ChannelSettings.ModemConfig](#.ChannelSettings.ModemConfig) - [Constants](#.Constants) + - [CriticalErrorCode](#.CriticalErrorCode) - [GpsOperation](#.GpsOperation) - [LocationSharing](#.LocationSharing) - [LogRecord.Level](#.LogRecord.Level) @@ -246,7 +247,7 @@ Sent to the phone in response to WantNodes. | region | [string](#string) | | The region code for my radio (US, CN, etc...) Note: This string is deprecated. The 1.0 builds populate it based on the flashed firmware name. But for newer builds this string will be unpopulated (missing/null). For those builds you should instead look at the new read/write region enum in UserSettings The format of this string was 1.0-US or 1.0-CN etc.. Or empty string if unset. | | hw_model | [string](#string) | | TBEAM, HELTEC, etc... | | firmware_version | [string](#string) | | 0.0.5 etc... | -| error_code | [uint32](#uint32) | | An error message we'd like to report back to the mothership through / analytics. It indicates a serious bug occurred on the device, the device / coped with it, but we still want to tell the devs about the bug. This / field will be cleared after the phone reads MyNodeInfo (i.e. it will only / be reported once) a numeric error code to go with error message, zero / means no error | +| error_code | [CriticalErrorCode](#CriticalErrorCode) | | An error message we'd like to report back to the mothership through / analytics. It indicates a serious bug occurred on the device, the device / coped with it, but we still want to tell the devs about the bug. This / field will be cleared after the phone reads MyNodeInfo (i.e. it will only / be reported once) a numeric error code to go with error message, zero / means no error | | error_address | [uint32](#uint32) | | A numeric error address (nonzero if available) | | error_count | [uint32](#uint32) | | The total number of errors this node has ever encountered (well - since / the last time we discarded preferences) | | packet_id_bits | [uint32](#uint32) | | How many bits are used for the packetid. If zero it is assumed we use eight bit packetids Old device loads (older that 0.6.5 do not populate this field, but all newer loads do). | @@ -488,6 +489,26 @@ Shared constants between device and phone + + +### CriticalErrorCode +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. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| None | 0 | | +| TxWatchdog | 1 | A software bug was detected while trying to send lora | +| SleepEnterWait | 2 | A software bug was detected on entry to sleep | +| NoRadio | 3 | No Lora radio hardware could be found | +| Unspecified | 4 | Not normally used | +| UBloxInitFailed | 5 | We failed while configuring a UBlox GPS | +| NoAXP192 | 6 | This board was expected to have a power management chip and it is missing or broken | + + + ### GpsOperation diff --git a/mesh.proto b/mesh.proto index 2ba394a..f07da44 100644 --- a/mesh.proto +++ b/mesh.proto @@ -681,6 +681,33 @@ message NodeInfo { uint32 next_hop = 5; } +/** 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 { + None = 0; + + /// A software bug was detected while trying to send lora + TxWatchdog = 1; + + /// A software bug was detected on entry to sleep + SleepEnterWait = 2; + + /// No Lora radio hardware could be found + NoRadio = 3; + + /// Not normally used + Unspecified = 4; + + /// We failed while configuring a UBlox GPS + UBloxInitFailed = 5; + + /// This board was expected to have a power management chip and it is missing or broken + NoAXP192 = 6; +} + /** Unique local debugging info for this node @@ -725,7 +752,7 @@ message MyNodeInfo { /// field will be cleared after the phone reads MyNodeInfo (i.e. it will only /// be reported once) a numeric error code to go with error message, zero /// means no error - uint32 error_code = 7; + CriticalErrorCode error_code = 7; /// A numeric error address (nonzero if available) uint32 error_address = 8;