diff --git a/README.md b/README.md index 490cf12..8e88e13 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,7 @@ $ ./build_rtlsdr.sh $ ./src/rtl_fsk -g 49 -f 144490000 - -a 200000 -r 10000 --code H_256_512_4 --mask 10000 --filter 0x1 | hexdump ``` Then send test frames from HackRF on laptop, e.g. bursts of 3 frames: - ``` + ``` $ ./src/freedv_data_raw_tx --source 0x1 -c --testframes 3 --burst 1 --Fs 100000 --Rs 10000 --tone1 10000 --shift 10000 -a 30000 FSK_LDPC /dev/zero - | ./misc/tlininterp - - 40 -d -f | hackrf_transfer -t - -s 4E6 -f 143.5E6 ``` This uses a source addressing scheme to filter out locally transmitted frames. In the example above, the laptop has @@ -264,8 +264,7 @@ $ ./build_rtlsdr.sh # Reading Further -1. [Open IP over VHF/UHF 1](http://www.rowetel.com/?p=7207) - Blog post introducing this project -1. [Open IP over VHF/UHF 2](http://www.rowetel.com/?p=7334) - Second blog post on uncoded OTA tests +1. Open IP over VHF/UHF [Part 1](http://www.rowetel.com/?p=7207) [Part 2](http://www.rowetel.com/?p=7334) [Part 3](http://www.rowetel.com/?p=7567) 1. [FSK_LDPC Data Mode](http://www.rowetel.com/?p=7467) - Physical layer design and testing 1. [Codec 2 FSK Raw Data Modes](https://github.com/drowe67/codec2/blob/master/README_data.md) 1. [Codec 2 FSK Modem](https://github.com/drowe67/codec2/blob/master/README_fsk.md) diff --git a/script/pirip b/script/pirip new file mode 100755 index 0000000..800b869 --- /dev/null +++ b/script/pirip @@ -0,0 +1,52 @@ +#!/bin/bash -x +# pirip service script + +# TODO +# [X] way to send stderr to log file +# [ ] way to set freq at start up +# [ ] way to set Rs and M at start up +# [ ] way to start as frame repeater or beacon + +TERM_ADDR=0x2 +RS=10000 +DATA_BITS_PER_FRAME=256 +CODE=H_${DATA_BITS_PER_FRAME}_512_4 +TR_SWITCH_GPIO=21 +PIRIP_PATH=/home/pi/pirip +NAME=pirip +PIDFILE=/var/run/${NAME}.pid +LOGFILE=/var/log/${NAME}.log +PATH=${PIRIP_PATH}/tx:${PIRIP_PATH}/librtlsdr/build_rtlsdr/src:${PATH} + +case "$1" in + start) + ( rtl_fsk -g 49 -f 144490000 - -a 200000 -r ${RS} --code ${CODE} --mask ${RS} --filter ${TERM_ADDR} -q -b | \ + frame_repeater ${DATA_BITS_PER_FRAME} ${TERM_ADDR} | \ + rpitx_fsk - --code ${CODE} -r ${RS} -s ${RS} -g ${TR_SWITCH_GPIO} -- ) >>${LOGFILE} 2>&1 & + RETVAL=$? + echo $!>${PIDFILE} + [ $RETVAL = 0 ] && echo -ne '\t\t\t\t\t[ \033[32mOK\033[0m ]\n' + ;; + stop) + parent=$(cat ${PIDFILE}) + children=$(ps -o pid= --ppid ${parent}) + kill ${children} + rm ${PIDFILE} + ;; + restart) + $0 stop + $0 start + ;; + status) + if [ -e ${PIDFILE} ]; then + echo ${NAME} is running, pid=`cat ${PIDFILE}` + else + echo$ {NAME} is NOT running + exit 1 + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" +esac + +exit 0