Skip to main content

Remote control of Topband CW transmitter

As both the remote station pc and the control pc external IP address are dynamically assigned, the first step is to get the address of the remote station computer. This python script does the job in combination with a cron job and associated cron mail output.

---------------------------------------------------------------------------

#!usr/bin/python
#
# Program gets your external IP address
#
# This program reads the title from
# the whatismyip.com website
#
# set up SSMTP then put the following line in crontab:
# 0 * * * * python /home/geoff/python/ipadd3_new.py
#
# Cron job will mail output to nominated mail a/c
# on the hour with the above.
#
# The ip address is written to file
# ext_ip_add.txt (overwritten)
#
# Version 1.0 Geoff Robinson Aug 09

fileobject1=open('/home/geoff/python/ext_ip_add.txt','r')
oldipaddress = fileobject1.readline()
fileobject1.close

import urllib

url = urllib.URLopener()
resp = url.open('http://www.whatismyip.com/automation/nxxxxxxxx.asp')
html = resp.read()

newipaddress = html

if newipaddress == oldipaddress:
print 'your external inter net address has not changed, your address is still'
print oldipaddress
else:
print 'you have a new external inter net address, your address is now'
print newipaddress

# This section writes the external
# IP address to ext_ip_add.txt file

fileobject=open('/home/geoff/python/ext_ip_add.txt','w')
fileobject.write(html)
fileobject.close()

---------------------------------------------------------------------------
The simplest remote control method for a CW transmitter is with cwdaemon. Install in Ubuntu 9.04 and run cwsetup as root from /usr/share/cwdaemon on the remote station pc with sh cwdaemon.sh - ignore 'you must run as root'. Then from same directory

sudo cwdaemon -d ttyUSB0 -s 20

the serial port label (d = device) is got from running dmesg and the cw speed (-s) is 20 wpm.

on the control pc start netcat and use the ip address from the cron job mail as follows:

nc -u 82.34.192.65 6789

+ or - to change cw speed,
ESC5 to exit
ESC4 to abort message
ESC0 to reset to 24 wpm etc.

Comments

Popular posts from this blog

GNU Radio Waterfall and CW Filter

The following GNU radio application adds a waterfall spectrogram to the previous CW filter program. The plot show 4 CW signals in the audio band (lower sideband) at 7023 kHz. The 700Hz signal is filtered and output to the laptop headphones by the CW bandpass filter. The frequency display is shown after the script which is as follows: #!/usr/bin/env python from gnuradio import gr from gnuradio import audio from lpf_bpf_class import Bandpass from gnuradio.qtgui import qtgui from PyQt4 import QtGui import sys, sip     class cw_filter(gr.top_block):     def __init__(self):         gr.top_block.__init__(self)           sample_rate = 44100         out_rate = 8000         kaiser = Bandpass()         cw_flr = gr.fir_filter_fff(1, kaiser.bpftaps)         decimate = int(sample_rate/out_rate)         Bandpass.cutoff1 = 3000                pre_decim = Bandpass()         dec_flr = gr.fir_filter_fff(1, pre_decim.lpftaps)         dec = gr.keep_one_in_n(gr.sizeof_float, decima

Digital Bandpass Filter FIR design - Python

The python code generates the Finite Impulse Response (FIR) filter coefficients for a lowpass filter (LPF) at 10 (Hz) cut off using firwin from scipy.  A highpass filter is then created by subtracting the lowpass filter output(s) from the output of an allpass filter. To do this the coefficients of the LPF are multiplied by -1 and 1 added to the centre tap (to create the allpass filter with subtraction). A second LPF is then created with a cutoff at 15 (Hz) and the bandpass filter formed by addition of the LPF and HPF coefficients. The program also generates a test sine wave of a given amplitude and power and to this noise from a Normal distribution is added.  The graph below shows the signal and nois, and the signal (green) after filtering. The input snr is approximately 3dB. The frequency response below shows the passband centered on 12.5 (Hz), the Nyquist frequency is 50 (Hz). from numpy import cos, sin, pi, absolute, arange from numpy.random import normal from scipy.

Splunk Cheat Sheet (Linux)

1. set root's password:  sudo su passwd root Enter new UNIX password: < new_root_password > Retype new UNIX password: < new_root_password > passwd: password updated successfully # su - 2. Remove any existing Splunk directories & create user etc: # rm -rf /opt/splunkforwarder # userdel -r splunk # this will remove as above if user splunk's home directory # groupadd siem # useradd -g siem -s /bin/bash -d /home/siem -m siem # vi ~/.profile # chage -I -1 -m -0 -M -99999 -E -1 siem If above fails because of multiple passwd fails: # pam_tally --reset check with #chage -l siem # uname -a # check OS version # dpkg -i splunk-4.3.1...........intel.deb # chown -R siem:siem /opt/splunk # su - siem : $SPLUNK_HOME/bin/splunk start --accept-license : $SPLUNK_HOME/bin/splunk edit user admin -password newpassword -role admin -auth admin:changeme 3. vi ~/.profile (as follows) (OR .bash_profile) # ~/.profile: executed by the command interpreter for log