In my rapidly diminishing spare time, from time to time I engage into ridiculous activities such as programming microcontrollers similar to the one pictured here (check out this site for similar goodies). Typically, the data exchange with these devices occurs via a serial port and I use a USB to serial adapter since COM ports are hard to come by these days.
For the terminal emulator software, I personally like to use Tera Term. However, as with other emulators, one of the annoying things is that it requires you to specify the COM port (i.e. COM5) for the connection, but any given time you plug the USB cable, you may not know what the resulting COM port is. Similarly, if you have multiple devices connected, things get confusing as well.
Enter ‘Serial Tray’. Basically, it is a tiny app that resides in the Windows System Tray. When you right-click its icon, it lists available COM ports along with their friendly names. Check out this article on the associated coding struggle.
The application comes with an XML file (because that’s how I roll in terms of configuration) where you can configure a 3rd party application that should be launched when a particular port is selected. In my case, I launch Tera Term. Within the same XML configuration, you can specify application parameters that can include a variable %PortNumber%, which will resolve to the number of COM port you’ve selected (e.g. ‘1’ for ‘COM1’).
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="CustomPortCommand" value="C:\Program Files\TTERMPRO\ttermpro.exe" /> <add key="CustomCommandArguments" value="/C=%PortNumber% /B=56000" /> </appSettings> </configuration>
The above configuration will execute command “C:\Program Files\TTERMPRO\ttermpro.exe /C=5 /N=56000” when you click on the friendly name of the COM5 port in the tray.
That’s pretty much it. No installer, as it does not need one. Just copy the files to a folder and tray away.
Let me know your thoughts and feelings on the matter,
v1.0 – Initial Revision