diff --git a/README.md b/README.md index 449b298..5eb5393 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ After connection with APRX based DIGI it can be used as KISS-TNC ## User key functions: ### short press (OLED Enabled): -* if OLED is OFF a short press will wake it up and show current data +* if OLED is OFF a short press will wake it up and show current data (as "Display Timeout" seconds) * if OLED is ON with GPS-FIX immediate sending of a frame with the position from the GPS * if OLED is ON without GPS-FIX, immediate sending of the frame with the position saved in the configuration @@ -68,12 +68,38 @@ Wait for the board to reboot, connect to "N0CALL AP" WiFi network, password is: ### WiFi Settings you can scan for local SSID or manually type in name and password +* Scan WiFi: scan for local WiFi networks +* SSID: name of the AP to connect to +* Password: password of WiFi AP ### APRS Settings -These are main APRS settings such as callsign, SSID and symbol (refer to: http://www.aprs.org/symbols.html). Please remember to turn ON GPS in order to use it as a tracker +These are main APRS settings such as callsign, SSID and symbol (refer to: http://www.aprs.org/symbols.html). Please remember to turn ON GPS in order to use it as a tracker. +* Frequency: frequency of receive and transmit +* Speed: speed of the LoRa APRS packet (default: 300) +* Callsign and SSID: Callsign of the tracker (e.g: N0CALL-10) +* Relay PATH: destination path of APRS packet +* Symbol table & Symbol: custom APRS icon +* Show altitude: allow altitude to be reported +* Show comment: includes comment in APRS packet +* Comment: custom message to send +* Show Battery: includes current battery voltage +* Fixed beacon: enables static beacon transmission +* Fixed beacon interval: beacon interval in seconds (please more than 30 minutes to avoid overflow on the network) +* Latitude & Longitude: fixed beacon position to transmit (in APRS format) +* Min interval: packet are transmitted not less than x second apart +* Max interval: maximum interval between packages +* Speed and course: variables to calculate smart beaconing +* GPS enabled: enables power to GPS module ### Device Settings -These are main device settings, hover the mouse on the checkboxes and explainations will appear Note: as of 09/2021 "Auto Power OFF" is enabled only with TBEAM 1.0, it will turn board off after unplugging USB +These are main device settings, hover the mouse on the checkboxes and explainations will appear. +* OLED Display enabled: Enables OLED functionalities +* Bluetooth enabled: Enables bluetooth functions (such as TNC via APRSDROID) +* LED Signaling: not yet implemented +* Auto Power OFF: activate auto power off when USB is unplugged (only for TBEAM 1.0 or later) +* Auto Power OFF delay: timer to turn off board after USB is unplugged (only if enabled) +* Display show RX Time: when a packet is received display the packet is shown for X seconds +* Display Timeout: display will turn OFF after X seconds for better power save (0 to disable and keep OLED ON) ### Received Here is the list of recently received stations with some details diff --git a/data_embed/index.html b/data_embed/index.html index df8bb67..0ca51c3 100644 --- a/data_embed/index.html +++ b/data_embed/index.html @@ -25,13 +25,17 @@
- +
- +
+
+ + +
@@ -167,7 +171,7 @@
- +
@@ -184,17 +188,18 @@
- +
- + +
- +
diff --git a/data_embed/style.css b/data_embed/style.css index 6f2db9d..8d5b22e 100644 --- a/data_embed/style.css +++ b/data_embed/style.css @@ -477,8 +477,8 @@ html { padding: 20px; text-align: center; display: grid; - grid-gap: 20px; - gap: 20px; + grid-gap: 5px; + gap: 5px; /* by default use min 200px wide columns auto-fit into width */ grid-template-columns: minmax(200px, 1fr); diff --git a/include/preference_storage.h b/include/preference_storage.h index 1d539da..fc883be 100644 --- a/include/preference_storage.h +++ b/include/preference_storage.h @@ -3,7 +3,6 @@ #ifndef PREF_STORAGE #define PREF_STORAGE - #define ENABLE_PREFERENCES extern Preferences preferences; @@ -47,7 +46,7 @@ static const char *const PREF_APRS_SB_MAX_SPEED_PRESET_INIT = "sb_max_speed_i"; static const char *const PREF_APRS_SB_ANGLE_PRESET = "sb_angle"; static const char *const PREF_APRS_SB_ANGLE_PRESET_INIT = "sb_angle_i"; -// +// Device settings static const char *const PREF_APRS_GPS_EN = "gps_enabled"; static const char *const PREF_APRS_GPS_EN_INIT = "gps_state_init"; static const char *const PREF_APRS_SHOW_CMT = "show_cmt"; @@ -62,6 +61,7 @@ static const char *const PREF_DEV_AUTO_SHUT = "shutdown_act"; static const char *const PREF_DEV_AUTO_SHUT_INIT = "shutdown_actini"; static const char *const PREF_DEV_AUTO_SHUT_PRESET = "shutdown_dt"; static const char *const PREF_DEV_AUTO_SHUT_PRESET_INIT = "shutdown_dtini"; - +static const char *const PREF_DEV_SHOW_OLED_TIME = "sh_oledtime"; // set OLED timeout +static const char *const PREF_DEV_SHOW_OLED_TIME_INIT = "sh_oledtime_i"; #endif diff --git a/platformio.ini b/platformio.ini index 6bbdc56..789c4e3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -52,6 +52,7 @@ build_flags = -D 'MAX_TIME_TO_NEXT_TX=120000L' ; can be set from www interfeace -D 'FIX_BEACON_INTERVAL=1800000L' ; can be set from www interfeace -D 'NETWORK_GPS_PORT=10110' ; GPS NMEA Port + -D 'SHOW_OLED_TIME=15000' ; OLED Timeout [env:ttgo-t-beam-v1.0] platform = espressif32 @ 3.0.0 diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 1ca29f8..eb3a5c2 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -184,9 +184,9 @@ boolean shutdown_usb_status_bef = false; // Variables required to Power Save OLED // With "Display dimmer enabled" it will turn OLED off after some time // if the checkbox is disabled the display stays OFF -uint oled_timeout; // OLED Timeout, same as "Display show RX Time" +uint oled_timeout = SHOW_OLED_TIME; // OLED Timeout bool tempOled = true; // Turn ON OLED at first startup -ulong oled_timer = millis(); +ulong oled_timer; // Variable to manually send beacon from html page bool manBeacon = false; @@ -671,8 +671,13 @@ void setup(){ preferences.putInt(PREF_DEV_SHOW_RX_TIME, showRXTime/1000); } showRXTime = preferences.getInt(PREF_DEV_SHOW_RX_TIME) * 1000; - // Use same timer for OLED timeout - oled_timeout = showRXTime; + + // Read OLED RX Timer + if (!preferences.getBool(PREF_DEV_SHOW_OLED_TIME_INIT)){ + preferences.putBool(PREF_DEV_SHOW_OLED_TIME_INIT, true); + preferences.putInt(PREF_DEV_SHOW_OLED_TIME, oled_timeout/1000); + } + oled_timeout = preferences.getInt(PREF_DEV_SHOW_OLED_TIME) * 1000; if (!preferences.getBool(PREF_DEV_AUTO_SHUT_PRESET_INIT)){ preferences.putBool(PREF_DEV_AUTO_SHUT_PRESET_INIT, true); @@ -839,6 +844,9 @@ void setup(){ time_to_refresh = millis() + showRXTime; displayInvalidGPS(); digitalWrite(TXLED, HIGH); + + // Hold the OLED ON at first boot + oled_timer=millis()+oled_timeout; } void enableOled() { @@ -875,6 +883,7 @@ void loop() { } if (manBeacon) { + // Manually sending beacon from html page enableOled(); writedisplaytext("((WEB TX))","","","","",""); sendpacket(); @@ -882,7 +891,12 @@ void loop() { } // Only wake up OLED when necessary, note that DIM is to turn OFF the backlight if (enabled_oled) { - display.dim(!tempOled); + if (oled_timeout>0) { + display.dim(!tempOled); + } else { + // If timeout is 0 keep OLED awake + display.dim(false); + } } if (tempOled && millis()>= oled_timer) { diff --git a/src/taskWebServer.cpp b/src/taskWebServer.cpp index 5f750ac..1f0b987 100644 --- a/src/taskWebServer.cpp +++ b/src/taskWebServer.cpp @@ -185,6 +185,7 @@ void handle_Cfg() { jsonData += jsonLineFromPreferenceInt(PREF_DEV_SHOW_RX_TIME); jsonData += jsonLineFromPreferenceBool(PREF_DEV_AUTO_SHUT); jsonData += jsonLineFromPreferenceInt(PREF_DEV_AUTO_SHUT_PRESET); + jsonData += jsonLineFromPreferenceInt(PREF_DEV_SHOW_OLED_TIME); jsonData += jsonLineFromInt("FreeHeap", ESP.getFreeHeap()); jsonData += jsonLineFromInt("HeapSize", ESP.getHeapSize()); jsonData += jsonLineFromInt("FreeSketchSpace", ESP.getFreeSketchSpace()); @@ -280,6 +281,10 @@ void handle_saveDeviceCfg(){ if (server.hasArg(PREF_DEV_SHOW_RX_TIME)){ preferences.putInt(PREF_DEV_SHOW_RX_TIME, server.arg(PREF_DEV_SHOW_RX_TIME).toInt()); } + // Manage OLED Timeout + if (server.hasArg(PREF_DEV_SHOW_OLED_TIME)){ + preferences.putInt(PREF_DEV_SHOW_OLED_TIME, server.arg(PREF_DEV_SHOW_OLED_TIME).toInt()); + } preferences.putBool(PREF_DEV_AUTO_SHUT, server.hasArg(PREF_DEV_AUTO_SHUT)); if (server.hasArg(PREF_DEV_AUTO_SHUT_PRESET)){ preferences.putInt(PREF_DEV_AUTO_SHUT_PRESET, server.arg(PREF_DEV_AUTO_SHUT_PRESET).toInt());