diff --git a/data_embed/index.html b/data_embed/index.html index d60e0d8..25a51f9 100644 --- a/data_embed/index.html +++ b/data_embed/index.html @@ -101,14 +101,26 @@ + +
+
Telemetry Settings
+
+
- +
+
+ + +
Fixed Beaconing Settings
diff --git a/include/preference_storage.h b/include/preference_storage.h index f401627..c61a7d0 100644 --- a/include/preference_storage.h +++ b/include/preference_storage.h @@ -41,6 +41,8 @@ static const char *const PREF_TNC_SELF_TELEMETRY_INTERVAL = "tnc_tel_int"; static const char *const PREF_TNC_SELF_TELEMETRY_INTERVAL_INIT = "tnc_tel_int_i"; static const char *const PREF_TNC_SELF_TELEMETRY_SEQ = "tnc_tel_seq"; static const char *const PREF_TNC_SELF_TELEMETRY_SEQ_INIT = "tnc_tel_seq_i"; +static const char *const PREF_TNC_SELF_TELEMETRY_MIC = "tnc_tel_mic"; +static const char *const PREF_TNC_SELF_TELEMETRY_MIC_INIT = "tnc_tel_mic_i"; // SMART BEACONING static const char *const PREF_APRS_SB_MIN_INTERVAL_PRESET = "sb_min_interv"; static const char *const PREF_APRS_SB_MIN_INTERVAL_PRESET_INIT = "sb_min_interv_i"; diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 0dc6af8..787984e 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -123,6 +123,11 @@ int tel_sequence; #else boolean enable_tel = false; #endif +#ifdef TNC_SELF_TELEMETRY_MIC + int tel_mic = 1; // telemetry as "T#MIC" +#else + int tel_mic = 0; // telemetry as "T#001" +#endif #ifdef ENABLE_BLUETOOTH boolean enable_bluetooth = true; #else @@ -519,11 +524,17 @@ String prepareCallsign(const String& callsign){ #endif // Determine sequence number (or 'MIC') - tel_sequence = preferences.getUInt(PREF_TNC_SELF_TELEMETRY_SEQ, 0); - // Pad to 3 digits - char tel_sequence_char[3]; - sprintf_P(tel_sequence_char, "%03u", tel_sequence); - String tel_sequence_str = String(tel_sequence_char); + String tel_sequence_str; + if(tel_mic == 1){ + tel_sequence_str = "MIC"; + }else{ + // Get the current saved telemetry sequence + tel_sequence = preferences.getUInt(PREF_TNC_SELF_TELEMETRY_SEQ, 0); + // Pad to 3 digits + char tel_sequence_char[3]; + sprintf_P(tel_sequence_char, "%03u", tel_sequence); + tel_sequence_str = String(tel_sequence_char); + } 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"; @@ -669,6 +680,12 @@ void setup(){ } tel_sequence = preferences.getInt(PREF_TNC_SELF_TELEMETRY_SEQ); + if (!preferences.getBool(PREF_TNC_SELF_TELEMETRY_MIC_INIT)){ + preferences.putBool(PREF_TNC_SELF_TELEMETRY_MIC_INIT, true); + preferences.putInt(PREF_TNC_SELF_TELEMETRY_MIC, tel_mic); + } + tel_mic = preferences.getInt(PREF_TNC_SELF_TELEMETRY_MIC); + if (!preferences.getBool(PREF_APRS_LATITUDE_PRESET_INIT)){ preferences.putBool(PREF_APRS_LATITUDE_PRESET_INIT, true); preferences.putString(PREF_APRS_LATITUDE_PRESET, LATIDUDE_PRESET); diff --git a/src/taskWebServer.cpp b/src/taskWebServer.cpp index 3c801da..460b0c4 100644 --- a/src/taskWebServer.cpp +++ b/src/taskWebServer.cpp @@ -206,6 +206,7 @@ void handle_Cfg() { jsonData += jsonLineFromPreferenceBool(PREF_APRS_GPS_EN); jsonData += jsonLineFromPreferenceBool(PREF_ENABLE_TNC_SELF_TELEMETRY); jsonData += jsonLineFromPreferenceInt(PREF_TNC_SELF_TELEMETRY_INTERVAL); + jsonData += jsonLineFromPreferenceInt(PREF_TNC_SELF_TELEMETRY_MIC); jsonData += jsonLineFromPreferenceBool(PREF_DEV_OL_EN); jsonData += jsonLineFromPreferenceBool(PREF_APRS_SHOW_CMT); jsonData += jsonLineFromPreferenceBool(PREF_DEV_BT_EN); @@ -275,6 +276,9 @@ void handle_SaveAPRSCfg() { if (server.hasArg(PREF_TNC_SELF_TELEMETRY_INTERVAL)){ preferences.putInt(PREF_TNC_SELF_TELEMETRY_INTERVAL, server.arg(PREF_TNC_SELF_TELEMETRY_INTERVAL).toInt()); } + if (server.hasArg(PREF_TNC_SELF_TELEMETRY_MIC)){ + preferences.putInt(PREF_TNC_SELF_TELEMETRY_MIC, server.arg(PREF_TNC_SELF_TELEMETRY_MIC).toInt()); + } // Smart Beaconing settings if (server.hasArg(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET)){