Skip to content
Crossplatform/Executable webserver in Go/Hyperapp that talks to hardware via serial port calls!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
src
styles
.babelrc
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.version
CODE_OF_CONDUCT.md
CONTRIBUTING.md
ISSUE_TEMPLATE.md
LICENSE
README.md
index.html
main.go
package-lock.json
package.json
webpack.config.js
webpack.config.prod.js

README.md

HMRCMD

Ham Radio Command Center 🙏

Portable executable webserver/client that can be run on Windows/MacOS/Linux.

RESTful WebServer in Go that talks to radios via serial port calls.

Frontend is in Hyperapp

Supported Radios

Currently ICOM is the main development focus.

However you can input any SERIAL_PORT/BAUD_RATE/HEX you like, so technically anything (like sending hex to an arduino)!

Releases/Executables

Please check the releases page: https://github.com/selfup/hmrcmd/releases

Downloading/Installing/Running HMRCMD

Go to the releases page: https://github.com/selfup/hmrcmd/releases

  1. Windows, download the latest .exe release
  2. MacOS, download the latest darwin- release
  3. Linux, download the latest linux- release

Once downloaded:

  1. Windows:

    1. Double click the exe
    2. Warning Protected Screen click -> More Info -> Allow
    3. Firewall -> Allow
    4. Done!
  2. MacOS/Linux execute the file via the commandline: ./path/to/latest/release

It will auto open a browser window and be ready to run 🎉

API

  1. ICOM Endpoint

    • Url: http://localhost:8792
    • Route: /api/v1/icom-cmd
    • Method: POST
    • Body (JSON): {SerialPort: '', IcomCommand: '', BaudRate: ''}
    • Example payload: {SerialPort: 'COM3', IcomCommand: 'FE FE 94 E0 26 00 05 00 01 FD', BaudRate: '9600'}

😄

Development Guidelines

Please read the CODE_OF_CONDUCT.md file 🙏

I use VSCode with three extensions for this project:

  1. Powershell
  2. Editorconfig
  3. Go Code

Please fork the project and make a Pull Request (PR) to contribute!

Development Deps

  1. Golang
  2. Node
  3. go-serial
  4. packr

If on macOS: go get golang.org/x/sys/unix 🤔

Install go-serial: go get github.com/jacobsa/go-serial/serial

Install packr: go get -u github.com/gobuffalo/packr/...

Install JS deps: npm i

Run the frontend

npm start

Caveats

Can make API calls when running the go server but you have to kill and reload the go server for new backend functionality.

Run the backend

To make calls to the radio while using the frontend:

go run main.go

To test API calls without using the frontend there are scripts!

Windows

./scripts/post.cmd.ps1

MacOS / Linux

./scripts/post.cmd.sh

Compile into a binary release

Windows

./scripts/release.ps1

MacOS / Linux

./scripts/release.sh

Virtual Ports and Observing Calls Without Hardware

Windows

  1. RealTerm
  2. com0com

Observing commands on Windows

Create a virtual port pair with com0com and then connect to one of the port pairs with RealTerm.

Set baudrate to 9600 and on the display tab set to either hex [with space] or binary (up to you)

Now make sure to send the commands to the other end of the pair!

Example:

  1. com0com pair: COM12 - COM13
  2. RealTerm listen to: COM12
  3. SerialPort for HEX command: COM13

MacOS/Linux

  1. socat
  2. screen

MacOS

Install socat brew install socat or install the binary yourself.

Linux (Ubuntu)

Install socat sudo apt install socat or install the binary yourself.

Observing commands on MacOS/Linux

Ok this gets interesting

In a terminal/pane/tab can either run:

  1. socat -d -d pty,raw,echo=0 pty,raw,echo=0
  2. ./scripts/virtual.pair.sh

You will see output like so

2018/07/29 09:43:54 socat[20004] N PTY is /dev/ttys007
2018/07/29 09:43:54 socat[20004] N PTY is /dev/ttys008
2018/07/29 09:43:54 socat[20004] N starting data transfer loop with FDs [5,5] and [7,7]

Now you will want to pick on of the tty pairs and cat the hexdump in another terminal/pane/tab:

cat /dev/ttys007 | hexdump

Now when you make an API call make sure to use the other port in the pair.

Once you send the message to 008, you will see the hexdump from 007!

It seems you have to make two calls to see it... 🤔

Do not be discouraged! 😄

Example screenshot:

screen shot 2018-07-29 at 10 17 32 am

Reading Materials

  1. HEX to BIN table
  2. CI-V Reference Manual
  3. ICOM IC-7610 Reference Manual
  4. Old CT-17 Reference Manual with BASIC code blocks
  5. Decimal Array to Binary $port.Write/3
  6. System.IO.Ports.SerialPort.Write .NET API

CI-V Manual Message Format Snippet

basic-message-format-icom

You can’t perform that action at this time.