DK6OV
2015-11-25 18:10:58 UTC
Hello hamlib developers,
I am running a SunSDR2 Pro at a Linux-computer. The Linux-software for
the SDR supports rig-control with Kenwood TS-480 commands. I often use
the program wsjt-x, that controls the rig via hamlib. I connect both
programs via “virtual serial cable” (socat).
Most things works well, but setting ptt on and off via cat-command
interrupts the program with "Hamlib error: Protocol error while setting
PTT off".
I made some tests with rigctrl:
./rigctl -vvvvv -m 228 -r /dev/ttyUSB9
rigctl, Hamlib 3.1~git
Report bugs to <hamlib-***@lists.sourceforge.net>
Opened rig model 228, 'TS-480'
Backend version: 0.9.5, Status: Untested
Rig command: T 1
rigctl_parse: input_line: T 1
kenwood_set_ptt called
kenwood_transaction called
kenwood_transaction: cmdstr = TX
write_block(): TX 3 bytes
0000 54 58 3b TX;
write_block(): TX 3 bytes
0000 49 44 3b ID;
read_string(): RX 6 characters
0000 49 44 30 32 30 3b ID020;
Rig command: T 0
rigctl_parse: input_line: T 0
kenwood_set_ptt called
kenwood_transaction called
kenwood_transaction: cmdstr = RX
write_block(): TX 3 bytes
0000 52 58 3b RX;
write_block(): TX 3 bytes
0000 49 44 3b ID;
read_string(): RX 4 characters
0000 52 58 30 3b RX0;
kenwood_transaction: wrong reply RX for command verification ID
kenwood_transaction: cmdstr = RX
write_block(): TX 3 bytes
0000 52 58 3b RX;
write_block(): TX 3 bytes
0000 49 44 3b ID;
read_string(): RX 6 characters
0000 49 44 30 32 30 3b ID020;
As you can see, when changing ptt back to RX, the reply RX0 appears
instead of ID020.
I have a look at the hamlib software an found the reason for that in the
file kenwood.c.
At top of the function kenwood_transaction you wrote:
* data: Buffer for reply string. Can be NULL, indicating that no reply
* is needed and will return with RIG_OK after command was sent.
When switching ptt on and off, the function is called with data=NULL.
But the correct reply from the rig is causing an error.
I deleted the else-part, from line 369 to 387 in kenwood.c.
After recompiling hamlib and wsjt-x there are no more errors when
setting ptt on and off.
Perhaps you can find a better change in the hamlib software, to avoid
that error.
Best regards
Dieter, DK6OV
I am running a SunSDR2 Pro at a Linux-computer. The Linux-software for
the SDR supports rig-control with Kenwood TS-480 commands. I often use
the program wsjt-x, that controls the rig via hamlib. I connect both
programs via “virtual serial cable” (socat).
Most things works well, but setting ptt on and off via cat-command
interrupts the program with "Hamlib error: Protocol error while setting
PTT off".
I made some tests with rigctrl:
./rigctl -vvvvv -m 228 -r /dev/ttyUSB9
rigctl, Hamlib 3.1~git
Report bugs to <hamlib-***@lists.sourceforge.net>
Opened rig model 228, 'TS-480'
Backend version: 0.9.5, Status: Untested
Rig command: T 1
rigctl_parse: input_line: T 1
kenwood_set_ptt called
kenwood_transaction called
kenwood_transaction: cmdstr = TX
write_block(): TX 3 bytes
0000 54 58 3b TX;
write_block(): TX 3 bytes
0000 49 44 3b ID;
read_string(): RX 6 characters
0000 49 44 30 32 30 3b ID020;
Rig command: T 0
rigctl_parse: input_line: T 0
kenwood_set_ptt called
kenwood_transaction called
kenwood_transaction: cmdstr = RX
write_block(): TX 3 bytes
0000 52 58 3b RX;
write_block(): TX 3 bytes
0000 49 44 3b ID;
read_string(): RX 4 characters
0000 52 58 30 3b RX0;
kenwood_transaction: wrong reply RX for command verification ID
kenwood_transaction: cmdstr = RX
write_block(): TX 3 bytes
0000 52 58 3b RX;
write_block(): TX 3 bytes
0000 49 44 3b ID;
read_string(): RX 6 characters
0000 49 44 30 32 30 3b ID020;
As you can see, when changing ptt back to RX, the reply RX0 appears
instead of ID020.
I have a look at the hamlib software an found the reason for that in the
file kenwood.c.
At top of the function kenwood_transaction you wrote:
* data: Buffer for reply string. Can be NULL, indicating that no reply
* is needed and will return with RIG_OK after command was sent.
When switching ptt on and off, the function is called with data=NULL.
But the correct reply from the rig is causing an error.
I deleted the else-part, from line 369 to 387 in kenwood.c.
After recompiling hamlib and wsjt-x there are no more errors when
setting ptt on and off.
Perhaps you can find a better change in the hamlib software, to avoid
that error.
Best regards
Dieter, DK6OV