Using HF Packet from an M5Stack Cardputer

About a year ago, I got into HF packet after using packet and Winlink on VHF. A friend of mine had mentioned HF packet and I found it fascinating. Being able to send and receive messages and chat long distance, such as halfway around the globe or further was really advantageous.

This mode of communication is not only truly off-grid and decentralized, it does not require much in terms of software. A simple TNC, either hardware or software based, and a terminal is all that is needed.

I picked up a KAM All Mode TNC, upgraded the firmware and wired it up to my Windows Desktop PC via serial port and to my Yaesu FT-991A transceiver.

Since PCs have not come with serial ports for awhile now, I used a USB serial dongle. For a terminal, I use PuTTY. Interfacing with the TNC is a bit like using a terminal program in the 80s and 90s to connect to BBSes. The TNC has its command set and the interaction to chat with other stations or to connect to their BBS is via keyboard commands and response on-screen in text mode:

Interaction with TNC via PuTTY

PuTTY has a great feature to save a session, which is all of the settings for the connection. For example, the serial port, baud rate, and other options are saved. In my case, I named my TNC saved session “KAM All Mode”. I have another session saved for my VHF TNC under another name.

PuTTY Saved Session Prompt

When I start PuTTY, I simply select which saved session I want and no configuration is needed.

Tethered to my Desktop

Since my TNC is connected to my Windows Desktop PC, if I want to use my TNC from another room in the house, I can use Remote Desktop connection from either a laptop or my iPhone. This works well, and even remotely if I VPN into my firewall.

If using chat mode, I would need to be sure to keep the Remote Desktop app open on the screen or else I could miss a chat or connection attempt.

M5Stack Cardputer as a Terminal

The M5Stack Cardputer is an inexpensive mini computer that has great battery life, a small size, and can be used as a terminal for TNC use.

The M5Stack Cardputer can connect to your WiFi network, and it can SSH into a remote server. I can even use my VPN client on my iPhone, turn on my iPhone hotspot, and the M5Stack Cardputer can then connect to that WiFi network and access anything on my home network, including my Windows desktop PC.

The M5Stack Cardputer is around $30. It has an internal battery and a USB C connection for recharging, debugging, and programming. It has a magnet in the case so that it can cling to anything metallic, it has LEGO-spaced holes for using LEGOs to attach and hold peripherals such as LoRA devices, sensors, and cameras for example.

Bridging the Gap between TNC and Cardputer

Since the TNC is not directly connected to the M5Stack Cardputer, how can I connect the two over WiFi?

Since the M5Stack Cardputer can connect to my WiFi network and it has an SSH client, all I need to do is find a way to use PuTTY over SSH.

I installed the OpenSSH server on my Windows desktop PC. I installed an SSH client (Bruce) on the M5Stack Cardputer. I was able to connect and get a windows prompt! No real surprise there.

However, PuTTY is a desktop application which does not interact with a windows console.

I found a utility called “plink” which comes with PuTTY. Plink is a wrapper that brings PuTTY screen and keyboard text to the windows console.

plink for PuTTY

On the command line from SSH, I can start plink and direct it to open my KAM All Mode saved session:

plink "kam all mode"

I first tested this on my iPhone with an SSH app, and it worked quite well:

SSH from iPhone

In all practicality, I could have stopped here. Using an SSH app from my iPhone or iPad would work perfectly well. However, I pushed a bit further to get this to work from the M5Stack Cardputer.

I connected to my WiFi network, opened the SSH client on the M5Stack Cardputer, logged into my Windows Desktop PC, then started plink.

It worked! I was able to interact with the TNC as if I were at the keyboard and screen of my Windows desktop PC.

TNC Access from SSH on M5Stack Cardputer

Command Mode Issue

When using plink, CTRL+C on the keyboard would cause plink to exit back to the windows command prompt. CTRL+C is the character that the TNC uses by default to exit to command mode. This is necessary for example in order to disconnect from a node or switch streams.

The KAM supports changing the command sequence using the COMMAND command. The default is $03 which is CTRL+C.

I experimented with CTRL sequences that would not cause plink to exit or freeze, and a sequence that was not already used for something else in the TNC.

It appeared that CTRL+Q was used for XOFF and START and I do not use software flow control. I set the command sequence for both to $13, which is CTRL+S. I then set the COMMAND command to $11 which is CTRL+Q. This worked perfectly within plink.

Final Thoughts

When I first saw the M5Stack Cardputer, I instantly thought it would make for a great dedicated portable terminal for my TNCs.

I was surprised how simple it was with out-of-the-box software, and most of which I already had. Of course all of the best practices for security are already in place, as this is all over SSH. Of course the data on HF is very much open to the public, but installing the SSH server, the client, WiFi and VPN for remote connections protect my Windows PC from unwanted connections.

Of course, the screen on the M5Stack Cardputer is incredibly small and it is a challenge to read, typing is a bit difficult, but it does work.

I am sure I will find other uses for the M5Stack Cardputer, but this was my first use for it.

Leave a Reply