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.
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