configuration path repack

This commit is contained in:
richonguzman 2023-06-08 00:44:13 -04:00
parent 353d7357dc
commit 20687cd9d2
6 changed files with 42 additions and 19 deletions

View File

@ -1,16 +1,17 @@
# Richonguzman / CD2RXU LoRa APRS iGate # Richonguzman / CD2RXU LoRa APRS iGate/Digirepeater
# Firmware for Tx and Rx !!! # Firmware for Tx and Rx !!!
LoRa APRS iGATE for: LoRa APRS iGATE/Digirepeater for:
- LILYGO ESP32 LoRa v2-1-1.6 - LILYGO ESP32 LoRa32 v2-1-1.6
- ESP32 Wroom Dev + SX1278 LoRa Module for a DIY Version - ESP32 Wroom Dev + SX1278 LoRa Module for a DIY Version
__________________________________________ __________________________________________
Achievements: Achievements:
- listening to LoRa packets the same as messages for Stations/Callsing in near 80Kms. - Rx LoRa packets and upload to APRS-IS servers
- transmiting messages listened from APRS-IS to LoRa - Be able to listen for 80kms or more Stations/Callsing.
- Tx LoRa packets from APRS-IS feed.
- Digirepeater Modes.
__________________________________________ __________________________________________
Instrucctions (add your information into the '/data/igate_conf.json'): Instrucctions (add your information into the '/data/igate_conf.json'):
@ -25,7 +26,16 @@ Instrucctions (add your information into the '/data/igate_conf.json'):
5.- Change "aprs_is">"passcode" from "XYZVW" to yours (remember that is 5 digits integer). 5.- Change "aprs_is">"passcode" from "XYZVW" to yours (remember that is 5 digits integer).
6.- Change "lora">"enableTx" to _"true"_ ONLY(!) if you are an valid Ham Operator 6.- Change "stationMode" value to other than 1 ONLY(!) if you are an valid Ham Operator.
__________________________________________
Digirepeater Modes:
1.- iGate (only Rx).
2.- iGate (Tx and Rx) HAM LICENSE REQUIRED!
3.- Digirepeater (Rx Freq = Tx Freq) HAM LICENSE REQUIRED!
4.- Digirepeater (Rx Freq != Tx Freq) HAM LICENSE REQUIRED!
5.- iGate changes to Digirepeater when it looses APRS-IS+WiFi connection (on development).
__________________________________________ __________________________________________
Versions: Versions:
@ -36,6 +46,7 @@ Versions:
- 2023.05.19 Saving Last-Heard Stations for validating Tx Responses - 2023.05.19 Saving Last-Heard Stations for validating Tx Responses
- 2023.05.23 Processing Query's from RF/LoRa or APRS-IS (Send "Help" Message to test) - 2023.05.23 Processing Query's from RF/LoRa or APRS-IS (Send "Help" Message to test)
- 2023.06.06 Full repack of Code and adding _enableTx_ only for Ham Ops - 2023.06.06 Full repack of Code and adding _enableTx_ only for Ham Ops
- 2023.06.08 Adding Digirepeater Funtions
__________________________________________ __________________________________________

View File

