gbowne1 / RadioLogger

A Radio Logging application build with NodeJS and ExpressJS
GNU General Public License v3.0
6 stars 7 forks source link

Add a Rig Control page accessible from the Dashboard #55

Open gbowne1 opened 1 year ago

gbowne1 commented 1 year ago

Add a Hamlib Rig Control panel using the API package. Not sure whether its a client or server side package.

1) add the Hamlib package with npm i hamlib

use the package with const hamlib = require('hamlib');

Define a new route

// Get current frequency
app.get('/rigcontrol/freq', (req, res) => {
  const freq = hamlib.get_freq();
  res.send(`Current frequency: \${freq}`);
});

// Set frequency
app.post('/rigcontrol/freq', (req, res) => {
  const { freq } = req.body;
  hamlib.set_freq(freq);
  res.send(`Frequency set to: \${freq}`);
});
gbowne1 commented 1 year ago

@jzunigarce I wanna work on this soon. It needs a route, controller and middleware and the package added to client and server.