Skip to content

Commit

Permalink
eliminando espacios en blanco
Browse files Browse the repository at this point in the history
  • Loading branch information
richonguzman committed Nov 6, 2024
1 parent 9159362 commit 06ef37e
Show file tree
Hide file tree
Showing 21 changed files with 68 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/A7670_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,6 @@
}
}
delay(1);
}
}
}
#endif
1 change: 1 addition & 0 deletions src/A7670_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <Arduino.h>


namespace A7670_Utils {

bool checkModemOn();
Expand Down
36 changes: 22 additions & 14 deletions src/LoRa_APRS_iGate.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/aprs_is_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(">"));
Expand Down Expand Up @@ -207,7 +207,7 @@ namespace APRS_IS_Utils {
displayShow(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
}
}
}
}
}
}
}
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/battery_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace BATTERY_Utils {
sample = 0;
#endif
#endif
#endif
#endif
sampleSum += sample;
delayMicroseconds(50);
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -240,7 +240,7 @@ namespace BATTERY_Utils {
tempValue = value;
break;
}
}
}

int firstByte = tempValue / 91;
tempValue -= firstByte * 91;
Expand Down
8 changes: 4 additions & 4 deletions src/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -152,15 +152,15 @@ 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";
aprs_is.port = data["aprs_is"]["port"] | 14580;
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;

Expand Down Expand Up @@ -262,7 +262,7 @@ void Configuration::init() {

beacon.gpsActive = false;
beacon.gpsAmbiguity = false;

digi.mode = 0;
digi.ecoMode = false;

Expand Down
1 change: 1 addition & 0 deletions src/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vector>
#include <FS.h>


class WiFi_AP {
public:
String ssid;
Expand Down
8 changes: 4 additions & 4 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -79,7 +79,7 @@ void displaySetup() {
display.ssd1306_command(SSD1306_SETCONTRAST);
display.ssd1306_command(1);
display.display();
}
}
#endif
#endif
delay(1000);
Expand Down
1 change: 1 addition & 0 deletions src/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/kiss_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <Arduino.h>


String encodeAddressAX25(String tnc2Address);
String decodeAddressAX25(const String& ax25Address, bool& isLast, bool isRelay);

Expand Down
3 changes: 2 additions & 1 deletion src/lora_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ bool transmitFlag = true;
int rssi, freqError;
float snr;


namespace LoRa_Utils {

void setFlag(void) {
Expand Down Expand Up @@ -204,7 +205,7 @@ namespace LoRa_Utils {
}
lastRxTime = millis();
return packet;
}
}
} else if (state == RADIOLIB_ERR_CRC_MISMATCH) {
rssi = radio.getRSSI();
snr = radio.getSNR();
Expand Down
2 changes: 1 addition & 1 deletion src/lora_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace LoRa_Utils {
String receivePacket();
void changeFreqTx();
void changeFreqRx();
void startReceive(); // ???
void startReceive();
void sleepRadio();

}
Expand Down
1 change: 1 addition & 0 deletions src/ntp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <Arduino.h>


namespace NTP_Utils {

void setup();
Expand Down
1 change: 0 additions & 1 deletion src/station_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ struct LastHeardStation {
String station;
};


namespace STATION_Utils {

void deleteNotHeard();
Expand Down
1 change: 1 addition & 0 deletions src/tnc_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ WiFiServer tncServer(TNC_PORT);
String inputServerBuffer[INPUT_BUFFER_SIZE];
String inputSerialBuffer = "";


namespace TNC_Utils {

void setup() {
Expand Down
1 change: 1 addition & 0 deletions src/tnc_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <Arduino.h>


namespace TNC_Utils {

void setup();
Expand Down
24 changes: 14 additions & 10 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -177,7 +181,7 @@ namespace Utils {
delay(3000);
}
sendStartTelemetry = false;
}
}

void checkBeaconInterval() {
uint32_t lastTx = millis() - lastBeaconTx;
Expand All @@ -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();
Expand Down Expand Up @@ -250,7 +254,7 @@ namespace Utils {
secondaryBeaconPacket += " Batt=";
secondaryBeaconPacket += internalVoltageInfo;
}
}
}
}
#endif

Expand All @@ -273,8 +277,8 @@ namespace Utils {
beaconPacket += externalVoltageInfo;
secondaryBeaconPacket += " Ext=";
secondaryBeaconPacket += externalVoltageInfo;
}
}
}
}
}
#endif

Expand All @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <Arduino.h>


class ReceivedPacket {
public:
String rxTime;
Expand Down
5 changes: 3 additions & 2 deletions src/web_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions src/web_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit 06ef37e

Please sign in to comment.