hamlib 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +367 -163
- package/index.d.ts +299 -1
- package/lib/binary-loader.js +3 -3
- package/lib/index.js +237 -0
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/hamlib.node +0 -0
- package/prebuilds/linux-arm64/hamlib.node +0 -0
- package/prebuilds/linux-x64/hamlib.node +0 -0
- package/src/hamlib.cpp +1128 -1
- package/src/hamlib.h +48 -0
package/Readme.md
CHANGED
|
@@ -1,253 +1,457 @@
|
|
|
1
1
|
# node-hamlib
|
|
2
2
|
|
|
3
|
-
A Node.js wrapper for [Hamlib](https://hamlib.github.io/) - control amateur radio transceivers from JavaScript/TypeScript.
|
|
3
|
+
A comprehensive Node.js wrapper for [Hamlib](https://hamlib.github.io/) - control amateur radio transceivers from JavaScript/TypeScript.
|
|
4
4
|
|
|
5
5
|
## 🚀 Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
7
|
+
- **Built-in Methods**: Complete radio control API including memory channels, RIT/XIT, scanning, levels, functions, and more
|
|
8
|
+
- **303+ Supported Radios**: Works with Yaesu, Icom, Kenwood, Elecraft, FlexRadio, and many more
|
|
9
|
+
- **Multi-platform**: Pre-built binaries for Windows x64, Linux x64/ARM64, macOS ARM64
|
|
10
|
+
- **Connection Types**: Serial ports, network (rigctld), and direct control
|
|
11
|
+
- **TypeScript Support**: Full type definitions and IntelliSense
|
|
12
|
+
- **Modern JavaScript**: CommonJS and ES Modules support
|
|
13
13
|
|
|
14
|
-
## 📦
|
|
14
|
+
## 📦 Quick Start
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
npm install node-hamlib
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
2. Fall back to compiling from source if needed
|
|
23
|
-
3. Provide helpful error messages for missing dependencies
|
|
20
|
+
```javascript
|
|
21
|
+
const { HamLib } = require('node-hamlib');
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
// Find your radio model
|
|
24
|
+
const rigs = HamLib.getSupportedRigs();
|
|
25
|
+
console.log('Supported radios:', rigs.length);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
// Connect to radio
|
|
28
|
+
const rig = new HamLib(1035, '/dev/ttyUSB0'); // FT-991A
|
|
29
|
+
rig.open();
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- **Windows**: hamlib via vcpkg or manual installation
|
|
36
|
-
- **Build tools**: `node-gyp` and platform-specific compilers
|
|
31
|
+
// Basic control
|
|
32
|
+
rig.setFrequency(144390000); // 144.39 MHz
|
|
33
|
+
rig.setMode('FM');
|
|
34
|
+
rig.setPtt(true);
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
// Get status
|
|
37
|
+
console.log('Frequency:', rig.getFrequency());
|
|
38
|
+
console.log('Mode:', rig.getMode());
|
|
39
|
+
console.log('Signal:', rig.getStrength());
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
sudo apt-get install libhamlib-dev libhamlib-utils
|
|
41
|
+
rig.close();
|
|
42
|
+
```
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
brew install hamlib
|
|
44
|
+
## 📡 Complete API Reference
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
### 🔍 Radio Discovery
|
|
47
|
+
|
|
48
|
+
#### `HamLib.getSupportedRigs()`
|
|
49
|
+
Get all supported radio models
|
|
50
|
+
```javascript
|
|
51
|
+
const rigs = HamLib.getSupportedRigs();
|
|
52
|
+
console.log(`Found ${rigs.length} supported radios`);
|
|
53
|
+
|
|
54
|
+
// Find your radio
|
|
55
|
+
const yaesu = rigs.filter(r => r.mfgName === 'Yaesu');
|
|
56
|
+
const ft991a = rigs.find(r => r.modelName === 'FT-991A');
|
|
57
|
+
console.log('FT-991A Model ID:', ft991a.rigModel);
|
|
49
58
|
```
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
### 🔌 Connection Management
|
|
52
61
|
|
|
53
|
-
|
|
62
|
+
#### `new HamLib(model, port)`
|
|
63
|
+
Create radio instance
|
|
54
64
|
```javascript
|
|
55
|
-
|
|
65
|
+
// Serial connection
|
|
66
|
+
const rig = new HamLib(1035, '/dev/ttyUSB0'); // Linux
|
|
67
|
+
const rig = new HamLib(1035, '/dev/cu.usbserial-1420'); // macOS
|
|
68
|
+
const rig = new HamLib(1035, 'COM3'); // Windows
|
|
56
69
|
|
|
57
|
-
//
|
|
58
|
-
const rig = new HamLib(1035, '
|
|
70
|
+
// Network connection
|
|
71
|
+
const rig = new HamLib(1035, 'localhost:4532'); // rigctld
|
|
72
|
+
```
|
|
59
73
|
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
#### `open()` / `close()` / `destroy()`
|
|
75
|
+
Connection control
|
|
76
|
+
```javascript
|
|
77
|
+
rig.open(); // Open connection
|
|
78
|
+
rig.close(); // Close (can reopen)
|
|
79
|
+
rig.destroy(); // Destroy permanently
|
|
80
|
+
```
|
|
62
81
|
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
#### `getConnectionInfo()`
|
|
83
|
+
Get connection details
|
|
84
|
+
```javascript
|
|
85
|
+
const info = rig.getConnectionInfo();
|
|
86
|
+
console.log('Connection type:', info.connectionType);
|
|
87
|
+
console.log('Port:', info.port);
|
|
88
|
+
console.log('Status:', info.status);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 📻 Basic Radio Control
|
|
92
|
+
|
|
93
|
+
#### Frequency Control
|
|
94
|
+
```javascript
|
|
95
|
+
// Set frequency (Hz)
|
|
96
|
+
rig.setFrequency(144390000);
|
|
97
|
+
rig.setFrequency(144390000, 'VFO-A');
|
|
98
|
+
|
|
99
|
+
// Get frequency
|
|
100
|
+
const freq = rig.getFrequency();
|
|
101
|
+
const freqA = rig.getFrequency('VFO-A');
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### Mode Control
|
|
105
|
+
```javascript
|
|
106
|
+
// Set mode
|
|
65
107
|
rig.setMode('FM');
|
|
66
|
-
rig.
|
|
108
|
+
rig.setMode('USB', 'wide');
|
|
67
109
|
|
|
68
|
-
// Get
|
|
69
|
-
|
|
70
|
-
console.log('
|
|
71
|
-
console.log('
|
|
110
|
+
// Get mode
|
|
111
|
+
const mode = rig.getMode();
|
|
112
|
+
console.log('Mode:', mode.mode);
|
|
113
|
+
console.log('Bandwidth:', mode.bandwidth);
|
|
114
|
+
```
|
|
72
115
|
|
|
73
|
-
|
|
74
|
-
|
|
116
|
+
#### VFO Control
|
|
117
|
+
```javascript
|
|
118
|
+
// Set VFO
|
|
119
|
+
rig.setVfo('VFO-A');
|
|
120
|
+
rig.setVfo('VFO-B');
|
|
121
|
+
|
|
122
|
+
// Get current VFO
|
|
123
|
+
const vfo = rig.getVfo();
|
|
75
124
|
```
|
|
76
125
|
|
|
77
|
-
|
|
126
|
+
#### PTT Control
|
|
78
127
|
```javascript
|
|
79
|
-
|
|
128
|
+
rig.setPtt(true); // Transmit
|
|
129
|
+
rig.setPtt(false); // Receive
|
|
130
|
+
```
|
|
80
131
|
|
|
81
|
-
|
|
82
|
-
|
|
132
|
+
#### Signal Monitoring
|
|
133
|
+
```javascript
|
|
134
|
+
const strength = rig.getStrength();
|
|
135
|
+
console.log('Signal strength:', strength);
|
|
83
136
|
```
|
|
84
137
|
|
|
85
|
-
###
|
|
86
|
-
```typescript
|
|
87
|
-
import { HamLib, ConnectionInfo, ModeInfo } from 'node-hamlib';
|
|
138
|
+
### 💾 Memory Channel Management
|
|
88
139
|
|
|
89
|
-
|
|
90
|
-
|
|
140
|
+
#### `setMemoryChannel(channel, data)`
|
|
141
|
+
Store memory channel
|
|
142
|
+
```javascript
|
|
143
|
+
rig.setMemoryChannel(1, {
|
|
144
|
+
frequency: 144390000,
|
|
145
|
+
mode: 'FM',
|
|
146
|
+
description: 'Local Repeater'
|
|
147
|
+
});
|
|
148
|
+
```
|
|
91
149
|
|
|
92
|
-
|
|
93
|
-
|
|
150
|
+
#### `getMemoryChannel(channel, readOnly)`
|
|
151
|
+
Retrieve memory channel
|
|
152
|
+
```javascript
|
|
153
|
+
const channel = rig.getMemoryChannel(1);
|
|
154
|
+
console.log('Channel 1:', channel);
|
|
94
155
|
```
|
|
95
156
|
|
|
96
|
-
|
|
157
|
+
#### `selectMemoryChannel(channel)`
|
|
158
|
+
Select memory channel
|
|
159
|
+
```javascript
|
|
160
|
+
rig.selectMemoryChannel(1);
|
|
161
|
+
```
|
|
97
162
|
|
|
98
|
-
###
|
|
163
|
+
### 🎛️ RIT/XIT Control
|
|
164
|
+
|
|
165
|
+
#### RIT (Receiver Incremental Tuning)
|
|
99
166
|
```javascript
|
|
100
|
-
//
|
|
101
|
-
const
|
|
167
|
+
rig.setRit(100); // +100 Hz offset
|
|
168
|
+
const rit = rig.getRit();
|
|
169
|
+
```
|
|
102
170
|
|
|
103
|
-
|
|
104
|
-
|
|
171
|
+
#### XIT (Transmitter Incremental Tuning)
|
|
172
|
+
```javascript
|
|
173
|
+
rig.setXit(-50); // -50 Hz offset
|
|
174
|
+
const xit = rig.getXit();
|
|
175
|
+
```
|
|
105
176
|
|
|
106
|
-
|
|
107
|
-
|
|
177
|
+
#### Clear RIT/XIT
|
|
178
|
+
```javascript
|
|
179
|
+
rig.clearRitXit(); // Clear both offsets
|
|
108
180
|
```
|
|
109
181
|
|
|
110
|
-
###
|
|
182
|
+
### 🔍 Scanning Operations
|
|
183
|
+
|
|
184
|
+
#### `startScan(type, channel)`
|
|
185
|
+
Start scanning
|
|
111
186
|
```javascript
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
187
|
+
rig.startScan('VFO'); // VFO scan
|
|
188
|
+
rig.startScan('MEM'); // Memory scan
|
|
189
|
+
rig.startScan('PROG'); // Program scan
|
|
115
190
|
```
|
|
116
191
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
192
|
+
#### `stopScan()`
|
|
193
|
+
Stop scanning
|
|
194
|
+
```javascript
|
|
195
|
+
rig.stopScan();
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 🎚️ Level Controls
|
|
199
|
+
|
|
200
|
+
#### `getSupportedLevels()`
|
|
201
|
+
Get available level controls
|
|
202
|
+
```javascript
|
|
203
|
+
const levels = rig.getSupportedLevels();
|
|
204
|
+
console.log('Available levels:', levels);
|
|
205
|
+
// ['AF', 'RF', 'SQL', 'RFPOWER', 'MICGAIN', ...]
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
#### `setLevel(type, value)` / `getLevel(type)`
|
|
209
|
+
Control audio and RF levels
|
|
210
|
+
```javascript
|
|
211
|
+
rig.setLevel('AF', 0.7); // Audio gain 70%
|
|
212
|
+
rig.setLevel('RF', 0.5); // RF gain 50%
|
|
213
|
+
rig.setLevel('SQL', 0.3); // Squelch 30%
|
|
214
|
+
rig.setLevel('RFPOWER', 0.5); // TX power 50%
|
|
215
|
+
rig.setLevel('MICGAIN', 0.8); // Mic gain 80%
|
|
216
|
+
|
|
217
|
+
// Get levels
|
|
218
|
+
const audioGain = rig.getLevel('AF');
|
|
219
|
+
const rfGain = rig.getLevel('RF');
|
|
220
|
+
```
|
|
121
221
|
|
|
122
|
-
|
|
123
|
-
rigctld -m 1035 -r /dev/ttyUSB0 -t 5001
|
|
222
|
+
### 🔧 Function Controls
|
|
124
223
|
|
|
125
|
-
|
|
126
|
-
|
|
224
|
+
#### `getSupportedFunctions()`
|
|
225
|
+
Get available function controls
|
|
226
|
+
```javascript
|
|
227
|
+
const functions = rig.getSupportedFunctions();
|
|
228
|
+
console.log('Available functions:', functions);
|
|
229
|
+
// ['NB', 'COMP', 'VOX', 'TONE', 'TSQL', 'TUNER', ...]
|
|
127
230
|
```
|
|
128
231
|
|
|
129
|
-
|
|
232
|
+
#### `setFunction(type, enable)` / `getFunction(type)`
|
|
233
|
+
Control radio functions
|
|
234
|
+
```javascript
|
|
235
|
+
rig.setFunction('NB', true); // Enable noise blanker
|
|
236
|
+
rig.setFunction('COMP', true); // Enable compressor
|
|
237
|
+
rig.setFunction('VOX', true); // Enable VOX
|
|
238
|
+
rig.setFunction('TUNER', true); // Enable auto tuner
|
|
239
|
+
|
|
240
|
+
// Get function status
|
|
241
|
+
const nbEnabled = rig.getFunction('NB');
|
|
242
|
+
const compEnabled = rig.getFunction('COMP');
|
|
243
|
+
```
|
|
130
244
|
|
|
131
|
-
###
|
|
132
|
-
- `new HamLib(model, port?)`: Create a new instance
|
|
133
|
-
- `model`: Radio model number (find yours with `rigctl -l`)
|
|
134
|
-
- `port`: Optional serial port or network address
|
|
245
|
+
### 📡 Split Operations
|
|
135
246
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
247
|
+
#### Split Frequency
|
|
248
|
+
```javascript
|
|
249
|
+
rig.setSplitFreq(144340000); // TX frequency
|
|
250
|
+
const txFreq = rig.getSplitFreq();
|
|
251
|
+
```
|
|
140
252
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
253
|
+
#### Split Mode
|
|
254
|
+
```javascript
|
|
255
|
+
rig.setSplitMode('FM', 'wide'); // TX mode
|
|
256
|
+
const txMode = rig.getSplitMode();
|
|
257
|
+
```
|
|
146
258
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
- `getConnectionInfo()`: Get connection details
|
|
259
|
+
#### Split Control
|
|
260
|
+
```javascript
|
|
261
|
+
rig.setSplit(true, 'VFO-B'); // Enable split
|
|
262
|
+
const splitStatus = rig.getSplit();
|
|
263
|
+
```
|
|
153
264
|
|
|
154
|
-
|
|
265
|
+
### 📻 VFO Operations
|
|
155
266
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
267
|
+
#### `vfoOperation(operation)`
|
|
268
|
+
VFO operations
|
|
269
|
+
```javascript
|
|
270
|
+
rig.vfoOperation('CPY'); // Copy VFO A to B
|
|
271
|
+
rig.vfoOperation('XCHG'); // Exchange VFO A and B
|
|
272
|
+
rig.vfoOperation('UP'); // Frequency up
|
|
273
|
+
rig.vfoOperation('DOWN'); // Frequency down
|
|
274
|
+
rig.vfoOperation('TOGGLE'); // Toggle VFO A/B
|
|
275
|
+
```
|
|
160
276
|
|
|
161
|
-
|
|
162
|
-
npm run build
|
|
277
|
+
### 📶 Antenna Selection
|
|
163
278
|
|
|
164
|
-
|
|
165
|
-
|
|
279
|
+
#### `setAntenna(antenna)` / `getAntenna()`
|
|
280
|
+
Antenna control
|
|
281
|
+
```javascript
|
|
282
|
+
rig.setAntenna(1); // Select antenna 1
|
|
283
|
+
rig.setAntenna(2); // Select antenna 2
|
|
284
|
+
const antenna = rig.getAntenna();
|
|
166
285
|
```
|
|
167
286
|
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
# Test module loading
|
|
171
|
-
node test/test_loader.js
|
|
287
|
+
## 🎯 Complete Example
|
|
172
288
|
|
|
173
|
-
|
|
174
|
-
node
|
|
289
|
+
```javascript
|
|
290
|
+
const { HamLib } = require('node-hamlib');
|
|
175
291
|
|
|
176
|
-
|
|
177
|
-
|
|
292
|
+
async function radioControl() {
|
|
293
|
+
// Find radios
|
|
294
|
+
const rigs = HamLib.getSupportedRigs();
|
|
295
|
+
const ft991a = rigs.find(r => r.modelName === 'FT-991A');
|
|
296
|
+
|
|
297
|
+
if (!ft991a) {
|
|
298
|
+
console.log('FT-991A not found');
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Connect
|
|
303
|
+
const rig = new HamLib(ft991a.rigModel, '/dev/ttyUSB0');
|
|
304
|
+
|
|
305
|
+
try {
|
|
306
|
+
rig.open();
|
|
307
|
+
console.log('Connected to', rig.getConnectionInfo().port);
|
|
308
|
+
|
|
309
|
+
// Set up radio
|
|
310
|
+
rig.setFrequency(144390000);
|
|
311
|
+
rig.setMode('FM');
|
|
312
|
+
rig.setLevel('RFPOWER', 0.5);
|
|
313
|
+
rig.setFunction('NB', true);
|
|
314
|
+
|
|
315
|
+
// Store memory channel
|
|
316
|
+
rig.setMemoryChannel(1, {
|
|
317
|
+
frequency: 144390000,
|
|
318
|
+
mode: 'FM',
|
|
319
|
+
description: 'Local Repeater'
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
// Monitor signal
|
|
323
|
+
setInterval(() => {
|
|
324
|
+
const freq = rig.getFrequency();
|
|
325
|
+
const mode = rig.getMode();
|
|
326
|
+
const strength = rig.getStrength();
|
|
327
|
+
|
|
328
|
+
console.log(`${freq/1000000} MHz ${mode.mode} S:${strength}`);
|
|
329
|
+
}, 1000);
|
|
330
|
+
|
|
331
|
+
} catch (error) {
|
|
332
|
+
console.error('Error:', error.message);
|
|
333
|
+
} finally {
|
|
334
|
+
rig.close();
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
radioControl();
|
|
178
339
|
```
|
|
179
340
|
|
|
180
|
-
##
|
|
341
|
+
## 📋 Supported Radios
|
|
342
|
+
|
|
343
|
+
This library supports **303+ radio models** from major manufacturers:
|
|
344
|
+
|
|
345
|
+
| Manufacturer | Models | Popular Radios |
|
|
346
|
+
|--------------|--------|----------------|
|
|
347
|
+
| **Yaesu** | 46 | FT-991A, FT-891, FT-857D, FT-817ND |
|
|
348
|
+
| **Icom** | 83 | IC-7300, IC-9700, IC-705, IC-7610 |
|
|
349
|
+
| **Kenwood** | 35 | TS-2000, TS-590SG, TS-890S, TH-D74 |
|
|
350
|
+
| **Elecraft** | 7 | K3, K4, KX3, KX2 |
|
|
351
|
+
| **FlexRadio** | 10 | 6300, 6400, 6500, 6600, 6700 |
|
|
352
|
+
| **Others** | 122 | AOR, JRC, Ten-Tec, Winradio, etc. |
|
|
353
|
+
|
|
354
|
+
### Finding Your Radio
|
|
355
|
+
```javascript
|
|
356
|
+
const rigs = HamLib.getSupportedRigs();
|
|
181
357
|
|
|
358
|
+
// Search by manufacturer
|
|
359
|
+
const yaesu = rigs.filter(r => r.mfgName === 'Yaesu');
|
|
360
|
+
|
|
361
|
+
// Search by model name
|
|
362
|
+
const ft991a = rigs.find(r => r.modelName.includes('FT-991A'));
|
|
363
|
+
|
|
364
|
+
// List all radios
|
|
365
|
+
rigs.forEach(rig => {
|
|
366
|
+
console.log(`${rig.rigModel}: ${rig.mfgName} ${rig.modelName}`);
|
|
367
|
+
});
|
|
182
368
|
```
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
369
|
+
|
|
370
|
+
## 🛠️ Installation & Setup
|
|
371
|
+
|
|
372
|
+
### System Requirements
|
|
373
|
+
- Node.js 12.0.0 or higher
|
|
374
|
+
- Supported platforms: Windows x64, Linux x64/ARM64, macOS ARM64
|
|
375
|
+
|
|
376
|
+
### Install Dependencies (if building from source)
|
|
377
|
+
```bash
|
|
378
|
+
# Ubuntu/Debian
|
|
379
|
+
sudo apt-get install libhamlib-dev
|
|
380
|
+
|
|
381
|
+
# macOS
|
|
382
|
+
brew install hamlib
|
|
383
|
+
|
|
384
|
+
# Windows
|
|
385
|
+
vcpkg install hamlib:x64-windows
|
|
195
386
|
```
|
|
196
387
|
|
|
197
|
-
|
|
388
|
+
### Building from Source
|
|
389
|
+
```bash
|
|
390
|
+
npm install
|
|
391
|
+
npm run build
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Testing
|
|
395
|
+
```bash
|
|
396
|
+
npm test
|
|
397
|
+
```
|
|
198
398
|
|
|
199
|
-
|
|
200
|
-
2. Create a feature branch
|
|
201
|
-
3. Make your changes
|
|
202
|
-
4. Test thoroughly
|
|
203
|
-
5. Submit a pull request
|
|
399
|
+
## 🔧 Connection Types
|
|
204
400
|
|
|
205
|
-
|
|
401
|
+
### Serial Connection
|
|
402
|
+
```javascript
|
|
403
|
+
// Linux
|
|
404
|
+
const rig = new HamLib(1035, '/dev/ttyUSB0');
|
|
206
405
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
| Linux | x64 | ✅ Pre-built (native) |
|
|
210
|
-
| Linux | ARM64 | ✅ Pre-built (native) |
|
|
211
|
-
| macOS | ARM64 | ✅ Pre-built (native) |
|
|
212
|
-
| Windows | x64 | ✅ Pre-built (native) |
|
|
406
|
+
// macOS
|
|
407
|
+
const rig = new HamLib(1035, '/dev/cu.usbserial-1420');
|
|
213
408
|
|
|
214
|
-
|
|
409
|
+
// Windows
|
|
410
|
+
const rig = new HamLib(1035, 'COM3');
|
|
411
|
+
```
|
|
215
412
|
|
|
216
|
-
###
|
|
217
|
-
|
|
413
|
+
### Network Connection (rigctld)
|
|
414
|
+
```javascript
|
|
415
|
+
const rig = new HamLib(1035, 'localhost:4532');
|
|
416
|
+
```
|
|
218
417
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
418
|
+
Start rigctld:
|
|
419
|
+
```bash
|
|
420
|
+
rigctld -m 1035 -r /dev/ttyUSB0 -t 4532
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
## 🐛 Troubleshooting
|
|
223
424
|
|
|
224
|
-
###
|
|
425
|
+
### Permission Issues (Linux)
|
|
225
426
|
```bash
|
|
226
|
-
# Linux: Add user to dialout group
|
|
227
427
|
sudo usermod -a -G dialout $USER
|
|
428
|
+
# Log out and back in
|
|
429
|
+
```
|
|
228
430
|
|
|
229
|
-
|
|
431
|
+
### Finding Serial Ports
|
|
432
|
+
```bash
|
|
433
|
+
# Linux
|
|
230
434
|
ls /dev/tty*
|
|
231
435
|
|
|
232
|
-
#
|
|
233
|
-
|
|
436
|
+
# macOS
|
|
437
|
+
ls /dev/cu.*
|
|
438
|
+
|
|
439
|
+
# Windows
|
|
440
|
+
# Use Device Manager
|
|
234
441
|
```
|
|
235
442
|
|
|
236
|
-
###
|
|
443
|
+
### Testing Connection
|
|
237
444
|
```bash
|
|
238
|
-
# Test
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
# In telnet session:
|
|
242
|
-
f # get frequency
|
|
243
|
-
q # quit
|
|
445
|
+
# Test with rigctl
|
|
446
|
+
rigctl -m 1035 -r /dev/ttyUSB0 f
|
|
244
447
|
```
|
|
245
448
|
|
|
246
449
|
## 📄 License
|
|
247
450
|
|
|
248
|
-
|
|
451
|
+
LGPL - see [COPYING](COPYING) file for details.
|
|
249
452
|
|
|
250
|
-
## 🔗
|
|
453
|
+
## 🔗 Links
|
|
251
454
|
|
|
252
|
-
- [Hamlib](https://hamlib.github.io/)
|
|
253
|
-
- [
|
|
455
|
+
- [Hamlib Project](https://hamlib.github.io/)
|
|
456
|
+
- [Supported Radios](https://github.com/Hamlib/Hamlib/wiki/Supported-Radios)
|
|
457
|
+
- [rigctl Documentation](https://hamlib.github.io/manpages/rigctl.html)
|