Skip to content

Commit

Permalink
Merge pull request #239 from mbridak/change_fldigi_qso_detection
Browse files Browse the repository at this point in the history
Change fldigi qso detection
  • Loading branch information
mbridak authored Dec 14, 2024
2 parents 326c56d + 24b4202 commit 8f1cd69
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 49 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

- [24-12-14] Changed method of detecting fldigi QSOs. See docs.
- [24-12-12] Add a try exception for a unicode decode error.
- [24-12-11-1] Add RTC to RAC Canada Day, ARRL VHF, ARRL Field Day, ARRL SS, ARRL DX, 10 10
- [24-12-11] Add RTC to IARU HF, IARU Field Day, DARC XMAS, CQ WW, CQ WPX
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.

## Recent Changes (Polishing the Turd)

- [24-12-14] Changed method of detecting fldigi QSOs. See docs.
- [24-12-12] Add a try exception for a unicode decode error.
- [24-12-11-1] Add RTC to RAC Canada Day, ARRL VHF, ARRL Field Day, ARRL SS, ARRL DX, 10 10
- [24-12-11] Add RTC to IARU HF, IARU Field Day, DARC XMAS, CQ WW, CQ WPX
Expand Down Expand Up @@ -607,9 +608,13 @@ On the Options TAB you can:
not1mm listens for WSJT-X UDP traffic on the Multicast address 224.0.0.1:2237.
No setup is needed to be done on not1mm's side. That's good because I'm lazy.

not1mm polls for fldigi QSOs via it's XMLRPC interface. It does this in a rather stupid
~~not1mm polls for fldigi QSOs via it's XMLRPC interface. It does this in a rather stupid
way. It just keeps asking what was the last QSO and compares it to the previous response.
If it's different, it's new.
If it's different, it's new.~~

not1mm watches for fldigi qso's by watching for UDP traffic from fldigi on 127.0.0.1:9876.

![fldigi configuration dialog](https://github.com/mbridak/not1mm/blob/master/pic/fldigi_adif_udp.png?raw=true)

The F1-F12 function keys be sent to fldigi via XMLRPC. Fldigi will be placed into TX
mode, the message will be sent and a ^r will be tacked onto the end to place it back into
Expand Down
27 changes: 15 additions & 12 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
print(exception)
print("portaudio is not installed")
sd = None
from PyQt6 import QtCore, QtGui, QtWidgets, uic
from PyQt6 import QtCore, QtGui, QtWidgets, uic, QtNetwork
from PyQt6.QtCore import QDir, Qt, QThread, QSettings, QCoreApplication
from PyQt6.QtGui import QFontDatabase, QColorConstants, QPalette, QColor, QPixmap
from PyQt6.QtWidgets import QFileDialog, QSplashScreen, QApplication
Expand Down Expand Up @@ -66,7 +66,6 @@
from not1mm.lib.version import __version__
from not1mm.lib.versiontest import VersionTest
from not1mm.lib.ft8_watcher import FT8Watcher
from not1mm.lib.fldigi_watcher import FlDigiWatcher
from not1mm.lib.fldigi_sendstring import FlDigi_Comm

import not1mm.fsutils as fsutils
Expand Down Expand Up @@ -174,10 +173,8 @@ class MainWindow(QtWidgets.QMainWindow):

radio_thread = QThread()
voice_thread = QThread()
fldigi_thread = QThread()
rtc_thread = QThread()

fldigi_watcher = None
rig_control = None
log_window = None
check_window = None
Expand Down Expand Up @@ -668,14 +665,6 @@ def __init__(self, splash):
self.show_splash_msg("Reading macros.")
self.read_macros()

self.show_splash_msg("Starting FlDigi watcher.")
self.fldigi_watcher = FlDigiWatcher()
self.fldigi_watcher.moveToThread(self.fldigi_thread)
self.fldigi_thread.started.connect(self.fldigi_watcher.run)
self.fldigi_thread.finished.connect(self.fldigi_watcher.deleteLater)
self.fldigi_watcher.poll_callback.connect(self.fldigi_qso)
self.fldigi_thread.start()

self.show_splash_msg("Restoring window states.")
self.settings = QSettings("K6GTE", "not1mm")
if self.settings.value("windowState") is not None:
Expand Down Expand Up @@ -718,6 +707,20 @@ def __init__(self, splash):
"You can udate to the current version by using:\npip install -U not1mm"
)

self.udp_socket = QtNetwork.QUdpSocket()
b_result = self.udp_socket.bind(
QtNetwork.QHostAddress.SpecialAddress.AnyIPv4, 9876
)
logger.info(f"bind {b_result}")
self.udp_socket.readyRead.connect(self.fldigi_on_udp_socket_ready_read)

def fldigi_on_udp_socket_ready_read(self):
""""""
datagram, sender_host, sender_port_number = self.udp_socket.readDatagram(
self.udp_socket.pendingDatagramSize()
)
self.fldigi_qso(datagram.decode())

def load_call_history(self) -> None:
"""Display filepicker and load chosen call history file."""
filename = self.filepicker("other")
Expand Down
33 changes: 0 additions & 33 deletions not1mm/lib/fldigi_watcher.py

This file was deleted.

2 changes: 1 addition & 1 deletion not1mm/lib/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""It's the version"""

__version__ = "24.12.12"
__version__ = "24.12.14"
Binary file added pic/fldigi_adif_udp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "not1mm"
version = "24.12.12"
version = "24.12.14"
description = "NOT1MM Logger"
readme = "README.md"
requires-python = ">=3.9"
Expand Down

0 comments on commit 8f1cd69

Please sign in to comment.