Python Flask based API for the Hardrock-50 - basically a serial to HTTP converter.
Go to file
Michael Clemens c3932ce4eb added new method "exec" 2021-11-27 00:32:15 +00:00
.gitignore Initial commit 2021-11-12 00:40:48 +01:00 fix 2021-11-12 10:09:16 +01:00 first commit 2021-11-12 00:43:19 +01:00 first commit 2021-11-12 00:43:19 +01:00 added new method "exec" 2021-11-27 00:32:15 +00:00

Hardrock-50 API

The Hardrock-50 is a 50W power amplifier for amateur radio QRP transceivers. It has a display showing valuable information like the selected band, the SWR, power, temperature etc. This project provides an API that can be used to query all relevant information of the HR50 via HTTP. It is also possible to send commands to the HR50 via HTTP, e.g. to change the band or to change the keying method.


You need a computer connected to the Hardrock-50 via USB, e.g. a Raspberry Pi. This system needs to be able to run Python and has to be connected to your network.


Download all files and copy them into a directory on your raspberry pi. alternatively, you can clone the git repository as follows:

micha@rpi:~ git clone


Open the file and adapt the following lines to your environment:

serial_port = '/dev/ttyUSB0'
baud = 19200


Executing this script will spawn a web server running on port 5000. This is not meant for production use and/or public exposure. Anyone able to access this server via the network can alter any settings on your HR50.

Run it as follows:

micha@rpi:~ cd hr50-api
micha@rpi:~/hr50-api$ ./ 

API Endpoints

There are two API endpoints available:


This method allows you to send commands to the HR50. The commands can be taken from the HR50 operator's manual and do not require the trailing ";"


This method returns all avalable information in JSON


Now you can access the API e.g. with your (HR50 Remote Display)[]

For testing or other purposes, you can access the api with trhe help of curl or any webbrowser:

Set the keying method to 'PTT':

micha@rpi:~/hr50-api$ curl http://<IP_ADDRESS>:5000?cmd=hrmd1

Set the keying method to 'COR':

micha@rpi:~/hr50-api$ curl http://<IP_ADDRESS>:5000?cmd=hrmd2

Query the status:

micha@rpi:~/hr50-api$ curl http://<IP_ADDRESS>:5000/status