Page 1 of 2

Band Indication for 2 radios

Posted: Tue Oct 20, 2020 9:25 am
by K2GC
I know this is not a common problem, but I am sure it exists for some. Before I go into an elaborate hardware solution, I thought I would check and see if a software solution could be easily used.

My 11 year old son has started to get on the air quite consistently. We are both running a Flex 5000, and sit in different rooms.

I am looking for a way for each of us to know what band the other is on. I know I can make a hardware solution with some relay boards (for band detection) and arduinos to read the band and display accordingly at the other location. I was just wondering if there was a possible way using the software (PSDR, ddutil, etc) that maybe we could so a simpler (non wired) setup.

Thoughts???

Re: Band Indication for 2 radios

Posted: Wed Oct 21, 2020 2:31 pm
by ke9ns
As PowerSDR works currently, you can query via a CAT command (through a virtual serial port), or reading the IIC (FlexWire) port (on the back).

DDUtil has a built in TCP server (connected to your local PC IP address, port 5678)
Since you probably have it running already, you can query it for various things.
I believe you could ask it frequency or maybe Band?
To enable it: DDUtil->Setup->Other->TCP Server

So you could write a PC program to monitor the IP address of both Flex-5000 PC's for band conflict.


Darrin
ke9ns

Re: Band Indication for 2 radios

Posted: Wed Oct 21, 2020 3:24 pm
by K2GC
Hmm. Something above my head....

Do you have any info on the command set for sending a query to either? I may have a friend who can help write something...

Re: Band Indication for 2 radios

Posted: Wed Oct 21, 2020 8:39 pm
by ke9ns
Looking at the help file for DDUtil, it looks like you cannot read the band or frequency using the "TCP server" feature. At least its not listed.
You should try asking someone in the DDUtil group (https://groups.io/g/DDUtil/) if there is a way to query for the Band or Frequency via an Ethernet TCP connection?
I was able to use Hyperterminal to connect to the TCP server, but All I could do was move my Antenna rotor position and see the temperature of the Flex-5000.

Not sure how much you know about setting up DDUtil, virtual COM ports, etc.? I have a section on my PowerSDR webpage explaining it (and a video on it).
When you have COM port pairs setup and running (using VspMgr and DDUtil), you can open a COM port, and using a serial port Terminal emulator, you can type ZZBS;
The response you will get from PowerSDR will be the the band the radio is currently on.

But obviously if the radio you want to read is in a different location, Ethernet would be the way to go. You could then just use Hyperterminal to read your other radio.

I haven't gotten around to adding a TCP CAT option to PowerSDR (haven't found the need).


Darrin
ke9ns

Re: Band Indication for 2 radios

Posted: Wed Oct 21, 2020 9:45 pm
by K2GC
I will have to see if I can pair the arduino up with the computer running ddutil. If I can connect the 2 over serial to get the data, I can use the arduino at each side to communicate to each other and handle the display.

I actually did have it communicating with ddutil via the tcp server, and like you, havent been able to come up with a proper command.

Re: Band Indication for 2 radios

Posted: Thu Oct 22, 2020 7:35 pm
by K2GC
So, some more playing around.

Sending a CAT command using a Macro via TCP didnt work.

I had a thought, and setup VSPE from Eterlogic (have used it in the past) and created a TCP server for a com port, and mapped it to a DDUtil port.

Now, sending ZZBS; via TCP from an Arduino, I am getting a response with the band that I am on!

My concern with this, is sending the command too fast may overload things. I would like to have near real time response.... especially because if this works, it could handle my band pass filter and antenna switching too.

Re: Band Indication for 2 radios

Posted: Thu Oct 22, 2020 9:06 pm
by ke9ns
Go and download and install .177
See revision history list on my webpage.
I added a TCP server for CAT commands. You can query for any CAT that you could using a COM port.

Darrin
ke9ns

Re: Band Indication for 2 radios

Posted: Thu Oct 22, 2020 9:31 pm
by K2GC
You da man!

Re: Band Indication for 2 radios

Posted: Thu Oct 22, 2020 9:38 pm
by K2GC
Ok, maybe a bit too soon.... LOL

It keeps turning itself off.....

Re: Band Indication for 2 radios

Posted: Thu Oct 22, 2020 10:54 pm
by ke9ns
It will probably take a few iterations to work the bugs out.
I have never looked at CAT before.

What string are you sending?

if you send zzbs; (no carriage return) you will get a zzbsXXX; response



Darrin

Re: Band Indication for 2 radios

Posted: Fri Oct 23, 2020 8:25 am
by K2GC
I send a connection request from the arduino, it responds with PowerSDR and version, and then the connection drops. In the settings, the checkbox for ON unchecks itself. I am not even getting so far as to send a command....

So it appears not so much a CAT issue yet, as a tcp connection issue.

Re: Band Indication for 2 radios

Posted: Fri Oct 23, 2020 10:15 am
by ke9ns
I have code to detect when the connection is cut, to free it up for a new connection.

If you open a Socket to your local IP address (should show up in the URL box) and port, you will get a connection and see the PowerSDR text (like you did get).

Not sure what you mean by connection request (other than you opened up a socket)?

