Minor changes
- New Message indicator: - "private message" is now "m" - "winlink" is now "w" - Both: "M" - M / m is now cleared if you read your message on display (see below) - message ((MSG)): - changed date notation to mm-dd - fixed small bug in displaying the time - If you enter this menu item, new message-indicaor is cleared - middle button: if webserver is started - changed info text for display to make it more clear, that you now should release the button (to avoid factory reset on boot) - changed time to tread this from 2s to 3s - tnc: - fixed a bug when starting webserver via tnc cli - beauty: added blank for displaying debug level - display: in behind_position_tx, fillDisplayLine1(5) is not needed; we test this and commented it out. Signed-off-by: DL3EL <dl3el@darc.de> Signed-off-by: Thomas Osterried <dl9sau@darc.de>pull/12/head
rodzic
a8cf5ce0a1
commit
7dc1c3c728
|
@ -328,8 +328,10 @@ struct LastHeard LH[MAX_LH];
|
||||||
|
|
||||||
String RX_RAW_PACKET_LIST[3];
|
String RX_RAW_PACKET_LIST[3];
|
||||||
String LastRXMessage = "";
|
String LastRXMessage = "";
|
||||||
String LastRXMessageTimeAndSender = "";
|
String LastRXMessageSender = "";
|
||||||
uint8_t LastRXMessageInfo = 0; // bitmask: 1 personal aprs text message. 2 winlink message. 3 both. => Display maker: 1: "m", 2: "W", 3: "M"
|
String LastRXMessageTimeStr = "";
|
||||||
|
uint8_t LastRXMessageChanged = 0L;
|
||||||
|
uint8_t LastRXMessageInfo = 0; // bitmask: 1 personal aprs text message. 2 winlink message. 3 both. => Display maker: 1: "m", 2: "w", 3: "M"
|
||||||
|
|
||||||
//byte Variables
|
//byte Variables
|
||||||
byte lora_TXStart; //start of packet data in TXbuff
|
byte lora_TXStart; //start of packet data in TXbuff
|
||||||
|
@ -1649,17 +1651,13 @@ String getSatAndBatInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void fillDisplayLine1(int caller) {
|
void fillDisplayLine1(int caller) {
|
||||||
//static String OledLine1s = "";
|
|
||||||
//OledLine1_time = gps_time_s;
|
|
||||||
// OledLine1s = " Up:" + String(millis()/1000/60) + "m";
|
|
||||||
|
|
||||||
if (freeze_display)
|
if (freeze_display)
|
||||||
return;
|
return;
|
||||||
if (debug_verbose > 2)
|
if (debug_verbose > 2)
|
||||||
Serial.printf("fillDisplayLine1 caller:%d button_down:%d\r\n",caller, freeze_display);
|
Serial.printf("fillDisplayLine1 caller:%d button_down:%d\r\n",caller, freeze_display);
|
||||||
static uint32_t old_time = 0L;
|
static uint32_t old_time = 0L;
|
||||||
uint32_t t = millis() / 1000;
|
uint32_t t = millis() / 1000;
|
||||||
char s_uptime[9]; // room for 49d17:02 + \0 -> 9 bytes
|
char s_uptime[6]; // room for 49d17 + \0 -> 6 bytes
|
||||||
|
|
||||||
// > 49d 17h 2min? millis-overflow -> mark it
|
// > 49d 17h 2min? millis-overflow -> mark it
|
||||||
if (t < old_time)
|
if (t < old_time)
|
||||||
|
@ -1672,14 +1670,12 @@ void fillDisplayLine1(int caller) {
|
||||||
int h = ((t / 60 / 60) % 24);
|
int h = ((t / 60 / 60) % 24);
|
||||||
int m = ((t / 60) % 60);
|
int m = ((t / 60) % 60);
|
||||||
if (d)
|
if (d)
|
||||||
sprintf(s_uptime, "%dd%2.2d:%2.2d", d, h, m);
|
sprintf(s_uptime, "%2dd%2.2d", d % 100, h);
|
||||||
else
|
else
|
||||||
sprintf(s_uptime, "%2.2d:%2.2d", h, m);
|
sprintf(s_uptime, "%2.2d:%2.2d", h, m);
|
||||||
old_time = t;
|
old_time = t;
|
||||||
}
|
}
|
||||||
OledLine1 = String("Up ") + String(s_uptime);
|
OledLine1 = String("Up:") + String(s_uptime);
|
||||||
if (*gps_time_s)
|
|
||||||
OledLine1 = String(gps_time_s) + String(" ") + OledLine1;
|
|
||||||
if (LastRXMessageInfo == 3) {
|
if (LastRXMessageInfo == 3) {
|
||||||
// winlink and personal message -> "M"
|
// winlink and personal message -> "M"
|
||||||
OledLine1 += " M";
|
OledLine1 += " M";
|
||||||
|
@ -1689,7 +1685,7 @@ void fillDisplayLine1(int caller) {
|
||||||
} else if (winlink_notified != 0L) {
|
} else if (winlink_notified != 0L) {
|
||||||
if (winlink_notified + 60*60*24*1000L > millis()) {
|
if (winlink_notified + 60*60*24*1000L > millis()) {
|
||||||
// show winlink mail info for max 24h
|
// show winlink mail info for max 24h
|
||||||
OledLine1 += " W";
|
OledLine1 += " w";
|
||||||
} else {
|
} else {
|
||||||
// reset
|
// reset
|
||||||
winlink_notified = 0L;
|
winlink_notified = 0L;
|
||||||
|
@ -1698,6 +1694,8 @@ void fillDisplayLine1(int caller) {
|
||||||
LastRXMessageInfo &= ~2;
|
LastRXMessageInfo &= ~2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (*gps_time_s)
|
||||||
|
OledLine1 = String(gps_time_s) + String(" ") + OledLine1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fillDisplayLine2() {
|
void fillDisplayLine2() {
|
||||||
|
@ -5027,9 +5025,9 @@ void handle_usb_serial_input(void) {
|
||||||
if (cmd == "debug") {
|
if (cmd == "debug") {
|
||||||
if (arg != "") {
|
if (arg != "") {
|
||||||
debug_verbose = arg.toInt();
|
debug_verbose = arg.toInt();
|
||||||
Serial.printf("Debug Level now:%d (Arg: %s)\r\n", debug_verbose, arg.c_str());
|
Serial.printf("Debug Level now: %d (Arg: %s)\r\n", debug_verbose, arg.c_str());
|
||||||
} else {
|
} else {
|
||||||
Serial.printf("Debug Level:%d\r\n", debug_verbose);
|
Serial.printf("Debug Level: %d\r\n", debug_verbose);
|
||||||
}
|
}
|
||||||
Serial.print("cmd:");
|
Serial.print("cmd:");
|
||||||
inputBuf = "";
|
inputBuf = "";
|
||||||
|
@ -5297,7 +5295,7 @@ void handle_usb_serial_input(void) {
|
||||||
} else if (cmd == "wifi") {
|
} else if (cmd == "wifi") {
|
||||||
if (arg != "") {
|
if (arg != "") {
|
||||||
#ifdef ENABLE_PREFERENCES
|
#ifdef ENABLE_PREFERENCES
|
||||||
preferences.putInt(PREF_WIFI_ENABLE, (arg_bool) ? 0 : 1);
|
preferences.putInt(PREF_WIFI_ENABLE, arg_bool ? 1 : 0);
|
||||||
#if defined(ENABLE_SYSLOG)
|
#if defined(ENABLE_SYSLOG)
|
||||||
if (debug_verbose)
|
if (debug_verbose)
|
||||||
syslog_log(LOG_DEBUG, String("FlashWrite preferences: handle_usb_serial_input() 5"));
|
syslog_log(LOG_DEBUG, String("FlashWrite preferences: handle_usb_serial_input() 5"));
|
||||||
|
@ -5322,6 +5320,8 @@ void handle_usb_serial_input(void) {
|
||||||
delay(1500);
|
delay(1500);
|
||||||
esp_task_wdt_reset();
|
esp_task_wdt_reset();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
enable_webserver = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Serial.println("*** " + cmd + " is " + (enable_webserver ? "on" : "off"));
|
Serial.println("*** " + cmd + " is " + (enable_webserver ? "on" : "off"));
|
||||||
|
@ -5462,13 +5462,18 @@ String handle_aprs_messsage_addressed_to_us(const char *received_frame) {
|
||||||
*q = 0;
|
*q = 0;
|
||||||
enableOled_now(); // enable OLED
|
enableOled_now(); // enable OLED
|
||||||
freeze_display = true;
|
freeze_display = true;
|
||||||
String RXMessageTimeAndSender;
|
String RXMessageSender = String(msg_from);
|
||||||
if (*gps_time_s)
|
String RXMessageTimeAndSender = RXMessageSender + ":";
|
||||||
RXMessageTimeAndSender = String(gps_time_s);
|
|
||||||
else
|
|
||||||
RXMessageTimeAndSender = String("@up ") + compute_time_since_received(millis()/1000);
|
|
||||||
RXMessageTimeAndSender = RXMessageTimeAndSender + String(" ") + String(msg_from) + ":";
|
|
||||||
String RXMessage = String(header_normal_or_third_party_end + 11+1);
|
String RXMessage = String(header_normal_or_third_party_end + 11+1);
|
||||||
|
String RXMessageTimeStr = "";
|
||||||
|
struct tm timeinfo;
|
||||||
|
if (getLocalTimeTheBetterWay(&timeinfo)) {
|
||||||
|
char buf[12]; // Room for "03-22 06:08" + \0
|
||||||
|
strftime(buf, sizeof(buf), "%m-%d %H:%M", &timeinfo);
|
||||||
|
RXMessageTimeStr = String(buf);
|
||||||
|
// Add time to front
|
||||||
|
RXMessageTimeAndSender = RXMessageTimeStr + " " + RXMessageTimeAndSender;
|
||||||
|
}
|
||||||
writedisplaytext(" ((MSG))",RXMessageTimeAndSender,RXMessage,"","","");
|
writedisplaytext(" ((MSG))",RXMessageTimeAndSender,RXMessage,"","","");
|
||||||
if (add_winlink_notification &&
|
if (add_winlink_notification &&
|
||||||
!strncmp(header_normal_or_third_party_start, "WLNK-1", 6) && header_normal_or_third_party_start[6] == '>' &&
|
!strncmp(header_normal_or_third_party_start, "WLNK-1", 6) && header_normal_or_third_party_start[6] == '>' &&
|
||||||
|
@ -5478,15 +5483,19 @@ String handle_aprs_messsage_addressed_to_us(const char *received_frame) {
|
||||||
LastRXMessageInfo |= 2;
|
LastRXMessageInfo |= 2;
|
||||||
if (!(LastRXMessageInfo & 1)) {
|
if (!(LastRXMessageInfo & 1)) {
|
||||||
// Store message
|
// Store message
|
||||||
LastRXMessageTimeAndSender = String(RXMessageTimeAndSender);
|
LastRXMessageSender = String(RXMessageSender);
|
||||||
|
LastRXMessageTimeStr = String(RXMessageTimeStr);
|
||||||
LastRXMessage = String(RXMessage);
|
LastRXMessage = String(RXMessage);
|
||||||
|
LastRXMessageChanged = millis();
|
||||||
}
|
}
|
||||||
winlink_notified = millis();
|
winlink_notified = millis();
|
||||||
} else {
|
} else {
|
||||||
// Store message
|
// Store message
|
||||||
LastRXMessageInfo |= 1;
|
LastRXMessageInfo |= 1;
|
||||||
LastRXMessageTimeAndSender = String(RXMessageTimeAndSender);
|
LastRXMessageSender = String(RXMessageSender);
|
||||||
|
LastRXMessageTimeStr = String(RXMessageTimeStr);
|
||||||
LastRXMessage = String(RXMessage);
|
LastRXMessage = String(RXMessage);
|
||||||
|
LastRXMessageChanged = millis();
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_WIFI
|
#ifdef ENABLE_WIFI
|
||||||
// TODO: add message to a new-to-implement web-received-list-for-aps-messages
|
// TODO: add message to a new-to-implement web-received-list-for-aps-messages
|
||||||
|
@ -5753,21 +5762,29 @@ void loop()
|
||||||
if (button_down_count == 1) {
|
if (button_down_count == 1) {
|
||||||
write_last_heard_calls_with_distance_and_course_to_display();
|
write_last_heard_calls_with_distance_and_course_to_display();
|
||||||
} else if (button_down_count == 2) {
|
} else if (button_down_count == 2) {
|
||||||
writedisplaytext("((MSG))",LastRXMessageTimeAndSender,LastRXMessage,"","","");
|
String RXMessageTimeAndSender = "";
|
||||||
} else if (button_down_count == 2) {
|
if (!LastRXMessageSender.isEmpty()) {
|
||||||
writedisplaytext("((BN))","","BuildNr:" + buildnr,"by DL9SAU & DL3EL","","");
|
String RXMessageTimeStr;
|
||||||
|
if (LastRXMessageTimeStr.isEmpty()) {
|
||||||
|
RXMessageTimeStr = compute_time_since_received(millis()/1000L - LastRXMessageChanged/1000L) + " ago";
|
||||||
|
} else {
|
||||||
|
RXMessageTimeStr = LastRXMessageTimeStr;
|
||||||
|
}
|
||||||
|
RXMessageTimeAndSender = RXMessageTimeStr + " " + LastRXMessageSender + ":";
|
||||||
|
}
|
||||||
|
writedisplaytext("((MSG))",RXMessageTimeAndSender,LastRXMessage,"","","");
|
||||||
|
// Message has been displayed, we can remove the "new message-indicator"
|
||||||
|
if (LastRXMessageInfo & 2) {
|
||||||
|
// last received was a winlink notification and we just read that message
|
||||||
|
winlink_notified = 0L;
|
||||||
|
}
|
||||||
|
LastRXMessageInfo = 0;
|
||||||
} else if (button_down_count < 6) {
|
} else if (button_down_count < 6) {
|
||||||
int n = button_down_count-3;
|
int n = button_down_count-3;
|
||||||
writedisplaytext("RX raw-" + String(n+1),"",RX_RAW_PACKET_LIST[n],"","","");
|
writedisplaytext("RX raw-" + String(n+1),"",RX_RAW_PACKET_LIST[n],"","","");
|
||||||
time_to_refresh = millis() + showRXTime;
|
time_to_refresh = millis() + showRXTime;
|
||||||
} else if (button_down_count == 6) {
|
} else if (button_down_count == 6) {
|
||||||
writedisplaytext("((BN))","BuildNr:" + buildnr,"by DL9SAU & DL3EL","","next press: tx bcn","or wait ...");
|
writedisplaytext("((BN))","BuildNr:" + buildnr,"by DL9SAU & DL3EL","","next press: tx bcn","or wait ...");
|
||||||
// If we cycled through to this last page, we can remove the "new message-indicator"
|
|
||||||
if (LastRXMessageInfo & 2) {
|
|
||||||
// last received was a winlink notification and we just read that message
|
|
||||||
winlink_notified = 0L;
|
|
||||||
}
|
|
||||||
LastRXMessageInfo = 0;
|
|
||||||
} else if (button_down_count == 7) {
|
} else if (button_down_count == 7) {
|
||||||
button_down_count = 0;
|
button_down_count = 0;
|
||||||
if (lora_tx_enabled || aprsis_enabled) {
|
if (lora_tx_enabled || aprsis_enabled) {
|
||||||
|
@ -6059,16 +6076,16 @@ if (t_elapsed > 15000L && ((curr_hdop < 1.5 && curr_sats >= 4) || gps_isValid !=
|
||||||
webServerCfg = {.callsign = Tcall};
|
webServerCfg = {.callsign = Tcall};
|
||||||
xTaskCreate(taskWebServer, "taskWebServer", 12000, (void*)(&webServerCfg), 1, nullptr);
|
xTaskCreate(taskWebServer, "taskWebServer", 12000, (void*)(&webServerCfg), 1, nullptr);
|
||||||
webserverStarted = true;
|
webserverStarted = true;
|
||||||
writedisplaytext("LoRa-APRS","","Button:","WiFi task started","long press to ","stop again");
|
writedisplaytext("LoRa-APRS","","Button:","WiFi task started","long press to ","stop again (->reboot)");
|
||||||
esp_task_wdt_reset();
|
esp_task_wdt_reset();
|
||||||
delay(1500);
|
delay(3000);
|
||||||
esp_task_wdt_reset();
|
esp_task_wdt_reset();
|
||||||
} else {
|
} else {
|
||||||
writedisplaytext("LoRa-APRS","","Rebooting:","to stop WiFi","do not press key","");
|
writedisplaytext("LoRa-APRS","","Button:","Rebooting,","for stoping WiFi.","Release Button now!");
|
||||||
#ifdef ENABLE_WIFI
|
#ifdef ENABLE_WIFI
|
||||||
do_send_status_message_about_reboot_to_aprsis();
|
do_send_status_message_about_reboot_to_aprsis();
|
||||||
#endif
|
#endif
|
||||||
delay(2000);
|
delay(3000);
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -6161,10 +6178,10 @@ if (t_elapsed > 15000L && ((curr_hdop < 1.5 && curr_sats >= 4) || gps_isValid !=
|
||||||
if (shutdown_active && shutdown_countdown_timer_enable) {
|
if (shutdown_active && shutdown_countdown_timer_enable) {
|
||||||
shutdown_countdown_timer_enable = false;
|
shutdown_countdown_timer_enable = false;
|
||||||
writedisplaytext("((ABORT))","External Power","plugged in","Shutdown aborted","","");
|
writedisplaytext("((ABORT))","External Power","plugged in","Shutdown aborted","","");
|
||||||
|
freeze_display = true;
|
||||||
} else {
|
} else {
|
||||||
writedisplaytext("((POWER))","External Power","plugged in","","","");
|
writedisplaytext("((POWER))","External Power","plugged in","","","");
|
||||||
}
|
}
|
||||||
freeze_display = true;
|
|
||||||
usb_status_before = true;
|
usb_status_before = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -6912,8 +6929,8 @@ behind_position_tx:
|
||||||
displayInvalidGPS();
|
displayInvalidGPS();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// refresh time
|
// refresh time -> check if necessary
|
||||||
fillDisplayLine1(5);
|
//fillDisplayLine1(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue