Linux Serial Server Now Working with HRD and FT-857
March 4, 2011 19 Comments
After some additional efforts, I managed to get my Linux remote serial server to work with HRD; now HRD running on Windows can control my FT-857 when it is connected to a Linux box.
Getting there required resolving three issues. One was getting the code that configures the serial port to work correctly. It had some bugs in this code initially, which prevented the code from actually talking to the radio. The second was a new protocol command that I did not see before. HRD uses this command to set the frequency of the radio. I initially treated it like the normal command that sends data to the radio. This did not work. Snooping on the protocol with Wireshark showed that the server should not respond to this message at all; I removed the response, and it started working. The final issue involved the command that writes configuration parameters to the radio’s EEPROM, command BC in the CAT protocol. This is an undocumented CAT command (and a very useful one). For some reason, HRD expects a 5-byte reply from the radio to the command. The radio apparently does not reply, so the serial read attempt times out. I did not initially implement timeouts in my code, so it just got stuck. When I added timeouts (which are also useful in other cases), the code was finally able to fully control the radio.
Here is the code; it’s very preliminary and only tested with the FT-857.