forked from iarv/meshstream
Initial commit: MQTT client for monitoring Meshtastic packets
This commit is contained in:
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"cSpell.words": ["meshstream", "Motherlode", "mqtt"]
|
||||
}
|
||||
42
README.md
Normal file
42
README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Meshstream
|
||||
|
||||
A Go application that monitors the Meshtastic MQTT server and logs packets to the terminal.
|
||||
|
||||
## Setup
|
||||
|
||||
1. Clone this repository
|
||||
2. Install dependencies:
|
||||
|
||||
```
|
||||
go mod tidy
|
||||
```
|
||||
|
||||
## Running
|
||||
|
||||
```
|
||||
go run main.go
|
||||
```
|
||||
|
||||
## Decoding Meshtastic Packets
|
||||
|
||||
This project includes the Meshtastic protocol buffer definitions in the `proto/` directory. To decode the packets:
|
||||
|
||||
1. Install protoc (Protocol Buffer Compiler):
|
||||
- Visit https://github.com/protocolbuffers/protobuf/releases and download the appropriate version
|
||||
- Install the Go protobuf plugin: `go install google.golang.org/protobuf/cmd/protoc-gen-go@latest`
|
||||
|
||||
2. Generate Go code from protocol buffer definitions:
|
||||
```
|
||||
protoc --go_out=. --go_opt=paths=source_relative proto/meshtastic/*.proto proto/nanopb.proto
|
||||
```
|
||||
|
||||
3. Implement packet decoding in the application
|
||||
|
||||
Note: The current version only logs raw packets to the terminal. Future updates will include full packet decoding functionality.
|
||||
|
||||
## MQTT Configuration
|
||||
|
||||
- Broker: mqtt.bayme.sh
|
||||
- Username: meshdev
|
||||
- Password: large4cats
|
||||
- Topic prefix: msh/US/CA/Motherlode
|
||||
11
go.mod
Normal file
11
go.mod
Normal file
@@ -0,0 +1,11 @@
|
||||
module meshstream
|
||||
|
||||
go 1.24.1
|
||||
|
||||
require github.com/eclipse/paho.mqtt.golang v1.5.0
|
||||
|
||||
require (
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
golang.org/x/net v0.27.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
)
|
||||
8
go.sum
Normal file
8
go.sum
Normal file
@@ -0,0 +1,8 @@
|
||||
github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o=
|
||||
github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
|
||||
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
75
main.go
Normal file
75
main.go
Normal file
@@ -0,0 +1,75 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
mqtt "github.com/eclipse/paho.mqtt.golang"
|
||||
)
|
||||
|
||||
const (
|
||||
mqttBroker = "mqtt.bayme.sh"
|
||||
mqttUsername = "meshdev"
|
||||
mqttPassword = "large4cats"
|
||||
mqttTopicPrefix = "msh/US/CA/Motherlode"
|
||||
)
|
||||
|
||||
var messagePubHandler mqtt.MessageHandler = func(client mqtt.Client, msg mqtt.Message) {
|
||||
fmt.Printf("Received message from topic: %s\n", msg.Topic())
|
||||
fmt.Printf("Raw payload: %v\n", msg.Payload())
|
||||
|
||||
// TODO: When protobuf compilation is set up, we can decode the messages
|
||||
// using the Meshtastic protocol definitions in the proto/ directory
|
||||
// Example decoding logic will be added in a future update
|
||||
}
|
||||
|
||||
var connectHandler mqtt.OnConnectHandler = func(client mqtt.Client) {
|
||||
fmt.Println("Connected to MQTT Broker!")
|
||||
}
|
||||
|
||||
var connectLostHandler mqtt.ConnectionLostHandler = func(client mqtt.Client, err error) {
|
||||
fmt.Printf("Connection lost: %v\n", err)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Set up logging
|
||||
log.SetOutput(os.Stdout)
|
||||
|
||||
// Create MQTT client options
|
||||
opts := mqtt.NewClientOptions()
|
||||
opts.AddBroker(fmt.Sprintf("tcp://%s:1883", mqttBroker))
|
||||
opts.SetClientID("meshstream-client")
|
||||
opts.SetUsername(mqttUsername)
|
||||
opts.SetPassword(mqttPassword)
|
||||
opts.SetDefaultPublishHandler(messagePubHandler)
|
||||
opts.SetPingTimeout(1 * time.Second)
|
||||
opts.OnConnect = connectHandler
|
||||
opts.OnConnectionLost = connectLostHandler
|
||||
|
||||
// Create and start a client
|
||||
client := mqtt.NewClient(opts)
|
||||
if token := client.Connect(); token.Wait() && token.Error() != nil {
|
||||
log.Fatalf("Error connecting to MQTT broker: %v", token.Error())
|
||||
}
|
||||
|
||||
// Subscribe to topic
|
||||
topic := mqttTopicPrefix + "/#"
|
||||
token := client.Subscribe(topic, 0, nil)
|
||||
token.Wait()
|
||||
fmt.Printf("Subscribed to topic: %s\n", topic)
|
||||
|
||||
// Wait for interrupt signal to gracefully shutdown
|
||||
sig := make(chan os.Signal, 1)
|
||||
signal.Notify(sig, os.Interrupt, syscall.SIGTERM)
|
||||
<-sig
|
||||
|
||||
// Unsubscribe and disconnect
|
||||
fmt.Println("Unsubscribing and disconnecting...")
|
||||
token = client.Unsubscribe(topic)
|
||||
token.Wait()
|
||||
client.Disconnect(250)
|
||||
}
|
||||
14
proto/meshtastic/admin.options
Normal file
14
proto/meshtastic/admin.options
Normal file
@@ -0,0 +1,14 @@
|
||||
*AdminMessage.payload_variant anonymous_oneof:true
|
||||
|
||||
*AdminMessage.session_passkey max_size:8
|
||||
|
||||
*AdminMessage.set_canned_message_module_messages max_size:201
|
||||
*AdminMessage.get_canned_message_module_messages_response max_size:201
|
||||
*AdminMessage.delete_file_request max_size:201
|
||||
|
||||
*AdminMessage.set_ringtone_message max_size:231
|
||||
*AdminMessage.get_ringtone_response max_size:231
|
||||
|
||||
*HamParameters.call_sign max_size:8
|
||||
*HamParameters.short_name max_size:5
|
||||
*NodeRemoteHardwarePinsResponse.node_remote_hardware_pins max_count:16
|
||||
474
proto/meshtastic/admin.proto
Normal file
474
proto/meshtastic/admin.proto
Normal file
@@ -0,0 +1,474 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/channel.proto";
|
||||
import "meshtastic/config.proto";
|
||||
import "meshtastic/connection_status.proto";
|
||||
import "meshtastic/mesh.proto";
|
||||
import "meshtastic/module_config.proto";
|
||||
import "meshtastic/device_ui.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "AdminProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
||||
* This message is used to do settings operations to both remote AND local nodes.
|
||||
* (Prior to 1.2 these operations were done via special ToRadio operations)
|
||||
*/
|
||||
message AdminMessage {
|
||||
|
||||
/*
|
||||
* The node generates this key and sends it with any get_x_response packets.
|
||||
* The client MUST include the same key with any set_x commands. Key expires after 300 seconds.
|
||||
* Prevents replay attacks for admin messages.
|
||||
*/
|
||||
bytes session_passkey = 101;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum ConfigType {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DEVICE_CONFIG = 0;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
POSITION_CONFIG = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
POWER_CONFIG = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NETWORK_CONFIG = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DISPLAY_CONFIG = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
LORA_CONFIG = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
BLUETOOTH_CONFIG = 6;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
SECURITY_CONFIG = 7;
|
||||
|
||||
/*
|
||||
* Session key config
|
||||
*/
|
||||
SESSIONKEY_CONFIG = 8;
|
||||
|
||||
/*
|
||||
* device-ui config
|
||||
*/
|
||||
DEVICEUI_CONFIG = 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum ModuleConfigType {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
MQTT_CONFIG = 0;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
SERIAL_CONFIG = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
EXTNOTIF_CONFIG = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
STOREFORWARD_CONFIG = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RANGETEST_CONFIG = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
TELEMETRY_CONFIG = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
CANNEDMSG_CONFIG = 6;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AUDIO_CONFIG = 7;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
REMOTEHARDWARE_CONFIG = 8;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NEIGHBORINFO_CONFIG = 9;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AMBIENTLIGHTING_CONFIG = 10;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DETECTIONSENSOR_CONFIG = 11;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
PAXCOUNTER_CONFIG = 12;
|
||||
}
|
||||
|
||||
enum BackupLocation {
|
||||
/*
|
||||
* Backup to the internal flash
|
||||
*/
|
||||
FLASH = 0;
|
||||
|
||||
/*
|
||||
* Backup to the SD card
|
||||
*/
|
||||
SD = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
oneof payload_variant {
|
||||
/*
|
||||
* 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 = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Channel get_channel_response = 2;
|
||||
|
||||
/*
|
||||
* Send the current owner data in the response to this message.
|
||||
*/
|
||||
bool get_owner_request = 3;
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
ModuleConfigType get_module_config_request = 7;
|
||||
|
||||
/*
|
||||
* Send the current Config in the response to this message.
|
||||
*/
|
||||
ModuleConfig get_module_config_response = 8;
|
||||
|
||||
/*
|
||||
* 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)
|
||||
*/
|
||||
bool get_device_metadata_request = 12;
|
||||
|
||||
/*
|
||||
* Device metadata response
|
||||
*/
|
||||
DeviceMetadata get_device_metadata_response = 13;
|
||||
|
||||
/*
|
||||
* Get the Ringtone in the response to this message.
|
||||
*/
|
||||
bool get_ringtone_request = 14;
|
||||
|
||||
/*
|
||||
* Get the Ringtone in the response to this message.
|
||||
*/
|
||||
string get_ringtone_response = 15;
|
||||
|
||||
/*
|
||||
* Request the node to send it's connection status
|
||||
*/
|
||||
bool get_device_connection_status_request = 16;
|
||||
|
||||
/*
|
||||
* Device connection status response
|
||||
*/
|
||||
DeviceConnectionStatus get_device_connection_status_response = 17;
|
||||
|
||||
/*
|
||||
* Setup a node for licensed amateur (ham) radio operation
|
||||
*/
|
||||
HamParameters set_ham_mode = 18;
|
||||
|
||||
/*
|
||||
* Get the mesh's nodes with their available gpio pins for RemoteHardware module use
|
||||
*/
|
||||
bool get_node_remote_hardware_pins_request = 19;
|
||||
|
||||
/*
|
||||
* Respond with the mesh's nodes with their available gpio pins for RemoteHardware module use
|
||||
*/
|
||||
NodeRemoteHardwarePinsResponse get_node_remote_hardware_pins_response = 20;
|
||||
|
||||
/*
|
||||
* Enter (UF2) DFU mode
|
||||
* Only implemented on NRF52 currently
|
||||
*/
|
||||
bool enter_dfu_mode_request = 21;
|
||||
|
||||
/*
|
||||
* Delete the file by the specified path from the device
|
||||
*/
|
||||
string delete_file_request = 22;
|
||||
|
||||
/*
|
||||
* Set zero and offset for scale chips
|
||||
*/
|
||||
uint32 set_scale = 23;
|
||||
|
||||
/*
|
||||
* Backup the node's preferences
|
||||
*/
|
||||
BackupLocation backup_preferences = 24;
|
||||
|
||||
/*
|
||||
* Restore the node's preferences
|
||||
*/
|
||||
BackupLocation restore_preferences = 25;
|
||||
|
||||
/*
|
||||
* Remove backups of the node's preferences
|
||||
*/
|
||||
BackupLocation remove_backup_preferences = 26;
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/*
|
||||
* Set the ringtone for ExternalNotification.
|
||||
*/
|
||||
string set_ringtone_message = 37;
|
||||
|
||||
/*
|
||||
* Remove the node by the specified node-num from the NodeDB on the device
|
||||
*/
|
||||
uint32 remove_by_nodenum = 38;
|
||||
|
||||
/*
|
||||
* Set specified node-num to be favorited on the NodeDB on the device
|
||||
*/
|
||||
uint32 set_favorite_node = 39;
|
||||
|
||||
/*
|
||||
* Set specified node-num to be un-favorited on the NodeDB on the device
|
||||
*/
|
||||
uint32 remove_favorite_node = 40;
|
||||
|
||||
/*
|
||||
* Set fixed position data on the node and then set the position.fixed_position = true
|
||||
*/
|
||||
Position set_fixed_position = 41;
|
||||
|
||||
/*
|
||||
* Clear fixed position coordinates and then set position.fixed_position = false
|
||||
*/
|
||||
bool remove_fixed_position = 42;
|
||||
|
||||
/*
|
||||
* Set time only on the node
|
||||
* Convenience method to set the time on the node (as Net quality) without any other position data
|
||||
*/
|
||||
fixed32 set_time_only = 43;
|
||||
|
||||
/*
|
||||
* Tell the node to send the stored ui data.
|
||||
*/
|
||||
bool get_ui_config_request = 44;
|
||||
|
||||
/*
|
||||
* Reply stored device ui data.
|
||||
*/
|
||||
DeviceUIConfig get_ui_config_response = 45;
|
||||
|
||||
/*
|
||||
* Tell the node to store UI data persistently.
|
||||
*/
|
||||
DeviceUIConfig store_ui_config = 46;
|
||||
|
||||
/*
|
||||
* Set specified node-num to be ignored on the NodeDB on the device
|
||||
*/
|
||||
uint32 set_ignored_node = 47;
|
||||
|
||||
/*
|
||||
* Set specified node-num to be un-ignored on the NodeDB on the device
|
||||
*/
|
||||
uint32 remove_ignored_node = 48;
|
||||
|
||||
/*
|
||||
* Begins an edit transaction for config, module config, owner, and channel settings changes
|
||||
* This will delay the standard *implicit* save to the file system and subsequent reboot behavior until committed (commit_edit_settings)
|
||||
*/
|
||||
bool begin_edit_settings = 64;
|
||||
|
||||
/*
|
||||
* Commits an open transaction for any edits made to config, module config, owner, and channel settings
|
||||
*/
|
||||
bool commit_edit_settings = 65;
|
||||
|
||||
/*
|
||||
* Tell the node to factory reset config everything; all device state and configuration will be returned to factory defaults and BLE bonds will be cleared.
|
||||
*/
|
||||
int32 factory_reset_device = 94;
|
||||
|
||||
/*
|
||||
* Tell the node to reboot into the OTA Firmware in this many seconds (or <0 to cancel reboot)
|
||||
* Only Implemented for ESP32 Devices. This needs to be issued to send a new main firmware via bluetooth.
|
||||
*/
|
||||
int32 reboot_ota_seconds = 95;
|
||||
|
||||
/*
|
||||
* This message is only supported for the simulator Portduino build.
|
||||
* If received the simulator will exit successfully.
|
||||
*/
|
||||
bool exit_simulator = 96;
|
||||
|
||||
/*
|
||||
* Tell the node to reboot in this many seconds (or <0 to cancel reboot)
|
||||
*/
|
||||
int32 reboot_seconds = 97;
|
||||
|
||||
/*
|
||||
* Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
|
||||
*/
|
||||
int32 shutdown_seconds = 98;
|
||||
|
||||
/*
|
||||
* Tell the node to factory reset config; all device state and configuration will be returned to factory defaults; BLE bonds will be preserved.
|
||||
*/
|
||||
int32 factory_reset_config = 99;
|
||||
|
||||
/*
|
||||
* Tell the node to reset the nodedb.
|
||||
*/
|
||||
int32 nodedb_reset = 100;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Parameters for setting up Meshtastic for ameteur radio usage
|
||||
*/
|
||||
message HamParameters {
|
||||
/*
|
||||
* Amateur radio call sign, eg. KD2ABC
|
||||
*/
|
||||
string call_sign = 1;
|
||||
|
||||
/*
|
||||
* Transmit power in dBm at the LoRA transceiver, not including any amplification
|
||||
*/
|
||||
int32 tx_power = 2;
|
||||
|
||||
/*
|
||||
* The selected frequency of LoRA operation
|
||||
* Please respect your local laws, regulations, and band plans.
|
||||
* Ensure your radio is capable of operating of the selected frequency before setting this.
|
||||
*/
|
||||
float frequency = 3;
|
||||
|
||||
/*
|
||||
* Optional short name of user
|
||||
*/
|
||||
string short_name = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Response envelope for node_remote_hardware_pins
|
||||
*/
|
||||
message NodeRemoteHardwarePinsResponse {
|
||||
/*
|
||||
* Nodes and their respective remote hardware GPIO pins
|
||||
*/
|
||||
repeated NodeRemoteHardwarePin node_remote_hardware_pins = 1;
|
||||
}
|
||||
1
proto/meshtastic/apponly.options
Normal file
1
proto/meshtastic/apponly.options
Normal file
@@ -0,0 +1 @@
|
||||
*ChannelSet.settings max_count:8
|
||||
31
proto/meshtastic/apponly.proto
Normal file
31
proto/meshtastic/apponly.proto
Normal file
@@ -0,0 +1,31 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/channel.proto";
|
||||
import "meshtastic/config.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "AppOnlyProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This is the most compact possible representation for a set of channels.
|
||||
* It includes only one PRIMARY channel (which must be first) and
|
||||
* any SECONDARY channels.
|
||||
* No DISABLED channels are included.
|
||||
* This abstraction is used only on the the 'app side' of the world (ie python, javascript and android etc) to show a group of Channels as a (long) URL
|
||||
*/
|
||||
message ChannelSet {
|
||||
/*
|
||||
* Channel list with settings
|
||||
*/
|
||||
repeated ChannelSettings settings = 1;
|
||||
|
||||
/*
|
||||
* LoRa config
|
||||
*/
|
||||
Config.LoRaConfig lora_config = 2;
|
||||
}
|
||||
8
proto/meshtastic/atak.options
Normal file
8
proto/meshtastic/atak.options
Normal file
@@ -0,0 +1,8 @@
|
||||
*Contact.callsign max_size:120
|
||||
*Contact.device_callsign max_size:120
|
||||
*Status.battery int_size:8
|
||||
*PLI.course int_size:16
|
||||
*GeoChat.message max_size:200
|
||||
*GeoChat.to max_size:120
|
||||
*GeoChat.to_callsign max_size:120
|
||||
*TAKPacket.detail max_size:220
|
||||
263
proto/meshtastic/atak.proto
Normal file
263
proto/meshtastic/atak.proto
Normal file
@@ -0,0 +1,263 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ATAKProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Packets for the official ATAK Plugin
|
||||
*/
|
||||
message TAKPacket {
|
||||
/*
|
||||
* Are the payloads strings compressed for LoRA transport?
|
||||
*/
|
||||
bool is_compressed = 1;
|
||||
/*
|
||||
* The contact / callsign for ATAK user
|
||||
*/
|
||||
Contact contact = 2;
|
||||
/*
|
||||
* The group for ATAK user
|
||||
*/
|
||||
Group group = 3;
|
||||
/*
|
||||
* The status of the ATAK EUD
|
||||
*/
|
||||
Status status = 4;
|
||||
/*
|
||||
* The payload of the packet
|
||||
*/
|
||||
oneof payload_variant {
|
||||
/*
|
||||
* TAK position report
|
||||
*/
|
||||
PLI pli = 5;
|
||||
/*
|
||||
* ATAK GeoChat message
|
||||
*/
|
||||
GeoChat chat = 6;
|
||||
|
||||
/*
|
||||
* Generic CoT detail XML
|
||||
* May be compressed / truncated by the sender (EUD)
|
||||
*/
|
||||
bytes detail = 7;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK GeoChat message
|
||||
*/
|
||||
message GeoChat {
|
||||
/*
|
||||
* The text message
|
||||
*/
|
||||
string message = 1;
|
||||
|
||||
/*
|
||||
* Uid recipient of the message
|
||||
*/
|
||||
optional string to = 2;
|
||||
|
||||
/*
|
||||
* Callsign of the recipient for the message
|
||||
*/
|
||||
optional string to_callsign = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK Group
|
||||
* <__group role='Team Member' name='Cyan'/>
|
||||
*/
|
||||
message Group {
|
||||
/*
|
||||
* Role of the group member
|
||||
*/
|
||||
MemberRole role = 1;
|
||||
/*
|
||||
* Team (color)
|
||||
* Default Cyan
|
||||
*/
|
||||
Team team = 2;
|
||||
}
|
||||
|
||||
enum Team {
|
||||
/*
|
||||
* Unspecifed
|
||||
*/
|
||||
Unspecifed_Color = 0;
|
||||
/*
|
||||
* White
|
||||
*/
|
||||
White = 1;
|
||||
/*
|
||||
* Yellow
|
||||
*/
|
||||
Yellow = 2;
|
||||
/*
|
||||
* Orange
|
||||
*/
|
||||
Orange = 3;
|
||||
/*
|
||||
* Magenta
|
||||
*/
|
||||
Magenta = 4;
|
||||
/*
|
||||
* Red
|
||||
*/
|
||||
Red = 5;
|
||||
/*
|
||||
* Maroon
|
||||
*/
|
||||
Maroon = 6;
|
||||
/*
|
||||
* Purple
|
||||
*/
|
||||
Purple = 7;
|
||||
/*
|
||||
* Dark Blue
|
||||
*/
|
||||
Dark_Blue = 8;
|
||||
/*
|
||||
* Blue
|
||||
*/
|
||||
Blue = 9;
|
||||
/*
|
||||
* Cyan
|
||||
*/
|
||||
Cyan = 10;
|
||||
/*
|
||||
* Teal
|
||||
*/
|
||||
Teal = 11;
|
||||
/*
|
||||
* Green
|
||||
*/
|
||||
Green = 12;
|
||||
/*
|
||||
* Dark Green
|
||||
*/
|
||||
Dark_Green = 13;
|
||||
/*
|
||||
* Brown
|
||||
*/
|
||||
Brown = 14;
|
||||
}
|
||||
|
||||
/*
|
||||
* Role of the group member
|
||||
*/
|
||||
enum MemberRole {
|
||||
/*
|
||||
* Unspecifed
|
||||
*/
|
||||
Unspecifed = 0;
|
||||
/*
|
||||
* Team Member
|
||||
*/
|
||||
TeamMember = 1;
|
||||
/*
|
||||
* Team Lead
|
||||
*/
|
||||
TeamLead = 2;
|
||||
/*
|
||||
* Headquarters
|
||||
*/
|
||||
HQ = 3;
|
||||
/*
|
||||
* Airsoft enthusiast
|
||||
*/
|
||||
Sniper = 4;
|
||||
/*
|
||||
* Medic
|
||||
*/
|
||||
Medic = 5;
|
||||
/*
|
||||
* ForwardObserver
|
||||
*/
|
||||
ForwardObserver = 6;
|
||||
/*
|
||||
* Radio Telephone Operator
|
||||
*/
|
||||
RTO = 7;
|
||||
/*
|
||||
* Doggo
|
||||
*/
|
||||
K9 = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK EUD Status
|
||||
* <status battery='100' />
|
||||
*/
|
||||
message Status {
|
||||
/*
|
||||
* Battery level
|
||||
*/
|
||||
uint32 battery = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* ATAK Contact
|
||||
* <contact endpoint='0.0.0.0:4242:tcp' phone='+12345678' callsign='FALKE'/>
|
||||
*/
|
||||
message Contact {
|
||||
/*
|
||||
* Callsign
|
||||
*/
|
||||
string callsign = 1;
|
||||
|
||||
/*
|
||||
* Device callsign
|
||||
*/
|
||||
string device_callsign = 2;
|
||||
/*
|
||||
* IP address of endpoint in integer form (0.0.0.0 default)
|
||||
*/
|
||||
// fixed32 enpoint_address = 3;
|
||||
/*
|
||||
* Port of endpoint (4242 default)
|
||||
*/
|
||||
// uint32 endpoint_port = 4;
|
||||
/*
|
||||
* Phone represented as integer
|
||||
* Terrible practice, but we really need the wire savings
|
||||
*/
|
||||
// uint32 phone = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Position Location Information from ATAK
|
||||
*/
|
||||
message PLI {
|
||||
/*
|
||||
* The new preferred location encoding, multiply by 1e-7 to get degrees
|
||||
* in floating point
|
||||
*/
|
||||
sfixed32 latitude_i = 1;
|
||||
|
||||
/*
|
||||
* The new preferred location encoding, multiply by 1e-7 to get degrees
|
||||
* in floating point
|
||||
*/
|
||||
sfixed32 longitude_i = 2;
|
||||
|
||||
/*
|
||||
* Altitude (ATAK prefers HAE)
|
||||
*/
|
||||
int32 altitude = 3;
|
||||
|
||||
/*
|
||||
* Speed
|
||||
*/
|
||||
uint32 speed = 4;
|
||||
|
||||
/*
|
||||
* Course in degrees
|
||||
*/
|
||||
uint32 course = 5;
|
||||
}
|
||||
1
proto/meshtastic/cannedmessages.options
Normal file
1
proto/meshtastic/cannedmessages.options
Normal file
@@ -0,0 +1 @@
|
||||
*CannedMessageModuleConfig.messages max_size:201
|
||||
19
proto/meshtastic/cannedmessages.proto
Normal file
19
proto/meshtastic/cannedmessages.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "CannedMessageConfigProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Canned message module configuration.
|
||||
*/
|
||||
message CannedMessageModuleConfig {
|
||||
/*
|
||||
* Predefined messages for canned message module separated by '|' characters.
|
||||
*/
|
||||
string messages = 1;
|
||||
}
|
||||
5
proto/meshtastic/channel.options
Normal file
5
proto/meshtastic/channel.options
Normal file
@@ -0,0 +1,5 @@
|
||||
*Channel.index int_size:8
|
||||
|
||||
# 256 bit or 128 bit psk key
|
||||
*ChannelSettings.psk max_size:32
|
||||
*ChannelSettings.name max_size:12
|
||||
156
proto/meshtastic/channel.proto
Normal file
156
proto/meshtastic/channel.proto
Normal file
@@ -0,0 +1,156 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ChannelProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This information can be encoded as a QRcode/url so that other users can configure
|
||||
* their radio to join the same channel.
|
||||
* A note about how channel names are shown to users: channelname-X
|
||||
* poundsymbol is a prefix used to indicate this is a channel name (idea from @professr).
|
||||
* Where X is a letter from A-Z (base 26) representing a hash of the PSK for this
|
||||
* channel - so that if the user changes anything about the channel (which does
|
||||
* force a new PSK) this letter will also change. Thus preventing user confusion if
|
||||
* two friends try to type in a channel name of "BobsChan" and then can't talk
|
||||
* because their PSKs will be different.
|
||||
* The PSK is hashed into this letter by "0x41 + [xor all bytes of the psk ] modulo 26"
|
||||
* This also allows the option of someday if people have the PSK off (zero), the
|
||||
* users COULD type in a channel name and be able to talk.
|
||||
* FIXME: Add description of multi-channel support and how primary vs secondary channels are used.
|
||||
* FIXME: explain how apps use channels for security.
|
||||
* explain how remote settings and remote gpio are managed as an example
|
||||
*/
|
||||
message ChannelSettings {
|
||||
/*
|
||||
* Deprecated in favor of LoraConfig.channel_num
|
||||
*/
|
||||
uint32 channel_num = 1 [deprecated = true];
|
||||
|
||||
/*
|
||||
* A simple pre-shared key for now for crypto.
|
||||
* Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256).
|
||||
* A special shorthand is used for 1 byte long psks.
|
||||
* These psks should be treated as only minimally secure,
|
||||
* because they are listed in this source code.
|
||||
* Those bytes are mapped using the following scheme:
|
||||
* `0` = No crypto
|
||||
* `1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0x01}
|
||||
* `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 = 2;
|
||||
|
||||
/*
|
||||
* A SHORT name that will be packed into the URL.
|
||||
* Less than 12 bytes.
|
||||
* Something for end users to call the channel
|
||||
* If this is the empty string it is assumed that this channel
|
||||
* is the special (minimally secure) "Default"channel.
|
||||
* In user interfaces it should be rendered as a local language translation of "X".
|
||||
* 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 = 3;
|
||||
|
||||
/*
|
||||
* Used to construct a globally unique channel ID.
|
||||
* The full globally unique ID will be: "name.id" where ID is shown as base36.
|
||||
* Assuming that the number of meshtastic users is below 20K (true for a long time)
|
||||
* the chance of this 64 bit random number colliding with anyone else is super low.
|
||||
* And the penalty for collision is low as well, it just means that anyone trying to decrypt channel messages might need to
|
||||
* try multiple candidate channels.
|
||||
* Any time a non wire compatible change is made to a channel, this field should be regenerated.
|
||||
* There are a small number of 'special' globally known (and fairly) insecure standard channels.
|
||||
* Those channels do not have a numeric id included in the settings, but instead it is pulled from
|
||||
* a table of well known IDs.
|
||||
* (see Well Known Channels FIXME)
|
||||
*/
|
||||
fixed32 id = 4;
|
||||
|
||||
/*
|
||||
* If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe
|
||||
*/
|
||||
bool uplink_enabled = 5;
|
||||
|
||||
/*
|
||||
* If true, messages seen on the internet will be forwarded to the local mesh.
|
||||
*/
|
||||
bool downlink_enabled = 6;
|
||||
|
||||
/*
|
||||
* Per-channel module settings.
|
||||
*/
|
||||
ModuleSettings module_settings = 7;
|
||||
}
|
||||
|
||||
/*
|
||||
* This message is specifically for modules to store per-channel configuration data.
|
||||
*/
|
||||
message ModuleSettings {
|
||||
/*
|
||||
* Bits of precision for the location sent in position packets.
|
||||
*/
|
||||
uint32 position_precision = 1;
|
||||
|
||||
/*
|
||||
* Controls whether or not the phone / clients should mute the current channel
|
||||
* Useful for noisy public channels you don't necessarily want to disable
|
||||
*/
|
||||
bool is_client_muted = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* A pair of a channel number, mode and the (sharable) settings for that channel
|
||||
*/
|
||||
message Channel {
|
||||
/*
|
||||
* How this channel is being used (or not).
|
||||
* Note: this field is an enum to give us options for the future.
|
||||
* In particular, someday we might make a 'SCANNING' option.
|
||||
* SCANNING channels could have different frequencies and the radio would
|
||||
* occasionally check that freq to see if anything is being transmitted.
|
||||
* For devices that have multiple physical radios attached, we could keep multiple PRIMARY/SCANNING channels active at once to allow
|
||||
* cross band routing as needed.
|
||||
* If a device has only a single radio (the common case) only one channel can be PRIMARY at a time
|
||||
* (but any number of SECONDARY channels can't be sent received on that common frequency)
|
||||
*/
|
||||
enum Role {
|
||||
/*
|
||||
* This channel is not in use right now
|
||||
*/
|
||||
DISABLED = 0;
|
||||
|
||||
/*
|
||||
* This channel is used to set the frequency for the radio - all other enabled channels must be SECONDARY
|
||||
*/
|
||||
PRIMARY = 1;
|
||||
|
||||
/*
|
||||
* Secondary channels are only used for encryption/decryption/authentication purposes.
|
||||
* Their radio settings (freq etc) are ignored, only psk is used.
|
||||
*/
|
||||
SECONDARY = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* The index of this channel in the channel table (from 0 to MAX_NUM_CHANNELS-1)
|
||||
* (Someday - not currently implemented) An index of -1 could be used to mean "set by name",
|
||||
* in which case the target node will find and set the channel by settings.name.
|
||||
*/
|
||||
int32 index = 1;
|
||||
|
||||
/*
|
||||
* The new settings, or NULL to disable that channel
|
||||
*/
|
||||
ChannelSettings settings = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Role role = 3;
|
||||
}
|
||||
4
proto/meshtastic/clientonly.options
Normal file
4
proto/meshtastic/clientonly.options
Normal file
@@ -0,0 +1,4 @@
|
||||
*DeviceProfile.long_name max_size:40
|
||||
*DeviceProfile.short_name max_size:5
|
||||
*DeviceProfile.ringtone max_size:231
|
||||
*DeviceProfile.canned_messages max_size:201
|
||||
58
proto/meshtastic/clientonly.proto
Normal file
58
proto/meshtastic/clientonly.proto
Normal file
@@ -0,0 +1,58 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/localonly.proto";
|
||||
import "meshtastic/mesh.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ClientOnlyProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This abstraction is used to contain any configuration for provisioning a node on any client.
|
||||
* It is useful for importing and exporting configurations.
|
||||
*/
|
||||
message DeviceProfile {
|
||||
/*
|
||||
* Long name for the node
|
||||
*/
|
||||
optional string long_name = 1;
|
||||
|
||||
/*
|
||||
* Short name of the node
|
||||
*/
|
||||
optional string short_name = 2;
|
||||
|
||||
/*
|
||||
* The url of the channels from our node
|
||||
*/
|
||||
optional string channel_url = 3;
|
||||
|
||||
/*
|
||||
* The Config of the node
|
||||
*/
|
||||
optional LocalConfig config = 4;
|
||||
|
||||
/*
|
||||
* The ModuleConfig of the node
|
||||
*/
|
||||
optional LocalModuleConfig module_config = 5;
|
||||
|
||||
/*
|
||||
* Fixed position data
|
||||
*/
|
||||
optional Position fixed_position = 6;
|
||||
|
||||
/*
|
||||
* Ringtone for ExternalNotification
|
||||
*/
|
||||
optional string ringtone = 7;
|
||||
|
||||
/*
|
||||
* Predefined messages for CannedMessage
|
||||
*/
|
||||
optional string canned_messages = 8;
|
||||
}
|
||||
22
proto/meshtastic/config.options
Normal file
22
proto/meshtastic/config.options
Normal file
@@ -0,0 +1,22 @@
|
||||
# longest current is 45 chars, plan with a bit of buffer
|
||||
*DeviceConfig.tzdef max_size:65
|
||||
|
||||
*NetworkConfig.wifi_ssid max_size:33
|
||||
*NetworkConfig.wifi_psk max_size:65
|
||||
*NetworkConfig.ntp_server max_size:33
|
||||
*NetworkConfig.rsyslog_server max_size:33
|
||||
|
||||
# Max of three ignored nodes for our testing
|
||||
*LoRaConfig.ignore_incoming max_count:3
|
||||
|
||||
*LoRaConfig.tx_power int_size:8
|
||||
*LoRaConfig.bandwidth int_size:16
|
||||
*LoRaConfig.coding_rate int_size:8
|
||||
*LoRaConfig.channel_num int_size:16
|
||||
|
||||
*PowerConfig.device_battery_ina_address int_size:8
|
||||
|
||||
*SecurityConfig.public_key max_size:32
|
||||
*SecurityConfig.private_key max_size:32
|
||||
*SecurityConfig.admin_key max_size:32
|
||||
*SecurityConfig.admin_key max_count:3
|
||||
1147
proto/meshtastic/config.proto
Normal file
1147
proto/meshtastic/config.proto
Normal file
File diff suppressed because it is too large
Load Diff
1
proto/meshtastic/connection_status.options
Normal file
1
proto/meshtastic/connection_status.options
Normal file
@@ -0,0 +1 @@
|
||||
*WifiConnectionStatus.ssid max_size:33
|
||||
120
proto/meshtastic/connection_status.proto
Normal file
120
proto/meshtastic/connection_status.proto
Normal file
@@ -0,0 +1,120 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ConnStatusProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
message DeviceConnectionStatus {
|
||||
/*
|
||||
* WiFi Status
|
||||
*/
|
||||
optional WifiConnectionStatus wifi = 1;
|
||||
/*
|
||||
* WiFi Status
|
||||
*/
|
||||
optional EthernetConnectionStatus ethernet = 2;
|
||||
|
||||
/*
|
||||
* Bluetooth Status
|
||||
*/
|
||||
optional BluetoothConnectionStatus bluetooth = 3;
|
||||
|
||||
/*
|
||||
* Serial Status
|
||||
*/
|
||||
optional SerialConnectionStatus serial = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* WiFi connection status
|
||||
*/
|
||||
message WifiConnectionStatus {
|
||||
/*
|
||||
* Connection status
|
||||
*/
|
||||
NetworkConnectionStatus status = 1;
|
||||
|
||||
/*
|
||||
* WiFi access point SSID
|
||||
*/
|
||||
string ssid = 2;
|
||||
|
||||
/*
|
||||
* RSSI of wireless connection
|
||||
*/
|
||||
int32 rssi = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ethernet connection status
|
||||
*/
|
||||
message EthernetConnectionStatus {
|
||||
/*
|
||||
* Connection status
|
||||
*/
|
||||
NetworkConnectionStatus status = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ethernet or WiFi connection status
|
||||
*/
|
||||
message NetworkConnectionStatus {
|
||||
/*
|
||||
* IP address of device
|
||||
*/
|
||||
fixed32 ip_address = 1;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection or not
|
||||
*/
|
||||
bool is_connected = 2;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection to an MQTT broker or not
|
||||
*/
|
||||
bool is_mqtt_connected = 3;
|
||||
|
||||
/*
|
||||
* Whether the device is actively remote syslogging or not
|
||||
*/
|
||||
bool is_syslog_connected = 4;
|
||||
}
|
||||
|
||||
/*
|
||||
* Bluetooth connection status
|
||||
*/
|
||||
message BluetoothConnectionStatus {
|
||||
/*
|
||||
* The pairing PIN for bluetooth
|
||||
*/
|
||||
uint32 pin = 1;
|
||||
|
||||
/*
|
||||
* RSSI of bluetooth connection
|
||||
*/
|
||||
int32 rssi = 2;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection or not
|
||||
*/
|
||||
bool is_connected = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Serial connection status
|
||||
*/
|
||||
message SerialConnectionStatus {
|
||||
/*
|
||||
* Serial baud rate
|
||||
*/
|
||||
uint32 baud = 1;
|
||||
|
||||
/*
|
||||
* Whether the device has an active connection or not
|
||||
*/
|
||||
bool is_connected = 2;
|
||||
}
|
||||
10
proto/meshtastic/device_ui.options
Normal file
10
proto/meshtastic/device_ui.options
Normal file
@@ -0,0 +1,10 @@
|
||||
*DeviceUIConfig.screen_brightness int_size:8
|
||||
*DeviceUIConfig.screen_timeout int_size:16
|
||||
*DeviceUIConfig.ring_tone_id int_size:8
|
||||
*DeviceUIConfig.calibration_data max_size:16
|
||||
*NodeFilter.node_name max_size:16
|
||||
*NodeFilter.hops_away int_size:8
|
||||
*NodeFilter.channel int_size:8
|
||||
*NodeHighlight.node_name max_size:16
|
||||
*GeoPoint.zoom int_size:8
|
||||
*Map.style max_size:20
|
||||
290
proto/meshtastic/device_ui.proto
Normal file
290
proto/meshtastic/device_ui.proto
Normal file
@@ -0,0 +1,290 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "DeviceUIProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Protobuf structures for device-ui persistency
|
||||
*/
|
||||
|
||||
message DeviceUIConfig {
|
||||
/*
|
||||
* A version integer used to invalidate saved files when we make incompatible changes.
|
||||
*/
|
||||
uint32 version = 1;
|
||||
|
||||
/*
|
||||
* TFT display brightness 1..255
|
||||
*/
|
||||
uint32 screen_brightness = 2;
|
||||
|
||||
/*
|
||||
* Screen timeout 0..900
|
||||
*/
|
||||
uint32 screen_timeout = 3;
|
||||
|
||||
/*
|
||||
* Screen/Settings lock enabled
|
||||
*/
|
||||
bool screen_lock = 4;
|
||||
bool settings_lock = 5;
|
||||
uint32 pin_code = 6;
|
||||
|
||||
/*
|
||||
* Color theme
|
||||
*/
|
||||
Theme theme = 7;
|
||||
|
||||
/*
|
||||
* Audible message, banner and ring tone
|
||||
*/
|
||||
bool alert_enabled = 8;
|
||||
bool banner_enabled = 9;
|
||||
uint32 ring_tone_id = 10;
|
||||
|
||||
/*
|
||||
* Localization
|
||||
*/
|
||||
Language language = 11;
|
||||
|
||||
/*
|
||||
* Node list filter
|
||||
*/
|
||||
NodeFilter node_filter = 12;
|
||||
|
||||
/*
|
||||
* Node list highlightening
|
||||
*/
|
||||
NodeHighlight node_highlight = 13;
|
||||
|
||||
/*
|
||||
* 8 integers for screen calibration data
|
||||
*/
|
||||
bytes calibration_data = 14;
|
||||
|
||||
/*
|
||||
* Map related data
|
||||
*/
|
||||
Map map_data = 15;
|
||||
}
|
||||
|
||||
|
||||
message NodeFilter {
|
||||
/*
|
||||
* Filter unknown nodes
|
||||
*/
|
||||
bool unknown_switch = 1;
|
||||
|
||||
/*
|
||||
* Filter offline nodes
|
||||
*/
|
||||
bool offline_switch = 2;
|
||||
|
||||
/*
|
||||
* Filter nodes w/o public key
|
||||
*/
|
||||
bool public_key_switch = 3;
|
||||
|
||||
/*
|
||||
* Filter based on hops away
|
||||
*/
|
||||
int32 hops_away = 4;
|
||||
|
||||
/*
|
||||
* Filter nodes w/o position
|
||||
*/
|
||||
bool position_switch = 5;
|
||||
|
||||
/*
|
||||
* Filter nodes by matching name string
|
||||
*/
|
||||
string node_name = 6;
|
||||
|
||||
/*
|
||||
* Filter based on channel
|
||||
*/
|
||||
int32 channel = 7;
|
||||
|
||||
}
|
||||
|
||||
message NodeHighlight {
|
||||
/*
|
||||
* Hightlight nodes w/ active chat
|
||||
*/
|
||||
bool chat_switch = 1;
|
||||
|
||||
/*
|
||||
* Highlight nodes w/ position
|
||||
*/
|
||||
bool position_switch = 2;
|
||||
|
||||
/*
|
||||
* Highlight nodes w/ telemetry data
|
||||
*/
|
||||
bool telemetry_switch = 3;
|
||||
|
||||
/*
|
||||
* Highlight nodes w/ iaq data
|
||||
*/
|
||||
bool iaq_switch = 4;
|
||||
|
||||
/*
|
||||
* Highlight nodes by matching name string
|
||||
*/
|
||||
string node_name = 5;
|
||||
|
||||
}
|
||||
|
||||
message GeoPoint {
|
||||
/*
|
||||
* Zoom level
|
||||
*/
|
||||
int32 zoom = 1;
|
||||
|
||||
/*
|
||||
* Coordinate: latitude
|
||||
*/
|
||||
int32 latitude = 2;
|
||||
|
||||
/*
|
||||
* Coordinate: longitude
|
||||
*/
|
||||
int32 longitude = 3;
|
||||
}
|
||||
|
||||
message Map {
|
||||
/*
|
||||
* Home coordinates
|
||||
*/
|
||||
GeoPoint home = 1;
|
||||
|
||||
/*
|
||||
* Map tile style
|
||||
*/
|
||||
string style = 2;
|
||||
|
||||
/*
|
||||
* Map scroll follows GPS
|
||||
*/
|
||||
bool follow_gps = 3;
|
||||
}
|
||||
|
||||
enum Theme {
|
||||
/*
|
||||
* Dark
|
||||
*/
|
||||
DARK = 0;
|
||||
/*
|
||||
* Light
|
||||
*/
|
||||
LIGHT = 1;
|
||||
/*
|
||||
* Red
|
||||
*/
|
||||
RED = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* Localization
|
||||
*/
|
||||
enum Language {
|
||||
/*
|
||||
* English
|
||||
*/
|
||||
ENGLISH = 0;
|
||||
|
||||
/*
|
||||
* French
|
||||
*/
|
||||
FRENCH = 1;
|
||||
|
||||
/*
|
||||
* German
|
||||
*/
|
||||
GERMAN = 2;
|
||||
|
||||
/*
|
||||
* Italian
|
||||
*/
|
||||
ITALIAN = 3;
|
||||
|
||||
/*
|
||||
* Portuguese
|
||||
*/
|
||||
PORTUGUESE = 4;
|
||||
|
||||
/*
|
||||
* Spanish
|
||||
*/
|
||||
SPANISH = 5;
|
||||
|
||||
/*
|
||||
* Swedish
|
||||
*/
|
||||
SWEDISH = 6;
|
||||
|
||||
/*
|
||||
* Finnish
|
||||
*/
|
||||
FINNISH = 7;
|
||||
|
||||
/*
|
||||
* Polish
|
||||
*/
|
||||
POLISH = 8;
|
||||
|
||||
/*
|
||||
* Turkish
|
||||
*/
|
||||
TURKISH = 9;
|
||||
|
||||
/*
|
||||
* Serbian
|
||||
*/
|
||||
SERBIAN = 10;
|
||||
|
||||
/*
|
||||
* Russian
|
||||
*/
|
||||
RUSSIAN = 11;
|
||||
|
||||
/*
|
||||
* Dutch
|
||||
*/
|
||||
DUTCH = 12;
|
||||
|
||||
/*
|
||||
* Greek
|
||||
*/
|
||||
GREEK = 13;
|
||||
|
||||
/*
|
||||
* Norwegian
|
||||
*/
|
||||
NORWEGIAN = 14;
|
||||
|
||||
/*
|
||||
* Slovenian
|
||||
*/
|
||||
SLOVENIAN = 15;
|
||||
|
||||
/*
|
||||
* Ukrainian
|
||||
*/
|
||||
UKRAINIAN = 16;
|
||||
|
||||
/*
|
||||
* Simplified Chinese (experimental)
|
||||
*/
|
||||
SIMPLIFIED_CHINESE = 30;
|
||||
|
||||
/*
|
||||
* Traditional Chinese (experimental)
|
||||
*/
|
||||
TRADITIONAL_CHINESE = 31;
|
||||
}
|
||||
18
proto/meshtastic/deviceonly.options
Normal file
18
proto/meshtastic/deviceonly.options
Normal file
@@ -0,0 +1,18 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
# 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
|
||||
|
||||
*ChannelFile.channels max_count:8
|
||||
|
||||
*DeviceState.node_remote_hardware_pins max_count:12
|
||||
|
||||
*NodeInfoLite.channel int_size:8
|
||||
*NodeInfoLite.hops_away int_size:8
|
||||
*NodeInfoLite.next_hop int_size:8
|
||||
|
||||
*UserLite.long_name max_size:40
|
||||
*UserLite.short_name max_size:5
|
||||
*UserLite.public_key max_size:32 # public key
|
||||
*UserLite.macaddr max_size:6 fixed_length:true
|
||||
291
proto/meshtastic/deviceonly.proto
Normal file
291
proto/meshtastic/deviceonly.proto
Normal file
@@ -0,0 +1,291 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/channel.proto";
|
||||
import "meshtastic/mesh.proto";
|
||||
import "meshtastic/telemetry.proto";
|
||||
import "meshtastic/config.proto";
|
||||
import "meshtastic/localonly.proto";
|
||||
import "nanopb.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "DeviceOnly";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
option (nanopb_fileopt).include = "<vector>";
|
||||
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Position.LocSource location_source = 5;
|
||||
}
|
||||
|
||||
message UserLite {
|
||||
/*
|
||||
* This is the addr of the radio.
|
||||
*/
|
||||
bytes macaddr = 1 [deprecated = true];
|
||||
|
||||
/*
|
||||
* A full name for this user, i.e. "Kevin Hester"
|
||||
*/
|
||||
string long_name = 2;
|
||||
|
||||
/*
|
||||
* A VERY short name, ideally two characters.
|
||||
* Suitable for a tiny OLED screen
|
||||
*/
|
||||
string short_name = 3;
|
||||
|
||||
/*
|
||||
* TBEAM, HELTEC, etc...
|
||||
* 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.
|
||||
*/
|
||||
HardwareModel hw_model = 4;
|
||||
|
||||
/*
|
||||
* 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 = 5;
|
||||
|
||||
/*
|
||||
* Indicates that the user's role in the mesh
|
||||
*/
|
||||
Config.DeviceConfig.Role role = 6;
|
||||
|
||||
/*
|
||||
* 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 = 7;
|
||||
}
|
||||
|
||||
message NodeInfoLite {
|
||||
/*
|
||||
* The node number
|
||||
*/
|
||||
uint32 num = 1;
|
||||
|
||||
/*
|
||||
* The user info for this node
|
||||
*/
|
||||
UserLite 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;
|
||||
|
||||
/*
|
||||
* 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 direct neighbor)
|
||||
*/
|
||||
optional uint32 hops_away = 9;
|
||||
|
||||
/*
|
||||
* True if node is in our favorites list
|
||||
* Persists between NodeDB internal clean ups
|
||||
*/
|
||||
bool is_favorite = 10;
|
||||
|
||||
/*
|
||||
* True if node is in our ignored list
|
||||
* Persists between NodeDB internal clean ups
|
||||
*/
|
||||
bool is_ignored = 11;
|
||||
|
||||
/*
|
||||
* Last byte of the node number of the node that should be used as the next hop to reach this node.
|
||||
*/
|
||||
uint32 next_hop = 12;
|
||||
}
|
||||
|
||||
/*
|
||||
* This message is never sent over the wire, but it is used for serializing DB
|
||||
* state to flash in the device code
|
||||
* FIXME, since we write this each time we enter deep sleep (and have infinite
|
||||
* flash) it would be better to use some sort of append only data structure for
|
||||
* the receive queue and use the preferences store for the other stuff
|
||||
*/
|
||||
message DeviceState {
|
||||
/*
|
||||
* Read only settings/info about this node
|
||||
*/
|
||||
MyNodeInfo my_node = 2;
|
||||
|
||||
/*
|
||||
* My owner info
|
||||
*/
|
||||
User owner = 3;
|
||||
|
||||
/*
|
||||
* Received packets saved for delivery to the phone
|
||||
*/
|
||||
repeated MeshPacket receive_queue = 5;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 8;
|
||||
|
||||
/*
|
||||
* We keep the last received text message (only) stored in the device flash,
|
||||
* so we can show it on the screen.
|
||||
* Might be null
|
||||
*/
|
||||
MeshPacket rx_text_message = 7;
|
||||
|
||||
/*
|
||||
* Used only during development.
|
||||
* Indicates developer is testing and changes should never be saved to flash.
|
||||
* Deprecated in 2.3.1
|
||||
*/
|
||||
bool no_save = 9 [deprecated = true];
|
||||
|
||||
/*
|
||||
* Previously used to manage GPS factory resets.
|
||||
* Deprecated in 2.5.23
|
||||
*/
|
||||
bool did_gps_reset = 11 [deprecated = true];
|
||||
|
||||
/*
|
||||
* We keep the last received waypoint stored in the device flash,
|
||||
* so we can show it on the screen.
|
||||
* Might be null
|
||||
*/
|
||||
MeshPacket rx_waypoint = 12;
|
||||
|
||||
/*
|
||||
* The mesh's nodes with their available gpio pins for RemoteHardware module
|
||||
*/
|
||||
repeated NodeRemoteHardwarePin node_remote_hardware_pins = 13;
|
||||
}
|
||||
|
||||
message NodeDatabase {
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 1;
|
||||
|
||||
/*
|
||||
* New lite version of NodeDB to decrease memory footprint
|
||||
*/
|
||||
repeated NodeInfoLite nodes = 2 [(nanopb).callback_datatype = "std::vector<meshtastic_NodeInfoLite>"];
|
||||
}
|
||||
|
||||
/*
|
||||
* The on-disk saved channels
|
||||
*/
|
||||
message ChannelFile {
|
||||
/*
|
||||
* The channels our node knows about
|
||||
*/
|
||||
repeated Channel channels = 1;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* The on-disk backup of the node's preferences
|
||||
*/
|
||||
message BackupPreferences {
|
||||
/*
|
||||
* The version of the backup
|
||||
*/
|
||||
uint32 version = 1;
|
||||
|
||||
/*
|
||||
* The timestamp of the backup (if node has time)
|
||||
*/
|
||||
fixed32 timestamp = 2;
|
||||
|
||||
/*
|
||||
* The node's configuration
|
||||
*/
|
||||
LocalConfig config = 3;
|
||||
|
||||
/*
|
||||
* The node's module configuration
|
||||
*/
|
||||
LocalModuleConfig module_config = 4;
|
||||
|
||||
/*
|
||||
* The node's channels
|
||||
*/
|
||||
ChannelFile channels = 5;
|
||||
|
||||
/*
|
||||
* The node's user (owner) information
|
||||
*/
|
||||
User owner = 6;
|
||||
}
|
||||
1
proto/meshtastic/interdevice.options
Normal file
1
proto/meshtastic/interdevice.options
Normal file
@@ -0,0 +1 @@
|
||||
*InterdeviceMessage.nmea max_size:1024
|
||||
44
proto/meshtastic/interdevice.proto
Normal file
44
proto/meshtastic/interdevice.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "InterdeviceProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
// encapsulate up to 1k of NMEA string data
|
||||
|
||||
enum MessageType {
|
||||
ACK = 0;
|
||||
COLLECT_INTERVAL = 160; // in ms
|
||||
BEEP_ON = 161; // duration ms
|
||||
BEEP_OFF = 162; // cancel prematurely
|
||||
SHUTDOWN = 163;
|
||||
POWER_ON = 164;
|
||||
SCD41_TEMP = 176;
|
||||
SCD41_HUMIDITY = 177;
|
||||
SCD41_CO2 = 178;
|
||||
AHT20_TEMP = 179;
|
||||
AHT20_HUMIDITY = 180;
|
||||
TVOC_INDEX = 181;
|
||||
}
|
||||
|
||||
message SensorData {
|
||||
// The message type
|
||||
MessageType type = 1;
|
||||
// The sensor data, either as a float or an uint32
|
||||
oneof data {
|
||||
float float_value = 2;
|
||||
uint32 uint32_value = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message InterdeviceMessage {
|
||||
// The message data
|
||||
oneof data {
|
||||
string nmea = 1;
|
||||
SensorData sensor = 2;
|
||||
}
|
||||
}
|
||||
140
proto/meshtastic/localonly.proto
Normal file
140
proto/meshtastic/localonly.proto
Normal file
@@ -0,0 +1,140 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/config.proto";
|
||||
import "meshtastic/module_config.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "LocalOnlyProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Protobuf structures common to apponly.proto and deviceonly.proto
|
||||
* This is never sent over the wire, only for local use
|
||||
*/
|
||||
|
||||
message LocalConfig {
|
||||
/*
|
||||
* The part of the config that is specific to the Device
|
||||
*/
|
||||
Config.DeviceConfig device = 1;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the GPS Position
|
||||
*/
|
||||
Config.PositionConfig position = 2;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Power settings
|
||||
*/
|
||||
Config.PowerConfig power = 3;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Wifi Settings
|
||||
*/
|
||||
Config.NetworkConfig network = 4;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Display
|
||||
*/
|
||||
Config.DisplayConfig display = 5;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Lora Radio
|
||||
*/
|
||||
Config.LoRaConfig lora = 6;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Bluetooth settings
|
||||
*/
|
||||
Config.BluetoothConfig bluetooth = 7;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 8;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to Security settings
|
||||
*/
|
||||
Config.SecurityConfig security = 9;
|
||||
}
|
||||
|
||||
message LocalModuleConfig {
|
||||
/*
|
||||
* The part of the config that is specific to the MQTT module
|
||||
*/
|
||||
ModuleConfig.MQTTConfig mqtt = 1;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Serial module
|
||||
*/
|
||||
ModuleConfig.SerialConfig serial = 2;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the ExternalNotification module
|
||||
*/
|
||||
ModuleConfig.ExternalNotificationConfig external_notification = 3;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Store & Forward module
|
||||
*/
|
||||
ModuleConfig.StoreForwardConfig store_forward = 4;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the RangeTest module
|
||||
*/
|
||||
ModuleConfig.RangeTestConfig range_test = 5;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Telemetry module
|
||||
*/
|
||||
ModuleConfig.TelemetryConfig telemetry = 6;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Canned Message module
|
||||
*/
|
||||
ModuleConfig.CannedMessageConfig canned_message = 7;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Audio module
|
||||
*/
|
||||
ModuleConfig.AudioConfig audio = 9;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Remote Hardware module
|
||||
*/
|
||||
ModuleConfig.RemoteHardwareConfig remote_hardware = 10;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Neighbor Info module
|
||||
*/
|
||||
ModuleConfig.NeighborInfoConfig neighbor_info = 11;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Ambient Lighting module
|
||||
*/
|
||||
ModuleConfig.AmbientLightingConfig ambient_lighting = 12;
|
||||
|
||||
/*
|
||||
* The part of the config that is specific to the Detection Sensor module
|
||||
*/
|
||||
ModuleConfig.DetectionSensorConfig detection_sensor = 13;
|
||||
|
||||
/*
|
||||
* Paxcounter Config
|
||||
*/
|
||||
ModuleConfig.PaxcounterConfig paxcounter = 14;
|
||||
|
||||
/*
|
||||
* A version integer used to invalidate old save files when we make
|
||||
* incompatible changes This integer is set at build time and is private to
|
||||
* NodeDB.cpp in the device code.
|
||||
*/
|
||||
uint32 version = 8;
|
||||
}
|
||||
80
proto/meshtastic/mesh.options
Normal file
80
proto/meshtastic/mesh.options
Normal file
@@ -0,0 +1,80 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
*macaddr max_size:6 fixed_length:true # macaddrs
|
||||
*id max_size:16 # node id strings
|
||||
*public_key max_size:32 # public key
|
||||
|
||||
*User.long_name max_size:40
|
||||
*User.short_name max_size:5
|
||||
|
||||
*RouteDiscovery.route max_count:8
|
||||
*RouteDiscovery.snr_towards max_count:8
|
||||
*RouteDiscovery.snr_towards int_size:8
|
||||
*RouteDiscovery.route_back max_count:8
|
||||
*RouteDiscovery.snr_back max_count:8
|
||||
*RouteDiscovery.snr_back int_size:8
|
||||
|
||||
# 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
|
||||
*Data.payload max_size:233
|
||||
*Data.bitfield int_size:8
|
||||
|
||||
*NodeInfo.channel int_size:8
|
||||
*NodeInfo.hops_away int_size:8
|
||||
|
||||
# Big enough for 1.2.28.568032c-d
|
||||
*MyNodeInfo.firmware_version max_size:18
|
||||
*MyNodeInfo.device_id max_size:16
|
||||
*MyNodeInfo.pio_env max_size:40
|
||||
|
||||
*MyNodeInfo.air_period_tx max_count:8
|
||||
*MyNodeInfo.air_period_rx max_count:8
|
||||
|
||||
# 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.payload_variant anonymous_oneof:true
|
||||
*MeshPacket.hop_limit int_size:8
|
||||
*MeshPacket.hop_start int_size:8
|
||||
*MeshPacket.channel int_size:8
|
||||
*MeshPacket.next_hop int_size:8
|
||||
*MeshPacket.relay_node int_size:8
|
||||
|
||||
*QueueStatus.res int_size:8
|
||||
*QueueStatus.free int_size:8
|
||||
*QueueStatus.maxlen int_size:8
|
||||
|
||||
*ToRadio.payload_variant anonymous_oneof:true
|
||||
|
||||
*FromRadio.payload_variant anonymous_oneof:true
|
||||
|
||||
*Routing.variant anonymous_oneof:true
|
||||
|
||||
*LogRecord.message max_size:384
|
||||
*LogRecord.source max_size:32
|
||||
|
||||
*FileInfo.file_name max_size:228
|
||||
|
||||
*ClientNotification.message max_size:400
|
||||
|
||||
# MyMessage.name max_size:40
|
||||
# or fixed_length or fixed_count, or max_count
|
||||
|
||||
#This value may want to be a few bytes smaller to compensate for the parent fields.
|
||||
*Compressed.data max_size:233
|
||||
|
||||
*Waypoint.name max_size:30
|
||||
*Waypoint.description max_size:100
|
||||
|
||||
*NeighborInfo.neighbors max_count:10
|
||||
|
||||
*DeviceMetadata.firmware_version max_size:18
|
||||
|
||||
*MqttClientProxyMessage.topic max_size:60
|
||||
*MqttClientProxyMessage.data max_size:435
|
||||
*MqttClientProxyMessage.text max_size:435
|
||||
|
||||
*ChunkedPayload.chunk_count int_size:16
|
||||
*ChunkedPayload.chunk_index int_size:16
|
||||
*ChunkedPayload.payload_chunk max_size:228
|
||||
2151
proto/meshtastic/mesh.proto
Normal file
2151
proto/meshtastic/mesh.proto
Normal file
File diff suppressed because it is too large
Load Diff
29
proto/meshtastic/module_config.options
Normal file
29
proto/meshtastic/module_config.options
Normal file
@@ -0,0 +1,29 @@
|
||||
*CannedMessageConfig.allow_input_source max_size:16
|
||||
|
||||
*MQTTConfig.address max_size:64
|
||||
*MQTTConfig.username max_size:64
|
||||
*MQTTConfig.password max_size:32
|
||||
*MQTTConfig.root max_size:32
|
||||
|
||||
*AudioConfig.ptt_pin int_size:8
|
||||
*AudioConfig.i2s_ws int_size:8
|
||||
*AudioConfig.i2s_sd int_size:8
|
||||
*AudioConfig.i2s_din int_size:8
|
||||
*AudioConfig.i2s_sck int_size:8
|
||||
|
||||
*ExternalNotificationConfig.output_vibra int_size:8
|
||||
*ExternalNotificationConfig.output_buzzer int_size:8
|
||||
*ExternalNotificationConfig.nag_timeout int_size:16
|
||||
|
||||
*RemoteHardwareConfig.available_pins max_count:4
|
||||
*RemoteHardwarePin.name max_size:15
|
||||
*RemoteHardwarePin.gpio_pin int_size:8
|
||||
|
||||
*AmbientLightingConfig.current int_size:8
|
||||
*AmbientLightingConfig.red int_size:8
|
||||
*AmbientLightingConfig.green int_size:8
|
||||
*AmbientLightingConfig.blue int_size:8
|
||||
|
||||
*DetectionSensorConfig.monitor_pin int_size:8
|
||||
*DetectionSensorConfig.name max_size:20
|
||||
*DetectionSensorConfig.detection_trigger_type max_size:8
|
||||
849
proto/meshtastic/module_config.proto
Normal file
849
proto/meshtastic/module_config.proto
Normal file
@@ -0,0 +1,849 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "ModuleConfigProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Module Config
|
||||
*/
|
||||
message ModuleConfig {
|
||||
/*
|
||||
* MQTT Client Config
|
||||
*/
|
||||
message MQTTConfig {
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* The server to use for our MQTT global message gateway feature.
|
||||
* If not set, the default server will be used
|
||||
*/
|
||||
string address = 2;
|
||||
|
||||
/*
|
||||
* MQTT username to use (most useful for a custom MQTT server).
|
||||
* If using a custom server, this will be honoured even if empty.
|
||||
* If using the default server, this will only be honoured if set, otherwise the device will use the default username
|
||||
*/
|
||||
string username = 3;
|
||||
|
||||
/*
|
||||
* MQTT password to use (most useful for a custom MQTT server).
|
||||
* If using a custom server, this will be honoured even if empty.
|
||||
* If using the default server, this will only be honoured if set, otherwise the device will use the default password
|
||||
*/
|
||||
string password = 4;
|
||||
|
||||
/*
|
||||
* Whether to send encrypted or decrypted packets to MQTT.
|
||||
* This parameter is only honoured if you also set server
|
||||
* (the default official mqtt.meshtastic.org server can handle encrypted packets)
|
||||
* 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;
|
||||
|
||||
/*
|
||||
* If true, we attempt to establish a secure connection using TLS
|
||||
*/
|
||||
bool tls_enabled = 7;
|
||||
|
||||
/*
|
||||
* The root topic to use for MQTT messages. Default is "msh".
|
||||
* This is useful if you want to use a single MQTT server for multiple meshtastic networks and separate them via ACLs
|
||||
*/
|
||||
string root = 8;
|
||||
|
||||
/*
|
||||
* If true, we can use the connected phone / client to proxy messages to MQTT instead of a direct connection
|
||||
*/
|
||||
bool proxy_to_client_enabled = 9;
|
||||
|
||||
/*
|
||||
* If true, we will periodically report unencrypted information about our node to a map via MQTT
|
||||
*/
|
||||
bool map_reporting_enabled = 10;
|
||||
|
||||
/*
|
||||
* Settings for reporting information about our node to a map via MQTT
|
||||
*/
|
||||
MapReportSettings map_report_settings = 11;
|
||||
}
|
||||
|
||||
/*
|
||||
* Settings for reporting unencrypted information about our node to a map via MQTT
|
||||
*/
|
||||
message MapReportSettings {
|
||||
/*
|
||||
* How often we should report our info to the map (in seconds)
|
||||
*/
|
||||
uint32 publish_interval_secs = 1;
|
||||
|
||||
/*
|
||||
* Bits of precision for the location sent (default of 32 is full precision).
|
||||
*/
|
||||
uint32 position_precision = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* RemoteHardwareModule Config
|
||||
*/
|
||||
message RemoteHardwareConfig {
|
||||
/*
|
||||
* Whether the Module is enabled
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Whether the Module allows consumers to read / write to pins not defined in available_pins
|
||||
*/
|
||||
bool allow_undefined_pin_access = 2;
|
||||
|
||||
/*
|
||||
* Exposes the available pins to the mesh for reading and writing
|
||||
*/
|
||||
repeated RemoteHardwarePin available_pins = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* NeighborInfoModule Config
|
||||
*/
|
||||
message NeighborInfoConfig {
|
||||
/*
|
||||
* Whether the Module is enabled
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* Neighbor Info (minimum is 14400, i.e., 4 hours)
|
||||
*/
|
||||
uint32 update_interval = 2;
|
||||
|
||||
/*
|
||||
* Whether in addition to sending it to MQTT and the PhoneAPI, our NeighborInfo should be transmitted over LoRa.
|
||||
* Note that this is not available on a channel with default key and name.
|
||||
*/
|
||||
bool transmit_over_lora = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Detection Sensor Module Config
|
||||
*/
|
||||
message DetectionSensorConfig {
|
||||
|
||||
enum TriggerType {
|
||||
// Event is triggered if pin is low
|
||||
LOGIC_LOW = 0;
|
||||
// Event is triggered if pin is high
|
||||
LOGIC_HIGH = 1;
|
||||
// Event is triggered when pin goes high to low
|
||||
FALLING_EDGE = 2;
|
||||
// Event is triggered when pin goes low to high
|
||||
RISING_EDGE = 3;
|
||||
// Event is triggered on every pin state change, low is considered to be
|
||||
// "active"
|
||||
EITHER_EDGE_ACTIVE_LOW = 4;
|
||||
// Event is triggered on every pin state change, high is considered to be
|
||||
// "active"
|
||||
EITHER_EDGE_ACTIVE_HIGH = 5;
|
||||
}
|
||||
/*
|
||||
* Whether the Module is enabled
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we can send a message to the mesh when a
|
||||
* trigger event is detected
|
||||
*/
|
||||
uint32 minimum_broadcast_secs = 2;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should send a message to the mesh
|
||||
* with the current state regardless of trigger events When set to 0, only
|
||||
* trigger events will be broadcasted Works as a sort of status heartbeat
|
||||
* for peace of mind
|
||||
*/
|
||||
uint32 state_broadcast_secs = 3;
|
||||
|
||||
/*
|
||||
* Send ASCII bell with alert message
|
||||
* Useful for triggering ext. notification on bell
|
||||
*/
|
||||
bool send_bell = 4;
|
||||
|
||||
/*
|
||||
* Friendly name used to format message sent to mesh
|
||||
* Example: A name "Motion" would result in a message "Motion detected"
|
||||
* Maximum length of 20 characters
|
||||
*/
|
||||
string name = 5;
|
||||
|
||||
/*
|
||||
* GPIO pin to monitor for state changes
|
||||
*/
|
||||
uint32 monitor_pin = 6;
|
||||
|
||||
/*
|
||||
* The type of trigger event to be used
|
||||
*/
|
||||
TriggerType detection_trigger_type = 7;
|
||||
|
||||
/*
|
||||
* Whether or not use INPUT_PULLUP mode for GPIO pin
|
||||
* Only applicable if the board uses pull-up resistors on the pin
|
||||
*/
|
||||
bool use_pullup = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* Audio Config for codec2 voice
|
||||
*/
|
||||
message AudioConfig {
|
||||
/*
|
||||
* Baudrate for codec2 voice
|
||||
*/
|
||||
enum Audio_Baud {
|
||||
CODEC2_DEFAULT = 0;
|
||||
CODEC2_3200 = 1;
|
||||
CODEC2_2400 = 2;
|
||||
CODEC2_1600 = 3;
|
||||
CODEC2_1400 = 4;
|
||||
CODEC2_1300 = 5;
|
||||
CODEC2_1200 = 6;
|
||||
CODEC2_700 = 7;
|
||||
CODEC2_700B = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* Whether Audio is enabled
|
||||
*/
|
||||
bool codec2_enabled = 1;
|
||||
|
||||
/*
|
||||
* PTT Pin
|
||||
*/
|
||||
uint32 ptt_pin = 2;
|
||||
|
||||
/*
|
||||
* The audio sample rate to use for codec2
|
||||
*/
|
||||
Audio_Baud bitrate = 3;
|
||||
|
||||
/*
|
||||
* I2S Word Select
|
||||
*/
|
||||
uint32 i2s_ws = 4;
|
||||
|
||||
/*
|
||||
* I2S Data IN
|
||||
*/
|
||||
uint32 i2s_sd = 5;
|
||||
|
||||
/*
|
||||
* I2S Data OUT
|
||||
*/
|
||||
uint32 i2s_din = 6;
|
||||
|
||||
/*
|
||||
* I2S Clock
|
||||
*/
|
||||
uint32 i2s_sck = 7;
|
||||
}
|
||||
|
||||
/*
|
||||
* Config for the Paxcounter Module
|
||||
*/
|
||||
message PaxcounterConfig {
|
||||
/*
|
||||
* Enable the Paxcounter Module
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* metrics to the mesh
|
||||
*/
|
||||
|
||||
uint32 paxcounter_update_interval = 2;
|
||||
|
||||
/*
|
||||
* WiFi RSSI threshold. Defaults to -80
|
||||
*/
|
||||
int32 wifi_threshold = 3;
|
||||
|
||||
/*
|
||||
* BLE RSSI threshold. Defaults to -80
|
||||
*/
|
||||
int32 ble_threshold = 4;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Serial Config
|
||||
*/
|
||||
message SerialConfig {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum Serial_Baud {
|
||||
BAUD_DEFAULT = 0;
|
||||
BAUD_110 = 1;
|
||||
BAUD_300 = 2;
|
||||
BAUD_600 = 3;
|
||||
BAUD_1200 = 4;
|
||||
BAUD_2400 = 5;
|
||||
BAUD_4800 = 6;
|
||||
BAUD_9600 = 7;
|
||||
BAUD_19200 = 8;
|
||||
BAUD_38400 = 9;
|
||||
BAUD_57600 = 10;
|
||||
BAUD_115200 = 11;
|
||||
BAUD_230400 = 12;
|
||||
BAUD_460800 = 13;
|
||||
BAUD_576000 = 14;
|
||||
BAUD_921600 = 15;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum Serial_Mode {
|
||||
DEFAULT = 0;
|
||||
SIMPLE = 1;
|
||||
PROTO = 2;
|
||||
TEXTMSG = 3;
|
||||
NMEA = 4;
|
||||
// NMEA messages specifically tailored for CalTopo
|
||||
CALTOPO = 5;
|
||||
// Ecowitt WS85 weather station
|
||||
WS85 = 6;
|
||||
}
|
||||
|
||||
/*
|
||||
* Preferences for the SerialModule
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
bool echo = 2;
|
||||
|
||||
/*
|
||||
* RX pin (should match Arduino gpio pin number)
|
||||
*/
|
||||
uint32 rxd = 3;
|
||||
|
||||
/*
|
||||
* TX pin (should match Arduino gpio pin number)
|
||||
*/
|
||||
uint32 txd = 4;
|
||||
|
||||
/*
|
||||
* Serial baud rate
|
||||
*/
|
||||
Serial_Baud baud = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 timeout = 6;
|
||||
|
||||
/*
|
||||
* Mode for serial module operation
|
||||
*/
|
||||
Serial_Mode mode = 7;
|
||||
|
||||
/*
|
||||
* Overrides the platform's defacto Serial port instance to use with Serial module config settings
|
||||
* This is currently only usable in output modes like NMEA / CalTopo and may behave strangely or not work at all in other modes
|
||||
* Existing logging over the Serial Console will still be present
|
||||
*/
|
||||
bool override_console_serial_port = 8;
|
||||
}
|
||||
|
||||
/*
|
||||
* External Notifications Config
|
||||
*/
|
||||
message ExternalNotificationConfig {
|
||||
/*
|
||||
* Enable the ExternalNotificationModule
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* When using in On/Off mode, keep the output on for this many
|
||||
* milliseconds. Default 1000ms (1 second).
|
||||
*/
|
||||
uint32 output_ms = 2;
|
||||
|
||||
/*
|
||||
* Define the output pin GPIO setting Defaults to
|
||||
* EXT_NOTIFY_OUT if set for the board.
|
||||
* In standalone devices this pin should drive the LED to match the UI.
|
||||
*/
|
||||
uint32 output = 3;
|
||||
|
||||
/*
|
||||
* Optional: Define a secondary output pin for a vibra motor
|
||||
* This is used in standalone devices to match the UI.
|
||||
*/
|
||||
uint32 output_vibra = 8;
|
||||
|
||||
/*
|
||||
* Optional: Define a tertiary output pin for an active buzzer
|
||||
* This is used in standalone devices to to match the UI.
|
||||
*/
|
||||
uint32 output_buzzer = 9;
|
||||
|
||||
/*
|
||||
* IF this is true, the 'output' Pin will be pulled active high, false
|
||||
* means active low.
|
||||
*/
|
||||
bool active = 4;
|
||||
|
||||
/*
|
||||
* True: Alert when a text message arrives (output)
|
||||
*/
|
||||
bool alert_message = 5;
|
||||
|
||||
/*
|
||||
* True: Alert when a text message arrives (output_vibra)
|
||||
*/
|
||||
bool alert_message_vibra = 10;
|
||||
|
||||
/*
|
||||
* True: Alert when a text message arrives (output_buzzer)
|
||||
*/
|
||||
bool alert_message_buzzer = 11;
|
||||
|
||||
/*
|
||||
* True: Alert when the bell character is received (output)
|
||||
*/
|
||||
bool alert_bell = 6;
|
||||
|
||||
/*
|
||||
* True: Alert when the bell character is received (output_vibra)
|
||||
*/
|
||||
bool alert_bell_vibra = 12;
|
||||
|
||||
/*
|
||||
* True: Alert when the bell character is received (output_buzzer)
|
||||
*/
|
||||
bool alert_bell_buzzer = 13;
|
||||
|
||||
/*
|
||||
* use a PWM output instead of a simple on/off output. This will ignore
|
||||
* the 'output', 'output_ms' and 'active' settings and use the
|
||||
* device.buzzer_gpio instead.
|
||||
*/
|
||||
bool use_pwm = 7;
|
||||
|
||||
/*
|
||||
* The notification will toggle with 'output_ms' for this time of seconds.
|
||||
* Default is 0 which means don't repeat at all. 60 would mean blink
|
||||
* and/or beep for 60 seconds
|
||||
*/
|
||||
uint32 nag_timeout = 14;
|
||||
|
||||
/*
|
||||
* When true, enables devices with native I2S audio output to use the RTTTL over speaker like a buzzer
|
||||
* T-Watch S3 and T-Deck for example have this capability
|
||||
*/
|
||||
bool use_i2s_as_buzzer = 15;
|
||||
}
|
||||
|
||||
/*
|
||||
* Store and Forward Module Config
|
||||
*/
|
||||
message StoreForwardConfig {
|
||||
/*
|
||||
* Enable the Store and Forward Module
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
bool heartbeat = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 records = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 history_return_max = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
uint32 history_return_window = 5;
|
||||
|
||||
/*
|
||||
* Set to true to let this node act as a server that stores received messages and resends them upon request.
|
||||
*/
|
||||
bool is_server = 6;
|
||||
}
|
||||
|
||||
/*
|
||||
* Preferences for the RangeTestModule
|
||||
*/
|
||||
message RangeTestConfig {
|
||||
/*
|
||||
* Enable the Range Test Module
|
||||
*/
|
||||
bool enabled = 1;
|
||||
|
||||
/*
|
||||
* Send out range test messages from this node
|
||||
*/
|
||||
uint32 sender = 2;
|
||||
|
||||
/*
|
||||
* Bool value indicating that this node should save a RangeTest.csv file.
|
||||
* ESP32 Only
|
||||
*/
|
||||
bool save = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Configuration for both device and environment metrics
|
||||
*/
|
||||
message TelemetryConfig {
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* device metrics to the mesh
|
||||
*/
|
||||
uint32 device_update_interval = 1;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* environment measurements to the mesh
|
||||
*/
|
||||
|
||||
uint32 environment_update_interval = 2;
|
||||
|
||||
/*
|
||||
* Preferences for the Telemetry Module (Environment)
|
||||
* Enable/Disable the telemetry measurement module measurement collection
|
||||
*/
|
||||
bool environment_measurement_enabled = 3;
|
||||
|
||||
/*
|
||||
* Enable/Disable the telemetry measurement module on-device display
|
||||
*/
|
||||
bool environment_screen_enabled = 4;
|
||||
|
||||
/*
|
||||
* 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 = 5;
|
||||
|
||||
/*
|
||||
* Enable/Disable the air quality metrics
|
||||
*/
|
||||
bool air_quality_enabled = 6;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* air quality metrics to the mesh
|
||||
*/
|
||||
uint32 air_quality_interval = 7;
|
||||
|
||||
/*
|
||||
* Enable/disable Power metrics
|
||||
*/
|
||||
bool power_measurement_enabled = 8;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* power metrics to the mesh
|
||||
*/
|
||||
uint32 power_update_interval = 9;
|
||||
|
||||
/*
|
||||
* Enable/Disable the power measurement module on-device display
|
||||
*/
|
||||
bool power_screen_enabled = 10;
|
||||
|
||||
/*
|
||||
* Preferences for the (Health) Telemetry Module
|
||||
* Enable/Disable the telemetry measurement module measurement collection
|
||||
*/
|
||||
bool health_measurement_enabled = 11;
|
||||
|
||||
/*
|
||||
* Interval in seconds of how often we should try to send our
|
||||
* health metrics to the mesh
|
||||
*/
|
||||
uint32 health_update_interval = 12;
|
||||
|
||||
/*
|
||||
* Enable/Disable the health telemetry module on-device display
|
||||
*/
|
||||
bool health_screen_enabled = 13;
|
||||
}
|
||||
|
||||
/*
|
||||
* Canned Messages Module Config
|
||||
*/
|
||||
message CannedMessageConfig {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum InputEventChar {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NONE = 0;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
UP = 17;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DOWN = 18;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
LEFT = 19;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RIGHT = 20;
|
||||
|
||||
/*
|
||||
* '\n'
|
||||
*/
|
||||
SELECT = 10;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
BACK = 27;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
CANCEL = 24;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable the rotary encoder #1. This is a 'dumb' encoder sending pulses on both A and B pins while rotating.
|
||||
*/
|
||||
bool rotary1_enabled = 1;
|
||||
|
||||
/*
|
||||
* GPIO pin for rotary encoder A port.
|
||||
*/
|
||||
uint32 inputbroker_pin_a = 2;
|
||||
|
||||
/*
|
||||
* GPIO pin for rotary encoder B port.
|
||||
*/
|
||||
uint32 inputbroker_pin_b = 3;
|
||||
|
||||
/*
|
||||
* GPIO pin for rotary encoder Press port.
|
||||
*/
|
||||
uint32 inputbroker_pin_press = 4;
|
||||
|
||||
/*
|
||||
* Generate input event on CW of this kind.
|
||||
*/
|
||||
InputEventChar inputbroker_event_cw = 5;
|
||||
|
||||
/*
|
||||
* Generate input event on CCW of this kind.
|
||||
*/
|
||||
InputEventChar inputbroker_event_ccw = 6;
|
||||
|
||||
/*
|
||||
* Generate input event on Press of this kind.
|
||||
*/
|
||||
InputEventChar inputbroker_event_press = 7;
|
||||
|
||||
/*
|
||||
* Enable the Up/Down/Select input device. Can be RAK rotary encoder or 3 buttons. Uses the a/b/press definitions from inputbroker.
|
||||
*/
|
||||
bool updown1_enabled = 8;
|
||||
|
||||
/*
|
||||
* Enable/disable CannedMessageModule.
|
||||
*/
|
||||
bool enabled = 9;
|
||||
|
||||
/*
|
||||
* Input event origin accepted by the canned message module.
|
||||
* Can be e.g. "rotEnc1", "upDownEnc1", "scanAndSelect", "cardkb", "serialkb", or keyword "_any"
|
||||
*/
|
||||
string allow_input_source = 10;
|
||||
|
||||
/*
|
||||
* CannedMessageModule also sends a bell character with the messages.
|
||||
* ExternalNotificationModule can benefit from this feature.
|
||||
*/
|
||||
bool send_bell = 11;
|
||||
}
|
||||
|
||||
/*
|
||||
Ambient Lighting Module - Settings for control of onboard LEDs to allow users to adjust the brightness levels and respective color levels.
|
||||
Initially created for the RAK14001 RGB LED module.
|
||||
*/
|
||||
message AmbientLightingConfig {
|
||||
/*
|
||||
* Sets LED to on or off.
|
||||
*/
|
||||
bool led_state = 1;
|
||||
|
||||
/*
|
||||
* Sets the current for the LED output. Default is 10.
|
||||
*/
|
||||
uint32 current = 2;
|
||||
|
||||
/*
|
||||
* Sets the red LED level. Values are 0-255.
|
||||
*/
|
||||
uint32 red = 3;
|
||||
|
||||
/*
|
||||
* Sets the green LED level. Values are 0-255.
|
||||
*/
|
||||
uint32 green = 4;
|
||||
|
||||
/*
|
||||
* Sets the blue LED level. Values are 0-255.
|
||||
*/
|
||||
uint32 blue = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
oneof payload_variant {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
MQTTConfig mqtt = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
SerialConfig serial = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
ExternalNotificationConfig external_notification = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
StoreForwardConfig store_forward = 4;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RangeTestConfig range_test = 5;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
TelemetryConfig telemetry = 6;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
CannedMessageConfig canned_message = 7;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AudioConfig audio = 8;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RemoteHardwareConfig remote_hardware = 9;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
NeighborInfoConfig neighbor_info = 10;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
AmbientLightingConfig ambient_lighting = 11;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
DetectionSensorConfig detection_sensor = 12;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
PaxcounterConfig paxcounter = 13;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A GPIO pin definition for remote hardware module
|
||||
*/
|
||||
message RemoteHardwarePin {
|
||||
/*
|
||||
* GPIO Pin number (must match Arduino)
|
||||
*/
|
||||
uint32 gpio_pin = 1;
|
||||
|
||||
/*
|
||||
* Name for the GPIO pin (i.e. Front gate, mailbox, etc)
|
||||
*/
|
||||
string name = 2;
|
||||
|
||||
/*
|
||||
* Type of GPIO access available to consumers on the mesh
|
||||
*/
|
||||
RemoteHardwarePinType type = 3;
|
||||
}
|
||||
|
||||
enum RemoteHardwarePinType {
|
||||
/*
|
||||
* Unset/unused
|
||||
*/
|
||||
UNKNOWN = 0;
|
||||
|
||||
/*
|
||||
* GPIO pin can be read (if it is high / low)
|
||||
*/
|
||||
DIGITAL_READ = 1;
|
||||
|
||||
/*
|
||||
* GPIO pin can be written to (high / low)
|
||||
*/
|
||||
DIGITAL_WRITE = 2;
|
||||
}
|
||||
8
proto/meshtastic/mqtt.options
Normal file
8
proto/meshtastic/mqtt.options
Normal file
@@ -0,0 +1,8 @@
|
||||
*ServiceEnvelope.packet type:FT_POINTER
|
||||
*ServiceEnvelope.channel_id type:FT_POINTER
|
||||
*ServiceEnvelope.gateway_id type:FT_POINTER
|
||||
|
||||
*MapReport.long_name max_size:40
|
||||
*MapReport.short_name max_size:5
|
||||
*MapReport.firmware_version max_size:18
|
||||
*MapReport.num_online_local_nodes int_size:16
|
||||
106
proto/meshtastic/mqtt.proto
Normal file
106
proto/meshtastic/mqtt.proto
Normal file
@@ -0,0 +1,106 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
import "meshtastic/config.proto";
|
||||
import "meshtastic/mesh.proto";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "MQTTProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* This message wraps a MeshPacket with extra metadata about the sender and how it arrived.
|
||||
*/
|
||||
message ServiceEnvelope {
|
||||
/*
|
||||
* The (probably encrypted) packet
|
||||
*/
|
||||
MeshPacket packet = 1;
|
||||
|
||||
/*
|
||||
* The global channel ID it was sent on
|
||||
*/
|
||||
string channel_id = 2;
|
||||
|
||||
/*
|
||||
* The sending gateway node ID. Can we use this to authenticate/prevent fake
|
||||
* nodeid impersonation for senders? - i.e. use gateway/mesh id (which is authenticated) + local node id as
|
||||
* the globally trusted nodenum
|
||||
*/
|
||||
string gateway_id = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Information about a node intended to be reported unencrypted to a map using MQTT.
|
||||
*/
|
||||
message MapReport {
|
||||
/*
|
||||
* A full name for this user, i.e. "Kevin Hester"
|
||||
*/
|
||||
string long_name = 1;
|
||||
|
||||
/*
|
||||
* A VERY short name, ideally two characters.
|
||||
* Suitable for a tiny OLED screen
|
||||
*/
|
||||
string short_name = 2;
|
||||
|
||||
/*
|
||||
* Role of the node that applies specific settings for a particular use-case
|
||||
*/
|
||||
Config.DeviceConfig.Role role = 3;
|
||||
|
||||
/*
|
||||
* Hardware model of the node, i.e. T-Beam, Heltec V3, etc...
|
||||
*/
|
||||
HardwareModel hw_model = 4;
|
||||
|
||||
/*
|
||||
* Device firmware version string
|
||||
*/
|
||||
string firmware_version = 5;
|
||||
|
||||
/*
|
||||
* The region code for the radio (US, CN, EU433, etc...)
|
||||
*/
|
||||
Config.LoRaConfig.RegionCode region = 6;
|
||||
|
||||
/*
|
||||
* Modem preset used by the radio (LongFast, MediumSlow, etc...)
|
||||
*/
|
||||
Config.LoRaConfig.ModemPreset modem_preset = 7;
|
||||
|
||||
/*
|
||||
* Whether the node has a channel with default PSK and name (LongFast, MediumSlow, etc...)
|
||||
* and it uses the default frequency slot given the region and modem preset.
|
||||
*/
|
||||
bool has_default_channel = 8;
|
||||
|
||||
/*
|
||||
* Latitude: multiply by 1e-7 to get degrees in floating point
|
||||
*/
|
||||
sfixed32 latitude_i = 9;
|
||||
|
||||
/*
|
||||
* Longitude: multiply by 1e-7 to get degrees in floating point
|
||||
*/
|
||||
sfixed32 longitude_i = 10;
|
||||
|
||||
/*
|
||||
* Altitude in meters above MSL
|
||||
*/
|
||||
int32 altitude = 11;
|
||||
|
||||
/*
|
||||
* Indicates the bits of precision for latitude and longitude set by the sending node
|
||||
*/
|
||||
uint32 position_precision = 12;
|
||||
|
||||
/*
|
||||
* Number of online nodes (heard in the last 2 hours) this node has in its list that were received locally (not via MQTT)
|
||||
*/
|
||||
uint32 num_online_local_nodes = 13;
|
||||
}
|
||||
29
proto/meshtastic/paxcount.proto
Normal file
29
proto/meshtastic/paxcount.proto
Normal file
@@ -0,0 +1,29 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "PaxcountProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message Paxcount {
|
||||
/*
|
||||
* seen Wifi devices
|
||||
*/
|
||||
uint32 wifi = 1;
|
||||
|
||||
/*
|
||||
* Seen BLE devices
|
||||
*/
|
||||
uint32 ble = 2;
|
||||
|
||||
/*
|
||||
* Uptime in seconds
|
||||
*/
|
||||
uint32 uptime = 3;
|
||||
}
|
||||
232
proto/meshtastic/portnums.proto
Normal file
232
proto/meshtastic/portnums.proto
Normal file
@@ -0,0 +1,232 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "Portnums";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* For any new 'apps' that run on the device or via sister apps on phones/PCs they should pick and use a
|
||||
* unique 'portnum' for their application.
|
||||
* If you are making a new app using meshtastic, please send in a pull request to add your 'portnum' to this
|
||||
* master table.
|
||||
* PortNums should be assigned in the following range:
|
||||
* 0-63 Core Meshtastic use, do not use for third party apps
|
||||
* 64-127 Registered 3rd party apps, send in a pull request that adds a new entry to portnums.proto to register your application
|
||||
* 256-511 Use one of these portnums for your private applications that you don't want to register publically
|
||||
* All other values are reserved.
|
||||
* Note: This was formerly a Type enum named 'typ' with the same id #
|
||||
* We have change to this 'portnum' based scheme for specifying app handlers for particular payloads.
|
||||
* This change is backwards compatible by treating the legacy OPAQUE/CLEAR_TEXT values identically.
|
||||
*/
|
||||
enum PortNum {
|
||||
/*
|
||||
* Deprecated: do not use in new code (formerly called OPAQUE)
|
||||
* A message sent from a device outside of the mesh, in a form the mesh does not understand
|
||||
* NOTE: This must be 0, because it is documented in IMeshService.aidl to be so
|
||||
* ENCODING: binary undefined
|
||||
*/
|
||||
UNKNOWN_APP = 0;
|
||||
|
||||
/*
|
||||
* A simple UTF-8 text message, which even the little micros in the mesh
|
||||
* can understand and show on their screen eventually in some circumstances
|
||||
* even signal might send messages in this form (see below)
|
||||
* ENCODING: UTF-8 Plaintext (?)
|
||||
*/
|
||||
TEXT_MESSAGE_APP = 1;
|
||||
|
||||
/*
|
||||
* Reserved for built-in GPIO/example app.
|
||||
* See remote_hardware.proto/HardwareMessage for details on the message sent/received to this port number
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
REMOTE_HARDWARE_APP = 2;
|
||||
|
||||
/*
|
||||
* The built-in position messaging app.
|
||||
* Payload is a Position message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
POSITION_APP = 3;
|
||||
|
||||
/*
|
||||
* The built-in user info app.
|
||||
* Payload is a User message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
NODEINFO_APP = 4;
|
||||
|
||||
/*
|
||||
* Protocol control packets for mesh protocol use.
|
||||
* Payload is a Routing message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
ROUTING_APP = 5;
|
||||
|
||||
/*
|
||||
* Admin control packets.
|
||||
* Payload is a AdminMessage message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
ADMIN_APP = 6;
|
||||
|
||||
/*
|
||||
* Compressed TEXT_MESSAGE payloads.
|
||||
* ENCODING: UTF-8 Plaintext (?) with Unishox2 Compression
|
||||
* NOTE: The Device Firmware converts a TEXT_MESSAGE_APP to TEXT_MESSAGE_COMPRESSED_APP if the compressed
|
||||
* payload is shorter. There's no need for app developers to do this themselves. Also the firmware will decompress
|
||||
* any incoming TEXT_MESSAGE_COMPRESSED_APP payload and convert to TEXT_MESSAGE_APP.
|
||||
*/
|
||||
TEXT_MESSAGE_COMPRESSED_APP = 7;
|
||||
|
||||
/*
|
||||
* Waypoint payloads.
|
||||
* Payload is a Waypoint message.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
WAYPOINT_APP = 8;
|
||||
|
||||
/*
|
||||
* Audio Payloads.
|
||||
* Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now
|
||||
* ENCODING: codec2 audio frames
|
||||
* NOTE: audio frames contain a 3 byte header (0xc0 0xde 0xc2) and a one byte marker for the decompressed bitrate.
|
||||
* This marker comes from the 'moduleConfig.audio.bitrate' enum minus one.
|
||||
*/
|
||||
AUDIO_APP = 9;
|
||||
|
||||
/*
|
||||
* Same as Text Message but originating from Detection Sensor Module.
|
||||
* NOTE: This portnum traffic is not sent to the public MQTT starting at firmware version 2.2.9
|
||||
*/
|
||||
DETECTION_SENSOR_APP = 10;
|
||||
|
||||
/*
|
||||
* Same as Text Message but used for critical alerts.
|
||||
*/
|
||||
ALERT_APP = 11;
|
||||
|
||||
/*
|
||||
* Provides a 'ping' service that replies to any packet it receives.
|
||||
* Also serves as a small example module.
|
||||
* ENCODING: ASCII Plaintext
|
||||
*/
|
||||
REPLY_APP = 32;
|
||||
|
||||
/*
|
||||
* Used for the python IP tunnel feature
|
||||
* ENCODING: IP Packet. Handled by the python API, firmware ignores this one and pases on.
|
||||
*/
|
||||
IP_TUNNEL_APP = 33;
|
||||
|
||||
/*
|
||||
* Paxcounter lib included in the firmware
|
||||
* ENCODING: protobuf
|
||||
*/
|
||||
PAXCOUNTER_APP = 34;
|
||||
|
||||
/*
|
||||
* Provides a hardware serial interface to send and receive from the Meshtastic network.
|
||||
* Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic
|
||||
* network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network.
|
||||
* Maximum packet size of 240 bytes.
|
||||
* Module is disabled by default can be turned on by setting SERIAL_MODULE_ENABLED = 1 in SerialPlugh.cpp.
|
||||
* ENCODING: binary undefined
|
||||
*/
|
||||
SERIAL_APP = 64;
|
||||
|
||||
/*
|
||||
* STORE_FORWARD_APP (Work in Progress)
|
||||
* Maintained by Jm Casler (MC Hamster) : jm@casler.org
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
STORE_FORWARD_APP = 65;
|
||||
|
||||
/*
|
||||
* Optional port for messages for the range test module.
|
||||
* ENCODING: ASCII Plaintext
|
||||
* NOTE: This portnum traffic is not sent to the public MQTT starting at firmware version 2.2.9
|
||||
*/
|
||||
RANGE_TEST_APP = 66;
|
||||
|
||||
/*
|
||||
* Provides a format to send and receive telemetry data from the Meshtastic network.
|
||||
* Maintained by Charles Crossan (crossan007) : crossan007@gmail.com
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
TELEMETRY_APP = 67;
|
||||
|
||||
/*
|
||||
* Experimental tools for estimating node position without a GPS
|
||||
* Maintained by Github user a-f-G-U-C (a Meshtastic contributor)
|
||||
* Project files at https://github.com/a-f-G-U-C/Meshtastic-ZPS
|
||||
* ENCODING: arrays of int64 fields
|
||||
*/
|
||||
ZPS_APP = 68;
|
||||
|
||||
/*
|
||||
* Used to let multiple instances of Linux native applications communicate
|
||||
* as if they did using their LoRa chip.
|
||||
* Maintained by GitHub user GUVWAF.
|
||||
* Project files at https://github.com/GUVWAF/Meshtasticator
|
||||
* ENCODING: Protobuf (?)
|
||||
*/
|
||||
SIMULATOR_APP = 69;
|
||||
|
||||
/*
|
||||
* Provides a traceroute functionality to show the route a packet towards
|
||||
* a certain destination would take on the mesh. Contains a RouteDiscovery message as payload.
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
TRACEROUTE_APP = 70;
|
||||
|
||||
/*
|
||||
* Aggregates edge info for the network by sending out a list of each node's neighbors
|
||||
* ENCODING: Protobuf
|
||||
*/
|
||||
NEIGHBORINFO_APP = 71;
|
||||
|
||||
/*
|
||||
* ATAK Plugin
|
||||
* Portnum for payloads from the official Meshtastic ATAK plugin
|
||||
*/
|
||||
ATAK_PLUGIN = 72;
|
||||
|
||||
/*
|
||||
* Provides unencrypted information about a node for consumption by a map via MQTT
|
||||
*/
|
||||
MAP_REPORT_APP = 73;
|
||||
|
||||
/*
|
||||
* PowerStress based monitoring support (for automated power consumption testing)
|
||||
*/
|
||||
POWERSTRESS_APP = 74;
|
||||
|
||||
/*
|
||||
* Reticulum Network Stack Tunnel App
|
||||
* ENCODING: Fragmented RNS Packet. Handled by Meshtastic RNS interface
|
||||
*/
|
||||
RETICULUM_TUNNEL_APP = 76;
|
||||
|
||||
/*
|
||||
* Private applications should use portnums >= 256.
|
||||
* To simplify initial development and testing you can use "PRIVATE_APP"
|
||||
* in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh))
|
||||
*/
|
||||
PRIVATE_APP = 256;
|
||||
|
||||
/*
|
||||
* ATAK Forwarder Module https://github.com/paulmandal/atak-forwarder
|
||||
* ENCODING: libcotshrink
|
||||
*/
|
||||
ATAK_FORWARDER = 257;
|
||||
|
||||
/*
|
||||
* Currently we limit port nums to no higher than this value
|
||||
*/
|
||||
MAX = 511;
|
||||
}
|
||||
104
proto/meshtastic/powermon.proto
Normal file
104
proto/meshtastic/powermon.proto
Normal file
@@ -0,0 +1,104 @@
|
||||
syntax = "proto3";
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "PowerMonProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
/* Note: There are no 'PowerMon' messages normally in use (PowerMons are sent only as structured logs - slogs).
|
||||
But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us)
|
||||
*/
|
||||
message PowerMon {
|
||||
/* Any significant power changing event in meshtastic should be tagged with a powermon state transition.
|
||||
If you are making new meshtastic features feel free to add new entries at the end of this definition.
|
||||
*/
|
||||
enum State {
|
||||
None = 0;
|
||||
|
||||
CPU_DeepSleep = 0x01;
|
||||
CPU_LightSleep = 0x02;
|
||||
|
||||
/*
|
||||
The external Vext1 power is on. Many boards have auxillary power rails that the CPU turns on only
|
||||
occasionally. In cases where that rail has multiple devices on it we usually want to have logging on
|
||||
the state of that rail as an independent record.
|
||||
For instance on the Heltec Tracker 1.1 board, this rail is the power source for the GPS and screen.
|
||||
|
||||
The log messages will be short and complete (see PowerMon.Event in the protobufs for details).
|
||||
something like "S:PM:C,0x00001234,REASON" where the hex number is the bitmask of all current states.
|
||||
(We use a bitmask for states so that if a log message gets lost it won't be fatal)
|
||||
*/
|
||||
Vext1_On = 0x04;
|
||||
|
||||
Lora_RXOn = 0x08;
|
||||
Lora_TXOn = 0x10;
|
||||
Lora_RXActive = 0x20;
|
||||
BT_On = 0x40;
|
||||
LED_On = 0x80;
|
||||
|
||||
Screen_On = 0x100;
|
||||
Screen_Drawing = 0x200;
|
||||
Wifi_On = 0x400;
|
||||
|
||||
/*
|
||||
GPS is actively trying to find our location
|
||||
See GPSPowerState for more details
|
||||
*/
|
||||
GPS_Active = 0x800;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* PowerStress testing support via the C++ PowerStress module
|
||||
*/
|
||||
message PowerStressMessage {
|
||||
/*
|
||||
* What operation would we like the UUT to perform.
|
||||
note: senders should probably set want_response in their request packets, so that they can know when the state
|
||||
machine has started processing their request
|
||||
*/
|
||||
enum Opcode {
|
||||
/*
|
||||
* Unset/unused
|
||||
*/
|
||||
UNSET = 0;
|
||||
|
||||
PRINT_INFO = 1; // Print board version slog and send an ack that we are alive and ready to process commands
|
||||
FORCE_QUIET = 2; // Try to turn off all automatic processing of packets, screen, sleeping, etc (to make it easier to measure in isolation)
|
||||
END_QUIET = 3; // Stop powerstress processing - probably by just rebooting the board
|
||||
|
||||
SCREEN_ON = 16; // Turn the screen on
|
||||
SCREEN_OFF = 17; // Turn the screen off
|
||||
|
||||
CPU_IDLE = 32; // Let the CPU run but we assume mostly idling for num_seconds
|
||||
CPU_DEEPSLEEP = 33; // Force deep sleep for FIXME seconds
|
||||
CPU_FULLON = 34; // Spin the CPU as fast as possible for num_seconds
|
||||
|
||||
LED_ON = 48; // Turn the LED on for num_seconds (and leave it on - for baseline power measurement purposes)
|
||||
LED_OFF = 49; // Force the LED off for num_seconds
|
||||
|
||||
LORA_OFF = 64; // Completely turn off the LORA radio for num_seconds
|
||||
LORA_TX = 65; // Send Lora packets for num_seconds
|
||||
LORA_RX = 66; // Receive Lora packets for num_seconds (node will be mostly just listening, unless an external agent is helping stress this by sending packets on the current channel)
|
||||
|
||||
BT_OFF = 80; // Turn off the BT radio for num_seconds
|
||||
BT_ON = 81; // Turn on the BT radio for num_seconds
|
||||
|
||||
WIFI_OFF = 96; // Turn off the WIFI radio for num_seconds
|
||||
WIFI_ON = 97; // Turn on the WIFI radio for num_seconds
|
||||
|
||||
GPS_OFF = 112; // Turn off the GPS radio for num_seconds
|
||||
GPS_ON = 113; // Turn on the GPS radio for num_seconds
|
||||
}
|
||||
|
||||
/*
|
||||
* What type of HardwareMessage is this?
|
||||
*/
|
||||
Opcode cmd = 1;
|
||||
|
||||
float num_seconds = 2;
|
||||
}
|
||||
75
proto/meshtastic/remote_hardware.proto
Normal file
75
proto/meshtastic/remote_hardware.proto
Normal file
@@ -0,0 +1,75 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "RemoteHardware";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* An example app to show off the module system. This message is used for
|
||||
* REMOTE_HARDWARE_APP PortNums.
|
||||
* Also provides easy remote access to any GPIO.
|
||||
* In the future other remote hardware operations can be added based on user interest
|
||||
* (i.e. serial output, spi/i2c input/output).
|
||||
* FIXME - currently this feature is turned on by default which is dangerous
|
||||
* because no security yet (beyond the channel mechanism).
|
||||
* It should be off by default and then protected based on some TBD mechanism
|
||||
* (a special channel once multichannel support is included?)
|
||||
*/
|
||||
message HardwareMessage {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
enum Type {
|
||||
/*
|
||||
* Unset/unused
|
||||
*/
|
||||
UNSET = 0;
|
||||
|
||||
/*
|
||||
* Set gpio gpios based on gpio_mask/gpio_value
|
||||
*/
|
||||
WRITE_GPIOS = 1;
|
||||
|
||||
/*
|
||||
* We are now interested in watching the gpio_mask gpios.
|
||||
* If the selected gpios change, please broadcast GPIOS_CHANGED.
|
||||
* Will implicitly change the gpios requested to be INPUT gpios.
|
||||
*/
|
||||
WATCH_GPIOS = 2;
|
||||
|
||||
/*
|
||||
* The gpios listed in gpio_mask have changed, the new values are listed in gpio_value
|
||||
*/
|
||||
GPIOS_CHANGED = 3;
|
||||
|
||||
/*
|
||||
* Read the gpios specified in gpio_mask, send back a READ_GPIOS_REPLY reply with gpio_value populated
|
||||
*/
|
||||
READ_GPIOS = 4;
|
||||
|
||||
/*
|
||||
* A reply to READ_GPIOS. gpio_mask and gpio_value will be populated
|
||||
*/
|
||||
READ_GPIOS_REPLY = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* What type of HardwareMessage is this?
|
||||
*/
|
||||
Type type = 1;
|
||||
|
||||
/*
|
||||
* What gpios are we changing. Not used for all MessageTypes, see MessageType for details
|
||||
*/
|
||||
uint64 gpio_mask = 2;
|
||||
|
||||
/*
|
||||
* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios.
|
||||
* Not used for all MessageTypes, see MessageType for details
|
||||
*/
|
||||
uint64 gpio_value = 3;
|
||||
}
|
||||
1
proto/meshtastic/rtttl.options
Normal file
1
proto/meshtastic/rtttl.options
Normal file
@@ -0,0 +1 @@
|
||||
*RTTTLConfig.ringtone max_size:231
|
||||
19
proto/meshtastic/rtttl.proto
Normal file
19
proto/meshtastic/rtttl.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "RTTTLConfigProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Canned message module configuration.
|
||||
*/
|
||||
message RTTTLConfig {
|
||||
/*
|
||||
* Ringtone for PWM Buzzer in RTTTL Format.
|
||||
*/
|
||||
string ringtone = 1;
|
||||
}
|
||||
1
proto/meshtastic/storeforward.options
Normal file
1
proto/meshtastic/storeforward.options
Normal file
@@ -0,0 +1 @@
|
||||
*StoreAndForward.text max_size:233
|
||||
218
proto/meshtastic/storeforward.proto
Normal file
218
proto/meshtastic/storeforward.proto
Normal file
@@ -0,0 +1,218 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "StoreAndForwardProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message StoreAndForward {
|
||||
/*
|
||||
* 001 - 063 = From Router
|
||||
* 064 - 127 = From Client
|
||||
*/
|
||||
enum RequestResponse {
|
||||
/*
|
||||
* Unset/unused
|
||||
*/
|
||||
UNSET = 0;
|
||||
|
||||
/*
|
||||
* Router is an in error state.
|
||||
*/
|
||||
ROUTER_ERROR = 1;
|
||||
|
||||
/*
|
||||
* Router heartbeat
|
||||
*/
|
||||
ROUTER_HEARTBEAT = 2;
|
||||
|
||||
/*
|
||||
* Router has requested the client respond. This can work as a
|
||||
* "are you there" message.
|
||||
*/
|
||||
ROUTER_PING = 3;
|
||||
|
||||
/*
|
||||
* The response to a "Ping"
|
||||
*/
|
||||
ROUTER_PONG = 4;
|
||||
|
||||
/*
|
||||
* Router is currently busy. Please try again later.
|
||||
*/
|
||||
ROUTER_BUSY = 5;
|
||||
|
||||
/*
|
||||
* Router is responding to a request for history.
|
||||
*/
|
||||
ROUTER_HISTORY = 6;
|
||||
|
||||
/*
|
||||
* Router is responding to a request for stats.
|
||||
*/
|
||||
ROUTER_STATS = 7;
|
||||
|
||||
/*
|
||||
* Router sends a text message from its history that was a direct message.
|
||||
*/
|
||||
ROUTER_TEXT_DIRECT = 8;
|
||||
|
||||
/*
|
||||
* Router sends a text message from its history that was a broadcast.
|
||||
*/
|
||||
ROUTER_TEXT_BROADCAST = 9;
|
||||
|
||||
/*
|
||||
* Client is an in error state.
|
||||
*/
|
||||
CLIENT_ERROR = 64;
|
||||
|
||||
/*
|
||||
* Client has requested a replay from the router.
|
||||
*/
|
||||
CLIENT_HISTORY = 65;
|
||||
|
||||
/*
|
||||
* Client has requested stats from the router.
|
||||
*/
|
||||
CLIENT_STATS = 66;
|
||||
|
||||
/*
|
||||
* Client has requested the router respond. This can work as a
|
||||
* "are you there" message.
|
||||
*/
|
||||
CLIENT_PING = 67;
|
||||
|
||||
/*
|
||||
* The response to a "Ping"
|
||||
*/
|
||||
CLIENT_PONG = 68;
|
||||
|
||||
/*
|
||||
* Client has requested that the router abort processing the client's request
|
||||
*/
|
||||
CLIENT_ABORT = 106;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message Statistics {
|
||||
/*
|
||||
* Number of messages we have ever seen
|
||||
*/
|
||||
uint32 messages_total = 1;
|
||||
|
||||
/*
|
||||
* Number of messages we have currently saved our history.
|
||||
*/
|
||||
uint32 messages_saved = 2;
|
||||
|
||||
/*
|
||||
* Maximum number of messages we will save
|
||||
*/
|
||||
uint32 messages_max = 3;
|
||||
|
||||
/*
|
||||
* Router uptime in seconds
|
||||
*/
|
||||
uint32 up_time = 4;
|
||||
|
||||
/*
|
||||
* Number of times any client sent a request to the S&F.
|
||||
*/
|
||||
uint32 requests = 5;
|
||||
|
||||
/*
|
||||
* Number of times the history was requested.
|
||||
*/
|
||||
uint32 requests_history = 6;
|
||||
|
||||
/*
|
||||
* Is the heartbeat enabled on the server?
|
||||
*/
|
||||
bool heartbeat = 7;
|
||||
|
||||
/*
|
||||
* Maximum number of messages the server will return.
|
||||
*/
|
||||
uint32 return_max = 8;
|
||||
|
||||
/*
|
||||
* Maximum history window in minutes the server will return messages from.
|
||||
*/
|
||||
uint32 return_window = 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message History {
|
||||
/*
|
||||
* Number of that will be sent to the client
|
||||
*/
|
||||
uint32 history_messages = 1;
|
||||
|
||||
/*
|
||||
* The window of messages that was used to filter the history client requested
|
||||
*/
|
||||
uint32 window = 2;
|
||||
|
||||
/*
|
||||
* Index in the packet history of the last message sent in a previous request to the server.
|
||||
* Will be sent to the client before sending the history and can be set in a subsequent request to avoid getting packets the server already sent to the client.
|
||||
*/
|
||||
uint32 last_request = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
message Heartbeat {
|
||||
/*
|
||||
* Period in seconds that the heartbeat is sent out that will be sent to the client
|
||||
*/
|
||||
uint32 period = 1;
|
||||
|
||||
/*
|
||||
* If set, this is not the primary Store & Forward router on the mesh
|
||||
*/
|
||||
uint32 secondary = 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
RequestResponse rr = 1;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
oneof variant {
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Statistics stats = 2;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
History history = 3;
|
||||
|
||||
/*
|
||||
* TODO: REPLACE
|
||||
*/
|
||||
Heartbeat heartbeat = 4;
|
||||
|
||||
/*
|
||||
* Text from history message.
|
||||
*/
|
||||
bytes text = 5;
|
||||
}
|
||||
}
|
||||
12
proto/meshtastic/telemetry.options
Normal file
12
proto/meshtastic/telemetry.options
Normal file
@@ -0,0 +1,12 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
*EnvironmentMetrics.iaq int_size:16
|
||||
*EnvironmentMetrics.wind_direction int_size:16
|
||||
*EnvironmentMetrics.soil_moisture int_size:8
|
||||
|
||||
*LocalStats.num_online_nodes int_size:16
|
||||
*LocalStats.num_total_nodes int_size:16
|
||||
|
||||
*HealthMetrics.heart_bpm int_size:8
|
||||
*HealthMetrics.spO2 int_size:8
|
||||
593
proto/meshtastic/telemetry.proto
Normal file
593
proto/meshtastic/telemetry.proto
Normal file
@@ -0,0 +1,593 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "TelemetryProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
/*
|
||||
* Key native device metrics such as battery level
|
||||
*/
|
||||
message DeviceMetrics {
|
||||
/*
|
||||
* 0-100 (>100 means powered)
|
||||
*/
|
||||
optional uint32 battery_level = 1;
|
||||
|
||||
/*
|
||||
* Voltage measured
|
||||
*/
|
||||
optional float voltage = 2;
|
||||
|
||||
/*
|
||||
* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise).
|
||||
*/
|
||||
optional float channel_utilization = 3;
|
||||
|
||||
/*
|
||||
* Percent of airtime for transmission used within the last hour.
|
||||
*/
|
||||
optional float air_util_tx = 4;
|
||||
|
||||
/*
|
||||
* How long the device has been running since the last reboot (in seconds)
|
||||
*/
|
||||
optional uint32 uptime_seconds = 5;
|
||||
}
|
||||
|
||||
/*
|
||||
* Weather station or other environmental metrics
|
||||
*/
|
||||
message EnvironmentMetrics {
|
||||
/*
|
||||
* Temperature measured
|
||||
*/
|
||||
optional float temperature = 1;
|
||||
|
||||
/*
|
||||
* Relative humidity percent measured
|
||||
*/
|
||||
optional float relative_humidity = 2;
|
||||
|
||||
/*
|
||||
* Barometric pressure in hPA measured
|
||||
*/
|
||||
optional float barometric_pressure = 3;
|
||||
|
||||
/*
|
||||
* Gas resistance in MOhm measured
|
||||
*/
|
||||
optional float gas_resistance = 4;
|
||||
|
||||
/*
|
||||
* Voltage measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x)
|
||||
*/
|
||||
optional float voltage = 5;
|
||||
|
||||
/*
|
||||
* Current measured (To be depreciated in favor of PowerMetrics in Meshtastic 3.x)
|
||||
*/
|
||||
optional float current = 6;
|
||||
|
||||
/*
|
||||
* relative scale IAQ value as measured by Bosch BME680 . value 0-500.
|
||||
* Belongs to Air Quality but is not particle but VOC measurement. Other VOC values can also be put in here.
|
||||
*/
|
||||
optional uint32 iaq = 7;
|
||||
|
||||
/*
|
||||
* RCWL9620 Doppler Radar Distance Sensor, used for water level detection. Float value in mm.
|
||||
*/
|
||||
optional float distance = 8;
|
||||
|
||||
/*
|
||||
* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor.
|
||||
*/
|
||||
optional float lux = 9;
|
||||
|
||||
/*
|
||||
* VEML7700 high accuracy white light(irradiance) not calibrated digital 16-bit resolution sensor.
|
||||
*/
|
||||
optional float white_lux = 10;
|
||||
|
||||
/*
|
||||
* Infrared lux
|
||||
*/
|
||||
optional float ir_lux = 11;
|
||||
|
||||
/*
|
||||
* Ultraviolet lux
|
||||
*/
|
||||
optional float uv_lux = 12;
|
||||
|
||||
/*
|
||||
* Wind direction in degrees
|
||||
* 0 degrees = North, 90 = East, etc...
|
||||
*/
|
||||
optional uint32 wind_direction = 13;
|
||||
|
||||
/*
|
||||
* Wind speed in m/s
|
||||
*/
|
||||
optional float wind_speed = 14;
|
||||
|
||||
/*
|
||||
* Weight in KG
|
||||
*/
|
||||
optional float weight = 15;
|
||||
|
||||
/*
|
||||
* Wind gust in m/s
|
||||
*/
|
||||
optional float wind_gust = 16;
|
||||
|
||||
/*
|
||||
* Wind lull in m/s
|
||||
*/
|
||||
optional float wind_lull = 17;
|
||||
|
||||
/*
|
||||
* Radiation in µR/h
|
||||
*/
|
||||
optional float radiation = 18;
|
||||
|
||||
/*
|
||||
* Rainfall in the last hour in mm
|
||||
*/
|
||||
optional float rainfall_1h = 19;
|
||||
|
||||
/*
|
||||
* Rainfall in the last 24 hours in mm
|
||||
*/
|
||||
optional float rainfall_24h = 20;
|
||||
|
||||
/*
|
||||
* Soil moisture measured (% 1-100)
|
||||
*/
|
||||
optional uint32 soil_moisture = 21;
|
||||
|
||||
/*
|
||||
* Soil temperature measured (*C)
|
||||
*/
|
||||
optional float soil_temperature = 22;
|
||||
}
|
||||
|
||||
/*
|
||||
* Power Metrics (voltage / current / etc)
|
||||
*/
|
||||
message PowerMetrics {
|
||||
/*
|
||||
* Voltage (Ch1)
|
||||
*/
|
||||
optional float ch1_voltage = 1;
|
||||
|
||||
/*
|
||||
* Current (Ch1)
|
||||
*/
|
||||
optional float ch1_current = 2;
|
||||
|
||||
/*
|
||||
* Voltage (Ch2)
|
||||
*/
|
||||
optional float ch2_voltage = 3;
|
||||
|
||||
/*
|
||||
* Current (Ch2)
|
||||
*/
|
||||
optional float ch2_current = 4;
|
||||
|
||||
/*
|
||||
* Voltage (Ch3)
|
||||
*/
|
||||
optional float ch3_voltage = 5;
|
||||
|
||||
/*
|
||||
* Current (Ch3)
|
||||
*/
|
||||
optional float ch3_current = 6;
|
||||
}
|
||||
|
||||
/*
|
||||
* Air quality metrics
|
||||
*/
|
||||
message AirQualityMetrics {
|
||||
/*
|
||||
* Concentration Units Standard PM1.0
|
||||
*/
|
||||
optional uint32 pm10_standard = 1;
|
||||
|
||||
/*
|
||||
* Concentration Units Standard PM2.5
|
||||
*/
|
||||
optional uint32 pm25_standard = 2;
|
||||
|
||||
/*
|
||||
* Concentration Units Standard PM10.0
|
||||
*/
|
||||
optional uint32 pm100_standard = 3;
|
||||
|
||||
/*
|
||||
* Concentration Units Environmental PM1.0
|
||||
*/
|
||||
optional uint32 pm10_environmental = 4;
|
||||
|
||||
/*
|
||||
* Concentration Units Environmental PM2.5
|
||||
*/
|
||||
optional uint32 pm25_environmental = 5;
|
||||
|
||||
/*
|
||||
* Concentration Units Environmental PM10.0
|
||||
*/
|
||||
optional uint32 pm100_environmental = 6;
|
||||
|
||||
/*
|
||||
* 0.3um Particle Count
|
||||
*/
|
||||
optional uint32 particles_03um = 7;
|
||||
|
||||
/*
|
||||
* 0.5um Particle Count
|
||||
*/
|
||||
optional uint32 particles_05um = 8;
|
||||
|
||||
/*
|
||||
* 1.0um Particle Count
|
||||
*/
|
||||
optional uint32 particles_10um = 9;
|
||||
|
||||
/*
|
||||
* 2.5um Particle Count
|
||||
*/
|
||||
optional uint32 particles_25um = 10;
|
||||
|
||||
/*
|
||||
* 5.0um Particle Count
|
||||
*/
|
||||
optional uint32 particles_50um = 11;
|
||||
|
||||
/*
|
||||
* 10.0um Particle Count
|
||||
*/
|
||||
optional uint32 particles_100um = 12;
|
||||
|
||||
/*
|
||||
* CO2 concentration in ppm
|
||||
*/
|
||||
optional uint32 co2 = 13;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local device mesh statistics
|
||||
*/
|
||||
message LocalStats {
|
||||
/*
|
||||
* How long the device has been running since the last reboot (in seconds)
|
||||
*/
|
||||
uint32 uptime_seconds = 1;
|
||||
/*
|
||||
* Utilization for the current channel, including well formed TX, RX and malformed RX (aka noise).
|
||||
*/
|
||||
float channel_utilization = 2;
|
||||
/*
|
||||
* Percent of airtime for transmission used within the last hour.
|
||||
*/
|
||||
float air_util_tx = 3;
|
||||
|
||||
/*
|
||||
* Number of packets sent
|
||||
*/
|
||||
uint32 num_packets_tx = 4;
|
||||
|
||||
/*
|
||||
* Number of packets received (both good and bad)
|
||||
*/
|
||||
uint32 num_packets_rx = 5;
|
||||
|
||||
/*
|
||||
* Number of packets received that are malformed or violate the protocol
|
||||
*/
|
||||
uint32 num_packets_rx_bad = 6;
|
||||
|
||||
/*
|
||||
* Number of nodes online (in the past 2 hours)
|
||||
*/
|
||||
uint32 num_online_nodes = 7;
|
||||
|
||||
/*
|
||||
* Number of nodes total
|
||||
*/
|
||||
uint32 num_total_nodes = 8;
|
||||
|
||||
/*
|
||||
* Number of received packets that were duplicates (due to multiple nodes relaying).
|
||||
* If this number is high, there are nodes in the mesh relaying packets when it's unnecessary, for example due to the ROUTER/REPEATER role.
|
||||
*/
|
||||
uint32 num_rx_dupe = 9;
|
||||
|
||||
/*
|
||||
* Number of packets we transmitted that were a relay for others (not originating from ourselves).
|
||||
*/
|
||||
uint32 num_tx_relay = 10;
|
||||
|
||||
/*
|
||||
* Number of times we canceled a packet to be relayed, because someone else did it before us.
|
||||
* This will always be zero for ROUTERs/REPEATERs. If this number is high, some other node(s) is/are relaying faster than you.
|
||||
*/
|
||||
uint32 num_tx_relay_canceled = 11;
|
||||
}
|
||||
|
||||
/*
|
||||
* Health telemetry metrics
|
||||
*/
|
||||
message HealthMetrics {
|
||||
/*
|
||||
* Heart rate (beats per minute)
|
||||
*/
|
||||
optional uint32 heart_bpm = 1;
|
||||
|
||||
/*
|
||||
* SpO2 (blood oxygen saturation) level
|
||||
*/
|
||||
optional uint32 spO2 = 2;
|
||||
|
||||
/*
|
||||
* Body temperature in degrees Celsius
|
||||
*/
|
||||
optional float temperature = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* Types of Measurements the telemetry module is equipped to handle
|
||||
*/
|
||||
message Telemetry {
|
||||
/*
|
||||
* Seconds since 1970 - or 0 for unknown/unset
|
||||
*/
|
||||
fixed32 time = 1;
|
||||
|
||||
oneof variant {
|
||||
/*
|
||||
* Key native device metrics such as battery level
|
||||
*/
|
||||
DeviceMetrics device_metrics = 2;
|
||||
|
||||
/*
|
||||
* Weather station or other environmental metrics
|
||||
*/
|
||||
EnvironmentMetrics environment_metrics = 3;
|
||||
|
||||
/*
|
||||
* Air quality metrics
|
||||
*/
|
||||
AirQualityMetrics air_quality_metrics = 4;
|
||||
|
||||
/*
|
||||
* Power Metrics
|
||||
*/
|
||||
PowerMetrics power_metrics = 5;
|
||||
|
||||
/*
|
||||
* Local device mesh statistics
|
||||
*/
|
||||
LocalStats local_stats = 6;
|
||||
|
||||
/*
|
||||
* Health telemetry metrics
|
||||
*/
|
||||
HealthMetrics health_metrics = 7;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Supported I2C Sensors for telemetry in Meshtastic
|
||||
*/
|
||||
enum TelemetrySensorType {
|
||||
/*
|
||||
* No external telemetry sensor explicitly set
|
||||
*/
|
||||
SENSOR_UNSET = 0;
|
||||
|
||||
/*
|
||||
* High accuracy temperature, pressure, humidity
|
||||
*/
|
||||
BME280 = 1;
|
||||
|
||||
/*
|
||||
* High accuracy temperature, pressure, humidity, and air resistance
|
||||
*/
|
||||
BME680 = 2;
|
||||
|
||||
/*
|
||||
* Very high accuracy temperature
|
||||
*/
|
||||
MCP9808 = 3;
|
||||
|
||||
/*
|
||||
* Moderate accuracy current and voltage
|
||||
*/
|
||||
INA260 = 4;
|
||||
|
||||
/*
|
||||
* Moderate accuracy current and voltage
|
||||
*/
|
||||
INA219 = 5;
|
||||
|
||||
/*
|
||||
* High accuracy temperature and pressure
|
||||
*/
|
||||
BMP280 = 6;
|
||||
|
||||
/*
|
||||
* High accuracy temperature and humidity
|
||||
*/
|
||||
SHTC3 = 7;
|
||||
|
||||
/*
|
||||
* High accuracy pressure
|
||||
*/
|
||||
LPS22 = 8;
|
||||
|
||||
/*
|
||||
* 3-Axis magnetic sensor
|
||||
*/
|
||||
QMC6310 = 9;
|
||||
|
||||
/*
|
||||
* 6-Axis inertial measurement sensor
|
||||
*/
|
||||
QMI8658 = 10;
|
||||
|
||||
/*
|
||||
* 3-Axis magnetic sensor
|
||||
*/
|
||||
QMC5883L = 11;
|
||||
|
||||
/*
|
||||
* High accuracy temperature and humidity
|
||||
*/
|
||||
SHT31 = 12;
|
||||
|
||||
/*
|
||||
* PM2.5 air quality sensor
|
||||
*/
|
||||
PMSA003I = 13;
|
||||
|
||||
/*
|
||||
* INA3221 3 Channel Voltage / Current Sensor
|
||||
*/
|
||||
INA3221 = 14;
|
||||
|
||||
/*
|
||||
* BMP085/BMP180 High accuracy temperature and pressure (older Version of BMP280)
|
||||
*/
|
||||
BMP085 = 15;
|
||||
|
||||
/*
|
||||
* RCWL-9620 Doppler Radar Distance Sensor, used for water level detection
|
||||
*/
|
||||
RCWL9620 = 16;
|
||||
|
||||
/*
|
||||
* Sensirion High accuracy temperature and humidity
|
||||
*/
|
||||
SHT4X = 17;
|
||||
|
||||
/*
|
||||
* VEML7700 high accuracy ambient light(Lux) digital 16-bit resolution sensor.
|
||||
*/
|
||||
VEML7700 = 18;
|
||||
|
||||
/*
|
||||
* MLX90632 non-contact IR temperature sensor.
|
||||
*/
|
||||
MLX90632 = 19;
|
||||
|
||||
/*
|
||||
* TI OPT3001 Ambient Light Sensor
|
||||
*/
|
||||
OPT3001 = 20;
|
||||
|
||||
/*
|
||||
* Lite On LTR-390UV-01 UV Light Sensor
|
||||
*/
|
||||
LTR390UV = 21;
|
||||
|
||||
/*
|
||||
* AMS TSL25911FN RGB Light Sensor
|
||||
*/
|
||||
TSL25911FN = 22;
|
||||
|
||||
/*
|
||||
* AHT10 Integrated temperature and humidity sensor
|
||||
*/
|
||||
AHT10 = 23;
|
||||
|
||||
/*
|
||||
* DFRobot Lark Weather station (temperature, humidity, pressure, wind speed and direction)
|
||||
*/
|
||||
DFROBOT_LARK = 24;
|
||||
|
||||
/*
|
||||
* NAU7802 Scale Chip or compatible
|
||||
*/
|
||||
NAU7802 = 25;
|
||||
|
||||
/*
|
||||
* BMP3XX High accuracy temperature and pressure
|
||||
*/
|
||||
BMP3XX = 26;
|
||||
|
||||
/*
|
||||
* ICM-20948 9-Axis digital motion processor
|
||||
*/
|
||||
ICM20948 = 27;
|
||||
|
||||
/*
|
||||
* MAX17048 1S lipo battery sensor (voltage, state of charge, time to go)
|
||||
*/
|
||||
MAX17048 = 28;
|
||||
|
||||
/*
|
||||
* Custom I2C sensor implementation based on https://github.com/meshtastic/i2c-sensor
|
||||
*/
|
||||
CUSTOM_SENSOR = 29;
|
||||
|
||||
/*
|
||||
* MAX30102 Pulse Oximeter and Heart-Rate Sensor
|
||||
*/
|
||||
MAX30102 = 30;
|
||||
|
||||
/*
|
||||
* MLX90614 non-contact IR temperature sensor
|
||||
*/
|
||||
MLX90614 = 31;
|
||||
|
||||
/*
|
||||
* SCD40/SCD41 CO2, humidity, temperature sensor
|
||||
*/
|
||||
SCD4X = 32;
|
||||
|
||||
/*
|
||||
* ClimateGuard RadSens, radiation, Geiger-Muller Tube
|
||||
*/
|
||||
RADSENS = 33;
|
||||
|
||||
/*
|
||||
* High accuracy current and voltage
|
||||
*/
|
||||
INA226 = 34;
|
||||
|
||||
/*
|
||||
* DFRobot Gravity tipping bucket rain gauge
|
||||
*/
|
||||
DFROBOT_RAIN = 35;
|
||||
|
||||
/*
|
||||
* Infineon DPS310 High accuracy pressure and temperature
|
||||
*/
|
||||
DPS310 = 36;
|
||||
|
||||
/*
|
||||
* RAKWireless RAK12035 Soil Moisture Sensor Module
|
||||
*/
|
||||
RAK12035 = 37;
|
||||
}
|
||||
|
||||
/*
|
||||
* NAU7802 Telemetry configuration, for saving to flash
|
||||
*/
|
||||
message Nau7802Config {
|
||||
/*
|
||||
* The offset setting for the NAU7802
|
||||
*/
|
||||
int32 zeroOffset = 1;
|
||||
|
||||
/*
|
||||
* The calibration factor for the NAU7802
|
||||
*/
|
||||
float calibrationFactor = 2;
|
||||
}
|
||||
6
proto/meshtastic/xmodem.options
Normal file
6
proto/meshtastic/xmodem.options
Normal file
@@ -0,0 +1,6 @@
|
||||
# options for nanopb
|
||||
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options
|
||||
|
||||
*XModem.buffer max_size:128
|
||||
*XModem.seq int_size:16
|
||||
*XModem.crc16 int_size:16
|
||||
27
proto/meshtastic/xmodem.proto
Normal file
27
proto/meshtastic/xmodem.proto
Normal file
@@ -0,0 +1,27 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package meshtastic;
|
||||
|
||||
option csharp_namespace = "Meshtastic.Protobufs";
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_outer_classname = "XmodemProtos";
|
||||
option java_package = "com.geeksville.mesh";
|
||||
option swift_prefix = "";
|
||||
|
||||
message XModem {
|
||||
enum Control {
|
||||
NUL = 0;
|
||||
SOH = 1;
|
||||
STX = 2;
|
||||
EOT = 4;
|
||||
ACK = 6;
|
||||
NAK = 21;
|
||||
CAN = 24;
|
||||
CTRLZ = 26;
|
||||
}
|
||||
|
||||
Control control = 1;
|
||||
uint32 seq = 2;
|
||||
uint32 crc16 = 3;
|
||||
bytes buffer = 4;
|
||||
}
|
||||
185
proto/nanopb.proto
Normal file
185
proto/nanopb.proto
Normal file
@@ -0,0 +1,185 @@
|
||||
// Custom options for defining:
|
||||
// - Maximum size of string/bytes
|
||||
// - Maximum number of elements in array
|
||||
//
|
||||
// These are used by nanopb to generate statically allocable structures
|
||||
// for memory-limited environments.
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
option go_package = "github.com/meshtastic/go/generated";
|
||||
option java_package = "fi.kapsi.koti.jpa.nanopb";
|
||||
|
||||
enum FieldType {
|
||||
FT_DEFAULT = 0; // Automatically decide field type, generate static field if possible.
|
||||
FT_CALLBACK = 1; // Always generate a callback field.
|
||||
FT_POINTER = 4; // Always generate a dynamically allocated field.
|
||||
FT_STATIC = 2; // Generate a static field or raise an exception if not possible.
|
||||
FT_IGNORE = 3; // Ignore the field completely.
|
||||
FT_INLINE = 5; // Legacy option, use the separate 'fixed_length' option instead
|
||||
}
|
||||
|
||||
enum IntSize {
|
||||
IS_DEFAULT = 0; // Default, 32/64bit based on type in .proto
|
||||
IS_8 = 8;
|
||||
IS_16 = 16;
|
||||
IS_32 = 32;
|
||||
IS_64 = 64;
|
||||
}
|
||||
|
||||
enum TypenameMangling {
|
||||
M_NONE = 0; // Default, no typename mangling
|
||||
M_STRIP_PACKAGE = 1; // Strip current package name
|
||||
M_FLATTEN = 2; // Only use last path component
|
||||
M_PACKAGE_INITIALS = 3; // Replace the package name by the initials
|
||||
}
|
||||
|
||||
enum DescriptorSize {
|
||||
DS_AUTO = 0; // Select minimal size based on field type
|
||||
DS_1 = 1; // 1 word; up to 15 byte fields, no arrays
|
||||
DS_2 = 2; // 2 words; up to 4095 byte fields, 4095 entry arrays
|
||||
DS_4 = 4; // 4 words; up to 2^32-1 byte fields, 2^16-1 entry arrays
|
||||
DS_8 = 8; // 8 words; up to 2^32-1 entry arrays
|
||||
}
|
||||
|
||||
// This is the inner options message, which basically defines options for
|
||||
// a field. When it is used in message or file scope, it applies to all
|
||||
// fields.
|
||||
message NanoPBOptions {
|
||||
// Allocated size for 'bytes' and 'string' fields.
|
||||
// For string fields, this should include the space for null terminator.
|
||||
optional int32 max_size = 1;
|
||||
|
||||
// Maximum length for 'string' fields. Setting this is equivalent
|
||||
// to setting max_size to a value of length+1.
|
||||
optional int32 max_length = 14;
|
||||
|
||||
// Allocated number of entries in arrays ('repeated' fields)
|
||||
optional int32 max_count = 2;
|
||||
|
||||
// Size of integer fields. Can save some memory if you don't need
|
||||
// full 32 bits for the value.
|
||||
optional IntSize int_size = 7 [default = IS_DEFAULT];
|
||||
|
||||
// Force type of field (callback or static allocation)
|
||||
optional FieldType type = 3 [default = FT_DEFAULT];
|
||||
|
||||
// Use long names for enums, i.e. EnumName_EnumValue.
|
||||
optional bool long_names = 4 [default = true];
|
||||
|
||||
// Add 'packed' attribute to generated structs.
|
||||
// Note: this cannot be used on CPUs that break on unaligned
|
||||
// accesses to variables.
|
||||
optional bool packed_struct = 5 [default = false];
|
||||
|
||||
// Add 'packed' attribute to generated enums.
|
||||
optional bool packed_enum = 10 [default = false];
|
||||
|
||||
// Skip this message
|
||||
optional bool skip_message = 6 [default = false];
|
||||
|
||||
// Generate oneof fields as normal optional fields instead of union.
|
||||
optional bool no_unions = 8 [default = false];
|
||||
|
||||
// integer type tag for a message
|
||||
optional uint32 msgid = 9;
|
||||
|
||||
// decode oneof as anonymous union
|
||||
optional bool anonymous_oneof = 11 [default = false];
|
||||
|
||||
// Proto3 singular field does not generate a "has_" flag
|
||||
optional bool proto3 = 12 [default = false];
|
||||
|
||||
// Force proto3 messages to have no "has_" flag.
|
||||
// This was default behavior until nanopb-0.4.0.
|
||||
optional bool proto3_singular_msgs = 21 [default = false];
|
||||
|
||||
// Generate an enum->string mapping function (can take up lots of space).
|
||||
optional bool enum_to_string = 13 [default = false];
|
||||
|
||||
// Generate bytes arrays with fixed length
|
||||
optional bool fixed_length = 15 [default = false];
|
||||
|
||||
// Generate repeated field with fixed count
|
||||
optional bool fixed_count = 16 [default = false];
|
||||
|
||||
// Generate message-level callback that is called before decoding submessages.
|
||||
// This can be used to set callback fields for submsgs inside oneofs.
|
||||
optional bool submsg_callback = 22 [default = false];
|
||||
|
||||
// Shorten or remove package names from type names.
|
||||
// This option applies only on the file level.
|
||||
optional TypenameMangling mangle_names = 17 [default = M_NONE];
|
||||
|
||||
// Data type for storage associated with callback fields.
|
||||
optional string callback_datatype = 18 [default = "pb_callback_t"];
|
||||
|
||||
// Callback function used for encoding and decoding.
|
||||
// Prior to nanopb-0.4.0, the callback was specified in per-field pb_callback_t
|
||||
// structure. This is still supported, but does not work inside e.g. oneof or pointer
|
||||
// fields. Instead, a new method allows specifying a per-message callback that
|
||||
// will be called for all callback fields in a message type.
|
||||
optional string callback_function = 19 [default = "pb_default_field_callback"];
|
||||
|
||||
// Select the size of field descriptors. This option has to be defined
|
||||
// for the whole message, not per-field. Usually automatic selection is
|
||||
// ok, but if it results in compilation errors you can increase the field
|
||||
// size here.
|
||||
optional DescriptorSize descriptorsize = 20 [default = DS_AUTO];
|
||||
|
||||
// Set default value for has_ fields.
|
||||
optional bool default_has = 23 [default = false];
|
||||
|
||||
// Extra files to include in generated `.pb.h`
|
||||
repeated string include = 24;
|
||||
|
||||
// Automatic includes to exclude from generated `.pb.h`
|
||||
// Same as nanopb_generator.py command line flag -x.
|
||||
repeated string exclude = 26;
|
||||
|
||||
// Package name that applies only for nanopb.
|
||||
optional string package = 25;
|
||||
|
||||
// Override type of the field in generated C code. Only to be used with related field types
|
||||
optional google.protobuf.FieldDescriptorProto.Type type_override = 27;
|
||||
|
||||
// Due to historical reasons, nanopb orders fields in structs by their tag number
|
||||
// instead of the order in .proto. Set this to false to keep the .proto order.
|
||||
// The default value will probably change to false in nanopb-0.5.0.
|
||||
optional bool sort_by_tag = 28 [default = true];
|
||||
|
||||
// Set the FT_DEFAULT field conversion strategy.
|
||||
// A field that can become a static member of a c struct (e.g. int, bool, etc)
|
||||
// will be a a static field.
|
||||
// Fields with dynamic length are converted to either a pointer or a callback.
|
||||
optional FieldType fallback_type = 29 [default = FT_CALLBACK];
|
||||
}
|
||||
|
||||
// Extensions to protoc 'Descriptor' type in order to define options
|
||||
// inside a .proto file.
|
||||
//
|
||||
// Protocol Buffers extension number registry
|
||||
// --------------------------------
|
||||
// Project: Nanopb
|
||||
// Contact: Petteri Aimonen <jpa@kapsi.fi>
|
||||
// Web site: http://kapsi.fi/~jpa/nanopb
|
||||
// Extensions: 1010 (all types)
|
||||
// --------------------------------
|
||||
|
||||
extend google.protobuf.FileOptions {
|
||||
optional NanoPBOptions nanopb_fileopt = 1010;
|
||||
}
|
||||
|
||||
extend google.protobuf.MessageOptions {
|
||||
optional NanoPBOptions nanopb_msgopt = 1010;
|
||||
}
|
||||
|
||||
extend google.protobuf.EnumOptions {
|
||||
optional NanoPBOptions nanopb_enumopt = 1010;
|
||||
}
|
||||
|
||||
extend google.protobuf.FieldOptions {
|
||||
optional NanoPBOptions nanopb = 1010;
|
||||
}
|
||||
Reference in New Issue
Block a user