listo nuevo tamaño texto
This commit is contained in:
parent
333c059e98
commit
257118c597
|
|
@ -35,7 +35,7 @@ uint32_t lastScreenOn = millis();
|
|||
std::vector<String> lastHeardStation;
|
||||
std::vector<String> 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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
extern Configuration Config;
|
||||
extern std::vector<String> lastHeardStation;
|
||||
extern std::vector<String> 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<lastHeardStation.size(); k++) {
|
||||
Serial.print(lastHeardStation[k].substring(0,lastHeardStation[k].indexOf(","))); Serial.print(" ");
|
||||
}
|
||||
Serial.println("");
|
||||
if (lastHeardStation.size() < 10) {
|
||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
||||
} else {
|
||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
||||
}
|
||||
}
|
||||
|
||||
bool wasHeard(String station) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ extern String fourthLine;
|
|||
extern String fifthLine;
|
||||
extern String sixthLine;
|
||||
extern String seventhLine;
|
||||
extern String eigthLine;
|
||||
extern uint32_t lastBeaconTx;
|
||||
extern uint32_t lastScreenOn;
|
||||
extern bool beacon_update;
|
||||
|
|
@ -66,16 +65,16 @@ void setupDiplay() {
|
|||
setup_display();
|
||||
digitalWrite(greenLed,HIGH);
|
||||
Serial.println("\nStarting iGate: " + Config.callsign + " Version: " + versionDate);
|
||||
show_display("", " LoRa APRS iGate", "", " Richonguzman", "", " -- CD2RXU --", "", " " + versionDate, 4000);
|
||||
show_display(" LoRa APRS", " ( iGate )", "", " Richonguzman", " -- CD2RXU --", "", " " + versionDate, 4000);
|
||||
digitalWrite(greenLed,LOW);
|
||||
firstLine = "LoRa iGate: " + Config.callsign;
|
||||
firstLine = Config.callsign;
|
||||
if (stationMode==3 || stationMode==4) {
|
||||
secondLine = "<DigiRepeater Active>";
|
||||
} else {
|
||||
secondLine = "";
|
||||
}
|
||||
seventhLine = "";
|
||||
eigthLine = " listening...";
|
||||
sixthLine = "";
|
||||
seventhLine = " listening...";
|
||||
}
|
||||
|
||||
void checkBeaconInterval() {
|
||||
|
|
@ -89,27 +88,27 @@ void checkBeaconInterval() {
|
|||
if (stationMode==1 || stationMode==2) {
|
||||
thirdLine = getLocalIP();
|
||||
STATION_Utils::deleteNotHeard();
|
||||
fourthLine = "Stations (" + String(Config.rememberStationTime) + "min) = ";
|
||||
if (lastHeardStation.size() < 10) {
|
||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
||||
} else {
|
||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
||||
fourthLine += " ";
|
||||
}
|
||||
fourthLine += String(lastHeardStation.size());
|
||||
fifthLine = "";
|
||||
sixthLine = "";
|
||||
seventhLine = "";
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, "SENDING iGate BEACON", 1000);
|
||||
eigthLine = " listening...";
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 1000);
|
||||
seventhLine = " listening...";
|
||||
if (Config.bme.active) {
|
||||
espClient.write((iGateBeaconPacket.substring(0,iGateBeaconPacket.indexOf(":=")+20) + "_" + BME_Utils::readDataSensor() + iGateBeaconPacket.substring(iGateBeaconPacket.indexOf(":=")+21) + " + WX" + "\n").c_str());
|
||||
} else {
|
||||
espClient.write((iGateBeaconPacket + "\n").c_str());
|
||||
}
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, eigthLine, 0);
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
||||
} else if (stationMode==3 || stationMode==4) {
|
||||
fourthLine = "";
|
||||
fifthLine = "";
|
||||
sixthLine = "";
|
||||
seventhLine = "";
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, "SENDING iGate BEACON", 0);
|
||||
eigthLine = " listening...";
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 0);
|
||||
seventhLine = " listening...";
|
||||
if (stationMode == 4) {
|
||||
LoRa_Utils::changeFreqTx();
|
||||
}
|
||||
|
|
@ -151,9 +150,9 @@ void typeOfPacket(String packet, String packetType) {
|
|||
String sender;
|
||||
if (stationMode==1 || stationMode==2) {
|
||||
if (packetType == "LoRa-APRS") {
|
||||
sixthLine = "LoRa Rx ----> APRS-IS";
|
||||
fifthLine = "LoRa Rx ----> APRS-IS";
|
||||
} else if (packetType == "APRS-LoRa") {
|
||||
sixthLine = "APRS-IS ----> LoRa Tx";
|
||||
fifthLine = "APRS-IS ----> LoRa Tx";
|
||||
}
|
||||
sender = packet.substring(0,packet.indexOf(">"));
|
||||
} 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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue