The Console tab
The radio's wire -- every byte between ShackRat and the radio, as it happens -- and a line to type Lua into, to ask the radio things or tell it things. It's like a web browser's JavaScript console, for one radio. It's there for working out how a radio behaves, and for trying a command before ShackRat has a button for it. Everyday operating doesn't need it.
In beta. For now it's only on a radio plugged into this computer, not one on a ShackRat server.
What it shows
Each line, newest at the bottom:
| Line | What it is |
|---|---|
› radio.frequency |
What you typed. |
14074000 |
What it came to. A string is in quotes, and bytes that aren't text show as hex("…"). |
✕ … |
Why it failed. |
12:00:01.234 > FE FE A4 E0 03 FD |
Bytes sent to the radio, with the time: ShackRat's own, as it follows the radio, as well as yours. |
12:00:01.250 < FE FE E0 A4 03 FD … |
Bytes from the radio. |
# … |
A note: a line stopped for running too long, say. |
Wire at the top shows or hides the bytes, leaving what you typed and its answers. Clear empties it. You can select and copy any of it.
What you can type
A line of Lua. Press Enter to run it, and the arrow keys go back through what you've typed. Variables you set stay for the next line.
At two levels:
-
ShackRat's view of the radio, the same as the pane's own controls:
radio.frequency -- the pane's active VFO, in hertz radio.frequency = 14074000 -- tune it radio.mode = "USB" radio.name, radio.vfo, radio.connected, radio.transmitting radio.controls() -- its settings' ids radio.get("rx.af") -- one setting radio.set("rx.af", 128) -
Raw commands, in the radio's own protocol, exactly as you give them:
send(hex("FE FE 94 E0 03 FD")) -- an Icom: read the frequency read{ending = hex("FD")} -- what came back since send("FA;") ; read{ending = ";"} -- a Yaesu or Kenwood tohex(read{n = 11, timeout = 500})readgives what the radio sent after your lastsend: up toending, ornbytes, or what came withintimeout(a second unless you say). ShackRat's own traffic goes on too, so an answer can be one meant for it.
print(…) shows anything, and hex and tohex turn hex into bytes and
back. There's no io, os or require: a line can't reach files, the
network or the rest of ShackRat. A line that runs over 30 seconds is
stopped, and a new session started, so its variables are gone.
Before anything is sent
The first time each raw command is sent, the console shows it and asks:
- Don't send: it isn't, and the line fails with "Not sent".
- Send once: sent now, and asked again next time.
- Send for this session: not asked about that command again until the app restarts.
A raw command can change the radio's settings, and some key it. Send nothing that transmits without the station owner's authorization. ShackRat can't tell from the bytes which commands transmit, so knowing is up to you. Setting a control that transmits, such as the tuner's Tune, is asked about every time.
Whose console it is
On a ShackRat server with several users, only the radio's control operator can type here. Anyone else sees W8XYZ has control and Ask, as in the pane's title bar (the radio's pane), and can still watch the wire.