diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..7ae98ff --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,16 @@ +

Installation Guide for PlatformIO

+
+Press the PlatformIO HOME Button to enter the Home Screen and there the Libraries Button to add missing libraries:
+
+Search and install the following libaries:
+ +
+Check that the platformio.ini is available as it holds the board type for PlatformIO.
+After pressing the check mark the code will be compiled, after pressing the arrow it will be compiled and uploaded to a connected TTGO.
diff --git a/img/img1.jpg b/img/img1.jpg new file mode 100644 index 0000000..b76c1fc Binary files /dev/null and b/img/img1.jpg differ diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index 1222f02..2028c23 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -265,7 +265,11 @@ void setup() Serial.println("LoRa-APRS / Init / AXP192 Begin FAIL"); } axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); - axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); + if (tracker_mode != WX_FIXED) { + axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // switch on GPS in all modes except WX_FIXED + } else { + axp.setPowerOutPut(AXP192_LDO3, AXP202_OFF); // switch off GPS in WX_FIXED mode + } axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON); axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON); axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); @@ -369,6 +373,9 @@ void setup() } writedisplaytext(" "+Tcall,"","Init:","Data from GPS OK!","","",250); Serial.println("LoRa-APRS / Init / Data from GPS OK!"); + } else { + writedisplaytext(" "+Tcall,"","Init:","GPS switched OFF!","","",250); + Serial.println("LoRa-APRS / Init / GPS switched OFF!"); } #ifdef T_BEAM_V1_0 @@ -426,6 +433,9 @@ void loop() { tracker_mode = WX_FIXED; writedisplaytext("LoRa-APRS","","New Mode","WX-FIXED","","",500); Serial.println("LoRa-APRS / New Mode / WX-FIXED"); + #ifdef T_BEAM_V1_0 + axp.setPowerOutPut(AXP192_LDO3, AXP202_OFF); // switch OFF GPS at mode WX_FIXED + #endif blinker(4); break; case WX_FIXED: @@ -433,6 +443,9 @@ void loop() { tracker_mode = TRACKER; writedisplaytext("LoRa-APRS","","New Mode","TRACKER","","",500); Serial.println("LoRa-APRS / New Mode / TRACKER"); + #ifdef T_BEAM_V1_0 + axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // switch on GPS in all modes except WX_FIXED + #endif blinker(1); break; } @@ -440,6 +453,7 @@ void loop() { prefs.putChar("tracker_mode", (char)tracker_mode); prefs.end(); button_ctr=0; + // ESP.restart(); } } else { button_ctr = 0; @@ -453,8 +467,10 @@ void loop() { hum = dht.getHumidity(); } - while (ss.available() > 0) { - gps.encode(ss.read()); + if (tracker_mode != WX_FIXED) { + while (ss.available() > 0) { + gps.encode(ss.read()); + } } if (rf95.waitAvailableTimeout(100)) { @@ -475,6 +491,17 @@ void loop() { if (nextTX < min_time_to_nextTX) {nextTX=min_time_to_nextTX;} if (nextTX > max_time_to_nextTX) {nextTX=max_time_to_nextTX;} + average_course[point_avg_course] = gps.course.deg(); // calculate smart beaconing course + ++point_avg_course; + if (point_avg_course>2) { + point_avg_course=0; + new_course = (average_course[0]+average_course[1]+average_course[2])/3; + if (abs(new_course-old_course)>=30) { + nextTX = 0; + } + old_course = new_course; + } + } else { LatShown = LatFixed; LongShown = LongFixed; @@ -487,18 +514,6 @@ void loop() { nextTX = 0; } - average_course[point_avg_course] = gps.course.deg(); // calculate smart beaconing course - ++point_avg_course; - if (point_avg_course>2) { - point_avg_course=0; - new_course = (average_course[0]+average_course[1]+average_course[2])/3; - if (abs(new_course-old_course)>=30) { - nextTX = 0; - } - old_course = new_course; - } - - if ((millis()