diff --git a/.gitignore b/.gitignore index 98ed7e7..662aed9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .idea -config.yml +server/config.yml .vscode # ---> Python diff --git a/esp32/telelogger/config.h b/esp32/telelogger/config.h index f32331d..8590cd3 100644 --- a/esp32/telelogger/config.h +++ b/esp32/telelogger/config.h @@ -95,8 +95,11 @@ #define SERVER_PROTOCOL PROTOCOL_UDP #endif +// Custom options from this fork #define SERVER_ENCRYPTION_ENABLE 1 #define CHACHA20_KEY "your encryption key here" +#define ENABLE_BEEPING 0 +// End custom options #ifndef CONFIG_MBEDTLS_CHACHAPOLY_C #define CONFIG_MBEDTLS_CHACHAPOLY_C y diff --git a/esp32/telelogger/telelogger.ino b/esp32/telelogger/telelogger.ino index 7f92b10..33e0247 100644 --- a/esp32/telelogger/telelogger.ino +++ b/esp32/telelogger/telelogger.ino @@ -175,11 +175,13 @@ void printTimeoutStats() void beep(int duration) { +#if ENABLE_BEEPING // turn on buzzer at 2000Hz frequency sys.buzzer(2000); delay(duration); // turn off buzzer sys.buzzer(0); +#endif } #if LOG_EXT_SENSORS diff --git a/server/src/server.go b/server/src/server.go index 060e2a4..7dd4cd2 100644 --- a/server/src/server.go +++ b/server/src/server.go @@ -91,12 +91,14 @@ func main() { if err != nil { rawHex := hex.EncodeToString(buf[:n]) logger.Warnf(formatLogMsg(addr.IP.String(), dest.Address, dest.Port, fmt.Sprintf(`Error decrypting message: %s. Length: %d, Raw: "%s"`, err, len(rawHex), rawHex))) - // Forward the raw message to the backend without bothering with decryption. - plaintext = buf[:n] + plaintext = buf[:n] // Forward the raw message to the backend without bothering with decryption. + if len(plaintext) > 0 { + logger.Warningf("Encryption failed, possibly recieved unencrypted message -- %s", plaintext) + } } } else { + // If empty message. plaintext = buf[:n] - logger.Warningln("Got unencrypted message!") } forwardAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", dest.Address, dest.Port))