If your Arduino sends anything other than ASCII characters, I am not sure what will happen?
If you send 2 <CR> characters, you will get a ?;?;
If you send 0's, eventually it will force a disconnect.

I was able to telnet into my Flex-5000 CAT Server from work using a free ddns address i use (and allowing the port to pass through my home router), and it worked and stays connected forever.

I did tweak the code a little. Go download .177 again. But you will need to install it 2 times (select repair the second time).
The connection text will now say "PowerSDR ke9ns v2.8.0.177 TCP Cat Connection started..."

Darrin
ke9ns

Re: Band Indication for 2 radios

Posted: Fri Oct 23, 2020 7:49 pm
by K2GC
Ok, I think I am more up to speed now.

The arduino code I was using closes the connection every time it loops. I can fix that, and that explains part of the issue.

But, even when I telnet, once I close the telnet session, it unchecks the 'on' box in PSDR settings and disables the TCP server, thus requiring a manual intervention to make another connection. (this is why my arduino code was messing me up)

Also, playing with it some... if I send ZZBS; (followed by carriage return) you get a proper response. But, once you get the response another carriage return is required in order to 'clear' the response and ready the system for its next command. Not a HUGE deal, but thought you may want to know. (as in I can work around it if needed)

Honestly, this opens up some serious doors for PSDR users in the way of automation... being able to use a wifi enabled arduino to communicate with PSDR allows for much easier antenna switching, etc. I am excited about it!

Re: Band Indication for 2 radios

Posted: Fri Oct 23, 2020 8:39 pm
by K2GC
This is really cool!!!!!

Messing around with it, the possibilities are endless! I could even build this so it would inhibit TX if we are on the same band!! Preventing both radios from transmitting if on the same band.

Really cool stuff! I am excited now!

Re: Band Indication for 2 radios

Posted: Fri Oct 23, 2020 8:49 pm
by K2GC
Be careful... dont send a ZZBY;

It closes PowerSDR!!!! LOL

Re: Band Indication for 2 radios

Posted: Fri Oct 23, 2020 9:32 pm
by ke9ns
You dont need to send a <CR>. when it sees the ; it assumes thats the end of the CAT command (from what I read about CAT commands).
I just fixed it so it will ignore a <CR>
I also added a indicator to show when someone is connected to your localIP:Port
Also if you right click on the "ON button" it will open up a screen to show the flow of CAT data in/out of PowerSDR.
Plus I fixed some other issues.

Go download .177 incremental and install 2 times.

Darrin
ke9ns

Re: Band Indication for 2 radios

Posted: Fri Oct 23, 2020 9:53 pm
by K2GC
Hmmm, its not accepting commands now...

I like the feature of showing the output! Makes debugging easier!

Code: Select all

CAT TCP Server activated. No connection
>>Try to Start CAT TCP Server..
>>WAIT for Initial connection.
>>CAT TCP Server STARTED on Port: 5588
PowerSDR ke9ns v2.8.177 TCP Cat Connection started...

>>Command Received: ÿûÿû ÿûÿû'ÿýÿûÿýZZBS;
>>PowerSDR sent: ?;
>>Command Received: 
ZZBS;
>>PowerSDR sent: ?;
>>Command Received: 
ZZBS;
>>PowerSDR sent: ?;
>>Command Received: 
ZZBS;
>>PowerSDR sent: ?;
>>Command Received: 
ZZBS;
>>PowerSDR sent: ?;
>>Command Received: 
ZZBS;
>>PowerSDR sent: ?;
>>Command Received: 
ZZBS;


BTW, if it would be easier for us to 'work' this real time, look me up on facebook (K2GC should turn me up, or Mike Maynard) or even google hangouts for that matter....

Re: Band Indication for 2 radios

Posted: Sat Oct 24, 2020 5:25 pm
by ke9ns
from your screen shot, I can see I missed the "\n" Line feed character.

I wasnt checking for LF. Now I am.

Its fixed. go download and install 2 times.

I tried using the WSJT-X running the "Flex-6xxx" radio setup (localhost).
It runs for a few seconds before WJST-X cuts the connection.
I can clearly see the commands being exchanged, but since PowerSDR doesnt have Slices and is not a Flex-6000 series, it apparently doesnt like the answers its receiving from PowerSDR.

Darrin
ke9ns.com

Re: Band Indication for 2 radios

Posted: Sat Oct 24, 2020 7:58 pm
by K2GC
Onward....

I can get it to work with Putty via Telnet....

the arduino is giving me fits, I get this in the TCP Server window...

Code: Select all

CAT TCP Server activated. No connection
>>Try to Start CAT TCP Server..
>>WAIT for Initial connection.
>>CAT TCP Server STARTED on Port: 5588
PowerSDR ke9ns v2.8.177 TCP Cat Connection started...

>>Command Received: ZZBS;
>>PowerSDR sent: ZZBS010;
>>Large number of 0 bytes received by PowerSDR.
>>Shutting Down CAT TCP Server due to 0 bytes.

Re: Band Indication for 2 radios

Posted: Sat Oct 24, 2020 8:55 pm
by ke9ns
Large number of 0 bytes...

That happens when your device (arduino in this case) disconnects.

Make sure it doesn't close the socket until your ready to disconnect.

Darrin