mirror of
https://github.com/richonguzman/LoRa_APRS_iGate.git
synced 2026-01-22 00:30:16 +01:00
lora32 name fix for boards name
This commit is contained in:
parent
9f4630c8f8
commit
65d0e12c19
|
|
@ -31,7 +31,7 @@ lib_deps =
|
|||
|
||||
[env:ttgo-lora32-v21]
|
||||
board = ttgo-lora32-v21
|
||||
build_flags = -Werror -Wall -DTTGO_T_LORA_V2_1 -DELEGANTOTA_USE_ASYNC_WEBSERVER=1
|
||||
build_flags = -Werror -Wall -DTTGO_T_LORA32_V2_1 -DELEGANTOTA_USE_ASYNC_WEBSERVER=1
|
||||
|
||||
[env:heltec-lora32-v2]
|
||||
board = ttgo-lora32-v21
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ String firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seven
|
|||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
pinMode(batteryPin, INPUT);
|
||||
#endif
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
pinMode(internalLedPin, OUTPUT);
|
||||
#endif
|
||||
if (Config.externalVoltageMeasurement) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace BATTERY_Utils {
|
|||
int sample;
|
||||
int sampleSum = 0;
|
||||
for (int i=0; i<100; i++) {
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
sample = analogRead(batteryPin);
|
||||
#endif
|
||||
#if defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ namespace LoRa_Utils {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_CS);
|
||||
LoRa.setPins(LORA_CS, LORA_RST, LORA_IRQ);
|
||||
long freq;
|
||||
|
|
@ -86,10 +86,10 @@ namespace LoRa_Utils {
|
|||
}
|
||||
|
||||
void sendNewPacket(const String &typeOfMessage, const String &newPacket) {
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
digitalWrite(internalLedPin,HIGH);
|
||||
#endif
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
LoRa.beginPacket();
|
||||
LoRa.write('<');
|
||||
if (typeOfMessage == "APRS") {
|
||||
|
|
@ -114,7 +114,7 @@ namespace LoRa_Utils {
|
|||
Serial.println(state);
|
||||
}
|
||||
#endif
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
digitalWrite(internalLedPin,LOW);
|
||||
#endif
|
||||
SYSLOG_Utils::log("LoRa Tx", newPacket,0,0,0);
|
||||
|
|
@ -132,7 +132,7 @@ namespace LoRa_Utils {
|
|||
|
||||
String receivePacket() {
|
||||
String loraPacket = "";
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
int packetSize = LoRa.parsePacket();
|
||||
if (packetSize) {
|
||||
while (LoRa.available()) {
|
||||
|
|
@ -177,7 +177,7 @@ namespace LoRa_Utils {
|
|||
|
||||
void changeFreqTx() {
|
||||
delay(500);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
LoRa.setFrequency(Config.loramodule.digirepeaterTxFreq);
|
||||
#endif
|
||||
#if defined(HELTEC_V3) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
|
|
@ -188,7 +188,7 @@ namespace LoRa_Utils {
|
|||
|
||||
void changeFreqRx() {
|
||||
delay(500);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2)
|
||||
LoRa.setFrequency(Config.loramodule.digirepeaterRxFreq);
|
||||
#endif
|
||||
#if defined(HELTEC_V3) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
|
||||
// LORA MODULES
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa)
|
||||
#undef LORA_RST
|
||||
#define LORA_SCK 5 // GPIO5 - SX1276 SCK
|
||||
#define LORA_MISO 19 // GPIO19 - SX1276 MISO
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
|
||||
// OLED
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa) || defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_2) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
#define OLED_SDA 21
|
||||
#define OLED_SCL 22
|
||||
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
#endif
|
||||
|
||||
// Leds and other stuff
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
#define internalLedPin 25 // Green Led
|
||||
#define batteryPin 35
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace POWER_Utils {
|
|||
}
|
||||
|
||||
bool begin(TwoWire &port) {
|
||||
#if defined (TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(HELTEC_V3) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined (TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(ESP32_DIY_LoRa) || defined(HELTEC_V3) || defined(ESP32_DIY_1W_LoRa)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
|
|
@ -88,6 +88,8 @@ namespace POWER_Utils {
|
|||
PMU.disableDLDO2();
|
||||
PMU.setDC1Voltage(3300);
|
||||
PMU.enableDC1();
|
||||
PMU.setButtonBatteryChargeVoltage(3300);
|
||||
PMU.enableButtonBatteryCharge();
|
||||
PMU.disableIRQ(XPOWERS_AXP2101_ALL_IRQ);
|
||||
}
|
||||
return result;
|
||||
|
|
@ -104,7 +106,6 @@ namespace POWER_Utils {
|
|||
Serial.println("AXP192 init failed!");
|
||||
}
|
||||
activateLoRa();
|
||||
//activateGPS();
|
||||
activateMeasurement();
|
||||
PMU.setChargerTerminationCurr(XPOWERS_AXP192_CHG_ITERM_LESS_10_PERCENT);
|
||||
PMU.setChargeTargetVoltage(XPOWERS_AXP192_CHG_VOL_4V2);
|
||||
|
|
@ -120,7 +121,6 @@ namespace POWER_Utils {
|
|||
Serial.println("AXP2101 init failed!");
|
||||
}
|
||||
activateLoRa();
|
||||
//activateGPS();
|
||||
activateMeasurement();
|
||||
PMU.setPrechargeCurr(XPOWERS_AXP2101_PRECHARGE_200MA);
|
||||
PMU.setChargerTerminationCurr(XPOWERS_AXP2101_CHG_ITERM_25MA);
|
||||
|
|
@ -131,7 +131,7 @@ namespace POWER_Utils {
|
|||
}
|
||||
|
||||
/*void lowerCpuFrequency() {
|
||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA_V2_1_GPS) || defined(TTGO_T_LORA_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
#if defined(TTGO_T_Beam_V1_0) || defined(TTGO_T_Beam_V1_0_SX1268) || defined(TTGO_T_Beam_V1_2) || defined(ESP32_DIY_LoRa_GPS) || defined(TTGO_T_LORA32_V2_1_GPS) || defined(TTGO_T_LORA32_V2_1_TNC) || defined(ESP32_DIY_1W_LoRa_GPS) || defined(TTGO_T_Beam_V1_2_SX1262)
|
||||
if (setCpuFrequencyMhz(80)) {
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "Main", "CPU frequency set to 80MHz");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -81,12 +81,12 @@ namespace Utils {
|
|||
|
||||
void setupDisplay() {
|
||||
setup_display();
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
digitalWrite(internalLedPin,HIGH);
|
||||
#endif
|
||||
Serial.println("\nStarting iGate: " + Config.callsign + " Version: " + versionDate);
|
||||
show_display(" LoRa APRS", "", " ( iGATE )", "", "", "Richonguzman / CA2RXU", " " + versionDate, 4000);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
digitalWrite(internalLedPin,LOW);
|
||||
#endif
|
||||
firstLine = Config.callsign;
|
||||
|
|
@ -117,7 +117,7 @@ namespace Utils {
|
|||
} else {
|
||||
beaconPacket = iGateBeaconPacket;
|
||||
}
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
if (Config.sendBatteryVoltage) {
|
||||
beaconPacket += " (Batt=" + String(BATTERY_Utils::checkBattery(),2) + "V)";
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ namespace Utils {
|
|||
}
|
||||
sixthLine = "";
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 1000);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
if (Config.sendBatteryVoltage) {
|
||||
sixthLine = " (Batt=" + String(BATTERY_Utils::checkBattery(),2) + "V)";
|
||||
}
|
||||
|
|
@ -156,7 +156,7 @@ namespace Utils {
|
|||
fifthLine = "";
|
||||
sixthLine = "";
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 0);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
if (Config.sendBatteryVoltage) {
|
||||
sixthLine = " (Batt=" + String(BATTERY_Utils::checkBattery(),2) + "V)";
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ namespace Utils {
|
|||
APRS_IS_Utils::checkStatus();
|
||||
thirdLine = getLocalIP();
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 1000);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
if (Config.sendBatteryVoltage) {
|
||||
sixthLine = " (Batt=" + String(BATTERY_Utils::checkBattery(),2) + "V)";
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ namespace Utils {
|
|||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, seventhLine, 0);
|
||||
} else {
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 0);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
if (Config.sendBatteryVoltage) {
|
||||
sixthLine = " (Batt=" + String(BATTERY_Utils::checkBattery(),2) + "V)";
|
||||
}
|
||||
|
|
@ -215,7 +215,7 @@ namespace Utils {
|
|||
sixthLine = "";
|
||||
|
||||
show_display(firstLine, secondLine, thirdLine, fourthLine, fifthLine, sixthLine, "SENDING iGate BEACON", 0);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2)
|
||||
if (Config.sendBatteryVoltage) {
|
||||
sixthLine = " (Batt=" + String(BATTERY_Utils::checkBattery(),2) + "V)";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@ namespace WIFI_Utils {
|
|||
WiFi.begin(currentWiFi->ssid.c_str(), currentWiFi->password.c_str());
|
||||
while (WiFi.status() != WL_CONNECTED && wifiCounter<2) {
|
||||
delay(500);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
digitalWrite(internalLedPin,HIGH);
|
||||
#endif
|
||||
Serial.print('.');
|
||||
delay(500);
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
digitalWrite(internalLedPin,LOW);
|
||||
#endif
|
||||
if ((millis() - start) > 10000){
|
||||
|
|
@ -62,7 +62,7 @@ namespace WIFI_Utils {
|
|||
WiFi.begin(currentWiFi->ssid.c_str(), currentWiFi->password.c_str());
|
||||
}
|
||||
}
|
||||
#if defined(TTGO_T_LORA_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
#if defined(TTGO_T_LORA32_V2_1) || defined(HELTEC_V2) || defined(HELTEC_V3) || defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa)
|
||||
digitalWrite(internalLedPin,LOW);
|
||||
#endif
|
||||
if (WiFi.status() == WL_CONNECTED) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue