diff --git a/README.md b/README.md
index 2f15f00..2243895 100644
--- a/README.md
+++ b/README.md
@@ -15,14 +15,14 @@ So you can change the SSID and make it easier to differentiate between normal an
"sSymbol" contains finally the symbol to be sent with the position report
"wxTable" should contain the value for the primary or secondary symbol table used for weather reports
-"wxSymbol" contains finally the symbol to be sent with the weather report
+"wxSymbol" contains finally the symbol to be sent with the weather report
"nextTX" is the transmit intervall in ms (milli seconds) - don't use to short intervalls as it overloads the APRS servers
60000L is a could starting point and means a intervall of 60secs or 1 minute.
Usage of the defines:
#define SEND_WX false => no weather reports are sent
-#define SEND_WX true => weather reports are sent, but needs a connected DHT22
+#define SEND_WX true => weather reports are sent, but needs a connected DHT22
#define FIXED_POSITION false
// set to true if you want to use fixed position (position defined below) instead, or to false if you want to use GPS data
@@ -32,3 +32,4 @@ the following lines are used to define the fixed position
#define LATITUDE "4813.62N" // please in APRS notation DDMM.mmN or DDMM.mmS used for FIXED_POSITION
#define LONGITUDE "01539.85E"
+for DHT22 I used the library from https://github.com/beegee-tokyo/DHTesp, as the standard library gives to many wrong readings
diff --git a/src/TTGO_T-Beam_LoRa_APRS.ino b/src/TTGO_T-Beam_LoRa_APRS.ino
index 6b70367..5fa6b30 100644
--- a/src/TTGO_T-Beam_LoRa_APRS.ino
+++ b/src/TTGO_T-Beam_LoRa_APRS.ino
@@ -18,18 +18,18 @@
#define DEBUG false // used for debugging purposes , e.g. turning on special serial or display logging
// Includes
-#include
+#include // to config user parameters
#include
#include
#include
-#include
+#include // library from OE1ACM
// #include
#include
// #include
#include
//#include
-#include
+#include // library from https://github.com/beegee-tokyo/DHTesp
#include
#include
@@ -51,6 +51,7 @@
//Variables for DHT22 temperature and humidity sensor
int chk;
+boolean hum_temp = false;
float hum=0; //Stores humidity value
float temp=99.99; //Stores temperature value
@@ -205,9 +206,12 @@ void setup()
delay(250);
//temp = dht.readTemperature();
temp = dht.getTemperature();
- writedisplaytext("","Init:","DHT OK!",String(temp),"",750);
+ hum = dht.getHumidity();
+ writedisplaytext("","Init:","DHT OK!","TEMP: "+String(temp),"HUM: "+String(hum),750);
Serial.print("Init: DHT OK! Temp=");
- Serial.println(String(temp));
+ Serial.print(String(temp));
+ Serial.print(" Hum=");
+ Serial.println(String(hum));
//#else //#if (SEND_WX)
// writedisplaytext("","Init:","no DHT configuration","","",1000);
// Serial.println("Init: no DHT configuration");
@@ -225,9 +229,16 @@ writedisplaytext("","","","","",0);
void loop()
{
-
+if (hum_temp)
+{
+ hum_temp=false;
+ temp = dht.getTemperature();
+} else
+{
+ hum_temp=true;
+ hum = dht.getHumidity();
+}
// temp = dht.readTemperature();
-temp = dht.getTemperature();
Serial.print("Init: DHT OK! Temp=");
Serial.println(String(temp));
@@ -255,8 +266,13 @@ if (rf95.waitAvailableTimeout(100))
}
}
-
-writedisplaytext(" "+String(((lastTX+nextTX)-millis())/1000),"LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAT: "+String(analogRead(35)*7.221/4096,2)+" TEMP: "+String(temp),250);
+if (hum_temp)
+{
+ writedisplaytext(" "+String(((lastTX+nextTX)-millis())/1000),"LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAT: "+String(analogRead(35)*7.221/4096,2)+" HUM: "+String(hum),250);
+} else
+{
+ writedisplaytext(" "+String(((lastTX+nextTX)-millis())/1000),"LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAT: "+String(analogRead(35)*7.221/4096,2)+" TEMP: "+String(temp),250);
+}
smartDelay(1000);
// digitalWrite(GPSLED, LOW);
@@ -269,7 +285,13 @@ smartDelay(1000);
{
digitalWrite(TXLED, HIGH);
batt_read();
- writedisplaytext(" ((TX))","LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAR: "+String(analogRead(35)*7.221/4096,2)+" TEMP: "+String(temp),250);
+ if (hum_temp)
+ {
+ writedisplaytext(" ((TX))","LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAR: "+String(analogRead(35)*7.221/4096,2)+" HUM: "+String(hum),250);
+ } else
+ {
+ writedisplaytext(" ((TX))","LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAR: "+String(analogRead(35)*7.221/4096,2)+" TEMP: "+String(temp),250);
+ }
sendpacket();
//writedisplaytext("","State:","Packet sent!","","",250);
Serial.println("State: Packet sent!");
@@ -279,7 +301,13 @@ smartDelay(1000);
{
digitalWrite(TXLED, HIGH);
batt_read();
- writedisplaytext(" ((TX))","LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAT: "+String(analogRead(35)*7.221/4096,2)+" TEMP: "+String(temp),250);
+ if (hum_temp)
+ {
+ writedisplaytext(" ((TX))","LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAR: "+String(analogRead(35)*7.221/4096,2)+" HUM: "+String(hum),250);
+ } else
+ {
+ writedisplaytext(" ((TX))","LAT: "+String(gps.location.lat(),5),"LON: "+String(gps.location.lng(),5),"SPD: "+String(gps.speed.kmph(),1)+" CRS: "+String(gps.course.deg(),0),"BAR: "+String(analogRead(35)*7.221/4096,2)+" TEMP: "+String(temp),250);
+ }
sendpacket();
// writedisplaytext("","State:","Packet sent!","","",250);
Serial.println("State: Packet sent!");