mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Merge pull request #276 from DJ2LS/ls-arq
raspberry pi compatibility and other small fixes
This commit is contained in:
commit
3afca6a5ab
5 changed files with 23 additions and 12 deletions
|
@ -832,6 +832,7 @@ ipcMain.on('request-stop-rigctld',(event,data)=>{
|
||||||
|
|
||||||
// CHECK RIGCTLD
|
// CHECK RIGCTLD
|
||||||
ipcMain.on('request-check-rigctld',(data)=>{
|
ipcMain.on('request-check-rigctld',(data)=>{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let Data = {
|
let Data = {
|
||||||
state: "unknown",
|
state: "unknown",
|
||||||
|
@ -843,12 +844,15 @@ ipcMain.on('request-check-rigctld',(data)=>{
|
||||||
} else {
|
} else {
|
||||||
Data["state"] = "unknown/stopped";
|
Data["state"] = "unknown/stopped";
|
||||||
}
|
}
|
||||||
|
if (win !== null && win !== ''){
|
||||||
win.webContents.send('action-check-rigctld', Data);
|
win.webContents.send('action-check-rigctld', Data);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
mainLog.error(e)
|
mainLog.error(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1196,7 +1196,7 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group input-group-sm mb-1">
|
<div class="input-group input-group-sm mb-1">
|
||||||
<label class="input-group-text w-50">Enable 563Hz mode</label>
|
<label class="input-group-text w-50">Enable 563Hz only mode</label>
|
||||||
<label class="input-group-text bg-white w-50">
|
<label class="input-group-text bg-white w-50">
|
||||||
<div class="form-check form-switch form-check-inline">
|
<div class="form-check form-switch form-check-inline">
|
||||||
<input class="form-check-input" type="checkbox" id="500HzModeSwitch">
|
<input class="form-check-input" type="checkbox" id="500HzModeSwitch">
|
||||||
|
@ -1205,7 +1205,7 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group input-group-sm mb-1">
|
<div class="input-group input-group-sm mb-1">
|
||||||
<label class="input-group-text w-50">Enable Explorer Publishing</label>
|
<label class="input-group-text w-50">Enable Explorer Publishing <br> (https://explorer.freedata.app) </label>
|
||||||
<label class="input-group-text bg-white w-50">
|
<label class="input-group-text bg-white w-50">
|
||||||
<div class="form-check form-switch form-check-inline">
|
<div class="form-check form-switch form-check-inline">
|
||||||
<input class="form-check-input" type="checkbox" id="ExplorerSwitch">
|
<input class="form-check-input" type="checkbox" id="ExplorerSwitch">
|
||||||
|
|
12
tnc/audio.py
12
tnc/audio.py
|
@ -31,7 +31,7 @@ def get_audio_devices():
|
||||||
sd._terminate()
|
sd._terminate()
|
||||||
sd._initialize()
|
sd._initialize()
|
||||||
|
|
||||||
log.debug("[AUD] get_audio_devices")
|
# log.debug("[AUD] get_audio_devices")
|
||||||
with multiprocessing.Manager() as manager:
|
with multiprocessing.Manager() as manager:
|
||||||
proxy_input_devices = manager.list()
|
proxy_input_devices = manager.list()
|
||||||
proxy_output_devices = manager.list()
|
proxy_output_devices = manager.list()
|
||||||
|
@ -42,8 +42,9 @@ def get_audio_devices():
|
||||||
proc.start()
|
proc.start()
|
||||||
proc.join()
|
proc.join()
|
||||||
|
|
||||||
log.debug("[AUD] get_audio_devices: input_devices:", list=f"{proxy_input_devices}")
|
# additional logging for audio devices
|
||||||
log.debug("[AUD] get_audio_devices: output_devices:", list=f"{proxy_output_devices}")
|
# log.debug("[AUD] get_audio_devices: input_devices:", list=f"{proxy_input_devices}")
|
||||||
|
# log.debug("[AUD] get_audio_devices: output_devices:", list=f"{proxy_output_devices}")
|
||||||
return list(proxy_input_devices), list(proxy_output_devices)
|
return list(proxy_input_devices), list(proxy_output_devices)
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +53,10 @@ def device_crc(device) -> str:
|
||||||
crc_hwid = crc_algorithm(bytes(f"{device}", encoding="utf-8"))
|
crc_hwid = crc_algorithm(bytes(f"{device}", encoding="utf-8"))
|
||||||
crc_hwid = crc_hwid.to_bytes(2, byteorder="big")
|
crc_hwid = crc_hwid.to_bytes(2, byteorder="big")
|
||||||
crc_hwid = crc_hwid.hex()
|
crc_hwid = crc_hwid.hex()
|
||||||
return f"{device['name']} [{crc_hwid}]"
|
|
||||||
|
hostapi_name = sd.query_hostapis(device['hostapi'])['name']
|
||||||
|
|
||||||
|
return f"{device['name']} [{hostapi_name}] [{crc_hwid}]"
|
||||||
|
|
||||||
|
|
||||||
def fetch_audio_devices(input_devices, output_devices):
|
def fetch_audio_devices(input_devices, output_devices):
|
||||||
|
|
|
@ -13,7 +13,7 @@ import threading
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
import zlib
|
import zlib
|
||||||
from random import randrange, randbytes
|
from random import randrange# , randbytes
|
||||||
|
|
||||||
import codec2
|
import codec2
|
||||||
import helpers
|
import helpers
|
||||||
|
@ -361,7 +361,7 @@ class DATA:
|
||||||
|
|
||||||
def enqueue_frame_for_tx(
|
def enqueue_frame_for_tx(
|
||||||
self,
|
self,
|
||||||
frame_to_tx: list[bytearray],
|
frame_to_tx,# : list[bytearray], # this causes a crash on python 3.7
|
||||||
c2_mode=FREEDV_MODE.datac0.value,
|
c2_mode=FREEDV_MODE.datac0.value,
|
||||||
copies=1,
|
copies=1,
|
||||||
repeat_delay=0,
|
repeat_delay=0,
|
||||||
|
@ -1323,7 +1323,8 @@ class DATA:
|
||||||
static.ARQ_SESSION_STATE = "connecting"
|
static.ARQ_SESSION_STATE = "connecting"
|
||||||
|
|
||||||
# create a random session id
|
# create a random session id
|
||||||
self.session_id = randbytes(1)
|
# self.session_id = randbytes(1)
|
||||||
|
self.session_id = np.random.bytes(1)
|
||||||
print(self.session_id)
|
print(self.session_id)
|
||||||
|
|
||||||
connection_frame = bytearray(self.length_sig0_frame)
|
connection_frame = bytearray(self.length_sig0_frame)
|
||||||
|
@ -1615,7 +1616,8 @@ class DATA:
|
||||||
|
|
||||||
# init a new random session id if we are not in an arq session
|
# init a new random session id if we are not in an arq session
|
||||||
if not static.ARQ_SESSION:
|
if not static.ARQ_SESSION:
|
||||||
self.session_id = randbytes(1)
|
# self.session_id = randbytes(1)
|
||||||
|
self.session_id = np.random.bytes(1)
|
||||||
print(self.session_id)
|
print(self.session_id)
|
||||||
|
|
||||||
# Update data_channel timestamp
|
# Update data_channel timestamp
|
||||||
|
|
|
@ -42,11 +42,12 @@ class explorer():
|
||||||
gridsquare = str(static.MYGRID, "utf-8")
|
gridsquare = str(static.MYGRID, "utf-8")
|
||||||
version = str(static.VERSION)
|
version = str(static.VERSION)
|
||||||
bandwidth = str(static.LOW_BANDWIDTH_MODE)
|
bandwidth = str(static.LOW_BANDWIDTH_MODE)
|
||||||
|
beacon = str(static.BEACON_STATE)
|
||||||
|
|
||||||
log.info("[EXPLORER] publish", frequency=frequency, band=band, callsign=callsign, gridsquare=gridsquare, version=version, bandwidth=bandwidth)
|
log.info("[EXPLORER] publish", frequency=frequency, band=band, callsign=callsign, gridsquare=gridsquare, version=version, bandwidth=bandwidth)
|
||||||
|
|
||||||
headers = {"Content-Type": "application/json"}
|
headers = {"Content-Type": "application/json"}
|
||||||
station_data = {'callsign': callsign, 'gridsquare': gridsquare, 'frequency': frequency, 'band': band, 'version': version, 'bandwidth': bandwidth}
|
station_data = {'callsign': callsign, 'gridsquare': gridsquare, 'frequency': frequency, 'band': band, 'version': version, 'bandwidth': bandwidth, 'beacon': beacon}
|
||||||
station_data = json.dumps(station_data)
|
station_data = json.dumps(station_data)
|
||||||
try:
|
try:
|
||||||
response = requests.post(self.explorer_url, json=station_data, headers=headers)
|
response = requests.post(self.explorer_url, json=station_data, headers=headers)
|
||||||
|
|
Loading…
Reference in a new issue