hamlib test

This commit is contained in:
dj2ls 2022-01-11 14:57:11 +01:00
parent cc3145fc1d
commit 284daf0258
2 changed files with 22 additions and 1 deletions

View file

@ -64,8 +64,18 @@ def noalsaerr():
try:
# installation path for Ubuntu 20.04 LTS python modules
sys.path.append('/usr/local/lib/python'+ python_version +'/site-packages')
# installation path for Ubuntu 20.10 +
sys.path.append('/usr/local/lib/')
# everything else... not nice, but an attempt
sys.path.append('/usr/local/lib/python3.6/site-packages')
sys.path.append('/usr/local/lib/python3.7/site-packages')
sys.path.append('/usr/local/lib/python3.8/site-packages')
sys.path.append('/usr/local/lib/python3.9/site-packages')
sys.path.append('/usr/local/lib/python3.10/site-packages')
import Hamlib
# https://stackoverflow.com/a/4703409
@ -104,7 +114,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
structlog.get_logger("structlog").debug("[DMN] Client connected", ip=self.client_address[0])
# loop through socket buffer until timeout is reached. then close buffer
socketTimeout = time.time() + 3
socketTimeout = time.time() + 6
while socketTimeout > time.time():
time.sleep(0.01)
@ -347,6 +357,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
stop_bits = str(received_json["parameter"][0]["stop_bits"])
handshake = str(received_json["parameter"][0]["handshake"])
hamlib = rig.radio()
hamlib.open_rig(devicename=devicename, deviceport=deviceport, hamlib_ptt_type=pttprotocol, serialspeed=serialspeed, pttport=pttport, data_bits=data_bits, stop_bits=stop_bits, handshake=handshake)

View file

@ -14,10 +14,20 @@ try:
# installation path for Ubuntu 20.04 LTS python modules
sys.path.append('/usr/local/lib/python'+ python_version +'/site-packages')
# installation path for Ubuntu 20.10 +
sys.path.append('/usr/local/lib/')
# installation path for Suse
sys.path.append('/usr/local/lib64/python'+ python_version +'/site-packages')
# everything else... not nice, but an attempt to see how its running within app bundle
sys.path.append('/usr/local/lib/python3.6/site-packages')
sys.path.append('/usr/local/lib/python3.7/site-packages')
sys.path.append('/usr/local/lib/python3.8/site-packages')
sys.path.append('/usr/local/lib/python3.9/site-packages')
sys.path.append('/usr/local/lib/python3.10/site-packages')
import Hamlib
# https://stackoverflow.com/a/4703409