Additional things to do on the 3B inside the IC910 and Gpredict - jharwinbarrozo/rotcontrol GitHub Wiki
Writing updated time on the RTC clock
sudo timedatectl set-ntp true //wait for couple of second to sync ntp time
sudo hwclock -r
sudo hwclock -w
sudo timedatectl set-ntp false
Install Socat
sudo apt-get install socat
Example usage of socat
sudo socat pty,link=/dev/ttyTCP0,ignoreeof,user=pi,group=dialout,mode=777,raw,echo=0 tcp:10.10.0.211:23 &
The above creates a virtual serial port /dev/ttyTCP0
To Listen to socat traffic:
ss -l
Steps on how to auto start socat to create a virtual port named /dev/ttyESP0
First create scripts that will run rigctld, rotctld and socat at bootup:
(note that & stands for backgrounding)
sudo nano /home/pi/autorig.sh
#!/bin/bash
rigctld -m 344 -r /dev/ttyUSB0 -t 4532 -s 19200 &
save
sudo nano /home/pi/autorot.sh
#!/bin/bash
sleep 3 && rotctld -m 202 -r /dev/ttyESP0 -t 4533 -s 19200 -C timeout=500 -vvv
save
sudo nano /home/pi/autosocat.sh
#!/bin/bash
sudo socat pty,link=/dev/ttyESP0,ignoreeof,user=pi,group=dialout,mode=777,raw,echo=0 tcp:192.168.1.51:23,forever,keepalive,keepidle=10,keepintvl=10,keepcnt=4 &
save
Don't forget to make the script executable by:
chmod +x autorig.sh
chmod +x autorot.sh
chmod +x autosocat.sh
To check:
ls -l
You will see these 3 scripts now turned to green. (executable file)
Very handy script to stop any rotctld and rigctld processes.
sudo nano /home/pi/stoprigrot.sh
#!/bin/bash
# finds rigctl and rotctl PIDs and SIGTERMs them
# Michael Hirsch
RigPID=$(pgrep rigctld)
RotPID=$(pgrep rotctld)
[ -n $RigPID ](/jharwinbarrozo/rotcontrol/wiki/--n-$RigPID-) && { echo "Stopping rigctld PID $RigPID"; kill $RigPID; }
[ -n $RotPID ](/jharwinbarrozo/rotcontrol/wiki/--n-$RotPID-) && { echo "Stopping rotctld PID $RotPID"; kill $RotPID; }
save
How to run this stoprigrot - just bash it :) Do it twice! So you would know if there's any other duplicate processes you are not aware of.
bash /home/pi/stoprigrot.sh
===========================
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@/home/pi/autorigrot.sh
@gpredict
point-rpi
===========================
Gpredict
-
Create a rotator module
Name: ESP-LINK
Host: localhost
Port: 4533
Min az: 0 Max az: 360
Min el: 0 Max el: 90 -
Create a radio module (if you haven't done this yet)
Name: IC910H
Host: localhost
Port: 4532
Radio type: IC-910 *you can only see this option if you modified, build from source the rigcontrol repo
PTT status: None
VFO Up/Down: Not applicable
LO down: 0 Lo up: 0
Signalling AOS LOS both unchecked
To monitor Gpredict log:
tail -f /home/pi/.config/Gpredict/logs/gpredict.log
Connect to the already running rotctld, and set position to 135.0 degrees azimuth and 30.0 degrees elevation with a 1 second read timeout from the shell prompt:
echo "\set_pos 135.0 30.0" | nc -w 1 localhost 4533