From 60ed3c0a02532cdb2fe1f335fa8da5c89742fd48 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 19 Sep 2021 15:50:35 -0500 Subject: [PATCH] Get self telemetry path working. --- README.md | 5 +++-- src/TTGO_T-Beam_LoRa_APRS.ino | 11 +++++++++-- src/taskWebServer.cpp | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dcbf2fd..567aad1 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,9 @@ After connection with APRX based DIGI it can be used as KISS-TNC ## Contributors * Initial work: OE1ACM, OE3CJB * Redesigned: SQ9MDD -* KISS TNC Over Seriall or Bluetooth: SQ5RWU -* Lora32 board support DJ1AN +* KISS TNC Over Serial or Bluetooth: SQ5RWU +* Lora32 board support: DJ1AN +* Self-telemetry improvement: KB1GIM ## Supported boards * TTGO T-beam v.0.7 diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 872730d..c9e650d 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -552,13 +552,20 @@ String prepareCallsign(const String& callsign){ sprintf_P(tel_sequence_char, "%03u", tel_sequence); tel_sequence_str = String(tel_sequence_char); } - + // Format telemetry path + String tel_path_str; + if(tel_path == ""){ + tel_path_str = tel_path; + }else{ + tel_path_str = "," + tel_path; + } + String telemetryParamsNames = String(":") + Tcall_message + ":PARM.B Volt,B In,B Out,AC V,AC C"; String telemetryUnitNames = String(":") + Tcall_message + ":UNIT.mV,mA,mA,mV,mA"; String telemetryEquations = String(":") + Tcall_message + ":EQNS.0,5.1,3000,0,10,0,0,10,0,0,28,3000,0,10,0"; String telemetryData = String("T#") + tel_sequence_str + "," + String(b_volt) + "," + String(b_in_c) + "," + String(b_out_c) + "," + String(ac_volt) + "," + String(ac_c) + ",00000000"; String telemetryBase = ""; - telemetryBase += Tcall + ">APLO01," + tel_path + ":"; + telemetryBase += Tcall + ">APLO01" + tel_path_str + ":"; Serial.print(telemetryBase); sendToTNC(telemetryBase + telemetryParamsNames); sendToTNC(telemetryBase + telemetryUnitNames); diff --git a/src/taskWebServer.cpp b/src/taskWebServer.cpp index d958298..743d5fa 100644 --- a/src/taskWebServer.cpp +++ b/src/taskWebServer.cpp @@ -214,7 +214,7 @@ void handle_Cfg() { jsonData += jsonLineFromPreferenceBool(PREF_ENABLE_TNC_SELF_TELEMETRY); jsonData += jsonLineFromPreferenceInt(PREF_TNC_SELF_TELEMETRY_INTERVAL); jsonData += jsonLineFromPreferenceInt(PREF_TNC_SELF_TELEMETRY_MIC); - jsonData += jsonLineFromPreferenceInt(PREF_TNC_SELF_TELEMETRY_PATH); + jsonData += jsonLineFromPreferenceString(PREF_TNC_SELF_TELEMETRY_PATH); jsonData += jsonLineFromPreferenceBool(PREF_DEV_OL_EN); jsonData += jsonLineFromPreferenceBool(PREF_APRS_SHOW_CMT); jsonData += jsonLineFromPreferenceBool(PREF_DEV_BT_EN);