Skip to content

Instantly share code, notes, and snippets.

@DGxInfinitY
Last active August 4, 2024 05:04
Show Gist options
  • Save DGxInfinitY/3c89676697e1f96e8fc13c0960a1e2c1 to your computer and use it in GitHub Desktop.
Save DGxInfinitY/3c89676697e1f96e8fc13c0960a1e2c1 to your computer and use it in GitHub Desktop.
Basic Script to use Digirig Lite(or any CM108 Based Soundcard with GPIO 3 for PTT) with JS8Call
#!/bin/bash
## This script is to be used with the twilly cm108 cli utility found here: https://github.com/twilly/cm108.
## I found that in order to correctly compile this program I needed to use the cc command instead of make.
## The commands I used to make this work are as follows.
## sudo apt-get install libudev-dev git
## git clone https://github.com/twilly/cm108.git #this clones the utility into your present working directory
## cd cm108
## cc cm108.o -o cm108 -ludev
## sudo make install #this will place the compiled program into your /usr/local/bin for use in your default path.
## then you need to download and place this file in any directory of your choice. Next will be to configure your
## JS8Call application to use this script as the ptt command. Open JS8Call and click File > Settings > Radio
## Under the Advanced Section their is a field called PTT Command, to use this make sure your rig is set to None
## In the PTT Command copy this command
## ~/cm108/cm108ptt.sh %1
## You will need to change the path to match where you put the cm108ptt.sh file. If you placed it somewhere other
## than your home directory.
## Also make sure cm108ptt.sh has exec permissions with this command.
## sudo chmod +X cm108ptt.sh
## This script is very basic. It doesn't offer any way to pass variables via the command line other than "on" or "off"
## but could be modified to support this function. Right now you need to hard code the hidraw port based on your system
## configuration. Usually this is /dev/hidraw1 but not always or for every configuration. One day I'd like to see the
## original software support "on" or "off" as valid variables compared to 1 or 0 just for ease of use.
if [ $1 = off ]; then
/usr/local/bin/cm108 -H /dev/hidraw1 -P 3 -L 0
else
if [ $1 = on ]; then
/usr/local/bin/cm108 -H /dev/hidraw1 -P 3 -L 1
fi
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment