From 9bb62cf7319bb9753c8056aa552b7ffa76506b6a Mon Sep 17 00:00:00 2001 From: alberto Date: Sat, 17 Oct 2026 00:42:47 +0200 Subject: [PATCH] Add home scan frequency controls and BPQ radio transmission pause --- README.md | 4 ++++ forwarding.mjs | 2 +- forwarding.test.mjs | 4 ++++ public/index.html | 2 +- public/mission.js | 2 +- public/radio-control.css | 1 + public/radio-control.js | 11 +++++++++++ radio-control.mjs | 13 +++++++++++++ radio-control.test.mjs | 4 ++++ server.mjs | 9 +++++++-- 10 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 public/radio-control.css create mode 100644 public/radio-control.js create mode 100644 radio-control.mjs create mode 100644 radio-control.test.mjs diff --git a/README.md b/README.md index 5ef6b7c..3b817ad 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,10 @@ Before changing that profile, the panel backs up `BPQMail.cfg` under `BPQMailCha ## Forwarding, chat and terminal +The home modem card shows the configured `RADIO` scan frequencies, mode, dwell time and current channel. With a compatible local scan controller, checkboxes include/exclude channels (at least one must remain selected). **Sospendi TX** stops the BPQ radio ports and closes radio sessions; **Riprendi radio** reopens them and restores scanning. Internet mail/chat remain available. The panel blocks new radio forwarding while paused or while a change is being applied. These controls change local listening; `WL2KREPORT` channel publication remains separately configured in BPQ. + +Rig controls are optional and read-only when no fresh controller acknowledgement is available. Configure local `radioControl` with `rig`, absolute `requestFile` and `statusFile` paths. The panel writes `{revision,enabled:["7050000-USB"],txSuspended:false}`; IDs are integer Hz plus mode, derived from the actual BPQ scan list. The controller must validate requests, wait for radio sessions before changing scan frequencies, apply changes and publish fresh `{at,frequency,txSuspended,appliedRevision,error}` status. Only matching `appliedRevision` confirms completion. The station's controller backs up `BPQ32.cfg`, preserves disabled entries as `; CONSOLE-OFF ...`, reloads rig control and confirms CAT readiness. The installer does not guess CAT/PTT commands or enable this write interface for unknown hardware; supply a compatible controller for that station. + The Winlink radio directory also downloads **PUBLIC Packet** channels when a UZ7HO/KISS/AX.25 port is present. Band filters include VHF (2 m), UHF (70 cm), both, and all bands. Packet channels use the published FM frequency exactly; the 1500 Hz USB offset applies only to HF channels. The channel details show the selected local port. Unsupported packet speeds stay visible with an explanation and cannot be selected; local support defaults to 1200 baud. Optional `winlinkRadio.packetPort` selects a specific local packet port and `winlinkRadio.packetBaud` declares its configured speed. These settings do not reprogram a TNC: its modem, audio and PTT must already be set up. The current packet client limits selection to 144–146 MHz and 430–440 MHz. Shared-radio installations may configure `winlinkRadio.packetController` with the same request/status file handshake described below. Their controller must acknowledge the requested frequency and keep the modem active while attached/connected. Internet forwarding is temporarily suspended and restored with the same recovery mechanism as HF radio sync. Directory downloads use Internet; the selected mail exchange uses radio. diff --git a/forwarding.mjs b/forwarding.mjs index 110dcc9..8541b4f 100644 --- a/forwarding.mjs +++ b/forwarding.mjs @@ -56,7 +56,7 @@ export class Forwarding{ const p=(await this.profiles()).find(p=>p.call===peer);if(!p?.configured)throw new Error('Profilo di forwarding non configurato'); if(Date.now()-(this.requested.get(peer)||0)<30000)throw new Error('Sincronizzazione già richiesta: attendi 30 secondi'); const last=forwardingHistory(await this.logs().catch(()=>''),peer)[0];if(last&&!last.endedAt&&['calling','connected'].includes(last.status))throw new Error('Forwarding già in corso per questo partner'); - const radio=this.radio();if(p.transport==='Radio'&&(radio?.active||radio?.connecting))throw new Error('Modem occupato da una connessione: riprova al termine'); + const radio=this.radio();if(p.transport==='Radio'&&radio?.txSuspended)throw Error('Trasmissioni radio sospese dalla console');if(p.transport==='Radio'&&(radio?.active||radio?.connecting))throw new Error('Modem occupato da una connessione: riprova al termine'); const key=await this.context();await this.bpq('/Mail/FwdDetails?'+key,{method:'POST',body:peer});await this.bpq('/Mail/FWDSave?'+key,{method:'POST',body:'StartForward'}); this.requested.set(peer,Date.now());this.cached=null;return {ok:true,peer,requestedAt:new Date().toISOString()}; });} diff --git a/forwarding.test.mjs b/forwarding.test.mjs index fc64057..b5a2654 100644 --- a/forwarding.test.mjs +++ b/forwarding.test.mjs @@ -25,3 +25,7 @@ test('forwarding starts configured peers only, serializes native context, preven }); test('outgoing FBB count requires remote turn acknowledgement after acceptance',()=>{const prefix='261016 10:00:00 |N0TEST Connecting to BBS N0TEST\n261016 10:00:01 >N0TEST FA B N9DEMO EU BBS 1_N9DEMO 100\n261016 10:00:02 { + const calls=[],f=new Forwarding({root:'',ports:[]},async(url,opts)=>{calls.push([url,opts]);return 'ok';},()=>({txSuspended:true}));f.profiles=async()=>[{call:'N0TEST',configured:true,transport:'Radio'},{call:'RMS',configured:true,transport:'Internet'}];f.logs=async()=>'';f.context=async()=>'fixture';await assert.rejects(f.start('N0TEST'),/sospese/);assert.equal(calls.length,0);await f.start('RMS');assert.equal(calls.length,2); +}); diff --git a/public/index.html b/public/index.html index 6763af6..6116e06 100644 --- a/public/index.html +++ b/public/index.html @@ -1,5 +1,5 @@ -BPQ Console +BPQ Console