Use riglib to interact with rigs #21

Open
W1CDN wants to merge 3 commits from riglib into main
Owner

Closes #19.

Closes #19.
W1CDN added the enhancement label 2026-09-12 16:34:39 -05:00
W1CDN added 1 commit 2026-09-12 16:34:40 -05:00
Author
Owner

The S-meter values coming out are much lower (-80) and allegedly dBm. But if I use the function to convert them to S-units, they seem much greater than I hear through the headphones on the QMX. With no antenna!

From my own code I was getting back positive numbers 000 to ~040 from the QMX with no antenna. Similar to what I get from
qmx-cat with python3 qmx-cat -p /dev/tty.usbmodem1101 cat SM.

In which case I'm not sure if I modified riglib right, or am interpreting the QMX numbers right. In the manual it just says "Returns the S-meter value in dB."

The S-meter values coming out are much lower (-80) and allegedly dBm. But if I use the function to convert them to S-units, they seem much greater than I hear through the headphones on the QMX. With no antenna! From my own code I was getting back positive numbers 000 to ~040 from the QMX with no antenna. Similar to what I get from [qmx-cat](https://github.com/toddfoster/qmx-cat) with `python3 qmx-cat -p /dev/tty.usbmodem1101 cat SM`. In which case I'm not sure if I modified riglib right, or am interpreting the QMX numbers right. In the manual it just says "Returns the S-meter value in dB."
W1CDN added 1 commit 2026-09-12 18:08:35 -05:00
Author
Owner

From QMX manual:

S0 (-127dBm) to S9+36dB (-37dBm)

From translation of https://github.com/SQK-014/QMX-Signal-Monitor:

Conversion based on the true dB S-meter specifications in the QRP Labs QMX operation manual (S0 = -127 dBm, 6 dB per S-unit, upper limit S9 + 36 dB = -37 dBm). Values ​​exceeding S9 are displayed in the format "S9 + ** dB".

riglib says

/// Uses the standard HF S-meter calibration (50 ohm, IARU):
/// - S9 = −73 dBm
/// - Each S-unit = 6 dB
/// - Below S1, returns "S0"
/// - Above S9, returns "S9+N dB" (rounded to the nearest integer dB)

From [QMX manual](https://qrp-labs.com/images/qmx/manuals/operation_1_04_004.pdf): > S0 (-127dBm) to S9+36dB (-37dBm) From translation of https://github.com/SQK-014/QMX-Signal-Monitor: > Conversion based on the true dB S-meter specifications in the QRP Labs QMX operation manual (S0 = -127 dBm, 6 dB per S-unit, upper limit S9 + 36 dB = -37 dBm). Values ​​exceeding S9 are displayed in the format "S9 + ** dB". [riglib](https://github.com/chadsbrown/riglib/blob/b8adc13dc715652470509ae5ec6965ab8a2b8aa9/crates/riglib-core/src/helpers.rs#L26-L30) says > /// Uses the standard HF S-meter calibration (50 ohm, IARU): /// - S9 = −73 dBm /// - Each S-unit = 6 dB /// - Below S1, returns "S0" /// - Above S9, returns "S9+N dB" (rounded to the nearest integer dB)
Author
Owner

I changed something that stopped me from getting -80 numbers and now getting -5 numbers, but the QMX screen tells me it should be S1 or so.

EDIT: and now it's back. Weird. But the values are too high.

VFO-A: 14100000 Hz
2026-09-12 18:40:02 -61  S9+12 dB
2026-09-12 18:40:03 -80.2  S8
2026-09-12 18:40:04 -73  S9
2026-09-12 18:40:05 -76.6  S8
2026-09-12 18:40:06 -73  S9
2026-09-12 18:40:07 -98.2  S5
2026-09-12 18:40:08 -76.6  S8
2026-09-12 18:40:09 -91  S6
2026-09-12 18:40:10 -76.6  S8
I changed something that stopped me from getting -80 numbers and now getting -5 numbers, but the QMX screen tells me it should be S1 or so. EDIT: and now it's back. Weird. But the values are too high. ``` VFO-A: 14100000 Hz 2026-09-12 18:40:02 -61 S9+12 dB 2026-09-12 18:40:03 -80.2 S8 2026-09-12 18:40:04 -73 S9 2026-09-12 18:40:05 -76.6 S8 2026-09-12 18:40:06 -73 S9 2026-09-12 18:40:07 -98.2 S5 2026-09-12 18:40:08 -76.6 S8 2026-09-12 18:40:09 -91 S6 2026-09-12 18:40:10 -76.6 S8 ```
Author
Owner

Possible that QMX is supposed to report dB relative to S0. So S1 is 6, S2 is 12, S3 is 18...

With qmx-cat that looks like what I get. S7 on the screen is 042. (42 / 6 = 7).

The "smart" way to do this--until QMX is added to riglib--is to use my own protocol for QMX and riglib for other rigs. Easier said than done.

Possible that QMX is supposed to report dB relative to S0. So S1 is 6, S2 is 12, S3 is 18... With qmx-cat that looks like what I get. S7 on the screen is 042. (42 / 6 = 7). The "smart" way to do this--until QMX is added to riglib--is to use my own protocol for QMX and riglib for other rigs. Easier said than done.
W1CDN added 1 commit 2026-09-12 20:38:33 -05:00
Author
Owner

Setting this aside for the moment.

Setting this aside for the moment.
This pull request has changes conflicting with the target branch.
  • src/main.rs
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin riglib:riglib
git checkout riglib
Sign in to join this conversation.