I ran this a few times and it's unstable. It fails more than it works.
For some reason the "get_context" gets a network timeout
Then when this happens HRD starts chewing CPU up to 100%.
I got this to work once and got it to fail a dozen times or more. I'm
seeing different commands time out. So I'm wonder if HRD has a problem
where it's swallowing commands or such.
I'd think you should be able to reproduce this with any other radio if
that's true.
A bit weird. It didn't work first time. So I added another debug
statement. Then it didn't work with that either (same error).
if (!hrd_->waitForReadyRead (socket_wait_time))
{
#if WSJT_TRACE_CAT
qDebug () << "HRDTransceiver::send_command(" << cmd << ")";
qDebug () << "HRDTransceiver::send_command failed to reply" <<
hrd_->errorString ();
#endif
Then I added one more debug and it started working. I added the qDebug here
so I could see what command was timing out.
auto string = prepend_context ? context + cmd : cmd;
#if WSJT_TRACE_CAT
qDebug () << "HRDTransceiver::string(" << string << ")";
#endif
QScopedPointer<HRDMessage> message (new (string) HRDMessage);
bytes_to_send = message->size_;
bytes_sent = hrd_->write (reinterpret_cast<char *> (message.data ()),
bytes_to_send);
I'm using the latest HRD 6.2.71.286
Here's what I got without the above debug statements the first time I ran
it. Below it is with my debug statements added.
Sun Aug 31 03:49:11 2014 GMT(D:\JTSDK-QT\src\wsjtx\main.cpp:115)Debug:
"WSJT-X v1.4.0 r4235 by K1JT - Program startup"
Sun Aug 31 03:49:11 2014
GMT(D:\JTSDK-QT\src\wsjtx\Configuration.cpp:456)Debug:
Configuration::transceiver_online: open_if_closed: true
Transceiver::TransceiverState(online: no Frequency {0Hz, 0Hz} UNK; SPLIT:
unknown; PTT: off)
Sun Aug 31 03:49:11 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:262)Debug:
HamlibTransceiver::do_start rig: "Hamlib Dummy"
Sun Aug 31 03:49:11 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:423)Debug:
HamlibTransceiver::init_rig exit Transceiver::TransceiverState(online: no
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 03:49:13 2014
GMT(D:\JTSDK-QT\src\wsjtx\Configuration.cpp:1889)Debug:
Configuration::handle_transceiver_update: Transceiver State:
Transceiver::TransceiverState(online: yes Frequency {0Hz, 0Hz} UNK; SPLIT:
unknown; PTT: off)
Sun Aug 31 03:49:43 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:741)Debug:
HamlibTransceiver::do_ptt: false Transceiver::TransceiverState(online: yes
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 03:49:43 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:279)Debug:
HamlibTransceiver::do_stop: state: Transceiver::TransceiverState(online: yes
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 03:49:43 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:101)Debug:
HRDTransceiver::start
Sun Aug 31 03:49:43 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:262)Debug:
HamlibTransceiver::do_start rig: "Hamlib Dummy"
Sun Aug 31 03:49:43 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:423)Debug:
HamlibTransceiver::init_rig exit Transceiver::TransceiverState(online: no
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 03:49:44 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 28
Sun Aug 31 03:49:44 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get context" ): -> "715"
Sun Aug 31 03:49:48 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 54
Sun Aug 31 03:49:48 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get id" ): -> "Ham Radio Deluxe"
Sun Aug 31 03:49:48 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:155)Debug: "Ham Radio Deluxe"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 54
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get version" ): -> "v6.2.71.286 b286"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:156)Debug: "v6.2.71.286 b286"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 68
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get radios" ): -> "715:TT-OMNI VII (Radio)"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:176)Debug: radios:
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:179)Debug: [ 715 ] "TT-OMNI
VII (Radio)"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 60
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get radio" ): -> "TT-OMNI VII (Radio)"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 60
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get radio" ): -> "TT-OMNI VII (Radio)"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 24
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get vfo-count" ): -> "2"
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:195)Debug: vfo count: 2
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 60
Sun Aug 31 03:49:50 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get radio" ): -> "TT-OMNI VII (Radio)"
Sun Aug 31 03:49:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:750)Debug:
HRDTransceiver::send_command: reply byte count: 114
Sun Aug 31 03:49:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:777)Debug:
HRDTransceiver::send_command( "get buttons" ): ->
"ATT,Slow,Medm,Fast,Notch,NR,A <> B,A = B,B = A"
Sun Aug 31 03:49:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:201)Debug: HRD Buttons:
("ATT", "Slow", "Medm", "Fast", "Notch", "NR", "A~<>~B", "A~=~B", "B~=~A")
Sun Aug 31 03:49:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:741)Debug:
HRDTransceiver::send_command failed to reply "Network operation timed out"
Sun Aug 31 03:49:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\Configuration.cpp:1971)Debug:
Configuration::handle_transceiver_failure: reason: "Ham Radio Deluxe failed
to reply to command
Network operation timed out
"
Sun Aug 31 03:49:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:741)Debug:
HamlibTransceiver::do_ptt: false Transceiver::TransceiverState(online: yes
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 03:49:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:279)Debug:
HamlibTransceiver::do_stop: state: Transceiver::TransceiverState(online: yes
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 03:49:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:261)Debug:
HRDTransceiver::stop: state: Transceiver::TransceiverState(online: no
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Additional debug statements:
Sun Aug 31 04:34:51 2014 GMT(D:\JTSDK-QT\src\wsjtx\main.cpp:115)Debug:
"WSJT-X v1.4.0 r4235-dirty by K1JT - Program startup"
Sun Aug 31 04:34:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\Configuration.cpp:456)Debug:
Configuration::transceiver_online: open_if_closed: true
Transceiver::TransceiverState(online: no Frequency {0Hz, 0Hz} UNK; SPLIT:
unknown; PTT: off)
Sun Aug 31 04:34:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:101)Debug:
HRDTransceiver::start
Sun Aug 31 04:34:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:262)Debug:
HamlibTransceiver::do_start rig: "Hamlib Dummy"
Sun Aug 31 04:34:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:423)Debug:
HamlibTransceiver::init_rig exit Transceiver::TransceiverState(online: no
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 04:34:51 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:722)Debug:
HRDTransceiver::string( "get context" )
Sun Aug 31 04:34:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:742)Debug:
HRDTransceiver::send_command( "get context" )
Sun Aug 31 04:34:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:743)Debug:
HRDTransceiver::send_command failed to reply "Network operation timed out"
Sun Aug 31 04:34:56 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:715)Debug:
HRDTransceiver::send_command: "get context
"
Sun Aug 31 04:35:01 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:742)Debug:
HRDTransceiver::send_command( "get context" )
Sun Aug 31 04:35:01 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:743)Debug:
HRDTransceiver::send_command failed to reply "Network operation timed out"
Sun Aug 31 04:35:01 2014
GMT(D:\JTSDK-QT\src\wsjtx\Configuration.cpp:1971)Debug:
Configuration::handle_transceiver_failure: reason: "Ham Radio Deluxe failed
to reply to command
Network operation timed out
"
Sun Aug 31 04:35:01 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:741)Debug:
HamlibTransceiver::do_ptt: false Transceiver::TransceiverState(online: yes
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 04:35:01 2014
GMT(D:\JTSDK-QT\src\wsjtx\HamlibTransceiver.cpp:279)Debug:
HamlibTransceiver::do_stop: state: Transceiver::TransceiverState(online: yes
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
Sun Aug 31 04:35:01 2014
GMT(D:\JTSDK-QT\src\wsjtx\HRDTransceiver.cpp:261)Debug:
HRDTransceiver::stop: state: Transceiver::TransceiverState(online: no
Frequency {0Hz, 0Hz} UNK; SPLIT: unknown; PTT: off) reversed = false
From: Bill Somerville [mailto:[email protected]]
Sent: Saturday, August 30, 2014 3:11 PM
To: [email protected]
Subject: Re: [wsjt-devel] TenTec Omni HRD TCP fix
On 29/08/2014 19:04, Michael Black wrote:
Hi Mike,
Yeah.just wanted to let you know what I did.
HRD is going to fix this for the TenTec Omni VII. I had to go a few rounds
with them as they thought it was WSJT-X's fault.
You didn't say why you needed to set a default mode of USB. As far as I can
see the HRD interface for the Omni VII includes mode setting and this
shouldn't be necessary. If mode setting doesn't work correctly; you should
be able to set the WSJT-X configure setting for "Mode" to "None" and it will
assume you have set the mode manually on your transceiver.
I have committed a change (revision 4235) that will not fail on any missing
HRD feature that we require. This shoudl allow you to control your Omni VII
via HRD at least for single frequency non split operation with some other
method than CAT for PTT (i.e. VOX or via a separate COM port control line.)
Please be aware that this will allow you to set split mode operating in
WSJT-X but it will not work as expected because WSJT-X will adjust TX tones
as if the TX frequency were different from the RX frequency. This would mean
you would not be netted with any QSO partner. Until HRD provides a way of
setting split mode and the frequency of the TX VFO this is the best we can
do and split mode working cannot be used with the Omni VII via HRD.
If you can build this version and test on your setup, it would be very much
appreciated.
Mike W9MDB
73
Bill
G4WJS.
From: Bill Somerville [mailto:[email protected]]
Sent: Friday, August 29, 2014 12:24 PM
To: [email protected]
Subject: Re: [wsjt-devel] TenTec Omni HRD TCP fix
On 23/08/2014 16:06, Michael Black wrote:
Hi Mike,
sorry for the delay in replying, I am now back on line.
I got the TCP working for the TenTec Omni VII on HRD basically just by
ignoring the pull-down menu error.
Diff is attached and in-line here too.
OK, but i have a problem with this approach since the original failure is
designed to flag that the code needs changes to talk to HRD for a new rig
that has unrecognised controls in HRD. The Omni HRD simply doesn't meet the
minimum requirements for WSJT-X as currently implemented. I had not realised
that there were HRD rig integrations that were so primitive :( I need to
address this by reducing the minimum requirements to that level. This will
mean that some WSJT-X configuration settings cannot work such as split
operation, BTW this is already the case for mode setting although I'm not
sure it is correctly implemented just yet.
HRD has a bug report from me which, hopefully, they will eventually fix to
give those parameters. HRD doesn't even show buttons for mode, split, or
PTT for the Omni VII which is their problem.
OK, it will be interesting to see how responsive they are.
I also made a small improvement to the error messages since what was there
was lacking specificity on where the failure was occurring.
This is a good improvement although, if you don't mind, I will implement
with more user friendly text since referring to internal implementation
details about drop downs and buttons may not be helpful to users.
What I did was default the mode to USB if there is no dropdown available for
mode select.
I'm not sure why you needed to do this, mode control appears to be available
for the TenTec Omni using HRD.
Hopefully that's the right thing to do here.
I need to revisit mode setting in HRD, the intent was to allow control of
rigs with no CAT mode control. I see that I have broken that by blindly
setting mode in the initialization. I will fix that in a more generic way.
Thanks for looking at this Mike, it has revealed several issues which I am
working on now.
Mike W9MDB
73
Bill
G4WJS.
Index: HRDTransceiver.cpp
===================================================================
--- HRDTransceiver.cpp (revision 4231)
+++ HRDTransceiver.cpp (working copy)
@@ -214,7 +214,7 @@
vfo_A_button_ = find_button (QRegExp ("^(VFO~A|Main)$"));
vfo_B_button_ = find_button (QRegExp ("^(VFO~B|Sub)$"));
vfo_toggle_button_ = find_button (QRegExp ("^(A~/~B)$"));
- Q_ASSERT (vfo_toggle_button_ >= 0 || (vfo_A_button_ >= 0 && vfo_B_button_
>=0));
+ //Q_ASSERT (vfo_toggle_button_ >= 0 || (vfo_A_button_ >= 0 &&
vfo_B_button_ >=0));
split_mode_button_ = find_button (QRegExp ("^(Spl~On|Spl_On|Split)$"));
split_off_button_ = find_button (QRegExp ("^(Spl~Off|Spl_Off)$"));
@@ -266,11 +266,25 @@
{
// put the rig into a known state
auto f = send_command ("get frequency").toUInt ();
- auto m = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);
+ auto m = USB; // default to USB if no mode select available
+ try
+ {
+ m = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);
+ }
+ catch (error const&)
+ { // defaults to m=USB
+ }
set_button (vfo_B_button_ >= 0 ? vfo_B_button_ : vfo_toggle_button_);
auto fo = send_command ("get frequency").toUInt ();
update_other_frequency (fo);
- auto mo = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);
+ auto mo = USB;
+ try
+ {
+ mo = lookup_mode (get_dropdown (mode_A_dropdown_), mode_A_map_);
+ }
+ catch (error const&)
+ { // defaults to mo=USB
+ }
set_button (vfo_A_button_ >= 0 ? vfo_A_button_ : vfo_toggle_button_);
if (f != fo || m != mo)
{
@@ -281,7 +295,14 @@
else
{
update_rx_frequency (send_command ("get frequency").toUInt ());
- update_mode (lookup_mode (get_dropdown (mode_A_dropdown_),
mode_A_map_));
+ try
+ {
+ update_mode (lookup_mode (get_dropdown (mode_A_dropdown_),
mode_A_map_));
+ }
+ catch (error const&)
+ {
+ // nothing to do if there is no mode select
+ }
}
}
@@ -386,7 +407,7 @@
qDebug () << "HRDTransceiver::get_dropdown bad response";
#endif
- throw error {tr ("Ham Radio Deluxe didn't respond as expected")};
+ throw error {tr ("Ham Radio Deluxe didn't respond as expected.
get_dropdown failed")};
}
Q_ASSERT (reply.left (colon_index).trimmed () == dd_name);
@@ -571,7 +592,7 @@
qDebug () << "HRDTransceiver::is_button_checked bad response";
#endif
- throw error {tr ("Ham Radio Deluxe didn't respond as expected")};
+ throw error {tr ("Ham Radio Deluxe didn't respond as expected.
is_button_checked failed")};
}
return "1" == reply;
}
@@ -627,8 +648,15 @@
{
update_rx_frequency (send_command ("get frequency", quiet).toUInt
());
}
-
- update_mode (lookup_mode (get_dropdown (mode_A_dropdown_, quiet),
mode_A_map_));
+ try {
+ update_mode (lookup_mode (get_dropdown (mode_A_dropdown_,
quiet), mode_A_map_));
+ }
+ catch (error const&)
+ {
+#if WSJT_TRACE_CAT
+ qDebug () << "HRDTransceiver::poll failed:" << hrd_->errorString ();
+#endif
+ }
}
QString HRDTransceiver::send_command (QString const& cmd, bool no_debug,
bool prepend_context, bool recurse)
@@ -765,6 +793,6 @@
qDebug () << "HRDTransceiver::send_simple_command unexpected
response";
#endif
- throw error {tr ("Ham Radio Deluxe didn't respond as expected")};
+ throw error {tr ("Ham Radio Deluxe didn't respond as expected.
send_simple_command failed")};
}
}
----------------------------------------------------------------------------
--
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel
----------------------------------------------------------------------------
--
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
wsjt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wsjt-devel