diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 2f4069d..291cfc5 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -35,7 +35,7 @@ uint32_t lastScreenOn = millis(); std::vector lastHeardStation; std::vector lastHeardStation_temp; -String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, eigthLine, iGateBeaconPacket; +String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, iGateBeaconPacket; void setup() { Serial.begin(115200); @@ -58,7 +58,7 @@ void loop() { APRS_IS_Utils::connect(); } APRS_IS_Utils::checkStatus(); - show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, eigthLine, 0); + show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); while (espClient.connected()) { Utils::checkDisplayInterval(); Utils::checkBeaconInterval(); diff --git a/src/aprs_is_utils.cpp b/src/aprs_is_utils.cpp index 7abbcc4..4b1c309 100644 --- a/src/aprs_is_utils.cpp +++ b/src/aprs_is_utils.cpp @@ -19,7 +19,7 @@ extern String fourthLine; extern String fifthLine; extern String sixthLine; extern String seventhLine; -extern String eigthLine; + namespace APRS_IS_Utils { @@ -114,7 +114,7 @@ void processLoRaPacket(String packet) { } LoRa_Utils::sendNewPacket("APRS", QUERY_Utils::process(receivedMessage, Sender, "LoRa")); lastScreenOn = millis(); - show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "Callsign = " + Sender, "TYPE --> QUERY", 0); + show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, "Callsign = " + Sender, "TYPE --> QUERY", 0); } } } @@ -129,7 +129,7 @@ void processLoRaPacket(String packet) { Serial.println(" ---> Uploaded to APRS-IS"); STATION_Utils::updateLastHeard(Sender); Utils::typeOfPacket(aprsPacket, "LoRa-APRS"); - show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, eigthLine, 0); + show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); } } } else { @@ -171,8 +171,8 @@ void processAPRSISPacket(String packet) { lastScreenOn = millis(); delay(500); espClient.write(queryAnswer.c_str()); - seventhLine = "Callsign = " + Sender; - eigthLine = "TYPE --> QUERY"; + sixthLine = "Callsign = " + Sender; + seventhLine = "TYPE --> QUERY"; } } else { Serial.print("Received from APRS-IS : " + packet); @@ -181,7 +181,7 @@ void processAPRSISPacket(String packet) { display_toggle(true); lastScreenOn = millis(); Utils::typeOfPacket(packet, "APRS-LoRa"); - show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, eigthLine, 0); + show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0); } } } diff --git a/src/display.cpp b/src/display.cpp index 857f80e..e466872 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -137,47 +137,22 @@ void show_display(String line1, String line2, String line3, String line4, String void show_display(String line1, String line2, String line3, String line4, String line5, String line6, String line7, int wait) { display.clearDisplay(); display.setTextColor(WHITE); - display.setTextSize(1); + display.setTextSize(2); display.setCursor(0, 0); display.println(line1); - display.setCursor(0, 8); - display.println(line2); - display.setCursor(0, 16); - display.println(line3); - display.setCursor(0, 24); - display.println(line4); - display.setCursor(0, 32); - display.println(line5); - display.setCursor(0, 40); - display.println(line6); - display.setCursor(0, 48); - display.println(line7); - display.ssd1306_command(SSD1306_SETCONTRAST); - display.ssd1306_command(1); - display.display(); - delay(wait); -} - -void show_display(String line1, String line2, String line3, String line4, String line5, String line6, String line7, String line8, int wait) { - display.clearDisplay(); - display.setTextColor(WHITE); display.setTextSize(1); - display.setCursor(0, 0); - display.println(line1); - display.setCursor(0, 8); - display.println(line2); display.setCursor(0, 16); - display.println(line3); + display.println(line2); display.setCursor(0, 24); - display.println(line4); + display.println(line3); display.setCursor(0, 32); - display.println(line5); + display.println(line4); display.setCursor(0, 40); - display.println(line6); + display.println(line5); display.setCursor(0, 48); - display.println(line7); + display.println(line6); display.setCursor(0, 56); - display.println(line8); + display.println(line7); display.ssd1306_command(SSD1306_SETCONTRAST); display.ssd1306_command(1); display.display(); diff --git a/src/display.h b/src/display.h index f0e7630..45f4246 100644 --- a/src/display.h +++ b/src/display.h @@ -18,6 +18,5 @@ void show_display(String line1, String line2, String line3, String line4, int wa void show_display(String line1, String line2, String line3, String line4, String line5, int wait = 0); void show_display(String line1, String line2, String line3, String line4, String line5, String line6, int wait = 0); void show_display(String line1, String line2, String line3, String line4, String line5, String line6, String line7, int wait = 0); -void show_display(String line1, String line2, String line3, String line4, String line5, String line6, String line7, String line8, int wait = 0); #endif \ No newline at end of file diff --git a/src/station_utils.cpp b/src/station_utils.cpp index 96d837b..4d9278a 100644 --- a/src/station_utils.cpp +++ b/src/station_utils.cpp @@ -5,7 +5,7 @@ extern Configuration Config; extern std::vector lastHeardStation; extern std::vector lastHeardStation_temp; -extern String fifthLine; +extern String fourthLine; namespace STATION_Utils { @@ -37,17 +37,18 @@ void updateLastHeard(String station) { lastHeardStation.push_back(station + "," + String(millis())); } + fourthLine = "Stations (" + String(Config.rememberStationTime) + "min) = "; + if (lastHeardStation.size() < 10) { + fourthLine += " "; + } + fourthLine += String(lastHeardStation.size()); + ////// Serial.print("Stations Near (last 30 minutes): "); for (int k=0; k")); } else { @@ -173,16 +172,16 @@ void typeOfPacket(String packet, String packetType) { } else { seventhLine = sender + "> MESSAGE"; } - eigthLine = "RSSI: 38dBm SNR: 6dBm"; + seventhLine = "RSSI: 38dBm SNR: 6dBm"; } else if (packet.indexOf(":>") >= 10) { - seventhLine = sender + "> NEW STATUS"; - eigthLine = "RSSI: 38dBm SNR: 6dBm"; + sixthLine = sender + "> NEW STATUS"; + seventhLine = "RSSI: 38dBm SNR: 6dBm"; } else if (packet.indexOf(":!") >= 10 || packet.indexOf(":=") >= 10) { - seventhLine = sender + "> GPS BEACON"; - eigthLine = "RSSI:38dBm D: 25.6km"; + sixthLine = sender + "> GPS BEACON"; + seventhLine = "RSSI:38dBm D: 25.6km"; } else { - seventhLine = sender + "> ??????????"; - eigthLine = "RSSI: 38dBm SNR: 6dBm"; + sixthLine = sender + "> ??????????"; + seventhLine = "RSSI: 38dBm SNR: 6dBm"; } }