mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2025-12-06 07:42:00 +01:00
fixing main
This commit is contained in:
parent
4a39c5e2f2
commit
c1fc1c5cbf
|
|
@ -20,6 +20,7 @@
|
||||||
#include "project_configuration.h"
|
#include "project_configuration.h"
|
||||||
|
|
||||||
#define VERSION "22.11.1"
|
#define VERSION "22.11.1"
|
||||||
|
#define MODULE_NAME "Main"
|
||||||
|
|
||||||
String create_lat_aprs(double lat);
|
String create_lat_aprs(double lat);
|
||||||
String create_long_aprs(double lng);
|
String create_long_aprs(double lng);
|
||||||
|
|
@ -45,10 +46,10 @@ RouterTask routerTask(fromModem, toModem, toAprsIs, toMQTT);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Logger::instance().setSerial(&Serial);
|
LoRaSystem.getLogger().setSerial(&Serial);
|
||||||
delay(500);
|
delay(500);
|
||||||
logPrintlnI("LoRa APRS iGate by OE5BPA (Peter Buchegger)");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "LoRa APRS iGate by OE5BPA (Peter Buchegger)");
|
||||||
logPrintlnI("Version: " VERSION);
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "Version: %s", VERSION);
|
||||||
|
|
||||||
std::list<BoardConfig const *> boardConfigs;
|
std::list<BoardConfig const *> boardConfigs;
|
||||||
boardConfigs.push_back(&TTGO_LORA32_V1);
|
boardConfigs.push_back(&TTGO_LORA32_V1);
|
||||||
|
|
@ -68,28 +69,26 @@ void setup() {
|
||||||
if (!boardConfig) {
|
if (!boardConfig) {
|
||||||
boardConfig = finder.searchBoardConfig();
|
boardConfig = finder.searchBoardConfig();
|
||||||
if (!boardConfig) {
|
if (!boardConfig) {
|
||||||
logPrintlnE("Board config not set and search failed!");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "Board config not set and search failed!");
|
||||||
while (true)
|
while (true)
|
||||||
;
|
;
|
||||||
} else {
|
} else {
|
||||||
userConfig.board = boardConfig->Name;
|
userConfig.board = boardConfig->Name;
|
||||||
confmg.writeConfiguration(userConfig);
|
confmg.writeConfiguration(userConfig);
|
||||||
logPrintlnI("will restart board now!");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "will restart board now!");
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logPrintI("Board ");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "Board %s loaded.", boardConfig->Name);
|
||||||
logPrintI(boardConfig->Name);
|
|
||||||
logPrintlnI(" loaded.");
|
|
||||||
|
|
||||||
if (boardConfig->Type == eTTGO_T_Beam_V1_0) {
|
if (boardConfig->Type == eTTGO_T_Beam_V1_0) {
|
||||||
Wire.begin(boardConfig->OledSda, boardConfig->OledScl);
|
Wire.begin(boardConfig->OledSda, boardConfig->OledScl);
|
||||||
PowerManagement powerManagement;
|
PowerManagement powerManagement;
|
||||||
if (!powerManagement.begin(Wire)) {
|
if (!powerManagement.begin(Wire)) {
|
||||||
logPrintlnI("AXP192 init done!");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "AXP192 init done!");
|
||||||
} else {
|
} else {
|
||||||
logPrintlnE("AXP192 init failed!");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "AXP192 init failed!");
|
||||||
}
|
}
|
||||||
powerManagement.activateLoRa();
|
powerManagement.activateLoRa();
|
||||||
powerManagement.activateOLED();
|
powerManagement.activateOLED();
|
||||||
|
|
@ -126,13 +125,13 @@ void setup() {
|
||||||
LoRaSystem.getDisplay().showSpashScreen("LoRa APRS iGate", VERSION);
|
LoRaSystem.getDisplay().showSpashScreen("LoRa APRS iGate", VERSION);
|
||||||
|
|
||||||
if (userConfig.callsign == "NOCALL-10") {
|
if (userConfig.callsign == "NOCALL-10") {
|
||||||
logPrintlnE("You have to change your settings in 'data/is-cfg.json' and upload it via \"Upload File System image\"!");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "You have to change your settings in 'data/is-cfg.json' and upload it via 'Upload File System image'!");
|
||||||
LoRaSystem.getDisplay().showStatusScreen("ERROR", "You have to change your settings in 'data/is-cfg.json' and upload it via \"Upload File System image\"!");
|
LoRaSystem.getDisplay().showStatusScreen("ERROR", "You have to change your settings in 'data/is-cfg.json' and upload it via \"Upload File System image\"!");
|
||||||
while (true)
|
while (true)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
if ((!userConfig.aprs_is.active) && !(userConfig.digi.active)) {
|
if ((!userConfig.aprs_is.active) && !(userConfig.digi.active)) {
|
||||||
logPrintlnE("No mode selected (iGate or Digi)! You have to activate one of iGate or Digi.");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, MODULE_NAME, "No mode selected (iGate or Digi)! You have to activate one of iGate or Digi.");
|
||||||
LoRaSystem.getDisplay().showStatusScreen("ERROR", "No mode selected (iGate or Digi)! You have to activate one of iGate or Digi.");
|
LoRaSystem.getDisplay().showStatusScreen("ERROR", "No mode selected (iGate or Digi)! You have to activate one of iGate or Digi.");
|
||||||
while (true)
|
while (true)
|
||||||
;
|
;
|
||||||
|
|
@ -144,7 +143,7 @@ void setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
delay(5000);
|
delay(5000);
|
||||||
logPrintlnI("setup done...");
|
LoRaSystem.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_INFO, MODULE_NAME, "setup done...");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue