From f9e64f9eb078725d0b995392710d2a04c3a948a1 Mon Sep 17 00:00:00 2001 From: Sacha Weatherstone Date: Mon, 2 Jan 2023 16:48:17 +1100 Subject: [PATCH 01/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2d0b49..771dfa3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Meshtastic Protobuf Definitions -[![CI](https://img.shields.io/github/workflow/status/meshtastic/protobufs/CI?label=actions&logo=github&color=yellow)](https://github.com/meshtastic/protobufs/actions/workflows/ci.yml) +[![CI](https://img.shields.io/github/actions/workflow/status/meshtastic/protobufs/ci.yml?branch=master&label=actions&logo=github&color=yellow)](https://github.com/meshtastic/protobufs/actions/workflows/ci.yml) [![CLA assistant](https://cla-assistant.io/readme/badge/meshtastic/protobufs)](https://cla-assistant.io/meshtastic/protobufs) [![Fiscal Contributors](https://opencollective.com/meshtastic/tiers/badge.svg?label=Fiscal%20Contributors&color=deeppink)](https://opencollective.com/meshtastic/) [![Vercel](https://img.shields.io/static/v1?label=Powered%20by&message=Vercel&style=flat&logo=vercel&color=000000)](https://vercel.com?utm_source=meshtastic&utm_campaign=oss) From a33ca9615e9d6abc8f0b8f8ae2cedad9872ff937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 28 Dec 2022 23:27:51 +0100 Subject: [PATCH 02/12] add proto for RemoteHardware. This can be extended later, enables for now. --- admin.proto | 5 +++++ localonly.proto | 5 +++++ module_config.proto | 16 ++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/admin.proto b/admin.proto index 79a6687..873939b 100644 --- a/admin.proto +++ b/admin.proto @@ -105,6 +105,11 @@ message AdminMessage { * TODO: REPLACE */ AUDIO_CONFIG = 7; + + /* + * TODO: REPLACE + */ + REMOTEHARDWARE_CONFIG = 7; } /* diff --git a/localonly.proto b/localonly.proto index f4c1859..366ed02 100644 --- a/localonly.proto +++ b/localonly.proto @@ -100,6 +100,11 @@ message LocalModuleConfig { */ ModuleConfig.AudioConfig audio = 9; + /* + * The part of the config that is specific to the GPS module + */ + ModuleConfig.RemoteHardwareConfig remote_hardware = 10; + /* * 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 diff --git a/module_config.proto b/module_config.proto index c6e6cb0..4b4ad87 100644 --- a/module_config.proto +++ b/module_config.proto @@ -56,6 +56,17 @@ message ModuleConfig { bool json_enabled = 6; } + /* + * RemoteHardwareModule Config + */ + message RemoteHardwareConfig { + + /* + * Whether the Module is enabled + */ + bool enabled = 1; + } + /* * Audio Config for codec2 voice */ @@ -516,5 +527,10 @@ message ModuleConfig { */ AudioConfig audio = 8; + /* + * TODO: REPLACE + */ + RemoteHardwareConfig remote_hardware = 9; + } } From cc6ddaaebb1f0b2ce25a120bb29520717b575437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 28 Dec 2022 23:34:40 +0100 Subject: [PATCH 03/12] fix dual enum --- admin.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin.proto b/admin.proto index 873939b..53f1728 100644 --- a/admin.proto +++ b/admin.proto @@ -109,7 +109,7 @@ message AdminMessage { /* * TODO: REPLACE */ - REMOTEHARDWARE_CONFIG = 7; + REMOTEHARDWARE_CONFIG = 8; } /* From 01c3130a4063276839aab1451bcb036f163f8dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 28 Dec 2022 23:35:22 +0100 Subject: [PATCH 04/12] Add Settings for Screen Layout --- config.proto | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/config.proto b/config.proto index bfeb7a7..eafbdcd 100644 --- a/config.proto +++ b/config.proto @@ -466,6 +466,37 @@ message Config { * Override auto-detect in screen */ OledType oled = 7; + + enum DisplayMode { + /* + * Default. The old style for the 128x64 OLED screen + */ + DEFAULT = 0; + + /* + * Rearrange display elements to cater for bicolor OLED displays + */ + TWOCOLOR = 1; + + /* + * Same as TwoColor, but with inverted top bar. Not so good for Epaper displays + */ + INVERTED = 2; + + /* + * TFT Full Color Displays (not implemented yet) + */ + COLOR = 3; + } + /* + * Display Mode + */ + DisplayMode displaymode = 8; + + /* + * Print first line in pseudo-bold? FALSE is original style, TRUE is bold + */ + bool heading_bold = 9; } /* From 2b712f523c20f1d46263e98abed11d16fab1e7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 28 Dec 2022 23:49:34 +0100 Subject: [PATCH 05/12] add ringtone storage as extra file --- admin.options | 3 +++ admin.proto | 15 +++++++++++++++ rtttl.options | 1 + rtttl.proto | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 rtttl.options create mode 100644 rtttl.proto diff --git a/admin.options b/admin.options index 0873a92..1495a50 100644 --- a/admin.options +++ b/admin.options @@ -2,3 +2,6 @@ *AdminMessage.set_canned_message_module_messages max_size:201 *AdminMessage.get_canned_message_module_messages_response max_size:201 + +*AdminMessage.set_ringtone_message max_size:231 +*AdminMessage.get_ringtone_response max_size:231 diff --git a/admin.proto b/admin.proto index 53f1728..8b203d9 100644 --- a/admin.proto +++ b/admin.proto @@ -178,6 +178,16 @@ message AdminMessage { */ 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; + /* * Set the owner for this node */ @@ -207,6 +217,11 @@ message AdminMessage { */ string set_canned_message_module_messages = 36; + /* + * Set the ringtone for ExternalNotification. + */ + string set_ringtone_message = 37; + /* * 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) diff --git a/rtttl.options b/rtttl.options new file mode 100644 index 0000000..1ae0c2f --- /dev/null +++ b/rtttl.options @@ -0,0 +1 @@ +*RTTTLConfig.ringtone max_size:230 diff --git a/rtttl.proto b/rtttl.proto new file mode 100644 index 0000000..2655c10 --- /dev/null +++ b/rtttl.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +option java_package = "com.geeksville.mesh"; +option java_outer_classname = "RTTTLConfigProtos"; +option optimize_for = LITE_RUNTIME; +option go_package = "github.com/meshtastic/go/generated"; +option csharp_namespace = "Meshtastic.Protobufs"; + +/* + * Canned message module configuration. + */ +message RTTTLConfig { + + /* + * Ringtone for PWM Buzzer in RTTTL Format. + */ + string ringtone = 1; +} From bf7c81b5ef5e3321daec82f03f306bbdd37d7d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 29 Dec 2022 14:14:23 +0100 Subject: [PATCH 06/12] Update localonly.proto --- localonly.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localonly.proto b/localonly.proto index 366ed02..46c83d8 100644 --- a/localonly.proto +++ b/localonly.proto @@ -101,7 +101,7 @@ message LocalModuleConfig { ModuleConfig.AudioConfig audio = 9; /* - * The part of the config that is specific to the GPS module + * The part of the config that is specific to the Remote Hardware module */ ModuleConfig.RemoteHardwareConfig remote_hardware = 10; From 8a97dd042752db33719e56ba9125db6922a71df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 2 Jan 2023 16:58:06 +0100 Subject: [PATCH 07/12] Rename eth_mode->address_mode, it's also for WiFi Numerical values and struct stay the same. May need changes to the client code for setting/getting these --- config.proto | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config.proto b/config.proto index eafbdcd..72a5867 100644 --- a/config.proto +++ b/config.proto @@ -273,7 +273,7 @@ message Config { */ message NetworkConfig { - enum EthMode { + enum AddressMode { /* * obtain ip address via DHCP */ @@ -312,7 +312,6 @@ message Config { */ bool wifi_enabled = 1; - /* * If set, this node will try to join the specified wifi network and * acquire an address via DHCP @@ -337,7 +336,7 @@ message Config { /* * acquire an address via DHCP or assign static */ - EthMode eth_mode = 7; + AddressMode address_mode = 7; /* * struct to keep static address From a16be4f907d6e8ae35d34710de269a3942f80886 Mon Sep 17 00:00:00 2001 From: Pavel Boldin Date: Sat, 8 Oct 2022 02:51:42 +0300 Subject: [PATCH 08/12] FromRadio: add QueueStatus payload Send amount of available places in the queue as well as last allocation result. Signed-off-by: Pavel Boldin --- mesh.options | 4 ++++ mesh.proto | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/mesh.options b/mesh.options index 59f66bc..35c753b 100644 --- a/mesh.options +++ b/mesh.options @@ -26,6 +26,10 @@ *MeshPacket.hop_limit int_size:8 *MeshPacket.channel 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 diff --git a/mesh.proto b/mesh.proto index 7a20594..735058d 100644 --- a/mesh.proto +++ b/mesh.proto @@ -1192,6 +1192,20 @@ message LogRecord { Level level = 4; } +message QueueStatus { + /* Last attempt to queue status, ErrorCode */ + int32 res = 1; + + /* Free entries in the outgoing queue */ + uint32 free = 2; + + /* Maximum entries in the outgoing queue */ + uint32 maxlen = 3; + + /* What was mesh packet id that generated this response? */ + uint32 mesh_packet_id = 4; +} + /* * Packets from the radio to the phone will appear on the fromRadio characteristic. * It will support READ and NOTIFY. When a new packet arrives the device will BLE notify? @@ -1263,6 +1277,9 @@ message FromRadio { * One packet is sent for each channel */ Channel channel = 10; + + /* Queue status info */ + QueueStatus queueStatus = 11; } } From 01480de34aad155dedf7d69b7059f56788f4eb4b Mon Sep 17 00:00:00 2001 From: Mark Trevor Birss Date: Sat, 7 Jan 2023 13:46:08 +0200 Subject: [PATCH 09/12] Add BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU https://betafpv.com/products/elrs-micro-tx-module --- mesh.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mesh.proto b/mesh.proto index 735058d..5c932bc 100644 --- a/mesh.proto +++ b/mesh.proto @@ -371,6 +371,11 @@ enum HardwareModel { */ HELTEC_WSL_V3 = 44; + /* + * New BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU + */ + BETAFPV_2400_TX = 45; + /* * 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. */ From 5ddb7cbbe7439cf6b1476dd42d166cb137521468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 9 Jan 2023 10:10:22 +0100 Subject: [PATCH 10/12] correct formatting --- mesh.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesh.proto b/mesh.proto index 5c932bc..f4d38a8 100644 --- a/mesh.proto +++ b/mesh.proto @@ -371,10 +371,10 @@ enum HardwareModel { */ HELTEC_WSL_V3 = 44; - /* + /* * New BETAFPV ELRS Micro TX Module 2.4G with ESP32 CPU */ - BETAFPV_2400_TX = 45; + BETAFPV_2400_TX = 45; /* * 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. From 1da871fb2f3a73ed0a24e64deb6274c3faec3d53 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 9 Jan 2023 06:50:17 -0600 Subject: [PATCH 11/12] Github action for automated tagging (release) --- .github/workflows/ci.yml | 53 +++++++++++++++++++++++++++++++++++++++- scripts/buildinfo.py | 8 ++++++ scripts/bump_version.py | 16 ++++++++++++ scripts/readprops.py | 35 ++++++++++++++++++++++++++ version.properties | 4 +++ 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100755 scripts/buildinfo.py create mode 100755 scripts/bump_version.py create mode 100644 scripts/readprops.py create mode 100644 version.properties diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e2f63b..6a6b706 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,10 +6,12 @@ on: pull_request: branches: - master - + workflow_dispatch: + jobs: lint: + if: ${{ github.event_name != 'workflow_dispatch' }} runs-on: ubuntu-latest steps: @@ -20,3 +22,52 @@ jobs: uses: plexsystems/protolint-action@v0.2.0 with: configDirectory: . + + release: + if: ${{ github.event_name == 'workflow_dispatch' }} + runs-on: ubuntu-latest + + steps: + - name: checkout source + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Cache python libs + uses: actions/cache@v3 + id: cache-pip # needed in if test + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip + + - name: Upgrade python tools + shell: bash + run: | + python -m pip install --upgrade pip + + - name: Get release version string + run: echo "version=$(./scripts/buildinfo.py short)" >> $GITHUB_OUTPUT + id: version + + - name: Create release + uses: actions/create-release@v1 + id: create_release + with: + release_name: Meshtastic Protobufs ${{ steps.version.outputs.version }} + tag_name: v${{ steps.version.outputs.version }} + body: Protobufs for version ${{ steps.version.outputs.version }} release of Meshtastic firmware + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Bump version.properties + run: >- + scripts/bump_version.py + + - name: Create version.properties pull request + uses: peter-evans/create-pull-request@v3 + with: + add-paths: | + version.properties \ No newline at end of file diff --git a/scripts/buildinfo.py b/scripts/buildinfo.py new file mode 100755 index 0000000..4865f90 --- /dev/null +++ b/scripts/buildinfo.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +import configparser +import sys +from readprops import readProps + +verObj = readProps('version.properties') +propName = sys.argv[1] +print(f"{verObj[propName]}") \ No newline at end of file diff --git a/scripts/bump_version.py b/scripts/bump_version.py new file mode 100755 index 0000000..6128fad --- /dev/null +++ b/scripts/bump_version.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +"""Bump the version number""" + +lines = None + +with open('version.properties', 'r', encoding='utf-8') as f: + lines = f.readlines() + +with open('version.properties', 'w', encoding='utf-8') as f: + for line in lines: + if line.lstrip().startswith("build = "): + words = line.split(" = ") + ver = f'build = {int(words[1]) + 1}' + f.write(f'{ver}\n') + else: + f.write(line) diff --git a/scripts/readprops.py b/scripts/readprops.py new file mode 100644 index 0000000..94199c4 --- /dev/null +++ b/scripts/readprops.py @@ -0,0 +1,35 @@ +import subprocess +import configparser +import traceback +import sys + + +def readProps(prefsLoc): + """Read the version of our project as a string""" + + config = configparser.RawConfigParser() + config.read(prefsLoc) + version = dict(config.items('VERSION')) + verObj = dict(short = "{}.{}.{}".format(version["major"], version["minor"], version["build"]), + long = "unset") + + # Try to find current build SHA if if the workspace is clean. This could fail if git is not installed + try: + sha = subprocess.check_output( + ['git', 'rev-parse', '--short', 'HEAD']).decode("utf-8").strip() + isDirty = subprocess.check_output( + ['git', 'diff', 'HEAD']).decode("utf-8").strip() + suffix = sha + if isDirty: + # short for 'dirty', we want to keep our verstrings source for protobuf reasons + suffix = sha + "-d" + verObj['long'] = "{}.{}.{}.{}".format( + version["major"], version["minor"], version["build"], suffix) + except: + # print("Unexpected error:", sys.exc_info()[0]) + # traceback.print_exc() + verObj['long'] = verObj['short'] + + # print("firmware version " + verStr) + return verObj +# print("path is" + ','.join(sys.path)) diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..816f7c2 --- /dev/null +++ b/version.properties @@ -0,0 +1,4 @@ +[VERSION] +major = 2 +minor = 0 +build = 12 From 098ba8e69611b0e62ac7441495556c7725d87a77 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 9 Jan 2023 07:15:10 -0600 Subject: [PATCH 12/12] Create version.properties --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index 816f7c2..40e7926 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 0 -build = 12 +build = 13