Re: Arduino, PC, Serial Communications / CAT #arduino #programming #serial #usb #cat


Brian Bowling
 

Mark,
Thanks for sharing that code. That’ll come in handy. I didn’t know you could do that. 

Brian. 

On Thu, Jan 7, 2021 at 6:00 PM Mark Erbaugh <mark.election@...> wrote:
John (and others),

As I was trying to debug the CAT communications, I wrote a Python script (attached) to monitor the communications. Basically, create a virtual serial port pair. I use COM0COM, but I imagine other VSP software will work. The radio control program (WSJT-X, FLGIDI, HDR) connects to one half of the virtual serial port pair, the Python script connects to the other half. The Python script also connects to the hardware serial port (USB) of the uBITX. In my case, the virtual serial ports are 21 and 22, the uBITX is on 5, you can easily see where to make changes in the code. The script simply echoes data between the two ports, while also displaying it on the screen.

One note, I noticed that sometimes the radio control program and radio would communicate while running through the Python script, but not when the radio control program was connected directly to the radio. I think it had something to do with resetting the Arduino which toggling the DTR line does. I think the Python script does that when it opens the serial port.

I run the script using the Python IDLE program. When I want to stop the script and free up the radio's hardware serial port, I just issue a Restart Shell command.

The script includes some interpretation of the commands but not all. If it can't parse the commands, it just displays the raw hex values. It should be obvious how to add additional command parsers.

73,
Mark, N8ME

Join SoftwareControlledHamRadio@groups.io to automatically receive all group messages.