eliminando espacios en blanco

This commit is contained in:
richonguzman 2024-11-06 12:47:42 -03:00
parent 9159362796
commit 06ef37e4dc
21 changed files with 66 additions and 49 deletions

View File

@ -200,6 +200,6 @@
}
}
delay(1);
}
}
}
#endif

View File

@ -3,6 +3,7 @@
#include <Arduino.h>
namespace A7670_Utils {
bool checkModemOn();

View File

@ -1,16 +1,24 @@
/*______________________________________________________________________________________________________________
/*___________________________________________________________________
Ricardo Guzman - CA2RXU
https://github.com/richonguzman/LoRa_APRS_Tracker
(donations : http://paypal.me/richonguzman)
______________________________________________________________________________________________________________*/
Ricardo Guzman - CA2RXU
https://github.com/richonguzman/LoRa_APRS_Tracker
(donations : http://paypal.me/richonguzman)
___________________________________________________________________*/
#include <ElegantOTA.h>
#include <TinyGPS++.h>
@ -172,7 +180,7 @@ void loop() {
if (Config.loramodule.txActive && (Config.digi.mode == 2 || Config.digi.mode == 3 || backUpDigiMode)) { // If Digi enabled
STATION_Utils::clean25SegBuffer();
DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi
DIGI_Utils::processLoRaPacket(packet); // Send received packet to Digi
}
if (Config.tnc.enableServer) { // If TNC server enabled

View File

@ -101,7 +101,7 @@ namespace APRS_IS_Utils {
if(aprsisState == "--" && !Config.display.alwaysOn && Config.display.timeout != 0) {
displayToggle(true);
lastScreenOn = millis();
}
}
}
secondLine = "WiFi: ";
secondLine += wifiState;
@ -176,7 +176,7 @@ namespace APRS_IS_Utils {
void processLoRaPacket(const String& packet) {
if (espClient.connected() || modemLoggedToAPRSIS) {
if (packet != "") {
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) {
if ((packet.substring(0, 3) == "\x3c\xff\x01") && (packet.indexOf("NOGATE") == -1) && (packet.indexOf("RFONLY") == -1)) {
int firstColonIndex = packet.indexOf(":");
if (firstColonIndex > 5 && firstColonIndex < (packet.length() - 1) && packet[firstColonIndex + 1] != '}' && packet.indexOf("TCPIP") == -1) {
const String& Sender = packet.substring(3, packet.indexOf(">"));
@ -207,7 +207,7 @@ namespace APRS_IS_Utils {
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
}
}
}
}
}
}
}
@ -285,7 +285,7 @@ namespace APRS_IS_Utils {
A7670_Utils::uploadToAPRSIS(ackPacket);
#else
upload(ackPacket);
#endif
#endif
receivedMessage = AddresseeAndMessage.substring(AddresseeAndMessage.indexOf(":") + 1, AddresseeAndMessage.indexOf("{"));
} else {
receivedMessage = AddresseeAndMessage.substring(AddresseeAndMessage.indexOf(":") + 1);

View File

@ -126,7 +126,7 @@ namespace BATTERY_Utils {
sample = 0;
#endif
#endif
#endif
#endif
sampleSum += sample;
delayMicroseconds(50);
}
@ -182,7 +182,7 @@ namespace BATTERY_Utils {
float extVoltage;
#ifdef HAS_ADC_CALIBRATION
if (calibrationEnable){
if (calibrationEnable){
extVoltage = esp_adc_cal_raw_to_voltage(sampleSum / 100, &adc_chars) * voltageDividerTransformation; // in mV
extVoltage /= 1000;
} else {
@ -240,7 +240,7 @@ namespace BATTERY_Utils {
tempValue = value;
break;
}
}
}
int firstByte = tempValue / 91;
tempValue -= firstByte * 91;

View File

@ -71,7 +71,7 @@ void Configuration::writeFile() {
data["battery"]["voltageDividerR2"] = battery.voltageDividerR2;
data["battery"]["sendVoltageAsTelemetry"] = battery.sendVoltageAsTelemetry;
data["wxsensor"]["active"] = wxsensor.active;
data["wxsensor"]["heightCorrection"] = wxsensor.heightCorrection;
data["wxsensor"]["temperatureCorrection"] = wxsensor.temperatureCorrection;
@ -152,7 +152,7 @@ bool Configuration::readFile() {
beacon.gpsActive = data["beacon"]["gpsActive"] | false;
beacon.gpsAmbiguity = data["beacon"]["gpsAmbiguity"] | false;
aprs_is.active = data["aprs_is"]["active"] | false;
aprs_is.passcode = data["aprs_is"]["passcode"] | "XYZWV";
aprs_is.server = data["aprs_is"]["server"] | "rotate.aprs2.net";
@ -160,7 +160,7 @@ bool Configuration::readFile() {
aprs_is.filter = data["aprs_is"]["filter"] | "m/10";
aprs_is.messagesToRF = data["aprs_is"]["messagesToRF"] | false;
aprs_is.objectsToRF = data["aprs_is"]["objectsToRF"] | false;
digi.mode = data["digi"]["mode"] | 0;
digi.ecoMode = data["digi"]["ecoMode"] | false;
@ -262,7 +262,7 @@ void Configuration::init() {
beacon.gpsActive = false;
beacon.gpsAmbiguity = false;
digi.mode = 0;
digi.ecoMode = false;

View File

@ -5,6 +5,7 @@
#include <vector>
#include <FS.h>
class WiFi_AP {
public:
String ssid;

View File

@ -11,9 +11,9 @@
TFT_eSPI tft = TFT_eSPI();
#ifdef HELTEC_WIRELESS_TRACKER
#define bigSizeFont 2.5
#define smallSizeFont 1.5
#define lineSpacing 12
#define bigSizeFont 2
#define smallSizeFont 1
#define lineSpacing 10
#endif
#else
#ifdef HAS_EPAPER
@ -79,7 +79,7 @@ void displaySetup() {
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(1);
display.display();
}
}
#endif
#endif
delay(1000);

View File

@ -5,6 +5,7 @@
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
void cleanTFT();
void displaySetup();
void displayToggle(bool toggle);

View File

@ -3,6 +3,7 @@
#include <Arduino.h>
String encodeAddressAX25(String tnc2Address);
String decodeAddressAX25(const String& ax25Address, bool& isLast, bool isRelay);

View File

@ -40,6 +40,7 @@ bool transmitFlag = true;
int rssi, freqError;
float snr;
namespace LoRa_Utils {
void setFlag(void) {
@ -204,7 +205,7 @@ namespace LoRa_Utils {
}
lastRxTime = millis();
return packet;
}
}
} else if (state == RADIOLIB_ERR_CRC_MISMATCH) {
rssi = radio.getRSSI();
snr = radio.getSNR();

View File

@ -12,7 +12,7 @@ namespace LoRa_Utils {
String receivePacket();
void changeFreqTx();
void changeFreqRx();
void startReceive(); // ???
void startReceive();
void sleepRadio();
}

View File

@ -3,6 +3,7 @@
#include <Arduino.h>
namespace NTP_Utils {
void setup();

View File

@ -16,7 +16,6 @@ struct LastHeardStation {
String station;
};
namespace STATION_Utils {
void deleteNotHeard();

View File

@ -19,6 +19,7 @@ WiFiServer tncServer(TNC_PORT);
String inputServerBuffer[INPUT_BUFFER_SIZE];
String inputSerialBuffer = "";
namespace TNC_Utils {
void setup() {

View File

@ -3,6 +3,7 @@
#include <Arduino.h>
namespace TNC_Utils {
void setup();

View File

@ -83,7 +83,7 @@ namespace Utils {
return "- BACKUP DIGI MODE -";
} else {
return "IP : " + String(WiFi.localIP()[0]) + "." + String(WiFi.localIP()[1]) + "." + String(WiFi.localIP()[2]) + "." + String(WiFi.localIP()[3]);
}
}
}
void setupDisplay() {
@ -122,11 +122,15 @@ namespace Utils {
baseAPRSISTelemetryPacket += ":";
String baseRFTelemetryPacket = Config.callsign;
baseRFTelemetryPacket += ">APLRG1,WIDE1-1::";
baseRFTelemetryPacket += ">APLRG1";
if (Config.beacon.path.indexOf("WIDE") != -1) {
baseRFTelemetryPacket += ",";
baseRFTelemetryPacket += Config.beacon.path;
}
baseRFTelemetryPacket += "::";
baseRFTelemetryPacket += sender;
baseRFTelemetryPacket += ":";
String telemetryPacket1 = "EQNS.";
if (Config.battery.sendInternalVoltage) {
telemetryPacket1 += "0,0.01,0";
@ -177,7 +181,7 @@ namespace Utils {
delay(3000);
}
sendStartTelemetry = false;
}
}
void checkBeaconInterval() {
uint32_t lastTx = millis() - lastBeaconTx;
@ -200,7 +204,7 @@ namespace Utils {
if (sendStartTelemetry && Config.battery.sendVoltageAsTelemetry && !Config.wxsensor.active && (Config.battery.sendInternalVoltage || Config.battery.sendExternalVoltage)) {
sendInitialTelemetryPackets();
}
STATION_Utils::deleteNotHeard();
activeStations();
@ -250,7 +254,7 @@ namespace Utils {
secondaryBeaconPacket += " Batt=";
secondaryBeaconPacket += internalVoltageInfo;
}
}
}
}
#endif
@ -273,8 +277,8 @@ namespace Utils {
beaconPacket += externalVoltageInfo;
secondaryBeaconPacket += " Ext=";
secondaryBeaconPacket += externalVoltageInfo;
}
}
}
}
}
#endif
@ -286,7 +290,7 @@ namespace Utils {
if (Config.aprs_is.active && Config.beacon.sendViaAPRSIS && !backUpDigiMode) {
Utils::println("-- Sending Beacon to APRSIS --");
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0);
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING IGATE BEACON", 0);
seventhLine = " listening...";
#ifdef HAS_A7670
A7670_Utils::uploadToAPRSIS(beaconPacket);
@ -338,7 +342,7 @@ namespace Utils {
case 1: // APRS-LoRa
fifthLine = "APRS-IS ----> LoRa Tx";
break;
case 2: // Digi
case 2: // Digipeater
fifthLine = "LoRa Rx ----> LoRa Tx";
break;
}

View File

@ -3,6 +3,7 @@
#include <Arduino.h>
class ReceivedPacket {
public:
String rxTime;

View File

@ -34,6 +34,7 @@ extern const unsigned char favicon_data[] asm("_binary_data_embed_favicon_png_gz
extern const unsigned char favicon_data_end[] asm("_binary_data_embed_favicon_png_gz_end");
extern const size_t favicon_data_len = favicon_data_end - favicon_data;
namespace WEB_Utils {
AsyncWebServer server(80);
@ -136,7 +137,7 @@ namespace WEB_Utils {
Config.beacon.gpsActive = request->hasParam("beacon.gpsActive", true);
Config.beacon.gpsAmbiguity = request->hasParam("beacon.gpsAmbiguity", true);
Config.digi.mode = request->getParam("digi.mode", true)->value().toInt();
Config.digi.ecoMode = request->hasParam("digi.ecoMode", true);
@ -186,7 +187,7 @@ namespace WEB_Utils {
Config.syslog.server = request->getParam("syslog.server", true)->value();
Config.syslog.port = request->getParam("syslog.port", true)->value().toInt();
}
Config.tnc.enableServer = request->hasParam("tnc.enableServer", true);
Config.tnc.enableSerial = request->hasParam("tnc.enableSerial", true);
Config.tnc.acceptOwn = request->hasParam("tnc.acceptOwn", true);

View File

@ -13,10 +13,6 @@ namespace WEB_Utils {
void handleNotFound(AsyncWebServerRequest *request);
void handleStatus(AsyncWebServerRequest *request);
void handleHome(AsyncWebServerRequest *request);
//void handleReadConfiguration(AsyncWebServerRequest *request);
//void handleWriteConfiguration(AsyncWebServerRequest *request);
void handleStyle(AsyncWebServerRequest *request);
void handleScript(AsyncWebServerRequest *request);
void handleBootstrapStyle(AsyncWebServerRequest *request);

View File

@ -125,7 +125,7 @@ namespace WX_Utils {
break;
}
}
}
}
}
}
@ -232,7 +232,7 @@ namespace WX_Utils {
presStr = ".....";
} else {
presStr = generatePresString(newPress + (Config.wxsensor.heightCorrection/CORRECTION_FACTOR));
}
}
fifthLine = "BME-> ";
fifthLine += String(int(newTemp + Config.wxsensor.temperatureCorrection));