From fa47c64558473c806ca6535d407df7409acbc283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 2 Nov 2022 13:46:35 +0100 Subject: [PATCH 1/6] Audio support with codec2, SX1280 on 2.4GHz only for now. --- admin.proto | 5 +++++ localonly.proto | 5 +++++ module_config.proto | 51 +++++++++++++++++++++++++++++++++++++++++++++ portnums.proto | 5 +++++ 4 files changed, 66 insertions(+) diff --git a/admin.proto b/admin.proto index 9bf4dd9..1c8dac6 100644 --- a/admin.proto +++ b/admin.proto @@ -99,6 +99,11 @@ message AdminMessage { * TODO: REPLACE */ CANNEDMSG_CONFIG = 6; + + /* + * TODO: REPLACE + */ + AUDIO_CONFIG = 7; } /* diff --git a/localonly.proto b/localonly.proto index f9a4bb7..cc77c3d 100644 --- a/localonly.proto +++ b/localonly.proto @@ -94,6 +94,11 @@ message LocalModuleConfig { */ ModuleConfig.CannedMessageConfig canned_message = 7; + /* + * The part of the config that is specific to the Audio module + */ + ModuleConfig.AudioConfig audio = 9; + /* * 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 05cfcba..304cf07 100644 --- a/module_config.proto +++ b/module_config.proto @@ -55,6 +55,52 @@ message ModuleConfig { bool json_enabled = 6; } + /* + * 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; + + /* + * ADC where Microphone is connected + */ + uint32 mic_chan = 2; + + /* + * DAC where Speaker is connected + */ + uint32 amp_pin = 3; + + /* + * PTT Pin + */ + uint32 ptt_pin = 4; + + /* + * The audio sample rate to use for codec2 + */ + Audio_Baud bitrate = 5; + } + /* * Serial Config */ @@ -407,5 +453,10 @@ message ModuleConfig { */ CannedMessageConfig canned_message = 7; + /* + * TODO: REPLACE + */ + AudioConfig audio = 8; + } } diff --git a/portnums.proto b/portnums.proto index 5096be7..dd8a7c6 100644 --- a/portnums.proto +++ b/portnums.proto @@ -76,6 +76,11 @@ enum PortNum { */ WAYPOINT_APP = 8; + /* Audio Payloads. + * Encapsulated codec2 packets. On 2.4 GHZ Bandwidths only for now + */ + AUDIO_APP = 9; + /* * Provides a 'ping' service that replies to any packet it receives. * Also serves as a small example module. From c7b826d93092b44d547c5e605d8dd030210c9ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 3 Nov 2022 22:18:17 +0100 Subject: [PATCH 2/6] auto-detect override settings --- config.proto | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/config.proto b/config.proto index 631f6d8..04dbefe 100644 --- a/config.proto +++ b/config.proto @@ -399,6 +399,27 @@ message Config { */ IMPERIAL = 1; } + + /* + * Override OLED outo detect with this if it fails. + */ + enum OledType { + + /* + * Default / Auto + */ + OLED_AUTO = 0; + + /* + * Default / Auto + */ + OLED_SSD1306 = 1; + + /* + * Default / Auto + */ + OLED_SH1106 = 2; + } /* * Number of seconds the screen stays on after pressing the user button or receiving a message @@ -432,6 +453,11 @@ message Config { * Perferred display units */ DisplayUnits units = 6; + + /* + * Override auto-detect in screen + */ + OledType oled = 7; } /* From 7e102f0f3c4d6a41e9ee42e4771ca3c35c517d56 Mon Sep 17 00:00:00 2001 From: sigmahour Date: Fri, 4 Nov 2022 22:25:38 -0400 Subject: [PATCH 3/6] updated links --- mesh.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesh.proto b/mesh.proto index 1cf2b40..1dbf7fe 100644 --- a/mesh.proto +++ b/mesh.proto @@ -720,7 +720,7 @@ message MeshPacket { /* * The sending node number. * Note: Our crypto implementation uses this field as well. - * See [crypto](/docs/developers/firmware/encryption) for details. + * See [crypto](/docs/about/overview/encryption) for details. * FIXME - really should be fixed32 instead, this encoding only hurts the ble link though. */ fixed32 from = 1; @@ -772,7 +772,7 @@ message MeshPacket { * needs to be unique for a few minutes (long enough to last for the length of * any ACK or the completion of a mesh broadcast flood). * Note: Our crypto implementation uses this id as well. - * See [crypto](/docs/developers/firmware/encryption) for details. + * See [crypto](/docs/about/overview/encryption) for details. * FIXME - really should be fixed32 instead, this encoding only * hurts the ble link though. */ From 2954e5b0228c85902c841bfb0f18add43980a2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sat, 5 Nov 2022 14:58:41 +0100 Subject: [PATCH 4/6] Resurrect wifi_mode but not as we knew it :-) --- config.proto | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/config.proto b/config.proto index 04dbefe..a5e8f80 100644 --- a/config.proto +++ b/config.proto @@ -249,23 +249,6 @@ message Config { */ message NetworkConfig { - enum WiFiMode { - /* - * This mode is used to connect to an external WiFi network - */ - CLIENT = 0; - - /* - * In this mode the node will operate as an AP (and DHCP server) - */ - ACCESS_POINT = 1; - - /* - * If set, the node AP will broadcast as a hidden SSID - */ - ACCESS_POINT_HIDDEN = 2; - } - enum EthMode { /* * obtain ip address via DHCP @@ -304,6 +287,11 @@ message Config { * Enable WiFi (disables Bluetooth) */ bool wifi_enabled = 1; + + /* + * acquire an address via DHCP or assign static + */ + EthMode wifi_mode = 2; /* * If set, this node will try to join the specified wifi network and From 055d181f70a35d4ac5eb6e3d37d08c1241a4f506 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 8 Nov 2022 11:43:44 -0600 Subject: [PATCH 5/6] Rename config --- config.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.proto b/config.proto index a5e8f80..18379aa 100644 --- a/config.proto +++ b/config.proto @@ -291,7 +291,7 @@ message Config { /* * acquire an address via DHCP or assign static */ - EthMode wifi_mode = 2; + EthMode eth_mode = 2; /* * If set, this node will try to join the specified wifi network and From 1d70e7865e2d50f0ae8bddd83050c38e9960dfd3 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 8 Nov 2022 14:38:48 -0600 Subject: [PATCH 6/6] Remove #2 --- config.proto | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config.proto b/config.proto index 18379aa..64c23d9 100644 --- a/config.proto +++ b/config.proto @@ -288,10 +288,6 @@ message Config { */ bool wifi_enabled = 1; - /* - * acquire an address via DHCP or assign static - */ - EthMode eth_mode = 2; /* * If set, this node will try to join the specified wifi network and