]> git.gag.com Git - fw/altos/blob - ao-bringup/turnon_telemetrum
update changelogs for Debian build
[fw/altos] / ao-bringup / turnon_telemetrum
1 #!/bin/sh
2
3 if [ -x ../ao-tools/ao-load/ao-load ]; then
4         AOLOAD=../ao-tools/ao-load/ao-load
5 elif [ -x /usr/bin/ao-load ]; then
6         AOLOAD=/usr/bin/ao-load
7 else
8         echo "Can't find ao-load!  Aborting."
9         exit 1
10 fi
11
12 if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then
13         RAWLOAD=../ao-tools/ao-rawload/ao-rawload
14 elif [ -x /usr/bin/ao-rawload ]; then
15         RAWLOAD=/usr/bin/ao-rawload
16 else
17         echo "Can't find ao-rawload!  Aborting."
18         exit 1
19 fi
20
21 echo "TeleMetrum v1.0 Turn-On and Calibration Program"
22 echo "Copyright 2010 by Bdale Garbee.  Released under GPL v2"
23 echo
24 echo "Expectations:"
25 echo "\tTeleMetrum v1.0 powered from USB"
26 echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header"
27 echo "\t\twith coax from UHF to frequency counter"
28 echo
29 echo -n "TeleMetrum serial number: "
30 read SERIAL
31
32 echo $RAWLOAD
33
34 $RAWLOAD -r ao_led_blink.ihx
35 echo "LEDs should be blinking"
36 sleep 5
37
38 $RAWLOAD -r ao_radio_xmit.ihx
39 echo -n "Generating RF carrier.  Please enter measured frequency: "
40 read FREQ
41
42 CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"`
43
44 echo "Programming flash with cal value " $CAL_VALUE
45 $AOLOAD --cal $CAL_VALUE /usr/share/altos/telemetrum-v1.0.ihx $SERIAL
46
47 echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
48 echo "Unplug and replug USB, cu to the board, confirm freq and record power"