#!/bin/bash
# Copyright 2013 Monterey Bay Aquarium Research Institute, all rights reserved.
# Log RSSI from CDMA modem

# Disconnect CDMA ppp, power off radio
sudo cellOff

# Get power port and serial port from configuration
powerSerial=`python /home/hotspot/smc-script/modemConfig.py $MODEM_CONFIG_FILE "cell"`
if [ $? != 0 ]; then
   echo $powerSerial
   echo Could not get configuration for cell radio
   exit 1
fi

# Get power port
powerPort=`echo $powerSerial | awk '{print $1}'`


# Turn on CDMA modem
/home/smc/bin/SetPowerSwitch $powerPort 1

# Read and log CDMA modem RSSI
python -u /home/hotspot/smc-script/modemtest.py /dev/ttyLX1 115200 5 0 >> /opt/hotspot/logs/cdmaRSSI.log &


