-$RAWLOAD -D $DONGLE -r ao_radio_xmit.ihx
-echo -n "Generating RF carrier. Please enter measured frequency: "
-read FREQ
+$USBLOAD --serial=$SERIAL $REPO/telebt-v$VERSION*.elf || exit 1
+
+sleep 5
+
+dev=`ao-list | awk '/TeleBT-v'"$VERSION"'/ { print $3; exit(0); }'`
+
+case "$dev" in
+/dev/tty*)
+ echo "TeleBT found on $dev"
+ ;;
+*)
+ echo 'No TeleBT-v'"$VERSION"' found'
+ exit 1
+ ;;
+esac
+
+echo 'E 0' > $dev
+
+SERIAL=$SERIAL ./cal-freq $dev
+
+echo 'E 1' > $dev