Using Web Serial API for Radio CAT interface

Work in progress…

An html example that sends and receives CAT commands with an Elecraft K4 connected to the serial port of the machine running the web browser.

The file was built using examples from this article by Francois Beaufort. https://developer.chrome.com/docs/capabilities/serial It’s an excellent resource for Web Serial.

The html file for this project is here: http://www.pr0jex.com/serial/index.html

But it won’t run from that server. It only runs locally.

Instructions

Download the index.html file from the link above. start a local web server, eg., “npx http-server” and enter the server address into a Chrome browser.

When you press connect, the browser will prompt you to select a serial port for the radio.  On my computer the K4 serial ports appear something like: cu2.usbserial-21100. There are 2 ports. Select either one.

Then press read. If you spin the dial on the K4, and it is autoinfo mode, you should see CAT commands in the read window.

enter a CAT command in the write window and press the write button. It is preloaded with “fa7;” which sets frequency to 7 MHz.

Press the disconnect button to end your session.

local files tkzic/webusb/serial2/index.html

 

Virtual serial port pairs in Mac OSx

I was unable to find any apps to create virtual serial ports for later versions of Mac OSx eg., Catalina.

There is a partial solution using the linux socat utility. It will create functioning vsp’s but the ports will not be detected by most apps, like Max/MSP.  I tried setting a symlink to files in /dev using tty. and cu. prefixes. eg., /dev/tty.x1. But apps that look for serial ports still couldn’t detect the vsp’s.

Instructions

  1. download and install socat using macports or brew. eg., “sudo port install socat”
  2. Disable SIP (system integrity protection). In Catalina, reboot holding cmd+r. Then type: “csrutil disable” into a terminal window. Reboot – Note: you probably don’t need to do this if you aren’t setting up a link in /dev – which so far doesn’t work anyway
  3. Run one of the following commands:

socat -d -d pty,raw,echo=0 pty,raw,echo=0

sudo socat -d -d pty,link=/dev/tty.x0,raw,echo=0,user=tkzic,group=staff pty,link=/dev/tty.x1,raw,echo=0,user=tkzic,group=staff

What works and what doesn’t

After setting up the ports, you can send data in one port and out the other, for example, type the following into 2 different terminal windows.

cat /dev/ttys004

echo “Hello World” > /dev/cu.x1

This works great. But, so far, using sym links – the ports don’t show up in any app that accesses serial ports. Still working on this…

Using socat you can also setup a serial/tcp pair – this may be a solution for some projects.

2021 WPX CW – TF/KA1IS

Amatuer radio station TF/KA1IS in Akureyri, Iceland – May 2021.

It is 1:52 AM: Sunset/Sunrise over Eyjafjörður.

  • Category: Single Operator, All Band, low power.
  • Claimed score: QSO’s: 882 Prefixes = 499 Total Score = 1,033,928 (34 hours).

Station:

  • Elecraft KX2
  • Elecraft KXPA100
  • 5 meter whip antenna with 4 elevated radials and loading coil for 40/80 meter bands

New SC playlists – piano music 2

Demo tracks are now available in these Soundcloud playlists for an upcoming recording project. The letter ‘c’ following a track name indicates the chart has been completed.

 

 

New SC playlists – piano music 3

Demo tracks are now available in these Soundcloud playlists for an upcoming recording project. The letter ‘c’ following a track name indicates the chart has been completed.

 

 

New SC playlists – piano music 4

Demo tracks are now available in these Soundcloud playlists for an upcoming recording project. The letter ‘c’ following a track name indicates the chart has been completed.

 

 

New SC playlists – piano music 5

Demo tracks are now available in these Soundcloud playlists for an upcoming recording project. The letter ‘c’ following a track name indicates the chart has been completed.

 

 

New SC playlists – piano music 6

Demo tracks are now available in these Soundcloud playlists for an upcoming recording project. The letter ‘c’ following a track name indicates the chart has been completed.

 

 

New SC playlists – piano music 7

Demo tracks are now available in these Soundcloud playlists for an upcoming recording project. The letter ‘c’ following a track name indicates the chart has been completed.