TCP Socket to Serial CAT command

How to start. I have written about 60% of an application that controls a ham radio via Serial using CAT commands. But now I need to accept connections from another application on the same computer that can send a CAT command and get an answer. I have tried playing with the TCP socket and can’t get this to work.

Any help in pointing me in the right direction is appreciated. To resume.

App 1 sends a TCP command to port 12345 on 127.0.0.1
MyApp (Mac OS) listens to the command, sends it to the radio via Serial and gets the answer, then sends this one back to the original app 1.

Issues I have. There is a serial connection that retrieves data from the radio every 200ms to maintain the application updated of any changes made directly in the radio. Do I need to pause that Serial connection and use a different one to query the radio for the TCP command? And then start it as soon as the response to the TCP request is finished?

Thanks for any help provided.

Hello Carlos,

A question, are the two applications both written by you or are you trying to interface a commercial application?

I use serial ports for many applications myself and have never needed to ‘pause’ one in order to do anything.

i am interested in the application and what you may be trying to achieve.

de EA5/G0EBB Alicante (i am NOT on QRZ.com).

I think you are viewing this not from an event driven process. Take a look at the data available event (http://developer.xojo.com/xojo-net-tcpsocket$DataAvailable).

[quote=392684:@Mark Carlton]Hello Carlos,

A question, are the two applications both written by you or are you trying to interface a commercial application?

I use serial ports for many applications myself and have never needed to ‘pause’ one in order to do anything.

i am interested in the application and what you may be trying to achieve.

de EA5/G0EBB Alicante (i am NOT on QRZ.com).[/quote]

Hi Mark, thanks for your answer. I am writing a Rig Ctrl software for the FT-991A and later FT-891 (don’t yet have one) that will run our disaster relief mission in the Caribbean. In the mission end, I need it to interface with a client part that I will be built in Xojo. But in the personal end, I want it to be able to report to RumLogNG and similar the frequency, mode, etc. If you are familiar with these, they send an IF; CAT command. I will need it to be a ServerSocket in the future but wanted to start small. Back to the mission end, we usually have internet access via satellite at some point in the day/night, I want it then to be able to connect to our CONUS base and send a report. The report would be similar to an ADIF file.

Thanks de N2NGO and I am on QRZ.

Thanks Lange, my issue is that I am not being able to make this work at all. I am very new to Xojo. So even writing the connection part is giving me problems. I wrote a listening script based on what I found here and while I was able to see the command coming in, I got stuck going forward. BUT yes that sample at the bottom of ReadData may help! Will try later today, thanks.

Carlos

Hi Carlos, what a very interesting project and important too.

I believe for your first step, the personal use, you do not need to use TCP in any way that i can see from your description, what is the purpose of the TCP, to send the ADIF?

I think from your first post that you are trying to have your radio CAT control b one application and passing the data from the CAT to another Xojo app that sends an ADIF to the online logging program.

I am currently writing a logbook program which will also run the radios (ICOM) and eventually auto log to one of the world logbooks which sounds very similar to what you are doing!

[quote=392730:@Mark Carlton]Hi Carlos, what a very interesting project and important too.

I believe for your first step, the personal use, you do not need to use TCP in any way that i can see from your description, what is the purpose of the TCP, to send the ADIF?

I think from your first post that you are trying to have your radio CAT control b one application and passing the data from the CAT to another Xojo app that sends an ADIF to the online logging program.

I am currently writing a logbook program which will also run the radios (ICOM) and eventually auto log to one of the world logbooks which sounds very similar to what you are doing![/quote]

Hi Mark, thanks. Imagine if you had the logging software wanting to know what specific frequency and mode you are on every 1 second. I use RumLog, and it sends a IF or general information request to the radio or to the software running the radio. when sent to the application running the radio, this is done via TCP. This is why I want to be able to accomplish this. While I am building a very rudimentary logging part to the application, it will never be a complete one, so I do want to be able to have my rig control application talk to other applications I use.

does it make sense?

Hi Carlos, yes this makes sense, but i have not used TCP from another application, YET. i would like to know how you manage to finish the project.