wiki:testing/asE312

Version 1 (modified by seskar, 15 months ago) ( diff )

Antenna Setup/Installation/Deployment Validation

Attahc E312 to the large sector antennas to test cabling; cover GPS and each of the pannel antennas.

E312 + cabling + USB flash drive + directional antenna for SA + portable SA

Run two utilities:

  • gpspipe
  • tx_waveform

Start stop cadv script

#!/bin/sh

### BEGIN INIT INFO
# Provides:          cadv
# Required-Start:    $remote_fs $network gpsd
# Required-Stop:     $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: COSMOS Antenna Deployment Validation start/stop script
# Description:       Start/Stop script for the COSMOS service daemon,
#                    which start logging the GPS coordinates and starts 
#                    the transmitter on channel 1 so it can verify the antenna 
#                    cabling functionality
### END INIT INFO

# Author: WINLAB COSMOS Team

# PATH should only include /usr/* if it runs after the mountnfs.sh script
# PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="COSMOS Antenna Deplotment Validation"
NAME=cadv
SCRIPTNAME=/etc/init.d/$NAME
LOGDIR=/mnt
LOGFILE="$LOGDIR/$NAME-$(date -u +"%FT%H%MZ").log"
TXFREQ="2440.0e6"
TXRATE="4e6"
TXWAVE="RAMP"
TXWAVEFREQ="1e6"
TXGAIN="100"
PROG1=/usr/bin/gpspipe
PROG2=/usr/lib/uhd/examples/tx_waveforms

PROG1BASE=`basename $PROG1`
PROG2BASE=`basename $PROG2`

# Read configuration, if present
[ -r /etc/init.d/functions ] && . /etc/init.d/functions
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

#
# Check for external storage
#
#
# Function that starts the services
#
do_start()
{
   echo -n "Mount storage drive..."
   mount /dev/sda1 /mnt
   echo " OK"
   echo -n "Starting $PROG1: "
   $PROG1 -d -r -t -o "$LOGFILE"
   RETVAL=$?
   if [ "$RETVAL" = 0 ] ; then
     echo "OK"
     touch /var/lock/subsys/$PROG1BASE
   else
     echo "FAIL"
   fi
   echo -n "Starting $PROG2: "
   $PROG2 --freq "$TXFREQ" --rate "$TXRATE" --gain "$TXGAIN" --wave-type "$TXWAVE" --wave-freq "$TXWAVEFREQ"  >> "$LOGFILE" 2>&1 &
   RETVAL=$?
   if [ "$RETVAL" = 0 ] ; then
     echo "OK"
     touch /var/lock/subsys/$PROG2BASE
   else
     echo "FAIL"
   fi

}

#
# Function that stops the services
#
do_stop()
{
  echo -n "Stopping $PROG1: "
  killproc $PROG1 >& /dev/null
  rm -f /var/lock/subsys/$PROG1
   if [ -n "`/bin/pidof $PROG1`" ] ; then
    echo "FAIL"
  else
    echo "OK"
  fi
  echo -n "Stopping $PROG2: "
  killproc $PROG2 >& /dev/null
  rm -f /var/lock/subsys/$PROG2
   if [ -n "`/bin/pidof $PROG2`" ] ; then
    echo "FAIL"
  else
    echo "OK"
  fi
  umount /mnt
}

case "$1" in
  start)
     echo "Starting $DESC" "$NAME"
	do_start
	exit $?
	;;
  stop)
	echo "Stopping $DESC" "$NAME"
	do_stop
	exit $?
	;;
  restart)
	#
	# If the "reload" option is implemented then remove the
	# 'force-reload' alias
	#
	echo "Restarting $DESC" "$NAME"
	do_stop
	case "$?" in
	  0|1)
		do_start
		exit $?
		;;
	  *)
	 	# Failed to stop
		exit 1
		;;
	esac
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
	exit 3
	;;
esac

:

Install as startup script with:

update-rc.d cadv defaults 99

Output if antenna is working fine:

Spectrum Analyzer Screen

Transition from all 0 to GPS coorinates in teh log file on the flash drive (filename based turn-on timestamp)

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.