@ -23,7 +23,7 @@
"server": "soam.aprs2.net", "server": "soam.aprs2.net",
"port": 14580, "port": 14580,
"softwareName": "ESP32_LoRa_iGate", "softwareName": "ESP32_LoRa_iGate",
"softwareVersion": "0.1.1", "softwareVersion": "1.2",
"reportingDistance": 30 "reportingDistance": 30
}, },
"lora": { "lora": {

View File

@ -17,12 +17,11 @@
#include <ESPAsyncWebServer.h> #include <ESPAsyncWebServer.h>
#include <AsyncElegantOTA.h>*/ #include <AsyncElegantOTA.h>*/
#define VERSION "2023.06.07" #define VERSION "2023.06.08"
Configuration Config;
WiFiClient espClient; WiFiClient espClient;
//AsyncWebServer server(80); //AsyncWebServer server(80);
String ConfigurationFilePath = "/igate_conf.json";
Configuration Config(ConfigurationFilePath);
int myWiFiAPIndex = 0; int myWiFiAPIndex = 0;
int myWiFiAPSize = Config.wifiAPs.size(); int myWiFiAPSize = Config.wifiAPs.size();
@ -63,6 +62,9 @@ void loop() {
utils::checkBeaconInterval(); utils::checkBeaconInterval();
show_display(firstLine, secondLine, thirdLine, fourthLine, 0); show_display(firstLine, secondLine, thirdLine, fourthLine, 0);
DIGI_Utils::processPacket(LoRa_Utils::receivePacket()); DIGI_Utils::processPacket(LoRa_Utils::receivePacket());
if (statusAfterBoot) {
utils::processStatus();
}
} else if (stationMode==1 || stationMode==2 ) { // iGate (1 Only Rx / 2 Rx+Tx) } else if (stationMode==1 || stationMode==2 ) { // iGate (1 Only Rx / 2 Rx+Tx)
unsigned long currentWiFiMillis = millis(); unsigned long currentWiFiMillis = millis();
if ((WiFi.status() != WL_CONNECTED) && (currentWiFiMillis - previousWiFiMillis >= currentWiFi->checkInterval*1000)) { if ((WiFi.status() != WL_CONNECTED) && (currentWiFiMillis - previousWiFiMillis >= currentWiFi->checkInterval*1000)) {
@ -143,6 +145,7 @@ void loop() {
} }
} else { } else {
Serial.println(stationMode); Serial.println(stationMode);
// stationMode = 5
// this mode is only for when iGate loses Wifi and transforms into Digirepeater // this mode is only for when iGate loses Wifi and transforms into Digirepeater
} }
} }

View File

@ -1,7 +1,8 @@
#include "configuration.h" #include "configuration.h"
#include "display.h"
Configuration::Configuration(const String &filePath) { Configuration::Configuration() {
_filePath = filePath; _filePath = "/igate_conf.json";
if (!SPIFFS.begin(false)) { if (!SPIFFS.begin(false)) {
Serial.println("SPIFFS Mount Failed"); Serial.println("SPIFFS Mount Failed");
return; return;
@ -60,7 +61,8 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) {
void Configuration::validateConfigFile(String currentBeaconCallsign) { void Configuration::validateConfigFile(String currentBeaconCallsign) {
if (currentBeaconCallsign == "NOCALL-10") { if (currentBeaconCallsign == "NOCALL-10") {
Serial.println("Change Callsign in /data/wx_report_config.json"); Serial.println("Change Callsign in /data/igate_conf.json");
show_display("ERROR", "Change your settings", "'igate_conf.json'", "--> File System image", 0);
while (true) { while (true) {
delay(1000); delay(1000);
} }

View File

@ -60,11 +60,10 @@ public:
Display display; Display display;
Configuration(const String &filePath); Configuration();
void validateConfigFile(String currentBeaconCallsign); void validateConfigFile(String currentBeaconCallsign);
private: private:
Configuration() {}; // Hide default constructor
void readFile(fs::FS &fs, const char *fileName) ; void readFile(fs::FS &fs, const char *fileName) ;
String _filePath; String _filePath;
}; };

View File

@ -22,8 +22,16 @@ extern String iGateBeaconPacket;
namespace utils { namespace utils {
void processStatus() { void processStatus() {
String status = Config.callsign + ">APLRG1";
if (stationMode==1 || stationMode==2) {
delay(1000); delay(1000);
espClient.write((Config.callsign + ">APLRG1,qAC:>" + Config.defaultStatus + "\n").c_str()); status += ",qAC:>" + Config.defaultStatus;
espClient.write((status + "\n").c_str());
} else {
delay(5000);
status += ":>" + Config.defaultStatus;
LoRa_Utils::sendNewPacket("APRS", status);
}
statusAfterBoot = false; statusAfterBoot = false;
} }