GPIO Pins to PTT

5 posts / 0 new
Last post
KF4DRR
GPIO Pins to PTT

This may not be the right forum, and if it isn't I apologize, but if I want the PI4 to key the radio via the GPIO pins (say pin 17) when running digital modes what values do I put in here?

this thread
https://github.com/Hamlib/Hamlib/issues/48
suggests that
sudo rigctld -P GPIO -p 17
would achieve what I want from CLI but how to incorporate that into CQRlog's setup?

And am I assuming correctly, in that if I get this set up and working that when running WSJTX/FLDIGI in remote that CQRlog would handle the PTT? My IC-730 doesn't have USB ports so really the only thing I would want or need is for the computer to key the PTT instead of running a VOX circuit to do this. That's how I'm currently running but it is not without some of its own issues.

thanks

KF4DRR
didn't see how to attach that

didn't see how to attach that to the OP.

File: 

oh1kh
GPIO Pins to PTT

Hi !
You have 2 ways to do this.

#1) start rigctld from command line (or crontab See: https://github.com/OH1KH/cqrlog/blob/loc_testing/compiled/setting_rigctl... )
Then use rig model 2 Hamlib Net rigctld as in your picture. You do not need to set GPIO arguments in cqrlog setup. They have been done once at command line (or crontab script).
That should work. If your cqrlog is on different PC (not in RPI) change RPI's IP address to "Host:" (instead of localhost) Be sure your firewalls permit port 4532 usage.

You should be able to test PTT once you have started rigctld from command line (or crontab script) with:
telnet localhost 4532
(replace localhost with IP address of RPI if rigctld runs at diifferent PC than telnet)

[saku@hamtpad ~]$ telnet localhost 4532
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
T 1 (this sets PTT on)
RPRT 0
T 0 (this sets PTT off)
RPRT 0
Q
Connection closed by foreign host.

If telnet works cqrlog should also work.

#2) if running cqrlog at same RPI as rigctld (and started from cqrlog) just fill preferences/TRXControl with right values of rig, port speed, etc... and pass -P GPIO -p 17 to field "Extra command line arguments"

--
Saku
OH1KH

KF4DRR
thank you so much!

thank you so much!

Exactly the kind of instructions and information i've been googling for! You sir, are the best

73

KF4DRR
OK, now I'm a bit confused

OK, now I'm a bit confused and maybe I've missed something in the setup of rigcontrld..

this python script keys the relay but when i test with telnet rigcontrld does not.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17,GPIO.OUT)
print "PTT on"
GPIO.output(17,GPIO.HIGH)
time.sleep(10)
print "PTT off"
GPIO.output(17,GPIO.LOW)

start script

!/bin/bash
sleep2
a=$(/usr/bin/pidof rigctld)
if [ "$a" != "" ]; then
/usr/bin/date >> /tmp/start.log
echo "Already running." >> /tmp/start.log
else
/usr/bin/date >> /tmp/start.log
/usr/bin/rigctld -P GPIO -p 17 &
echo "Started." >> /tmp/start.log
fi
echo "---------------------------" >> /tmp/start.log

rigcntrl is running

@raspberrypi:~ $ ps ax | grep rig
394 ? Ss 0:01 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/input/event*
1120 ? Sl 0:01 /usr/bin/rigctld -P GPIO -p 17
3286 pts/0 S+ 0:00 grep --color=auto rig

I've even checked that I am part of dialout

raspberrypi:~ $ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio i2c spi

what am I missing here?

File: