Commands
All commands are sent as json encoded strings. The primary key cmd
represents the requested command being sent to the server. All other paramaters are specific to the command being executed.
- getReceivers
- getRadios
- addReceiver
- removeReceiver
- setRunning
- setFrequency
- setMode
- getVersion
- subscribeToSpots
- subscribeToSpectrum
- subscribeToAudio
{ "cmd": "getReceivers" }
Parameter | Description |
---|---|
Receivers | List of receivers connected to this server |
Receivers.ID | Receiver ID
|
Receivers.Mode | Mode of the receiver e.g. USB |
Receivers.Frequency | Tuned frequency of the receiver |
Receivers.FilterLow | Receiver filter low value |
Receivers.FilterHigh | Receiver filter high value |
{"cmd":"getReceiversResponse","Receivers":[{"cmd":"ReceiverResponse","ID":0,"Mode":"LSB","Frequency":7141000.0,"FilterLow":-3000.0,"FilterHigh":-150.0},...]}
{ "cmd": "getRadios" }
Parameter | Description |
---|---|
Radios | List of radios connected to this server |
Radios.ID | Radio ID
|
Radios.Name | Name of the radio |
Radios.Running | State of the current radio (powered on/off) |
{"cmd":"getRadiosResponse","Radios":[{"ID":0,"Name":"Hermes Lite 2 hpsdr_0-28-192-162-19-221","Running":true}]}
Add a new receiver to a radio by id.
Parameter | Description |
---|---|
ID | Radio ID for request |
{"cmd":"addReceiver","ID":0}
This response is the same as the getReceivers command.
Remove a receiver by receiver id
Parameter | Description |
---|---|
ID | Radio ID for request |
{"cmd":"removeReceiver","ID":0}
This response is the same as the getReceivers command.
Turn on/off the radio by id.
Parameter | Description |
---|---|
ID | Radio ID for request |
Running | Enable/Disable radio |
{"cmd":"setRunning","ID":0,"Running":true}
This response is the same as the getRadios command.
Sets the frequency of a receiver by id.
Parameter | Description |
---|---|
ID | Receiver ID for request |
Frequency | Frequency to tune the receiver |
{"cmd":"setFrequency","ID":0,"Frequency":7141000}
Parameter | Description |
---|---|
ID | Receiver ID
|
Frequency | New frequency of the receiver |
Mode | New mode of the receiver |
FilterLow | Receiver filter low value |
FilterHigh | Receiver filter high value |
{"cmd":"ReceiverResponse","ID":0,"Mode":"LSB","Frequency":7141001.0,"FilterLow":-3000.0,"FilterHigh":-150.0}
Sets the mode of a receiver by id.
Parameter | Description |
---|---|
ID | Receiver ID for request |
Mode | Mode to set the receiver e.g. `LSB |
{"cmd":"setFrequency","ID":0,"Frequency":7141000}
This response is the same as the setFrequency command.
Gets version information from server.
{"cmd":"getVersion"}
Parameter | Description |
---|---|
ProtocolVersion | WebSocket API version |
Host | Application Name |
HostVersion | Application Version |
{"cmd":"getVersionResponse","ProtocolVersion":"0.1.2","Host":"SparkSDR","HostVersion":"2.0.4.5"}
Request spot data from the server.
Parameter | Description |
---|---|
Enable | Subscribe/Unsubscribe to spots |
{"cmd":"subscribeToSpots","Enable":true}
Once subscribed to spot data you will continue to receive spot data from the server until you unsubscribe.
Parameter | Description |
---|---|
spots | List of spots |
{"cmd":"spotResponse","spots":[{"time":"2020-11-30T23:12:00Z","frequency":3576404.0,"tunedfrequency":3575000.0,"power":0,"drift":0,"snr":-7,"dt":-0.0,"msg":"CQ KD0XD EN12","mode":"FT4","distance":1490.7643834497214,"call":"KD0XD","color":1,"locator":"EN12","valid":true,"offsetFrequency":1404.0}]}
Request spectrum data from a receiver by id.
Parameter | Description |
---|---|
RxID | Receiver ID for request |
Enable | Subscribe/Unsubscribe to spectrum |
{"cmd":"subscribeToSpectrum","RxID":0}
Once subscribed to a spectrum channel you will continue to receive spectrum data from the server in the form of binary encoded websocket messages until you unsubscribe.
For more information see Binary Messages#Spectrum
Request audio from a receiver by id.
Parameter | Description |
---|---|
RxID | Receiver ID for request |
Enable | Subscribe/Unsubscribe to audio |
{"cmd":"subscribeToAudio","RxID":0}
Once subscribed to an audio channel you will continue to receive chunked audio data from the server in the form of binary encoded websocket messages until you unsubscribe.
For more information see Binary Messages#Audio