Compare commits

...

2 Commits

Author SHA1 Message Date
richonguzman dc1bdbb703 mqtt without user and pass 2025-08-29 15:01:34 -04:00
richonguzman 74a8fa7969 updatedVersion 2025-08-29 14:51:07 -04:00
5 changed files with 23 additions and 5 deletions
+1
View File
@@ -68,6 +68,7 @@ ___________________________________________________________________*/
String versionDate = "2025-08-29"; String versionDate = "2025-08-29";
String versionNumber = "3.1";
Configuration Config; Configuration Config;
WiFiClient aprsIsClient; WiFiClient aprsIsClient;
WiFiClient mqttClient; WiFiClient mqttClient;
+4 -1
View File
@@ -41,6 +41,7 @@ extern String sixthLine;
extern String seventhLine; extern String seventhLine;
extern bool modemLoggedToAPRSIS; extern bool modemLoggedToAPRSIS;
extern bool backUpDigiMode; extern bool backUpDigiMode;
extern String versionNumber;
uint32_t lastRxTime = millis(); uint32_t lastRxTime = millis();
bool passcodeValid = false; bool passcodeValid = false;
@@ -78,7 +79,9 @@ namespace APRS_IS_Utils {
aprsAuth += Config.callsign; aprsAuth += Config.callsign;
aprsAuth += " pass "; aprsAuth += " pass ";
aprsAuth += Config.aprs_is.passcode; aprsAuth += Config.aprs_is.passcode;
aprsAuth += " vers CA2RXU_iGate 3.0 filter "; aprsAuth += " vers CA2RXUiGate ";
aprsAuth += versionNumber;
aprsAuth += " filter ";
aprsAuth += Config.aprs_is.filter; aprsAuth += Config.aprs_is.filter;
upload(aprsAuth); upload(aprsAuth);
} }
+10 -2
View File
@@ -65,7 +65,15 @@ namespace MQTT_Utils {
} }
pubSub.setServer(Config.mqtt.server.c_str(), Config.mqtt.port); pubSub.setServer(Config.mqtt.server.c_str(), Config.mqtt.port);
Serial.print("Trying to connect with MQTT Server: " + String(Config.mqtt.server) + " MqttServerPort: " + String(Config.mqtt.port)); Serial.print("Trying to connect with MQTT Server: " + String(Config.mqtt.server) + " MqttServerPort: " + String(Config.mqtt.port));
if (pubSub.connect(Config.callsign.c_str(), Config.mqtt.username.c_str(), Config.mqtt.password.c_str())) {
bool connected = false;
if (!Config.mqtt.username.isEmpty()) {
connected = pubSub.connect(Config.callsign.c_str(), Config.mqtt.username.c_str(), Config.mqtt.password.c_str());
} else {
connected = pubSub.connect(Config.callsign.c_str());
}
if (connected) {
Serial.println(" -> Connected !"); Serial.println(" -> Connected !");
const String subscribedTopic = Config.mqtt.topic + "/" + Config.callsign + "/#"; const String subscribedTopic = Config.mqtt.topic + "/" + Config.callsign + "/#";
if (!pubSub.subscribe(subscribedTopic.c_str())) { if (!pubSub.subscribe(subscribedTopic.c_str())) {
@@ -74,7 +82,7 @@ namespace MQTT_Utils {
Serial.print("Subscribed to MQTT topic : "); Serial.print("Subscribed to MQTT topic : ");
Serial.println(subscribedTopic); Serial.println(subscribedTopic);
} else { } else {
Serial.println(" -> Not Connected (Retry in 10 secs)"); Serial.println(" -> Not Connected (Retry in a few secs)");
} }
} }
+4 -1
View File
@@ -31,6 +31,7 @@ extern float snr;
extern int freqError; extern int freqError;
extern bool shouldSleepLowVoltage; extern bool shouldSleepLowVoltage;
extern bool saveNewDigiEcoModeConfig; extern bool saveNewDigiEcoModeConfig;
extern String versionNumber;
namespace QUERY_Utils { namespace QUERY_Utils {
@@ -42,7 +43,9 @@ namespace QUERY_Utils {
if (queryQuestion == "?APRS?" || queryQuestion == "H" || queryQuestion == "HELP" || queryQuestion=="?") { if (queryQuestion == "?APRS?" || queryQuestion == "H" || queryQuestion == "HELP" || queryQuestion=="?") {
answer.concat("?APRSV ?APRSP ?APRSL ?APRSSSR ?EM=? ?TX=? "); // ?APRSH ?WHERE callsign answer.concat("?APRSV ?APRSP ?APRSL ?APRSSSR ?EM=? ?TX=? "); // ?APRSH ?WHERE callsign
} else if (queryQuestion == "?APRSV") { } else if (queryQuestion == "?APRSV") {
answer.concat("CA2RXU_LoRa_iGate 3.0 v"); answer.concat("CA2RXU_LoRa_iGate v");
answer.concat(versionNumber);
answer.concat(" ");
answer.concat(versionDate); answer.concat(versionDate);
} else if (queryQuestion == "?APRSP") { } else if (queryQuestion == "?APRSP") {
answer.concat("iGate QTH: "); answer.concat("iGate QTH: ");
+4 -1
View File
@@ -25,6 +25,7 @@
extern Configuration Config; extern Configuration Config;
extern String versionDate; extern String versionDate;
extern String versionNumber;
WiFiUDP udpClient; WiFiUDP udpClient;
@@ -35,7 +36,9 @@ namespace SYSLOG_Utils {
if (Config.syslog.active && WiFi.status() == WL_CONNECTED) { if (Config.syslog.active && WiFi.status() == WL_CONNECTED) {
String syslogPacket = "<165>1 - "; String syslogPacket = "<165>1 - ";
syslogPacket.concat(Config.callsign); syslogPacket.concat(Config.callsign);
syslogPacket.concat(" CA2RXU_LoRa_iGate_3.0 - - - "); //RFC5424 The Syslog Protocol syslogPacket.concat(" CA2RXU_LoRa_iGate_");
syslogPacket.concat(versionNumber);
syslogPacket.concat(" - - - "); //RFC5424 The Syslog Protocol
char signalData[35]; char signalData[35];
snprintf(signalData, sizeof(signalData), " / %ddBm / %.2fdB / %dHz", rssi, snr, freqError); snprintf(signalData, sizeof(signalData), " / %ddBm / %.2fdB / %dHz", rssi, snr, freqError);