From 4fe1ec48c0d99351d1b7bb0ec9a036e1ef40cd77 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 8 Jul 2024 12:13:38 +0200 Subject: [PATCH] Update birdnet_to_mqtt.py --- birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py b/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py index 2446111dc..d203e7c3e 100644 --- a/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py +++ b/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py @@ -18,7 +18,6 @@ import paho.mqtt.client as mqtt # this generator function monitors the requested file handle for new lines added at its end # the newly added line is returned by the function def file_row_generator(s): - s.seek(0,2) while True : line = s.readline() if not line: @@ -54,7 +53,7 @@ re_log_timestamp = re.compile(r'.+?(?= birdnet-)') re_high_found = re.compile(r'(?<=python3\[).*\.mp3$') re_high_clean = re.compile(r'(?<=\]:).*\.mp3$') -syslog = open('/test') +syslog = open('/proc/1/fd/1', 'r') # this little hack is to make each received record for the all birds section unique # the date and time that the log returns is only down to the 1 second accuracy, do