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;
|
||||||
std::vector<String> lastHeardStation_temp;
|
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() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
@ -58,7 +58,7 @@ void loop() {
|
||||||
APRS_IS_Utils::connect();
|
APRS_IS_Utils::connect();
|
||||||
}
|
}
|
||||||
APRS_IS_Utils::checkStatus();
|
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()) {
|
while (espClient.connected()) {
|
||||||
Utils::checkDisplayInterval();
|
Utils::checkDisplayInterval();
|
||||||
Utils::checkBeaconInterval();
|
Utils::checkBeaconInterval();
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ extern String fourthLine;
|
||||||
extern String fifthLine;
|
extern String fifthLine;
|
||||||
extern String sixthLine;
|
extern String sixthLine;
|
||||||
extern String seventhLine;
|
extern String seventhLine;
|
||||||
extern String eigthLine;
|
|
||||||
|
|
||||||
namespace APRS_IS_Utils {
|
namespace APRS_IS_Utils {
|
||||||
|
|
||||||
|
|
@ -114,7 +114,7 @@ void processLoRaPacket(String packet) {
|
||||||
}
|
}
|
||||||
LoRa_Utils::sendNewPacket("APRS", QUERY_Utils::process(receivedMessage, Sender, "LoRa"));
|
LoRa_Utils::sendNewPacket("APRS", QUERY_Utils::process(receivedMessage, Sender, "LoRa"));
|
||||||
lastScreenOn = millis();
|
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");
|
Serial.println(" ---> Uploaded to APRS-IS");
|
||||||
STATION_Utils::updateLastHeard(Sender);
|
STATION_Utils::updateLastHeard(Sender);
|
||||||
Utils::typeOfPacket(aprsPacket, "LoRa-APRS");
|
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 {
|
} else {
|
||||||
|
|
@ -171,8 +171,8 @@ void processAPRSISPacket(String packet) {
|
||||||
lastScreenOn = millis();
|
lastScreenOn = millis();
|
||||||
delay(500);
|
delay(500);
|
||||||
espClient.write(queryAnswer.c_str());
|
espClient.write(queryAnswer.c_str());
|
||||||
seventhLine = "Callsign = " + Sender;
|
sixthLine = "Callsign = " + Sender;
|
||||||
eigthLine = "TYPE --> QUERY";
|
seventhLine = "TYPE --> QUERY";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Serial.print("Received from APRS-IS : " + packet);
|
Serial.print("Received from APRS-IS : " + packet);
|
||||||
|
|
@ -181,7 +181,7 @@ void processAPRSISPacket(String packet) {
|
||||||
display_toggle(true);
|
display_toggle(true);
|
||||||
lastScreenOn = millis();
|
lastScreenOn = millis();
|
||||||
Utils::typeOfPacket(packet, "APRS-LoRa");
|
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) {
|
void show_display(String line1, String line2, String line3, String line4, String line5, String line6, String line7, int wait) {
|
||||||
display.clearDisplay();
|
display.clearDisplay();
|
||||||
display.setTextColor(WHITE);
|
display.setTextColor(WHITE);
|
||||||
display.setTextSize(1);
|
display.setTextSize(2);
|
||||||
display.setCursor(0, 0);
|
display.setCursor(0, 0);
|
||||||
display.println(line1);
|
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.setTextSize(1);
|
||||||
display.setCursor(0, 0);
|
|
||||||
display.println(line1);
|
|
||||||
display.setCursor(0, 8);
|
|
||||||
display.println(line2);
|
|
||||||
display.setCursor(0, 16);
|
display.setCursor(0, 16);
|
||||||
display.println(line3);
|
display.println(line2);
|
||||||
display.setCursor(0, 24);
|
display.setCursor(0, 24);
|
||||||
display.println(line4);
|
display.println(line3);
|
||||||
display.setCursor(0, 32);
|
display.setCursor(0, 32);
|
||||||
display.println(line5);
|
display.println(line4);
|
||||||
display.setCursor(0, 40);
|
display.setCursor(0, 40);
|
||||||
display.println(line6);
|
display.println(line5);
|
||||||
display.setCursor(0, 48);
|
display.setCursor(0, 48);
|
||||||
display.println(line7);
|
display.println(line6);
|
||||||
display.setCursor(0, 56);
|
display.setCursor(0, 56);
|
||||||
display.println(line8);
|
display.println(line7);
|
||||||
display.ssd1306_command(SSD1306_SETCONTRAST);
|
display.ssd1306_command(SSD1306_SETCONTRAST);
|
||||||
display.ssd1306_command(1);
|
display.ssd1306_command(1);
|
||||||
display.display();
|
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, 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, 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, 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
|
#endif
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
extern Configuration Config;
|
extern Configuration Config;
|
||||||
extern std::vector<String> lastHeardStation;
|
extern std::vector<String> lastHeardStation;
|
||||||
extern std::vector<String> lastHeardStation_temp;
|
extern std::vector<String> lastHeardStation_temp;
|
||||||
extern String fifthLine;
|
extern String fourthLine;
|
||||||
|
|
||||||
namespace STATION_Utils {
|
namespace STATION_Utils {
|
||||||
|
|
||||||
|
|
@ -37,17 +37,18 @@ void updateLastHeard(String station) {
|
||||||
lastHeardStation.push_back(station + "," + String(millis()));
|
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): ");
|
Serial.print("Stations Near (last 30 minutes): ");
|
||||||
for (int k=0; k<lastHeardStation.size(); k++) {
|
for (int k=0; k<lastHeardStation.size(); k++) {
|
||||||
Serial.print(lastHeardStation[k].substring(0,lastHeardStation[k].indexOf(","))); Serial.print(" ");
|
Serial.print(lastHeardStation[k].substring(0,lastHeardStation[k].indexOf(","))); Serial.print(" ");
|
||||||
}
|
}
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
if (lastHeardStation.size() < 10) {
|
|
||||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
|
||||||
} else {
|
|
||||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wasHeard(String station) {
|
bool wasHeard(String station) {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ extern String fourthLine;
|
||||||
extern String fifthLine;
|
extern String fifthLine;
|
||||||
extern String sixthLine;
|
extern String sixthLine;
|
||||||
extern String seventhLine;
|
extern String seventhLine;
|
||||||
extern String eigthLine;
|
|
||||||
extern uint32_t lastBeaconTx;
|
extern uint32_t lastBeaconTx;
|
||||||
extern uint32_t lastScreenOn;
|
extern uint32_t lastScreenOn;
|
||||||
extern bool beacon_update;
|
extern bool beacon_update;
|
||||||
|
|
@ -66,16 +65,16 @@ void setupDiplay() {
|
||||||
setup_display();
|
setup_display();
|
||||||
digitalWrite(greenLed,HIGH);
|
digitalWrite(greenLed,HIGH);
|
||||||
Serial.println("\nStarting iGate: " + Config.callsign + " Version: " + versionDate);
|
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);
|
digitalWrite(greenLed,LOW);
|
||||||
firstLine = "LoRa iGate: " + Config.callsign;
|
firstLine = Config.callsign;
|
||||||
if (stationMode==3 || stationMode==4) {
|
if (stationMode==3 || stationMode==4) {
|
||||||
secondLine = "<DigiRepeater Active>";
|
secondLine = "<DigiRepeater Active>";
|
||||||
} else {
|
} else {
|
||||||
secondLine = "";
|
secondLine = "";
|
||||||
}
|
}
|
||||||
seventhLine = "";
|
sixthLine = "";
|
||||||
eigthLine = " listening...";
|
seventhLine = " listening...";
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkBeaconInterval() {
|
void checkBeaconInterval() {
|
||||||
|
|
@ -89,27 +88,27 @@ void checkBeaconInterval() {
|
||||||
if (stationMode==1 || stationMode==2) {
|
if (stationMode==1 || stationMode==2) {
|
||||||
thirdLine = getLocalIP();
|
thirdLine = getLocalIP();
|
||||||
STATION_Utils::deleteNotHeard();
|
STATION_Utils::deleteNotHeard();
|
||||||
|
fourthLine = "Stations (" + String(Config.rememberStationTime) + "min) = ";
|
||||||
if (lastHeardStation.size() < 10) {
|
if (lastHeardStation.size() < 10) {
|
||||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
fourthLine += " ";
|
||||||
} else {
|
|
||||||
fifthLine = "Stations (30min) = " + String(lastHeardStation.size());
|
|
||||||
}
|
}
|
||||||
|
fourthLine += String(lastHeardStation.size());
|
||||||
|
fifthLine = "";
|
||||||
sixthLine = "";
|
sixthLine = "";
|
||||||
seventhLine = "";
|
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 1000);
|
||||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, "SENDING iGate BEACON", 1000);
|
seventhLine = " listening...";
|
||||||
eigthLine = " listening...";
|
|
||||||
if (Config.bme.active) {
|
if (Config.bme.active) {
|
||||||
espClient.write((iGateBeaconPacket.substring(0,iGateBeaconPacket.indexOf(":=")+20) + "_" + BME_Utils::readDataSensor() + iGateBeaconPacket.substring(iGateBeaconPacket.indexOf(":=")+21) + " + WX" + "\n").c_str());
|
espClient.write((iGateBeaconPacket.substring(0,iGateBeaconPacket.indexOf(":=")+20) + "_" + BME_Utils::readDataSensor() + iGateBeaconPacket.substring(iGateBeaconPacket.indexOf(":=")+21) + " + WX" + "\n").c_str());
|
||||||
} else {
|
} else {
|
||||||
espClient.write((iGateBeaconPacket + "\n").c_str());
|
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) {
|
} else if (stationMode==3 || stationMode==4) {
|
||||||
|
fourthLine = "";
|
||||||
fifthLine = "";
|
fifthLine = "";
|
||||||
sixthLine = "";
|
sixthLine = "";
|
||||||
seventhLine = "";
|
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 0);
|
||||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, "SENDING iGate BEACON", 0);
|
seventhLine = " listening...";
|
||||||
eigthLine = " listening...";
|
|
||||||
if (stationMode == 4) {
|
if (stationMode == 4) {
|
||||||
LoRa_Utils::changeFreqTx();
|
LoRa_Utils::changeFreqTx();
|
||||||
}
|
}
|
||||||
|
|
@ -151,9 +150,9 @@ void typeOfPacket(String packet, String packetType) {
|
||||||
String sender;
|
String sender;
|
||||||
if (stationMode==1 || stationMode==2) {
|
if (stationMode==1 || stationMode==2) {
|
||||||
if (packetType == "LoRa-APRS") {
|
if (packetType == "LoRa-APRS") {
|
||||||
sixthLine = "LoRa Rx ----> APRS-IS";
|
fifthLine = "LoRa Rx ----> APRS-IS";
|
||||||
} else if (packetType == "APRS-LoRa") {
|
} else if (packetType == "APRS-LoRa") {
|
||||||
sixthLine = "APRS-IS ----> LoRa Tx";
|
fifthLine = "APRS-IS ----> LoRa Tx";
|
||||||
}
|
}
|
||||||
sender = packet.substring(0,packet.indexOf(">"));
|
sender = packet.substring(0,packet.indexOf(">"));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -173,16 +172,16 @@ void typeOfPacket(String packet, String packetType) {
|
||||||
} else {
|
} else {
|
||||||
seventhLine = sender + "> MESSAGE";
|
seventhLine = sender + "> MESSAGE";
|
||||||
}
|
}
|
||||||
eigthLine = "RSSI: 38dBm SNR: 6dBm";
|
seventhLine = "RSSI: 38dBm SNR: 6dBm";
|
||||||
} else if (packet.indexOf(":>") >= 10) {
|
} else if (packet.indexOf(":>") >= 10) {
|
||||||
seventhLine = sender + "> NEW STATUS";
|
sixthLine = sender + "> NEW STATUS";
|
||||||
eigthLine = "RSSI: 38dBm SNR: 6dBm";
|
seventhLine = "RSSI: 38dBm SNR: 6dBm";
|
||||||
} else if (packet.indexOf(":!") >= 10 || packet.indexOf(":=") >= 10) {
|
} else if (packet.indexOf(":!") >= 10 || packet.indexOf(":=") >= 10) {
|
||||||
seventhLine = sender + "> GPS BEACON";
|
sixthLine = sender + "> GPS BEACON";
|
||||||
eigthLine = "RSSI:38dBm D: 25.6km";
|
seventhLine = "RSSI:38dBm D: 25.6km";
|
||||||
} else {
|
} else {
|
||||||
seventhLine = sender + "> ??????????";
|
sixthLine = sender + "> ??????????";
|
||||||
eigthLine = "RSSI: 38dBm SNR: 6dBm";
|
seventhLine = "RSSI: 38dBm SNR: 6dBm";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue