diff --git a/dxspider-proxy/server.js b/dxspider-proxy/server.js index bc3bd0c..ce1761c 100644 --- a/dxspider-proxy/server.js +++ b/dxspider-proxy/server.js @@ -19,12 +19,13 @@ app.use(express.json()); const CONFIG = { // DX Spider nodes to try (in order) nodes: [ + { host: 'dxspider.co.uk', port: 7300, name: 'DX Spider UK (G6NHU)' }, { host: 'dxc.nc7j.com', port: 7373, name: 'NC7J' }, { host: 'dxc.ai9t.com', port: 7373, name: 'AI9T' }, - { host: 'dxc.w6cua.org', port: 7300, name: 'W6CUA' }, - { host: 'spider.ham-radio-deluxe.com', port: 8000, name: 'HRD' } + { host: 'dxc.w6cua.org', port: 7300, name: 'W6CUA' } ], - callsign: process.env.CALLSIGN || 'OPENHAMCLOCK', + // Callsign with SSID -56 for OpenHamClock (HamClock uses -55) + callsign: (process.env.CALLSIGN || 'OPENHAMCLOCK') + '-56', spotRetentionMs: 30 * 60 * 1000, // 30 minutes reconnectDelayMs: 10000, // 10 seconds between reconnect attempts maxReconnectAttempts: 3, @@ -201,7 +202,7 @@ const connect = () => { log('CONNECT', `Attempting connection to ${node.name} (${node.host}:${node.port})`); client = new net.Socket(); - client.setTimeout(30000); + client.setTimeout(60000); // 60 second timeout client.connect(node.port, node.host, () => { connected = true; @@ -216,6 +217,23 @@ const connect = () => { if (client && connected) { client.write(CONFIG.callsign + '\r\n'); log('AUTH', `Sent callsign: ${CONFIG.callsign}`); + + // After login, enable DX spot announcements + setTimeout(() => { + if (client && connected) { + // Request recent spots first + client.write('sh/dx 30\r\n'); + log('CMD', 'Sent: sh/dx 30'); + + // Then enable the spot stream (some nodes need this) + setTimeout(() => { + if (client && connected) { + client.write('set/dx\r\n'); + log('CMD', 'Sent: set/dx (enable spot stream)'); + } + }, 2000); + } + }, 2000); } }, 1000); diff --git a/server.js b/server.js index 4b1bcb6..e854cdc 100644 --- a/server.js +++ b/server.js @@ -562,12 +562,15 @@ app.get('/api/dxcluster/spots', async (req, res) => { // Helper function for DX Spider (telnet-based, works locally/Pi) // Multiple nodes for failover + // DX Spider nodes - dxspider.co.uk primary per G6NHU + // SSID -56 for OpenHamClock (HamClock uses -55) const DXSPIDER_NODES = [ + { host: 'dxspider.co.uk', port: 7300 }, { host: 'dxc.nc7j.com', port: 7373 }, { host: 'dxc.ai9t.com', port: 7373 }, - { host: 'dxc.w6cua.org', port: 7300 }, - { host: 'spider.ham-radio-deluxe.com', port: 8000 } + { host: 'dxc.w6cua.org', port: 7300 } ]; + const DXSPIDER_SSID = '-56'; // OpenHamClock SSID async function fetchDXSpider() { // Check cache first (use longer cache to reduce connection attempts) @@ -754,7 +757,7 @@ app.get('/api/dxcluster/sources', (req, res) => { { id: 'auto', name: 'Auto (Best Available)', description: 'Tries Proxy first, then HamQTH, then direct telnet' }, { id: 'proxy', name: 'DX Spider Proxy ⭐', description: 'Our dedicated proxy service - real-time telnet feed via HTTP' }, { id: 'hamqth', name: 'HamQTH', description: 'HamQTH.com CSV feed (HTTP, works everywhere)' }, - { id: 'dxspider', name: 'DX Spider Direct', description: 'Direct telnet to DX cluster (works locally/Pi only)' } + { id: 'dxspider', name: 'DX Spider Direct', description: 'Direct telnet to dxspider.co.uk (G6NHU) - works locally/Pi' } ]); });