-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcast_tx.sh
executable file
·41 lines (27 loc) · 1.1 KB
/
cast_tx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# (c) 2022 Northeastern University
# Created by Davide Villa ([email protected])
# cast_tx.sh - This is the file that allows to run the CaST transmitter node to sound a scenario in Colosseum.
# This file is ready-to-use and can be simply calling by running in the reservation node terminal that should
# act as a transmitter node: ./run_tx_sounding.sh
echo "Starting transmitter CaST sounding..."
### Sounding parameters
## Get scenario frequency
while true; do
read -p "What is the scenario frequency in Hz to sound (should be the same as the rx node)?: " -r
if [[ $REPLY =~ ^([1-9][0-9]{6,9})$ ]] # Scenario id valid
then
SCENARIO_FREQ=$REPLY
break
fi
echo 'Scenario frequency not valid. It must contain between 7 and 10 digits (e.g. 1000000000).'
done
### Start tx node
## Flash fpga
echo 'Flashing FPGA.'
source /opt/fpga/usrp3/top/x300/setupenv.sh
viv_jtag_program /usr/share/uhd/images/usrp_x310_fpga_HG.bit
## Start tx
# Calling parameters: ./tx.py tx_time frequency gain
# If the tx_time is 0, it will run indefinitely
./radio_api/tx.py 0 "$SCENARIO_FREQ" 15