diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 70c229e..d375521 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,30 +1,132 @@ -name: Push new version to schema registry - -permissions: - contents: read +name: Publish to Cargo, JSR, & NPM on: push: tags: - - "**" + - "v*" + workflow_dispatch: + inputs: + version: + description: "Version to publish (e.g. v1.2.3). Used when manually dispatching." + required: false + type: string + +permissions: write-all jobs: - push_to_registry: - runs-on: ubuntu-latest - + codegen: + runs-on: ubuntu-24.04 steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Show files exist + run: | + set -euxo pipefail + ls -la packages/ts || true + ls -la packages/rust || true + cat packages/ts/deno.json + cat packages/ts/package.json + cat packages/rust/Cargo.toml + + - name: Determine VERSION + run: | + set -euo pipefail + if [ "${{ github.ref_type }}" = "tag" ]; then + VERSION="${{ github.ref_name }}" + elif [ -n "${{ inputs.version || '' }}" ]; then + VERSION="${{ inputs.version }}" + else + echo "No tag ref and no 'version' input. Provide a tag (push a tag) or pass inputs.version." >&2 + exit 1 + fi + # If you don't want the leading 'v' inside files, strip it: + STRIPPED="${VERSION#v}" + echo "VERSION=$STRIPPED" >> "$GITHUB_ENV" + echo "Resolved VERSION=$STRIPPED" + + - name: Set Package Versions to current tag + run: | + set -euxo pipefail + for f in \ + packages/ts/deno.json \ + packages/ts/package.json \ + packages/rust/Cargo.toml + do + test -f "$f" || { echo "Missing $f" >&2; exit 1; } + # replace __PACKAGE_VERSION__ with env VERSION + sed -i "s/__PACKAGE_VERSION__/${VERSION//\//-}/g" "$f" + done - name: Setup Buf - uses: bufbuild/buf-action@v1.2.0 + uses: bufbuild/buf-setup-action@main with: github_token: ${{ github.token }} - token: ${{ secrets.BUF_TOKEN }} - setup_only: true + + - name: Generate code + run: buf generate + + - name: Copy license & README + run: | + cp LICENSE packages/ts + cp LICENSE packages/rust + cp README.md packages/ts + cp README.md packages/rust + + - name: Upload Rust code + uses: actions/upload-artifact@v4 + with: + name: rust_code + path: packages/rust + + - name: Upload TypeScript code + uses: actions/upload-artifact@v4 + with: + name: ts_code + path: packages/ts - name: Push to schema registry env: BUF_TOKEN: ${{ secrets.BUF_TOKEN }} run: | buf push --tag ${{ github.ref_name }} + + publish-jsr: + runs-on: ubuntu-24.04 + needs: codegen + permissions: + contents: read + id-token: write + steps: + - name: Download TypeScript code + uses: actions/download-artifact@v4 + with: + name: ts_code + - name: Remove package.json (JSR doesn’t need it) + run: rm -f package.json + - name: Set up Deno + uses: denoland/setup-deno@main + with: + deno-version: rc + - name: Publish to JSR + run: deno publish --unstable-sloppy-imports + + publish-cargo: + runs-on: ubuntu-24.04 + needs: codegen + steps: + - name: Download Rust code + uses: actions/download-artifact@v4 + with: + name: rust_code + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Check Library + run: cargo check + - name: Publish to crates.io + uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_TOKEN }} + ignore-unpublished-changes: true \ No newline at end of file diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000..1306002 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,10 @@ +version: v2 +plugins: + - remote: buf.build/bufbuild/es:v2.1.0 + out: packages/ts/lib + opt: target=ts + - remote: buf.build/community/neoeinstein-prost:v0.4.0 + out: packages/rust/src/generated + - remote: buf.build/community/neoeinstein-prost-crate:v0.4.1 + out: packages/rust/src/generated + opt: no_features diff --git a/buf.yaml b/buf.yaml index 642e538..2a93588 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,14 +1,23 @@ -version: v1 -name: buf.build/meshtastic/protobufs -deps: [] -build: - excludes: [] -breaking: - use: - - FILE -lint: - ignore_only: - PACKAGE_DEFINED: - - nanopb.proto - use: - - MINIMAL +version: v2 +modules: + - path: . + name: buf.build/meshtastic/protobufs + excludes: + - .trunk/ + - meshtastic/device_only/ + lint: + use: + - MINIMAL + except: + - PACKAGE_NO_IMPORT_CYCLE + ignore_only: + PACKAGE_DEFINED: + - nanopb.proto + disallow_comment_ignores: true + breaking: + use: + - FILE + except: + - EXTENSION_NO_DELETE + - FIELD_SAME_DEFAULT + diff --git a/meshtastic/admin.options b/meshtastic/admin.options index 4a28ff2..6574db5 100644 --- a/meshtastic/admin.options +++ b/meshtastic/admin.options @@ -2,6 +2,8 @@ *AdminMessage.session_passkey max_size:8 +*AdminMessage.OTAEvent.ota_hash max_size:32 + *AdminMessage.InputEvent.event_code int_size:8 *AdminMessage.InputEvent.kb_char int_size:8 *AdminMessage.InputEvent.touch_x int_size:16 diff --git a/meshtastic/admin.proto b/meshtastic/admin.proto index c64306f..229d7de 100644 --- a/meshtastic/admin.proto +++ b/meshtastic/admin.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package meshtastic; +/* trunk-ignore(buf-lint/COMPILE) */ import "meshtastic/channel.proto"; import "meshtastic/config.proto"; import "meshtastic/connection_status.proto"; @@ -12,7 +13,7 @@ import "meshtastic/module_config.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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* @@ -187,6 +188,23 @@ message AdminMessage { uint32 touch_y = 4; } + /* + * User is requesting an over the air update. + * Node will reboot into the OTA loader + */ + message OTAEvent { + /* + * Tell the node to reboot into OTA mode for firmware update via BLE or WiFi (ESP32 only for now) + */ + OTAMode reboot_ota_mode = 1; + + /* + * A 32 byte hash of the OTA firmware. + * Used to verify the integrity of the firmware before applying an update. + */ + bytes ota_hash = 2; + } + /* * TODO: REPLACE */ @@ -414,6 +432,11 @@ message AdminMessage { */ uint32 remove_ignored_node = 48; + /* + * Set specified node-num to be muted + */ + uint32 toggle_muted_node = 49; + /* * 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) @@ -443,8 +466,9 @@ message AdminMessage { /* * 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. + * Deprecated in favor of reboot_ota_mode in 2.7.17 */ - int32 reboot_ota_seconds = 95; + int32 reboot_ota_seconds = 95 [deprecated = true]; /* * This message is only supported for the simulator Portduino build. @@ -469,8 +493,14 @@ message AdminMessage { /* * Tell the node to reset the nodedb. + * When true, favorites are preserved through reset. */ - int32 nodedb_reset = 100; + bool nodedb_reset = 100; + + /* + * Tell the node to reset into the OTA Loader + */ + OTAEvent ota_request = 101; /* * Parameters and sensor configuration @@ -479,6 +509,26 @@ message AdminMessage { } } +/* + * Firmware update mode for OTA updates + */ +enum OTAMode { + /* + * Do not reboot into OTA mode + */ + NO_REBOOT_OTA = 0; + + /* + * Reboot into OTA mode for BLE firmware update + */ + OTA_BLE = 1; + + /* + * Reboot into OTA mode for WiFi firmware update + */ + OTA_WIFI = 2; +} + /* * Parameters for setting up Meshtastic for ameteur radio usage */ @@ -531,6 +581,11 @@ message SharedContact { * Add this contact to the blocked / ignored list */ bool should_ignore = 3; + + /* + * Set the IS_KEY_MANUALLY_VERIFIED bit + */ + bool manually_verified = 4; } /* diff --git a/meshtastic/apponly.proto b/meshtastic/apponly.proto index 100833f..2612ed6 100644 --- a/meshtastic/apponly.proto +++ b/meshtastic/apponly.proto @@ -8,7 +8,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/atak.proto b/meshtastic/atak.proto index 5dc08c9..790c69b 100644 --- a/meshtastic/atak.proto +++ b/meshtastic/atak.proto @@ -1,11 +1,12 @@ syntax = "proto3"; +/* trunk-ignore(buf-lint/PACKAGE_DIRECTORY_MATCH) */ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/cannedmessages.proto b/meshtastic/cannedmessages.proto index baa5134..59f3dcc 100644 --- a/meshtastic/cannedmessages.proto +++ b/meshtastic/cannedmessages.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/channel.proto b/meshtastic/channel.proto index 16c8c19..f49895a 100644 --- a/meshtastic/channel.proto +++ b/meshtastic/channel.proto @@ -1,11 +1,12 @@ syntax = "proto3"; +/* trunk-ignore(buf-lint/PACKAGE_DIRECTORY_MATCH) */ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* @@ -98,10 +99,10 @@ message ModuleSettings { uint32 position_precision = 1; /* - * Controls whether or not the phone / clients should mute the current channel + * Controls whether or not the client / device should mute the current channel * Useful for noisy public channels you don't necessarily want to disable */ - bool is_client_muted = 2; + bool is_muted = 2; } /* diff --git a/meshtastic/clientonly.proto b/meshtastic/clientonly.proto index 2b919ef..c80f428 100644 --- a/meshtastic/clientonly.proto +++ b/meshtastic/clientonly.proto @@ -8,7 +8,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/config.proto b/meshtastic/config.proto index 12c79c5..649495e 100644 --- a/meshtastic/config.proto +++ b/meshtastic/config.proto @@ -7,7 +7,7 @@ import "meshtastic/device_ui.proto"; option csharp_namespace = "Meshtastic.Protobufs"; option go_package = "github.com/meshtastic/go/generated"; option java_outer_classname = "ConfigProtos"; -option java_package = "com.geeksville.mesh"; +option java_package = "org.meshtastic.proto"; option swift_prefix = ""; message Config { @@ -48,8 +48,9 @@ message Config { * Description: Infrastructure node for extending network coverage by relaying messages with minimal overhead. Not visible in Nodes list. * Technical Details: Mesh packets will simply be rebroadcasted over this node. Nodes configured with this role will not originate NodeInfo, Position, Telemetry * or any other packet type. They will simply rebroadcast any mesh packets on the same frequency, channel num, spread factor, and coding rate. + * Deprecated in v2.7.11 because it creates "holes" in the mesh rebroadcast chain. */ - REPEATER = 4; + REPEATER = 4 [deprecated = true]; /* * Description: Broadcasts GPS position packets as priority. @@ -110,7 +111,7 @@ message Config { ROUTER_LATE = 11; /* - * Description: Treats packets from or to favorited nodes as ROUTER, and all other packets as CLIENT. + * Description: Treats packets from or to favorited nodes as ROUTER_LATE, and all other packets as CLIENT. * Technical Details: Used for stronger attic/roof nodes to distribute messages more widely * from weaker, indoor, or less-well-positioned nodes. Recommended for users with multiple nodes * where one CLIENT_BASE acts as a more powerful base station, such as an attic/roof node. @@ -598,45 +599,10 @@ message Config { */ message DisplayConfig { /* - * How the GPS coordinates are displayed on the OLED screen. + * Deprecated in 2.7.4: Unused */ - enum GpsCoordinateFormat { - /* - * GPS coordinates are displayed in the normal decimal degrees format: - * DD.DDDDDD DDD.DDDDDD - */ - DEC = 0; - - /* - * GPS coordinates are displayed in the degrees minutes seconds format: - * DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant - */ - DMS = 1; - - /* - * Universal Transverse Mercator format: - * ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing - */ - UTM = 2; - - /* - * Military Grid Reference System format: - * ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square, - * E is easting, N is northing - */ - MGRS = 3; - - /* - * Open Location Code (aka Plus Codes). - */ - OLC = 4; - - /* - * Ordnance Survey Grid Reference (the National Grid System of the UK). - * Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square, - * E is the easting, N is the northing - */ - OSGR = 5; + enum DeprecatedGpsCoordinateFormat { + UNUSED = 0; } /* @@ -694,7 +660,7 @@ message Config { * Deprecated in 2.7.4: Unused * How the GPS coordinates are formatted on the OLED screen. */ - GpsCoordinateFormat gps_format = 2 [deprecated = true]; + DeprecatedGpsCoordinateFormat gps_format = 2 [deprecated = true]; /* * Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds. @@ -811,6 +777,12 @@ message Config { * If true, the device will display the time in 12-hour format on screen. */ bool use_12h_clock = 12; + + /* + * If false (default), the device will use short names for various display screens. + * If true, node names will show in long format + */ + bool use_long_node_name = 13; } /* @@ -966,8 +938,9 @@ message Config { /* * Long Range - Slow + * Deprecated in 2.7: Unpopular slow preset. */ - LONG_SLOW = 1; + LONG_SLOW = 1 [deprecated = true]; /* * Very Long Range - Slow @@ -1006,6 +979,12 @@ message Config { * It is not legal to use in all regions due to this wider bandwidth. */ SHORT_TURBO = 8; + + /* + * Long Range - Turbo + * This preset performs similarly to LongFast, but with 500Khz bandwidth. + */ + LONG_TURBO = 9; } /* diff --git a/meshtastic/connection_status.proto b/meshtastic/connection_status.proto index 7551596..641e916 100644 --- a/meshtastic/connection_status.proto +++ b/meshtastic/connection_status.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; message DeviceConnectionStatus { diff --git a/meshtastic/device_ui.options b/meshtastic/device_ui.options index 67bee23..a8fab46 100644 --- a/meshtastic/device_ui.options +++ b/meshtastic/device_ui.options @@ -3,9 +3,10 @@ *DeviceUIConfig.ring_tone_id int_size:8 *DeviceUIConfig.calibration_data max_size:16 *DeviceUIConfig.compass_mode int_size:8 +*DeviceUIConfig.gps_format int_size:8 *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 \ No newline at end of file +*Map.style max_size:20 diff --git a/meshtastic/device_ui.proto b/meshtastic/device_ui.proto index b9a72ce..28d2910 100644 --- a/meshtastic/device_ui.proto +++ b/meshtastic/device_ui.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* @@ -88,6 +88,59 @@ message DeviceUIConfig { * true for analog clockface, false for digital clockface */ bool is_clockface_analog = 18; + + /* + * How the GPS coordinates are formatted on the OLED screen. + */ + GpsCoordinateFormat gps_format = 19; + + /* + * How the GPS coordinates are displayed on the OLED screen. + */ + enum GpsCoordinateFormat { + /* + * GPS coordinates are displayed in the normal decimal degrees format: + * DD.DDDDDD DDD.DDDDDD + */ + DEC = 0; + + /* + * GPS coordinates are displayed in the degrees minutes seconds format: + * DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant + */ + DMS = 1; + + /* + * Universal Transverse Mercator format: + * ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing + */ + UTM = 2; + + /* + * Military Grid Reference System format: + * ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square, + * E is easting, N is northing + */ + MGRS = 3; + + /* + * Open Location Code (aka Plus Codes). + */ + OLC = 4; + + /* + * Ordnance Survey Grid Reference (the National Grid System of the UK). + * Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square, + * E is the easting, N is the northing + */ + OSGR = 5; + + /* + * Maidenhead Locator System + * Described here: https://en.wikipedia.org/wiki/Maidenhead_Locator_System + */ + MLS = 6; + } } message NodeFilter { @@ -319,6 +372,11 @@ enum Language { */ CZECH = 18; + /* + * Danish + */ + DANISH = 19; + /* * Simplified Chinese (experimental) */ diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index d449373..b7c377a 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package meshtastic; +/* trunk-ignore(buf-lint/COMPILE) */ import "meshtastic/channel.proto"; import "meshtastic/config.proto"; import "meshtastic/localonly.proto"; @@ -12,7 +13,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; option (nanopb_fileopt).include = ""; @@ -167,6 +168,7 @@ message NodeInfoLite { /* * Bitfield for storing booleans. * LSB 0 is_key_manually_verified + * LSB 1 is_muted */ uint32 bitfield = 13; } diff --git a/meshtastic/interdevice.proto b/meshtastic/interdevice.proto index 4616c08..f646368 100644 --- a/meshtastic/interdevice.proto +++ b/meshtastic/interdevice.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; // encapsulate up to 1k of NMEA string data diff --git a/meshtastic/localonly.proto b/meshtastic/localonly.proto index bcb2796..50e7305 100644 --- a/meshtastic/localonly.proto +++ b/meshtastic/localonly.proto @@ -8,7 +8,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/mesh.options b/meshtastic/mesh.options index 37c9341..77479ce 100644 --- a/meshtastic/mesh.options +++ b/meshtastic/mesh.options @@ -69,6 +69,11 @@ *KeyVerification.hash1 max_size:32 *KeyVerification.hash2 max_size:32 +*StoreForwardPlusPlus.message_hash max_size:32 +*StoreForwardPlusPlus.commit_hash max_size:32 +*StoreForwardPlusPlus.root_hash max_size:32 +*StoreForwardPlusPlus.message max_size:240 + # MyMessage.name max_size:40 # or fixed_length or fixed_count, or max_count diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index 62504d0..ecb8803 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -13,7 +13,7 @@ import "meshtastic/xmodem.proto"; option csharp_namespace = "Meshtastic.Protobufs"; option go_package = "github.com/meshtastic/go/generated"; option java_outer_classname = "MeshProtos"; -option java_package = "com.geeksville.mesh"; +option java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* @@ -388,9 +388,9 @@ enum HardwareModel { LORA_RELAY_V1 = 32; /* - * TODO: REPLACE + * T-Echo Plus device from LilyGo */ - NRF52840DK = 33; + T_ECHO_PLUS = 33; /* * TODO: REPLACE @@ -700,9 +700,9 @@ enum HardwareModel { HELTEC_SENSOR_HUB = 92; /* - * Reserved Fried Chicken ID for future use + * Muzi Works Muzi-Base device */ - RESERVED_FRIED_CHICKEN = 93; + MUZI_BASE = 93; /* * Heltec Magnetic Power Bank with Meshtastic compatible @@ -740,9 +740,9 @@ enum HardwareModel { SEEED_WIO_TRACKER_L1_EINK = 100; /* - * Reserved ID for future and past use + * Muzi Works R1 Neo */ - QWANTZ_TINY_ARMS = 101; + MUZI_R1_NEO = 101; /* * Lilygo T-Deck Pro @@ -755,9 +755,9 @@ enum HardwareModel { T_LORA_PAGER = 103; /* - * GAT562 Mesh Trial Tracker + * M5Stack Reserved */ - GAT562_MESH_TRIAL_TRACKER = 104; + M5STACK_RESERVED = 104; // 0x68 /* * RAKwireless WisMesh Tag @@ -790,6 +790,71 @@ enum HardwareModel { */ HELTEC_V4 = 110; + /* + * M5Stack C6L + */ + M5STACK_C6L = 111; + + /* + * M5Stack Cardputer Adv + */ + M5STACK_CARDPUTER_ADV = 112; + + /* + * ESP32S3 main controller with GPS and TFT screen. + */ + HELTEC_WIRELESS_TRACKER_V2 = 113; + + /* + * LilyGo T-Watch Ultra + */ + T_WATCH_ULTRA = 114; + + /* + * Elecrow ThinkNode M3 + */ + THINKNODE_M3 = 115; + + /* + * RAK WISMESH_TAP_V2 with ESP32-S3 CPU + */ + WISMESH_TAP_V2 = 116; + + /* + * RAK3401 + */ + RAK3401 = 117; + + /* + * RAK6421 Hat+ + */ + RAK6421 = 118; + + /* + * Elecrow ThinkNode M4 + */ + THINKNODE_M4 = 119; + + /* + * Elecrow ThinkNode M6 + */ + THINKNODE_M6 = 120; + + /* + * Elecrow Meshstick 1262 + */ + MESHSTICK_1262 = 121; + + /* + * LilyGo T-Beam 1W + */ + TBEAM_1_WATT = 122; + + /* + * LilyGo T5 S3 ePaper Pro (V1 and V2) + */ + T5_S3_EPAPER_PRO = 123; + /* * ------------------------------------------------------------------------------------------------------------------------------------------ * Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. @@ -1000,6 +1065,12 @@ message Routing { * This typically enforced per portnum and is used to prevent a single node from monopolizing airtime */ RATE_LIMIT_EXCEEDED = 38; + + /* + * PKI encryption failed, due to no public key for the remote node + * This is different from PKI_UNKNOWN_PUBKEY which indicates a failure upon receiving a packet + */ + PKI_SEND_FAIL_PUBLIC_KEY = 39; } oneof variant { @@ -1104,6 +1175,96 @@ message KeyVerification { bytes hash2 = 3; } +/* + * The actual over-the-mesh message doing store and forward++ + */ +message StoreForwardPlusPlus { + /* + * Enum of message types + */ + enum SFPP_message_type { + /* + * Send an announcement of the canonical tip of a chain + */ + CANON_ANNOUNCE = 0; + + /* + * Query whether a specific link is on the chain + */ + CHAIN_QUERY = 1; + + /* + * Request the next link in the chain + */ + LINK_REQUEST = 3; + + /* + * Provide a link to add to the chain + */ + LINK_PROVIDE = 4; + + /* + * If we must fragment, send the first half + */ + LINK_PROVIDE_FIRSTHALF = 5; + + /* + * If we must fragment, send the second half + */ + LINK_PROVIDE_SECONDHALF = 6; + } + + /* + * Which message type is this + */ + SFPP_message_type sfpp_message_type = 1; + + /* + * The hash of the specific message + */ + bytes message_hash = 2; + + /* + * The hash of a link on a chain + */ + bytes commit_hash = 3; + + /* + * the root hash of a chain + */ + bytes root_hash = 4; + + /* + * The encrypted bytes from a message + */ + bytes message = 5; + + /* + * Message ID of the contained message + */ + uint32 encapsulated_id = 6; + + /* + * Destination of the contained message + */ + uint32 encapsulated_to = 7; + + /* + * Sender of the contained message + */ + uint32 encapsulated_from = 8; + + /* + * The receive time of the message in question + */ + uint32 encapsulated_rxtime = 9; + + /* + * Used in a LINK_REQUEST to specify the message X spots back from head + */ + uint32 chain_count = 10; +} + /* * Waypoint message, used to share arbitrary locations across the mesh */ @@ -1336,6 +1497,10 @@ message MeshPacket { /* * The (immediate) destination for this packet + * If the value is 4,294,967,295 (maximum value of an unsigned 32bit integer), this indicates that the packet was + * not destined for a specific node, but for a channel as indicated by the value of `channel` below. + * If the value is another, this indicates that the packet was destined for a specific + * node (i.e. a kind of "Direct Message" to this node) and not broadcast on a channel. */ fixed32 to = 2; @@ -1609,6 +1774,12 @@ message NodeInfo { * LSB 0 of the bitfield */ bool is_key_manually_verified = 12; + + /* + * True if node has been muted + * Persistes between NodeDB internal clean ups + */ + bool is_muted = 13; } /* diff --git a/meshtastic/module_config.proto b/meshtastic/module_config.proto index f91671c..7825937 100644 --- a/meshtastic/module_config.proto +++ b/meshtastic/module_config.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* @@ -337,9 +337,12 @@ message ModuleConfig { // VE.Direct is a serial protocol used by Victron Energy products // https://beta.ivc.no/wiki/index.php/Victron_VE_Direct_DIY_Cable VE_DIRECT = 7; - //Used to configure and view some parameters of MeshSolar. - //https://heltec.org/project/meshsolar/ + // Used to configure and view some parameters of MeshSolar. + // https://heltec.org/project/meshsolar/ MS_CONFIG = 8; + // Logs mesh traffic to the serial pins, ideal for logging via openLog or similar. + LOG = 9; // includes other packets + LOGTEXT = 10; // only text (channel & DM) } /* @@ -615,6 +618,17 @@ message ModuleConfig { * Enable/Disable the health telemetry module on-device display */ bool health_screen_enabled = 13; + + /* + * Enable/Disable the device telemetry module to send metrics to the mesh + * Note: We will still send telemtry to the connected phone / client every minute over the API + */ + bool device_telemetry_enabled = 14; + + /* + * Enable/Disable the air quality telemetry measurement module on-device display + */ + bool air_quality_screen_enabled = 15; } /* diff --git a/meshtastic/mqtt.proto b/meshtastic/mqtt.proto index 4edf0c4..616780d 100644 --- a/meshtastic/mqtt.proto +++ b/meshtastic/mqtt.proto @@ -8,7 +8,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/paxcount.proto b/meshtastic/paxcount.proto index 47b2639..5084f9d 100644 --- a/meshtastic/paxcount.proto +++ b/meshtastic/paxcount.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/portnums.proto b/meshtastic/portnums.proto index e388a6f..221f113 100644 --- a/meshtastic/portnums.proto +++ b/meshtastic/portnums.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* @@ -134,6 +134,14 @@ enum PortNum { */ PAXCOUNTER_APP = 34; + /* + * Store and Forward++ module included in the firmware + * ENCODING: protobuf + * This module is specifically for Native Linux nodes, and provides a Git-style + * chain of messages. + */ + STORE_FORWARD_PLUSPLUS_APP = 35; + /* * 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 diff --git a/meshtastic/powermon.proto b/meshtastic/powermon.proto index 77206f4..5973b16 100644 --- a/meshtastic/powermon.proto +++ b/meshtastic/powermon.proto @@ -5,7 +5,7 @@ package meshtastic; 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* Note: There are no 'PowerMon' messages normally in use (PowerMons are sent only as structured logs - slogs). diff --git a/meshtastic/remote_hardware.proto b/meshtastic/remote_hardware.proto index ba4a693..d919203 100644 --- a/meshtastic/remote_hardware.proto +++ b/meshtastic/remote_hardware.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/rtttl.proto b/meshtastic/rtttl.proto index 11c8b92..06d94fc 100644 --- a/meshtastic/rtttl.proto +++ b/meshtastic/rtttl.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/storeforward.proto b/meshtastic/storeforward.proto index 651eae5..a4a18b2 100644 --- a/meshtastic/storeforward.proto +++ b/meshtastic/storeforward.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* diff --git a/meshtastic/telemetry.options b/meshtastic/telemetry.options index 3c7238a..81d2aa8 100644 --- a/meshtastic/telemetry.options +++ b/meshtastic/telemetry.options @@ -7,6 +7,7 @@ *LocalStats.num_online_nodes int_size:16 *LocalStats.num_total_nodes int_size:16 +*LocalStats.num_tx_dropped int_size:16 *HealthMetrics.heart_bpm int_size:8 *HealthMetrics.spO2 int_size:8 diff --git a/meshtastic/telemetry.proto b/meshtastic/telemetry.proto index 1fad6ba..1afdc9c 100644 --- a/meshtastic/telemetry.proto +++ b/meshtastic/telemetry.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; /* @@ -438,6 +438,11 @@ message LocalStats { * Number of bytes free in the heap */ uint32 heap_free_bytes = 13; + + /* + * Number of packets that were dropped because the transmit queue was full. + */ + uint32 num_tx_dropped = 14; } /* @@ -785,6 +790,11 @@ enum TelemetrySensorType { * TSL2561 light sensor */ TSL2561 = 44; + + /* + * BH1750 light sensor + */ + BH1750 = 45; } /* diff --git a/meshtastic/xmodem.proto b/meshtastic/xmodem.proto index 732780a..2a049d1 100644 --- a/meshtastic/xmodem.proto +++ b/meshtastic/xmodem.proto @@ -5,7 +5,7 @@ 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 java_package = "org.meshtastic.proto"; option swift_prefix = ""; message XModem { diff --git a/packages/rust/Cargo.lock b/packages/rust/Cargo.lock new file mode 100644 index 0000000..6b365f0 --- /dev/null +++ b/packages/rust/Cargo.lock @@ -0,0 +1,105 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anyhow" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" + +[[package]] +name = "bytes" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "meshtastic_protobufs" +version = "2.5.5" +dependencies = [ + "prost", + "prost-types", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +dependencies = [ + "prost", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "2.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" diff --git a/packages/rust/Cargo.toml b/packages/rust/Cargo.toml new file mode 100644 index 0000000..ce52443 --- /dev/null +++ b/packages/rust/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "meshtastic_protobufs" +edition = "2021" +version = "__PACKAGE_VERSION__" +description = "Meshtastic Protobuf definitions" +repository = "https://github.com/meshtastic/protobufs" +license-file = "LICENSE" +include = [ + "**/*.rs", + "Cargo.toml", +] + +[dependencies] +prost = "0.13.3" +prost-types = "0.13.3" diff --git a/packages/rust/src/generated/.gitkeep b/packages/rust/src/generated/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/rust/src/lib.rs b/packages/rust/src/lib.rs new file mode 100644 index 0000000..a5bf95a --- /dev/null +++ b/packages/rust/src/lib.rs @@ -0,0 +1,5 @@ +extern crate prost; +extern crate core; +extern crate prost_types; + +include!("generated/mod.rs"); diff --git a/packages/ts/deno.json b/packages/ts/deno.json new file mode 100644 index 0000000..99b801a --- /dev/null +++ b/packages/ts/deno.json @@ -0,0 +1,15 @@ +{ + "name": "@meshtastic/protobufs", + "version": "__PACKAGE_VERSION__", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@bufbuild/protobuf": "npm:@bufbuild/protobuf@^2.2.3" + }, + "publish": { + "exclude": [ + "!lib" + ] + } +} diff --git a/packages/ts/deno.lock b/packages/ts/deno.lock new file mode 100644 index 0000000..d39f28e --- /dev/null +++ b/packages/ts/deno.lock @@ -0,0 +1,16 @@ +{ + "version": "4", + "specifiers": { + "npm:@bufbuild/protobuf@^2.2.3": "2.2.3" + }, + "npm": { + "@bufbuild/protobuf@2.2.3": { + "integrity": "sha512-tFQoXHJdkEOSwj5tRIZSPNUuXK3RaR7T1nUrPgbYX1pUbvqqaaZAsfo+NXBPsz5rZMSKVFrgK1WL8Q/MSLvprg==" + } + }, + "workspace": { + "dependencies": [ + "npm:@bufbuild/protobuf@^2.2.3" + ] + } +} diff --git a/packages/ts/lib/.gitkeep b/packages/ts/lib/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/ts/mod.ts b/packages/ts/mod.ts new file mode 100644 index 0000000..b043e49 --- /dev/null +++ b/packages/ts/mod.ts @@ -0,0 +1,20 @@ +export * as Admin from "./lib/admin_pb.ts"; +export * as AppOnly from "./lib/apponly_pb.ts"; +export * as ATAK from "./lib/atak_pb.ts"; +export * as CannedMessages from "./lib/cannedmessages_pb.ts"; +export * as Channel from "./lib/channel_pb.ts"; +export * as ClientOnly from "./lib/clientonly_pb.ts"; +export * as Config from "./lib/config_pb.ts"; +export * as ConnectionStatus from "./lib/connection_status_pb.ts"; +export * as LocalOnly from "./lib/localonly_pb.ts"; +export * as Mesh from "./lib/mesh_pb.ts"; +export * as ModuleConfig from "./lib/module_config_pb.ts"; +export * as Mqtt from "./lib/mqtt_pb.ts"; +export * as PaxCount from "./lib/paxcount_pb.ts"; +export * as Portnums from "./lib/portnums_pb.ts"; +export * as PowerMon from "./lib/powermon_pb.ts"; +export * as RemoteHardware from "./lib/remote_hardware_pb.ts"; +export * as Rtttl from "./lib/rtttl_pb.ts"; +export * as StoreForward from "./lib/storeforward_pb.ts"; +export * as Telemetry from "./lib/telemetry_pb.ts"; +export * as Xmodem from "./lib/xmodem_pb.ts"; diff --git a/packages/ts/package.json b/packages/ts/package.json new file mode 100755 index 0000000..04f1162 --- /dev/null +++ b/packages/ts/package.json @@ -0,0 +1,32 @@ +{ + "name": "@meshtastic/protobufs", + "description": "Protobuf definitions for the Meshtastic project", + "version": "__PACKAGE_VERSION__", + "homepage": "https://github.com/meshtastic/protobufs", + "license": "GPLV3", + "publishConfig": { + "access": "public" + }, + "type": "module", + "main": "./dist/mod.js", + "module": "./dist/mod.js", + "types": "./dist/mod.d.ts", + "dependencies": { + "@bufbuild/protobuf": "^2.2.3" + }, + "devDependencies": { + "tsdown": "^0.13.4", + "typescript": "^5.8.3" + }, + "scripts": { + "build": "tsdown" + }, + "tsdown": { + "entry": "mod.ts", + "dts": true, + "format": [ + "esm" + ], + "splitting": false + } +}