diff --git a/log4om.py b/log4om.py
index 0c5695b..7a1c72d 100644
--- a/log4om.py
+++ b/log4om.py
@@ -15,42 +15,47 @@ def monitor():
global tot
while True:
tc = time.time() - tot # time since last timestamp
- if tc < 15: # 15 seconds
+ if tc < 15: #15 seconds
time.sleep(6)
else:
- writehtml(f"Radio off")
- time.sleep(30)
+ writehtml(f"Radio Off or Log4OM Not Running", False)
+ time.sleep(30) # Slow checks when radio off/no UDP
def log4om():
global tot
- global rstatus
while True:
data, addr = sock.recvfrom(1024)
root = ET.fromstring(data.decode("utf-8"))
freq = int(root.find("Freq").text)
tx_freq = int(root.find("TXFreq").text)
mode = root.find("Mode").text
+ onair = (root.find("IsTransmitting").text == "true")
f = freq / 100
tf = tx_freq / 100
sv = tf - f # Determines split value
if sv > 0:
- writehtml(f"Frequency: {f}kHz {mode}
Up: {sv:.2f} kHz")
+ writehtml(f"Frequency: {f}kHz {mode}
Tx Split Up: {sv:.2f} kHz", onair)
elif sv < 0:
sv = sv * -1 # Invert negative numbers
- writehtml(f"Frequency: {f}kHz {mode}
Down: {sv:.2f} kHz")
+ writehtml(f"Frequency: {f}kHz {mode}
Tx Split Down: {sv:.2f} kHz", onair)
else:
- writehtml(f"Frequency: {f}kHz {mode}")
+ writehtml(f"Frequency: {f}kHz {mode}", onair)
tot = time.time() #timestamp
time.sleep(.1)
-def writehtml(rs):
+def writehtml(rs, t = "true"):
header = "\n