diff --git a/platformio.ini b/platformio.ini index 477d83f..956d7ca 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,8 @@ platform = espressif32 board = ttgo-t-beam framework = arduino monitor_speed = 115200 -lib_deps = +lib_deps = + Adafruit BusIO RadioHead TinyGPSPlus DHT sensor library for ESPx diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino index a3255f6..87d3064 100644 --- a/src/TTGO_T-Beam_LoRa_APRS.ino +++ b/src/TTGO_T-Beam_LoRa_APRS.ino @@ -94,6 +94,7 @@ // Variables for DHT22 temperature and humidity sensor int chk; boolean hum_temp = false; +uint8_t hum_temp_ctr, hum_temp_ctr_max = 3; float hum=0; //Stores humidity value float temp=99.99; //Stores temperature value float tempf=99.99; //Stores temperature value @@ -354,7 +355,7 @@ void setup() } - if ((digitalRead(BUTTON) == LOW) || (Tcall == "OE1XYZ-0")) { // into setup when no real data entered in TTGO...config.h + if ((digitalRead(BUTTON) == LOW) || (Tcall == "XX9XXX-0")) { // into setup when no real data entered in TTGO...config.h writedisplaytext("LoRa-APRS","","","Entering Setup!","","",2000); setup_data(); } @@ -478,6 +479,8 @@ void setup() writedisplaytext("LoRa-APRS","","Init:","FINISHED OK!"," =:-) ","",250); Serial.println("LoRa-APRS / Init / FINISHED OK! / =:-)"); writedisplaytext("","","","","","",0); + + hum_temp_ctr = 0; } // +---------------------------------------------------------------------+// @@ -532,7 +535,11 @@ void loop() { } if (hum_temp) { - hum_temp=false; + ++hum_temp_ctr; + if (hum_temp_ctr>hum_temp_ctr_max) { + hum_temp_ctr = 0; + hum_temp=false; + } #ifdef DS18B20 sensors.requestTemperatures(); // Send the command to get temperature readings temp = sensors.getTempCByIndex(0); // get temp from 1st (!) sensor only @@ -545,7 +552,11 @@ void loop() { #endif #endif } else { - hum_temp=true; + ++hum_temp_ctr; + if (hum_temp_ctr>hum_temp_ctr_max) { + hum_temp_ctr = 0; + hum_temp=true; + } #ifdef DS18B20 hum = 0; #else @@ -824,19 +835,21 @@ void recalcGPS(){ Altx += Talt; Tcourse=gps.course.deg(); Tspeed=gps.speed.knots(); - if(Tlat<0) { Ns = "S"; } else { Ns = "N"; } - if(Tlon<0) { Ew = "W"; } else { Ew = "E"; } - if(Tlat < 0) { Tlat= -Tlat; } - unsigned int Deg_Lat = Tlat; - Lat = 100*(Deg_Lat) + (Tlat - Deg_Lat)*60; - if(Tlon < 0) { Tlon= -Tlon; } - unsigned int Deg_Lon = Tlon; - Lon = 100*(Deg_Lon) + (Tlon - Deg_Lon)*60; aprs_lat = 900000000 - Tlat * 10000000; aprs_lat = aprs_lat / 26 - aprs_lat / 2710 + aprs_lat / 15384615; aprs_lon = 900000000 + Tlon * 10000000 / 2; aprs_lon = aprs_lon / 26 - aprs_lon / 2710 + aprs_lon / 15384615; + + if(Tlat<0) { Ns = "S"; } else { Ns = "N"; } + if(Tlat < 0) { Tlat= -Tlat; } + unsigned int Deg_Lat = Tlat; + Lat = 100*(Deg_Lat) + (Tlat - Deg_Lat)*60; + + if(Tlon<0) { Ew = "W"; } else { Ew = "E"; } + if(Tlon < 0) { Tlon= -Tlon; } + unsigned int Deg_Lon = Tlon; + Lon = 100*(Deg_Lon) + (Tlon - Deg_Lon)*60; } outString = ""; @@ -926,9 +939,9 @@ switch(tracker_mode) { outString += Ew; outString += wxSymbol; #else - for (i=0; i=6) {pos_ssid=0;} } - // smartDelay(500); + // set normal SSID + initial_ssid = (int8_t) (Tcall.substring(7,9)).toInt(); + + pos_ssid = initial_ssid; + pfeile = " ^"; + key_pressed = false; + initial_waiter = 2000; + while (true) { + writedisplaytext(" SETUP", " normal SSID"," "+Tcall, pfeile, "PRESS KEY to select", "", 0); + waiter = millis(); + while (millis()<(waiter+1000+initial_waiter)) { + if (digitalRead(BUTTON)==LOW) { + key_pressed = true; + } + } + initial_waiter = 0; + if (key_pressed==true) { + key_pressed = false; + break; + } + ++pos_ssid; + if (pos_ssid>=16) {pos_ssid=0;} + Tcall = Tcall.substring(0,6)+"-"+werte_SSID[pos_ssid]; + } + + writedisplaytext(" SETUP", " SSID"," "+Tcall," ", "programmed", "", 2000); // fragen, ob es weiter gehen soll pos_ssid = 0; @@ -1383,33 +1421,9 @@ void setup_data(void) { ++pos_in_string; } - // set normal SSID - initial_ssid = (int8_t) (Tcall.substring(7,9)).toInt(); - - pos_ssid = initial_ssid; - pfeile = " ^"; - key_pressed = false; - initial_waiter = 2000; - while (true) { - writedisplaytext(" SETUP", " normal SSID"," "+Tcall, pfeile, "PRESS KEY to select", "", 0); - waiter = millis(); - while (millis()<(waiter+1000+initial_waiter)) { - if (digitalRead(BUTTON)==LOW) { - key_pressed = true; - } - } - initial_waiter = 0; - if (key_pressed==true) { - key_pressed = false; - break; - } - ++pos_ssid; - if (pos_ssid>=16) {pos_ssid=0;} - Tcall = Tcall.substring(0,6)+"-"+werte_SSID[pos_ssid]; - } - writedisplaytext(" SETUP", " Call"," "+Tcall," ", "programmed", "", 2000); + // set WX SSID initial_ssid = (int8_t) (wxTcall.substring(7,9)).toInt(); diff --git a/src/TTGO_T-Beam_LoRa_APRS_config.h b/src/TTGO_T-Beam_LoRa_APRS_config.h index 0672785..ab19266 100644 --- a/src/TTGO_T-Beam_LoRa_APRS_config.h +++ b/src/TTGO_T-Beam_LoRa_APRS_config.h @@ -42,8 +42,8 @@ // #define DONT_USE_FLASH_MEMORY // uncomment if you don't want to use Flashmemory - instead data below must be corrected #define TRACKERMODE 0 // preset MODE here, if flash not used >> 0=TRACKER, 1=WX_TRACKER, 2=WX_MOVE, 3=WX_FIXED -#define CALLSIGN "OE3CJB-11" // enter your callsign here - less then 6 letter callsigns please add "spaces" so total length is 6 (without SSID) -#define WX_CALLSIGN "OE3CJB-11" // use same callsign but you can use different SSID +#define CALLSIGN "XX9XXX-11" // enter your callsign here - less then 6 letter callsigns please add "spaces" so total length is 6 (without SSID) +#define WX_CALLSIGN "XX9XXX-11" // use same callsign but you can use different SSID #define LONGITUDE_PRESET "01539.85E" // please in APRS notation DDDMM.mmE or DDDMM.mmW #define LATIDUDE_PRESET "4813.62N" // please in APRS notation DDMM.mmN or DDMM.mmS #define APRS_SYMBOL ">" // other symbols are