Browse Source

Expiremental show RSSI and SNR on KISS FRAME

pull/1/head
US1GHQ 11 months ago
parent
commit
892a3e7217
  1. 38
      src/TTGO_T-Beam_LoRa_APRS.ino

38
src/TTGO_T-Beam_LoRa_APRS.ino

@ -95,9 +95,10 @@
#define I2C_SDA 21
#define I2C_SCL 22
#define BUTTON 0 //pin number for BUTTO
#define BUZZER 13 // enter your buzzer pin gpio
const byte TXLED = 17; //pin number for LED on TX Tracker
const byte RXLED = 16; //pin number for LED on TX Tracker
#define BUZZER 13
const byte TXLED = 2; // enter your buzzer pin gpio
const byte TXPIN = 17; //pin number for TX on 1W Modules
const byte RXPIN = 16; //pin number for RX on 1W Modules
#endif
// Variables for APRS packaging
@ -337,9 +338,13 @@ void sendpacket(){
* @param message
*/
void loraSend(byte lora_LTXPower, float lora_FREQ, const String &message) {
#ifdef ESP32_DEV_V1
digitalWrite(TXPIN, HIGH);
digitalWrite(RXPIN, LOW);
#endif
#ifdef ENABLE_LED_SIGNALING
digitalWrite(TXLED, HIGH);
digitalWrite(RXLED, LOW);
#endif
lastTX = millis();
@ -354,9 +359,13 @@ void loraSend(byte lora_LTXPower, float lora_FREQ, const String &message) {
rf95.setTxPower(lora_LTXPower);
rf95.sendAPRS(lora_TXBUFF, messageSize);
rf95.waitPacketSent();
#ifdef ESP32_DEV_V1
digitalWrite(TXPIN, LOW);
digitalWrite(RXPIN, HIGH);
#endif
#ifdef ENABLE_LED_SIGNALING
digitalWrite(TXLED, LOW);
digitalWrite(RXLED, HIGH);
#endif
}
@ -653,8 +662,12 @@ void setup(){
average_course[i]=0;
}
#ifdef ESP32_DEV_V1
pinMode(TXPIN, OUTPUT);
pinMode(RXPIN, OUTPUT);
#endif
pinMode(TXLED, OUTPUT);
pinMode(RXLED, OUTPUT);
#ifdef T_BEAM_V1_0
pinMode(BUTTON, INPUT);
#elif T_BEAM_V0_7
@ -662,8 +675,12 @@ void setup(){
#else
pinMode(BUTTON, INPUT_PULLUP);
#endif
#ifdef ESP32_DEV_V1
digitalWrite(TXPIN, LOW); // turn blue LED off
digitalWrite(RXPIN, HIGH); // turn blue LED off
#endif
digitalWrite(TXLED, LOW); // turn blue LED off
digitalWrite(RXLED, HIGH); // turn blue LED off
Serial.begin(115200);
Wire.begin(I2C_SDA, I2C_SCL);
@ -774,8 +791,11 @@ void setup(){
writedisplaytext("","","","","","");
time_to_refresh = millis() + showRXTime;
displayInvalidGPS();
#ifdef ESP32_DEV_V1
digitalWrite(TXPIN, LOW);
digitalWrite(RXPIN, HIGH);
#endif
digitalWrite(TXLED, LOW);
digitalWrite(RXLED, HIGH);
}
// +---------------------------------------------------------------------+//
@ -894,7 +914,7 @@ void loop() {
}
writedisplaytext(" ((RX))", "", loraReceivedFrameString, "", "", "");
#ifdef KISS_PROTOCOL
sendToTNC(loraReceivedFrameString, rf95.lastRssi(), rf95.lastSNR());
sendToTNC(loraReceivedFrameString + ", RSSI:"+ rf95.lastRssi() + ", SNR:" + rf95.lastSNR());
#endif
#ifdef ENABLE_WIFI
sendToWebList(loraReceivedFrameString, rf95.lastRssi(), rf95.lastSNR());

Loading…
Cancel
Save