diff --git a/decoder/decoder.py b/decoder/decoder.py index cbaef71..459f8b0 100755 --- a/decoder/decoder.py +++ b/decoder/decoder.py @@ -108,7 +108,11 @@ def received_data(data): print 'Send to SSDV data server: OK' error = False except urllib2.URLError, error: - print 'Send to SSDV data server: failed (connection error :( trying again...)' + if error.code == 400: + print 'The SSDV server indicated a faulty packet: ' + error.read() + error = False + else: + print 'Send to SSDV data server: failed (connection error :( trying again...)' except urllib2.HTTPError, error: # The server did not like our packets :( print 'Send to SSDV data server: failed (the server did not like our packets :( )' diff --git a/tracker/hardware/pecanpico9.bak b/tracker/hardware/pecanpico9.bak index 0f7cb31..1e772ed 100644 --- a/tracker/hardware/pecanpico9.bak +++ b/tracker/hardware/pecanpico9.bak @@ -2715,9 +2715,7 @@ Wire Wire Line Wire Wire Line 22100 13500 22200 13500 Wire Wire Line - 22100 13600 22200 13600 -Wire Wire Line - 22200 13600 22600 13600 + 22100 13600 22600 13600 Wire Wire Line 21000 13200 21000 13500 Wire Wire Line @@ -2762,9 +2760,7 @@ Wire Wire Line Wire Wire Line 18000 11800 18000 11600 Wire Wire Line - 17900 11800 18000 11800 -Wire Wire Line - 18000 11800 18100 11800 + 17900 11800 18100 11800 Wire Wire Line 17500 11800 17600 11800 Wire Wire Line @@ -2793,17 +2789,13 @@ Wire Wire Line Wire Wire Line 5000 8350 5000 9450 Wire Wire Line - 5000 8350 5300 8350 -Wire Wire Line - 5300 8350 5400 8350 + 5000 8350 5400 8350 Wire Wire Line 4900 9350 4800 9350 Wire Wire Line 4900 8850 4900 9350 Wire Wire Line - 4900 8850 5300 8850 -Wire Wire Line - 5300 8850 5400 8850 + 4900 8850 5400 8850 Connection ~ 3800 9150 Wire Wire Line 3800 9250 3900 9250 @@ -2812,47 +2804,19 @@ Wire Wire Line Wire Wire Line 3800 9550 3900 9550 Wire Wire Line - 1000 9150 1700 9150 -Wire Wire Line - 1700 9150 2100 9150 -Wire Wire Line - 2100 9150 2650 9150 -Wire Wire Line - 2650 9150 3100 9150 -Wire Wire Line - 3100 9150 3800 9150 -Wire Wire Line - 3800 9150 3900 9150 + 1000 9150 3900 9150 Connection ~ 5100 9650 Wire Wire Line - 4800 9150 5400 9150 + 4800 9150 7600 9150 Wire Wire Line - 5400 9150 5700 9150 + 18400 11800 19100 11800 Wire Wire Line - 5700 9150 6500 9150 -Wire Wire Line - 6500 9150 7250 9150 -Wire Wire Line - 7250 9150 7500 9150 -Wire Wire Line - 7500 9150 7600 9150 -Wire Wire Line - 18400 11800 19000 11800 -Wire Wire Line - 19000 11800 19100 11800 -Wire Wire Line - 7800 14600 7800 14700 -Wire Wire Line - 7800 14700 7800 14900 -Wire Wire Line - 7800 14900 7800 15000 + 7800 14600 7800 15000 Wire Wire Line 7500 9150 7500 9250 Connection ~ 6500 8350 Wire Wire Line - 6500 8250 6500 8350 -Wire Wire Line - 6500 8350 6500 8450 + 6500 8250 6500 8450 Wire Wire Line 5700 8350 6500 8350 Wire Wire Line @@ -2869,9 +2833,7 @@ Connection ~ 1700 9150 Wire Wire Line 1700 9250 1700 9150 Wire Wire Line - 1000 9950 1700 9950 -Wire Wire Line - 1700 9950 1800 9950 + 1000 9950 1800 9950 Connection ~ 2100 9600 Wire Wire Line 20150 7350 20050 7350 @@ -2899,9 +2861,7 @@ Wire Wire Line Wire Wire Line 7350 11450 7450 11450 Wire Wire Line - 7350 11350 7350 11450 -Wire Wire Line - 7350 11450 7350 11550 + 7350 11350 7350 11550 Connection ~ 2100 9150 Wire Wire Line 1000 9600 2100 9600 @@ -2917,15 +2877,9 @@ Connection ~ 6500 8850 Wire Wire Line 5700 8850 6500 8850 Wire Wire Line - 6500 8750 6500 8850 + 6500 8750 6500 9250 Wire Wire Line - 6500 8850 6500 9150 -Wire Wire Line - 6500 9150 6500 9250 -Wire Wire Line - 2100 9550 2100 9600 -Wire Wire Line - 2100 9600 2100 9700 + 2100 9550 2100 9700 Wire Wire Line 2100 9150 2100 9250 Wire Wire Line @@ -2998,36 +2952,22 @@ Wire Wire Line Wire Wire Line 13300 7000 13300 6900 Wire Wire Line - 13050 6300 13300 6300 -Wire Wire Line - 13300 6300 13500 6300 + 13050 6300 13500 6300 Wire Wire Line 20650 7250 20650 7350 Wire Wire Line 8300 9150 8400 9150 Wire Wire Line - 9000 9150 9100 9150 -Wire Wire Line - 9100 9150 9350 9150 -Wire Wire Line - 9350 9150 9700 9150 -Wire Wire Line - 9700 9150 9900 9150 + 9000 9150 9900 9150 Wire Wire Line 9100 9150 9100 9200 Wire Wire Line 9350 9150 9350 9200 Connection ~ 9100 9150 Wire Wire Line - 9100 9500 9100 9550 + 9100 9500 9100 9600 Wire Wire Line - 9100 9550 9100 9600 -Wire Wire Line - 8300 9550 8900 9550 -Wire Wire Line - 8900 9550 9100 9550 -Wire Wire Line - 9100 9550 9350 9550 + 8300 9550 9350 9550 Wire Wire Line 9350 9550 9350 9500 Connection ~ 9100 9550 @@ -3042,11 +2982,7 @@ Connection ~ 9700 9150 Wire Wire Line 7600 9350 7500 9350 Wire Wire Line - 7500 9350 7500 9450 -Wire Wire Line - 7500 9450 7500 9550 -Wire Wire Line - 7500 9550 7500 10000 + 7500 9350 7500 10000 Wire Wire Line 7500 9450 7600 9450 Wire Wire Line @@ -3056,23 +2992,17 @@ Connection ~ 7500 9550 Wire Wire Line 7500 9250 7600 9250 Wire Wire Line - 7250 9050 7250 9150 -Wire Wire Line - 7250 9150 7250 9450 + 7250 9050 7250 9450 Connection ~ 7500 9150 Wire Wire Line 7250 9750 7250 10000 Wire Wire Line - 2650 9550 2650 9650 -Wire Wire Line - 2650 9650 2650 9750 + 2650 9550 2650 9750 Wire Wire Line 2650 10050 2650 10150 Connection ~ 7250 9150 Wire Wire Line - 6500 9550 6500 9650 -Wire Wire Line - 6500 9650 6500 9750 + 6500 9550 6500 9750 Wire Wire Line 6500 10050 6500 10150 Wire Wire Line @@ -3089,13 +3019,9 @@ Connection ~ 6500 9150 Wire Wire Line 5100 9650 5100 9750 Wire Wire Line - 4800 9650 5100 9650 + 4800 9650 5400 9650 Wire Wire Line - 5100 9650 5400 9650 -Wire Wire Line - 5400 9550 5400 9650 -Wire Wire Line - 5400 9650 5400 9750 + 5400 9550 5400 9750 Connection ~ 5400 9650 Wire Wire Line 5400 9150 5400 9250 @@ -3112,24 +3038,16 @@ Wire Wire Line Wire Wire Line 3100 9550 3200 9550 Wire Wire Line - 3100 9050 3100 9150 -Wire Wire Line - 3100 9150 3100 9550 -Wire Wire Line - 3100 9550 3100 9700 + 3100 9050 3100 9700 Wire Wire Line 3100 10150 3100 10000 Connection ~ 3100 9550 Connection ~ 3100 9150 Wire Wire Line - 6500 7050 6950 7050 -Wire Wire Line - 6950 7050 7100 7050 + 6500 7050 7100 7050 Connection ~ 6950 7050 Wire Wire Line - 6750 7150 6950 7150 -Wire Wire Line - 6950 7150 7100 7150 + 6750 7150 7100 7150 Connection ~ 6950 7150 Wire Wire Line 6750 7250 6750 7150 @@ -3144,9 +3062,7 @@ Wire Wire Line Wire Wire Line 7050 6700 7050 6800 Wire Wire Line - 6250 6800 7050 6800 -Wire Wire Line - 7050 6800 7100 6800 + 6250 6800 7100 6800 Wire Wire Line 6250 7250 6250 6800 Connection ~ 7050 6800 @@ -3155,24 +3071,16 @@ Wire Wire Line Wire Wire Line 8100 7050 8200 7050 Wire Wire Line - 8200 7050 8200 7150 -Wire Wire Line - 8200 7150 8200 7650 + 8200 7050 8200 7650 Wire Wire Line 8200 7150 8100 7150 Connection ~ 8200 7150 Wire Wire Line - 8400 6500 8400 6600 + 8400 6500 8400 7000 Wire Wire Line - 8400 6600 8400 7000 + 8650 6500 8650 7000 Wire Wire Line - 8650 6500 8650 6700 -Wire Wire Line - 8650 6700 8650 7000 -Wire Wire Line - 8900 6500 8900 6800 -Wire Wire Line - 8900 6800 8900 7000 + 8900 6500 8900 7000 Connection ~ 8400 6600 Connection ~ 8650 6700 Connection ~ 8900 6800 @@ -3185,16 +3093,12 @@ Wire Wire Line Wire Wire Line 12800 7000 12800 6900 Wire Wire Line - 12800 6400 12800 6500 -Wire Wire Line - 12800 6500 12800 6600 + 12800 6400 12800 6600 Connection ~ 12800 6500 Wire Wire Line 12800 6100 12800 5800 Wire Wire Line - 4150 14600 4150 14700 -Wire Wire Line - 4150 14700 4150 15600 + 4150 14600 4150 15600 Wire Wire Line 4150 14700 4050 14700 Wire Wire Line @@ -3211,19 +3115,9 @@ Wire Wire Line Wire Wire Line 2350 14600 3050 14600 Wire Wire Line - 2800 13500 2950 13500 + 2800 13500 3050 13500 Wire Wire Line - 2950 13500 3050 13500 -Wire Wire Line - 2950 12450 2950 12550 -Wire Wire Line - 2950 12550 2950 12800 -Wire Wire Line - 2950 12800 2950 13050 -Wire Wire Line - 2950 13050 2950 13400 -Wire Wire Line - 2950 13400 2950 13500 + 2950 12450 2950 13500 Wire Wire Line 2950 13400 3050 13400 Connection ~ 2950 13400 @@ -3243,11 +3137,7 @@ Wire Wire Line 2950 12800 2850 12800 Connection ~ 2950 12800 Wire Wire Line - 2450 12550 2450 12800 -Wire Wire Line - 2450 12800 2450 13050 -Wire Wire Line - 2450 13050 2450 13150 + 2450 12550 2450 13150 Wire Wire Line 2450 13050 2550 13050 Wire Wire Line @@ -3264,30 +3154,22 @@ Wire Wire Line Wire Wire Line 4150 12900 4150 13000 Wire Wire Line - 4050 14300 4400 14300 -Wire Wire Line - 4400 14300 4500 14300 + 4050 14300 4500 14300 Wire Wire Line 4400 14300 4400 14400 Connection ~ 4400 14300 Wire Wire Line - 4400 15000 4400 15100 -Wire Wire Line - 4400 15100 4400 15200 + 4400 15000 4400 15200 Wire Wire Line 4400 15100 4550 15100 Connection ~ 4400 15100 Wire Wire Line 4400 15600 4400 15500 Wire Wire Line - 13300 5800 13300 6300 -Wire Wire Line - 13300 6300 13300 6600 + 13300 5800 13300 6600 Connection ~ 13300 6300 Wire Wire Line - 11900 14400 11900 14500 -Wire Wire Line - 11900 14500 11900 14600 + 11900 14400 11900 14600 Wire Wire Line 12400 14500 12400 14600 Connection ~ 12400 14500 @@ -3297,9 +3179,7 @@ Connection ~ 12150 14500 Wire Wire Line 3700 5100 3800 5100 Wire Wire Line - 3800 5000 3800 5100 -Wire Wire Line - 3800 5100 3800 5200 + 3800 5000 3800 5200 Wire Wire Line 3700 5000 3800 5000 Connection ~ 3800 5100 @@ -3318,28 +3198,18 @@ Wire Wire Line Wire Wire Line 1100 4400 1500 4400 Wire Wire Line - 2300 3700 2400 3700 -Wire Wire Line - 2400 3700 2500 3700 + 2300 3700 2500 3700 Wire Wire Line 2500 3400 2400 3400 Wire Wire Line 2400 3400 2400 3700 Connection ~ 2400 3700 Wire Wire Line - 2200 2900 2300 2900 -Wire Wire Line - 2300 2900 2500 2900 + 2200 2900 2500 2900 Wire Wire Line 2300 2350 2300 2900 Wire Wire Line - 3700 2900 3800 2900 -Wire Wire Line - 3800 2900 4050 2900 -Wire Wire Line - 4050 2900 4350 2900 -Wire Wire Line - 4350 2900 4600 2900 + 3700 2900 4600 2900 Wire Wire Line 3800 2900 3800 3000 Connection ~ 3800 2900 @@ -3352,9 +3222,7 @@ Wire Wire Line Wire Wire Line 4050 4600 4050 4500 Wire Wire Line - 4050 3900 4050 4100 -Wire Wire Line - 4050 4100 4050 4200 + 4050 3900 4050 4200 Connection ~ 4050 4100 Wire Wire Line 3700 4000 4350 4000 @@ -3378,13 +3246,7 @@ Wire Wire Line Wire Wire Line 18600 7750 19200 7750 Wire Wire Line - 19200 4900 18600 4900 -Wire Wire Line - 11900 14500 12150 14500 -Wire Wire Line - 12150 14500 12400 14500 -Wire Wire Line - 12400 14500 13400 14500 + 11900 14500 13400 14500 Wire Wire Line 15600 12600 16400 12600 Wire Wire Line @@ -3395,9 +3257,7 @@ Connection ~ 14700 12800 Wire Wire Line 14700 12700 14800 12700 Wire Wire Line - 14700 12700 14700 12800 -Wire Wire Line - 14700 12800 14700 13000 + 14700 12700 14700 13000 Wire Wire Line 14800 12800 14700 12800 Wire Wire Line @@ -3487,49 +3347,29 @@ Wire Wire Line 4350 4000 4350 2900 Connection ~ 4350 2900 Wire Wire Line - 6950 6500 6950 6600 -Wire Wire Line - 6950 6600 6950 6950 -Wire Wire Line - 6950 6950 6950 7050 -Wire Wire Line - 6950 7050 6950 7150 + 6950 6500 6950 7150 Wire Wire Line 6950 6600 7100 6600 Connection ~ 6950 6600 Wire Wire Line 7350 10600 7350 10500 Wire Wire Line - 6300 14300 6400 14300 + 6300 14300 6500 14300 Wire Wire Line - 6400 14300 6500 14300 -Wire Wire Line - 5500 14300 5600 14300 -Wire Wire Line - 5600 14300 5700 14300 + 5500 14300 5700 14300 Wire Wire Line 5850 14100 5600 14100 Wire Wire Line - 5600 14100 5600 14300 -Wire Wire Line - 5600 14300 5600 14450 + 5600 14100 5600 14450 Connection ~ 5600 14300 Wire Wire Line - 6150 14100 6400 14100 + 6150 14100 6650 14100 Wire Wire Line - 6400 14100 6650 14100 -Wire Wire Line - 6400 14100 6400 14300 -Wire Wire Line - 6400 14300 6400 14450 + 6400 14100 6400 14450 Connection ~ 6400 14300 Connection ~ 6400 14100 Wire Wire Line - 7100 14300 7200 14300 -Wire Wire Line - 7200 14300 7600 14300 -Wire Wire Line - 7600 14300 7800 14300 + 7100 14300 7800 14300 Wire Wire Line 7200 14300 7200 14100 Wire Wire Line @@ -3545,17 +3385,11 @@ Connection ~ 7600 14300 Wire Wire Line 4600 3000 4500 3000 Wire Wire Line - 4500 3000 4500 3100 + 4500 3000 4500 3200 Wire Wire Line - 4500 3100 4500 3200 + 5300 3100 6100 3100 Wire Wire Line - 5300 3100 5700 3100 -Wire Wire Line - 5700 3100 6100 3100 -Wire Wire Line - 5400 2800 5400 2900 -Wire Wire Line - 5400 2900 5400 3250 + 5400 2800 5400 3250 Wire Wire Line 5400 3600 5400 3550 Wire Notes Line @@ -3573,15 +3407,7 @@ Wire Wire Line Wire Wire Line 18600 7650 19200 7650 Wire Wire Line - 16300 3150 16300 3250 -Wire Wire Line - 16300 3250 16300 3350 -Wire Wire Line - 16300 3350 16300 3450 -Wire Wire Line - 16300 3450 16300 3550 -Wire Wire Line - 16300 3550 16300 3700 + 16300 3150 16300 3700 Wire Wire Line 16200 4400 16200 4300 Wire Wire Line @@ -3617,11 +3443,7 @@ Wire Wire Line Connection ~ 16300 3350 Connection ~ 15250 4000 Wire Wire Line - 15150 4000 15250 4000 -Wire Wire Line - 15250 4000 15500 4000 -Wire Wire Line - 15500 4000 16400 4000 + 15150 4000 16400 4000 Wire Wire Line 15850 4700 15850 4100 Wire Wire Line @@ -3631,13 +3453,7 @@ Wire Wire Line Wire Wire Line 12800 6500 13500 6500 Wire Wire Line - 16300 7600 16300 7700 -Wire Wire Line - 16300 7700 16300 7800 -Wire Wire Line - 16300 7800 16300 7900 -Wire Wire Line - 16300 7900 16300 8000 + 16300 7600 16300 8000 Wire Wire Line 16300 7600 16400 7600 Wire Wire Line @@ -3660,21 +3476,7 @@ Wire Wire Line Wire Wire Line 15000 3250 15000 3350 Wire Wire Line - 14450 3250 14650 3250 -Wire Wire Line - 14650 3250 15000 3250 -Wire Wire Line - 15000 3250 15250 3250 -Wire Wire Line - 15250 3250 15500 3250 -Wire Wire Line - 15500 3250 15750 3250 -Wire Wire Line - 15750 3250 16000 3250 -Wire Wire Line - 16000 3250 16300 3250 -Wire Wire Line - 16300 3250 16400 3250 + 14450 3250 16400 3250 Connection ~ 15000 3250 Wire Wire Line 20650 7350 20550 7350 @@ -3696,18 +3498,12 @@ Wire Wire Line Wire Wire Line 19200 7050 18600 7050 Wire Wire Line - 21250 13600 21250 13800 -Wire Wire Line - 21250 13800 21250 14100 -Wire Wire Line - 21250 14100 21250 14350 + 21250 13600 21250 14350 Wire Wire Line 21350 13800 21250 13800 Connection ~ 21250 13800 Wire Wire Line - 13300 14700 13300 14900 -Wire Wire Line - 13300 14900 13300 15000 + 13300 14700 13300 15000 Wire Wire Line 13300 14900 13400 14900 Wire Wire Line @@ -3747,13 +3543,9 @@ Wire Wire Line Wire Wire Line 13300 13900 13300 13800 Wire Wire Line - 12400 13800 13300 13800 + 12400 13800 13400 13800 Wire Wire Line - 13300 13800 13400 13800 -Wire Wire Line - 12400 13700 12400 13800 -Wire Wire Line - 12400 13800 12400 13900 + 12400 13700 12400 13900 Connection ~ 13300 13800 Connection ~ 12400 13800 Wire Wire Line @@ -3763,15 +3555,11 @@ Wire Wire Line Connection ~ 13300 14900 Connection ~ 15700 12400 Wire Wire Line - 15700 12250 15700 12400 -Wire Wire Line - 15700 12400 15700 12800 + 15700 12250 15700 12800 Wire Wire Line 15700 12800 15600 12800 Wire Wire Line - 14700 12300 14700 12400 -Wire Wire Line - 14700 12400 14700 12500 + 14700 12300 14700 12500 Wire Wire Line 14700 12500 14800 12500 Wire Wire Line diff --git a/tracker/hardware/pecanpico9.sch b/tracker/hardware/pecanpico9.sch index 0ecaf6d..c292236 100644 --- a/tracker/hardware/pecanpico9.sch +++ b/tracker/hardware/pecanpico9.sch @@ -1833,7 +1833,7 @@ F 4 "10V" H 5300 8600 60 0001 C CNN "Specs" 1 0 0 -1 $EndComp Text Label 18500 12100 0 60 ~ 0 -V_BOOST +USB_ID $Comp L +1V8 #PWR061 U 1 1 57AF31A6 @@ -2576,17 +2576,6 @@ F 3 "" H 15850 4700 50 0000 C CNN 1 0 0 -1 $EndComp $Comp -L GND #PWR093 -U 1 1 58F4F4C7 -P 18700 4250 -F 0 "#PWR093" H 18700 4000 50 0001 C CNN -F 1 "GND" H 18700 4100 50 0000 C CNN -F 2 "" H 18700 4250 50 0000 C CNN -F 3 "" H 18700 4250 50 0000 C CNN - 1 18700 4250 - 0 -1 -1 0 -$EndComp -$Comp L GND #PWR094 U 1 1 58F58554 P 16300 8000 @@ -3245,8 +3234,6 @@ Wire Wire Line 21000 13500 21350 13500 Wire Wire Line 18600 7750 19200 7750 -Wire Wire Line - 19200 4900 18600 4900 Wire Wire Line 11900 14500 13400 14500 Wire Wire Line @@ -3451,7 +3438,7 @@ Wire Wire Line Wire Wire Line 15850 4100 16400 4100 Wire Wire Line - 18600 4250 18700 4250 + 18600 4250 19200 4250 Wire Wire Line 12800 6500 13500 6500 Wire Wire Line @@ -3683,4 +3670,6 @@ Wire Wire Line Connection ~ 1700 9950 Wire Wire Line 1700 9950 1700 9550 +Text Label 19200 4250 2 60 ~ 0 +USB_ID $EndSCHEMATC diff --git a/tracker/software/Makefile b/tracker/software/Makefile index 531864b..79c5272 100644 --- a/tracker/software/Makefile +++ b/tracker/software/Makefile @@ -1,259 +1,259 @@ -############################################################################## -# Build global options -# NOTE: Can be overridden externally. -# - -# Compiler options here. -ifeq ($(USE_OPT),) - USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -endif - -# C specific options here (added to USE_OPT). -ifeq ($(USE_COPT),) - USE_COPT = -endif - -# C++ specific options here (added to USE_OPT). -ifeq ($(USE_CPPOPT),) - USE_CPPOPT = -fno-rtti -endif - -# Enable this if you want the linker to remove unused code and data -ifeq ($(USE_LINK_GC),) - USE_LINK_GC = yes -endif - -# Linker extra options here. -ifeq ($(USE_LDOPT),) - USE_LDOPT = -endif - -# Enable this if you want link time optimizations (LTO) -ifeq ($(USE_LTO),) - USE_LTO = yes -endif - -# If enabled, this option allows to compile the application in THUMB mode. -ifeq ($(USE_THUMB),) - USE_THUMB = yes -endif - -# Enable this if you want to see the full log while compiling. -ifeq ($(USE_VERBOSE_COMPILE),) - USE_VERBOSE_COMPILE = no -endif - -# If enabled, this option makes the build process faster by not compiling -# modules not used in the current configuration. -ifeq ($(USE_SMART_BUILD),) - USE_SMART_BUILD = yes -endif - -# -# Build global options -############################################################################## - -############################################################################## -# Architecture or project specific options -# - -# Stack size to be allocated to the Cortex-M process stack. This stack is -# the stack used by the main() thread. -ifeq ($(USE_PROCESS_STACKSIZE),) - USE_PROCESS_STACKSIZE = 0x400 -endif - -# Stack size to the allocated to the Cortex-M main/exceptions stack. This -# stack is used for processing interrupts and exceptions. -ifeq ($(USE_EXCEPTIONS_STACKSIZE),) - USE_EXCEPTIONS_STACKSIZE = 0x400 -endif - -# Enables the use of FPU (no, softfp, hard). -ifeq ($(USE_FPU),) - USE_FPU = no -endif - -# -# Architecture or project specific options -############################################################################## - -############################################################################## -# Project, sources and paths -# - -# Define project name here -PROJECT = ch - -# Imported source files and paths -CHIBIOS = ChibiOS -# Startup files. -include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk -# HAL-OSAL files (optional). -include $(CHIBIOS)/os/hal/hal.mk -include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk -include board/board.mk -include $(CHIBIOS)/os/hal/osal/rt/osal.mk -# RTOS files (optional). -include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk -# Other files (optional). -include $(CHIBIOS)/test/rt/test.mk -include $(CHIBIOS)/os/hal/lib/streams/streams.mk -include $(CHIBIOS)/os/various/shell/shell.mk - -# Define linker script file here -LDSCRIPT= board/STM32F413xH.ld - -# C sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(TESTSRC) \ - $(SHELLSRC) \ - $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ - $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ - modules/tracking.c \ - modules/position.c \ - modules/image.c \ - modules/log.c \ - protocols/ssdv/ssdv.c \ - protocols/ssdv/rs8.c \ - protocols/aprs/aprs.c \ - protocols/aprs/ax25.c \ - protocols/morse/morse.c \ - drivers/wrapper/pi2c.c \ - drivers/wrapper/padc.c \ - drivers/wrapper/ptime.c \ - drivers/ublox.c \ - drivers/si4464.c \ - drivers/bme280.c \ - drivers/pac1720.c \ - drivers/ov2640.c \ - drivers/ov5640.c \ - drivers/flash/flash.c \ - drivers/flash/helper.c \ - drivers/flash/ihex.c \ - debug.c \ - radio.c \ - sleep.c \ - modules.c \ - math/base.c \ - math/sgp4.c \ - math/geofence.c \ - config.c \ - watchdog.c \ - usbcfg.c \ - main.c - -# C++ sources that can be compiled in ARM or THUMB mode depending on the global -# setting. -CPPSRC = - -# C sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACSRC = - -# C++ sources to be compiled in ARM mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -ACPPSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCSRC = - -# C sources to be compiled in THUMB mode regardless of the global setting. -# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler -# option that results in lower performance and larger code size. -TCPPSRC = - -# List ASM source files here -ASMSRC = -ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) - -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various \ - $(SHELLINC) - -# -# Project, sources and paths -############################################################################## - -############################################################################## -# Compiler settings -# - -MCU = cortex-m4 - -#TRGT = arm-elf- -TRGT = arm-none-eabi- -CC = $(TRGT)gcc -CPPC = $(TRGT)g++ -# Enable loading with g++ only if you need C++ runtime support. -# NOTE: You can use C++ even without C++ support if you are careful. C++ -# runtime support makes code size explode. -LD = $(TRGT)gcc -#LD = $(TRGT)g++ -CP = $(TRGT)objcopy -AS = $(TRGT)gcc -x assembler-with-cpp -AR = $(TRGT)ar -OD = $(TRGT)objdump -SZ = $(TRGT)size -HEX = $(CP) -O ihex -BIN = $(CP) -O binary - -# ARM-specific options here -AOPT = - -# THUMB-specific options here -TOPT = -mthumb -DTHUMB - -# Define C warning options here -CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes - -# Define C++ warning options here -CPPWARN = -Wall -Wextra -Wundef - -# -# Compiler settings -############################################################################## - -############################################################################## -# Start of user section -# - -# List all user C define here, like -D_DEBUG=1 -UDEFS = - -# Define ASM defines here -UADEFS = - -# List all user directories here -UINCDIR = modules/ drivers/ drivers/wrapper/ protocols/aprs \ - protocols/ssdv protocols/morse math/ drivers/flash/ - -# List the user directory to look for the libraries here -ULIBDIR = - -# List all user libraries here -ULIBS = -lm - -# -# End of user defines -############################################################################## - -RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC -include $(RULESPATH)/rules.mk - -burn: - st-flash write build/$(PROJECT).bin 0x08000000 +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +# Compiler options here. +ifeq ($(USE_OPT),) + USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 +endif + +# C specific options here (added to USE_OPT). +ifeq ($(USE_COPT),) + USE_COPT = -std=c11 +endif + +# C++ specific options here (added to USE_OPT). +ifeq ($(USE_CPPOPT),) + USE_CPPOPT = -fno-rtti +endif + +# Enable this if you want the linker to remove unused code and data +ifeq ($(USE_LINK_GC),) + USE_LINK_GC = yes +endif + +# Linker extra options here. +ifeq ($(USE_LDOPT),) + USE_LDOPT = +endif + +# Enable this if you want link time optimizations (LTO) +ifeq ($(USE_LTO),) + USE_LTO = yes +endif + +# If enabled, this option allows to compile the application in THUMB mode. +ifeq ($(USE_THUMB),) + USE_THUMB = yes +endif + +# Enable this if you want to see the full log while compiling. +ifeq ($(USE_VERBOSE_COMPILE),) + USE_VERBOSE_COMPILE = no +endif + +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +ifeq ($(USE_SMART_BUILD),) + USE_SMART_BUILD = yes +endif + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Stack size to be allocated to the Cortex-M process stack. This stack is +# the stack used by the main() thread. +ifeq ($(USE_PROCESS_STACKSIZE),) + USE_PROCESS_STACKSIZE = 0x400 +endif + +# Stack size to the allocated to the Cortex-M main/exceptions stack. This +# stack is used for processing interrupts and exceptions. +ifeq ($(USE_EXCEPTIONS_STACKSIZE),) + USE_EXCEPTIONS_STACKSIZE = 0x400 +endif + +# Enables the use of FPU (no, softfp, hard). +ifeq ($(USE_FPU),) + USE_FPU = no +endif + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define project name here +PROJECT = ch + +# Imported source files and paths +CHIBIOS = ChibiOS +#CHIBIOS = C:\ChibiStudio\chibios_trunk +# Startup files. +include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk +# HAL-OSAL files (optional). +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk +include board/board.mk +include $(CHIBIOS)/os/hal/osal/rt/osal.mk +# RTOS files (optional). +include $(CHIBIOS)/os/rt/rt.mk +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +# Other files (optional). +include $(CHIBIOS)/test/rt/test.mk +include $(CHIBIOS)/os/hal/lib/streams/streams.mk +include $(CHIBIOS)/os/various/shell/shell.mk + +# Define linker script file here +LDSCRIPT= board/STM32F413xH.ld + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CSRC = $(STARTUPSRC) \ + $(KERNSRC) \ + $(PORTSRC) \ + $(OSALSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(TESTSRC) \ + $(SHELLSRC) \ + $(CHIBIOS)/os/hal/lib/streams/memstreams.c \ + $(CHIBIOS)/os/hal/lib/streams/chprintf.c \ + threads/tracking.c \ + threads/position.c \ + threads/image.c \ + threads/log.c \ + protocols/ssdv/ssdv.c \ + protocols/ssdv/rs8.c \ + protocols/aprs/aprs.c \ + protocols/aprs/ax25.c \ + protocols/morse/morse.c \ + drivers/wrapper/pi2c.c \ + drivers/wrapper/padc.c \ + drivers/wrapper/ptime.c \ + drivers/ublox.c \ + drivers/si4464.c \ + drivers/bme280.c \ + drivers/pac1720.c \ + drivers/ov5640.c \ + drivers/flash/flash.c \ + drivers/flash/helper.c \ + drivers/flash/ihex.c \ + debug.c \ + radio.c \ + sleep.c \ + threads/threads.c \ + math/base.c \ + math/sgp4.c \ + math/geofence.c \ + config.c \ + watchdog.c \ + usbcfg.c \ + main.c + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +CPPSRC = + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACSRC = + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +ACPPSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCSRC = + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +TCPPSRC = + +# List ASM source files here +ASMSRC = +ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) + +INCDIR = $(CHIBIOS)/os/license \ + $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ + $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various \ + $(SHELLINC) + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +MCU = cortex-m4 + +#TRGT = arm-elf- +TRGT = arm-none-eabi- +CC = $(TRGT)gcc +CPPC = $(TRGT)g++ +# Enable loading with g++ only if you need C++ runtime support. +# NOTE: You can use C++ even without C++ support if you are careful. C++ +# runtime support makes code size explode. +LD = $(TRGT)gcc +#LD = $(TRGT)g++ +CP = $(TRGT)objcopy +AS = $(TRGT)gcc -x assembler-with-cpp +AR = $(TRGT)ar +OD = $(TRGT)objdump +SZ = $(TRGT)size +HEX = $(CP) -O ihex +BIN = $(CP) -O binary + +# ARM-specific options here +AOPT = + +# THUMB-specific options here +TOPT = -mthumb -DTHUMB + +# Define C warning options here +CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes + +# Define C++ warning options here +CPPWARN = -Wall -Wextra -Wundef + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +UDEFS = + +# Define ASM defines here +UADEFS = + +# List all user directories here +UINCDIR = threads/ drivers/ drivers/wrapper/ protocols/aprs \ + protocols/ssdv protocols/morse math/ drivers/flash/ + +# List the user directory to look for the libraries here +ULIBDIR = + +# List all user libraries here +ULIBS = -lm + +# +# End of user defines +############################################################################## + +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC +include $(RULESPATH)/rules.mk + +burn: + st-flash write build/$(PROJECT).bin 0x08000000 diff --git a/tracker/software/README.md b/tracker/software/README.md deleted file mode 100644 index fd91a8f..0000000 --- a/tracker/software/README.md +++ /dev/null @@ -1,307 +0,0 @@ -# Software for Pecan Balloon Trackers - -This is the software, that runs the [Pecan Pico 7 balloon trackers](https://github.com/DL7AD/pecanpico7). Since the new trackers can be used in many ways, this software is designed for multiple purpose. It can be used for: -- Image transmissions - - [SSDV](https://ukhas.org.uk/guides:ssdv) as 2FSK modulation (RTTY) - - [APRS](http://aprs.org)-encoded [SSDV](https://ukhas.org.uk/guides:ssdv) as AFSK or 2GFSK modulation -- Position/Telemetry transmission (GPS) - - by [APRS](http://aprs.org) AFSK or 2GFSK - - 2FSK (RTTY) - - CW (morse) - -This software may also feature -- Amateur satellite communication links -- Full duplex repeater for digital modulations (up 70cm, down 2m) -- Ground control access via radio link - -###### Transmitted Test Images -Here are some images which were transmitted by [SSDV](https://ukhas.org.uk/guides:ssdv). These QVGA-images were captured by an [Omnivision OV9655](http://www.waveshare.com/wiki/OV9655_Camera_Board). - -![Test image 1](https://raw.githubusercontent.com/DL7AD/pecan-stm32f429/master/doc/sample_pictures/test2.jpg) -![Test image 2](https://raw.githubusercontent.com/DL7AD/pecan-stm32f429/master/doc/sample_pictures/test3.jpg)
- -###### Targets -Currently there is only one target supported by the Software. Pecan Pico 7a will be succeeded by Pecan Pico 7b due to some mayor errors ([See known PCB errors](https://github.com/DL7AD/pecanpico7/tree/7a)). - -Pecan Pico 7a
[Pecan Pico 7a](https://github.com/DL7AD/pecanpico7/tree/7a) - -###### Features -All features can be combined as required for the user. Currently the software is incomplete but basic features can be used: - -- Image capturing (just QVGA at the moment) and transmission by SSDV -- Reception of positions (by ublox MAX8 GNSS module) -- Measurement of temperature/air-pressure/humidity (by onboard BME280) -- Measurement of temperature/air-pressure/humidity (by external BME280) -- Measurement of the power consumption (battery charging and discharging) -- Position and telemetry transmissions by 2FSK (or RTTY) -- High altitude mode (up to 50km altitude) -- Debugging (serial connection) -- APRS encoding (AFSK, 2GFSK) -- APRS SSDV-encoded Image Transmission - -What currently doesn't work (but planned): -- High resolution image capture (just QVGA at the moment) -- Logging and log transmissions -- Amateur satellite orbit calculations and transmissions -- Power save modes -- Storage of telemetry and image data on the microSD card - -It is currently not planned to implement video capture. The STM32F4 doesn't have sufficient computing power for compression encoding. However the new pin-compabile [STM32F7x7](http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1858) supports JPEG encoding. So video capture may be possible in future. - -###### Dependency installations/ Compiling/ Flashing -In order to get the hardware working, you'll need a programmer. There are several devices on the market but I personally use the [STM32F429I-DISCOVERY](http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00093903.pdf) demo board. The discovery board is basically a programmer with a demo target (microcontroller) attached to it. It's designed in a way so you can either flash the demo target or the Pecan Pico 7 by switching specific jumpers on the board. You may get the programmer at [Mouser](http://www2.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeySTM32F429I-DISC1), [Farnell](http://www.newark.com/stmicroelectronics/stm32f429i-disc1/dev-board-stm32f429zi-advanced/dp/72Y1169), [Digikey](http://www.digikey.de/product-detail/de/stmicroelectronics/STM32F429I-DISCO/497-13898-ND/4310131) or on Ebay for roughly $30. You'll need to connect the programmer as follows. Don't forget to remove the jumpers which connect the programmer with the demo target. - -You'll also need some software dependencies. -- _GCC_ to build binary files -- _ST-Flash_ to flash the binaries to your target -There's a [great guide](http://www.wolinlabs.com/blog/linux.stm32.discovery.gcc.html) on the Web which I've followed myself to set up everything. They are using a different demo board but it works similarily. - -Then you'll need the source code for the tracker: -``` -git clone --recursive https://github.com/DL7AD/pecan-stm32f429.git -cd pecan-stm32f429 -make -make flash -``` -A _build_ folder will be created automatically. The software can be configured/customized in the [config.h](config.h). - -###### How to connect the programmer to the Pecan Pico 7 PCB -Programmer connected to Pecan Pico 7 - - - - -# Technical Description -Technical description below... - -# Modules -This section describes the different function blocks in the software and how they interact which each other. The software provides multiple modules, which supply the main functionality of the tracker like transmitting positions or images. Modules are basically [threads in the ChibiOS RTOS](http://www.chibios.org/dokuwiki/doku.php?id=chibios:howtos:createthread). Modules can be: - -- POSITION - for transmining position and telemetry -- IMAGE - for transmitting images -- LOG - for transmitting logs - -There are two more specific modules which are started automatically be the software at run time. They are necessary to handle input/output jobs. -- TRACKING (or tracking manager) - collects all the data from the periphery (BME280, GPS, etc.) and provides them (as struct) to other modules in the software. -- RADIO - provides the two radios which are available. This module receives internal messages from other modules which intend to send packets via VHF or UHF. - -The following diagram shows how the modules interact with each other. - -``` - DRIVER | DATA PROCESSING MODULES | DRIVER -------------+--------------------------------------------------------------+------------------ - - MPU9250 ---+ +---> SATELLITE ---+ - | | | - BME280 ----+---> TRACKING Manager -----+---> POSITION ----+----> RADIO ---+---> RADIO1 (2m) - | | | | - MAX -------+ +-----> LOG -------+ +---> RADIO2 (70cm) - | - OV9655 or ----------------------------------> IMAGE ------+ - OV2640 -``` - -## Module configuration -In order to use these modules, they can be configured in the MOULDES() macro in the [configuration file](config.h). All modules can be configured except of TRACKING and RADIO. They have no configurable parameters because they get their parameters from other modules in run time. The following example shows how an image module and a position module can be configured. -``` -MODULES() { \ - MODULE_IMAGE (TX_CONTINUOSLY, SLEEP_WHEN_BATT_BELOW_3V5, CUSTOM_FREQ, 10, PROT_SSDV_2FSK ); \ - MODULE_POSITION(WAIT_FOR_TRACKING_POINT, SLEEP_WHEN_BATT_BELOW_3V0, CUSTOM_FREQ, 10, PROT_UKHAS_2FSK); \ -} -``` -As you can see, there are several parameters which can be used to configure a specific module: - -**Parameter 1** specifies in which cycle the modules shall send their data. This can be a time in seconds. It's also allowed to indicate *TX_CONTINUOSLY* or *WAIT_FOR_TRACKING_POINT* in this field.
-*TX_CONTINUOSLY* - Transmit new data as soon as the previous frame is compled
-*WAIT_FOR_TRACKING_POINT* - Transmit when the tracking manager generates a new track point
-**Parameter 2** specifies the sleep mode. Note this function is currently not implemented. The modules will disregard this field.
-**Parameter 3** specifies a frequency method. Currently *CUSTOM_FREQ* or *APRS_REGION_FREQ* can be used. The frequencies are dynamic and set in [radio.c](radio.c). *CUSTOM_FREQ* is set to 434.500MHz and *APRS_REGION_FREQ* is set to 144.800MHz as the default. A geofencing algorithm is implemented for *APRS_REGION_FREQ* in order to find out the specific APRS region frequency by the actual location.
-**Parameter 4** specifies the transmission power in dBm. If the value is set to a point which the radio is unable to reach (or would damage the PCB) the actual value may be limited by the RADIO module.
-**Parameter 5** specifies the protocol and modulation. While you can use *PROT_UKHAS_2FSK*, *PROT_APRS_AFSK* or *PROT_RAW_CW* for the POSITION module, the IMAGE module can accept *PROT_SSDV_2FSK*, *PROT_SSDV_APRS_AFSK* and *PROT_SSDV_APRS_2GFSK* at the moment. - -Note not all of the parameters can be used for every individual module because some configurations may not make sense e.g. CW modulation for transmitting images. You can find an exact documentation in the [configuration file](config.h) which specific parameters can be applied to the the modules. - -## Concurrent use of modules -Modules can be merged in various combinations. However modules can be also understood as classes whose instances can be used multiple times. So if you want to transmit telemetry and positions by RTTY and APRS at the same time, you may configure modules multiple times. The following example shows, how the position/telemetry is sent on a custon frequency while it's also transmitted by APRS on the regional APRS frequency and CW. -``` -MODULES() { \ - MODULE_POSITION (WAIT_FOR_TRACKING_POINT, SLEEP_WHEN_BATT_BELOW_2V5, CUSTOM_FREQ, 10, PROT_UKHAS_2FSK); \ - MODULE_POSITION (WAIT_FOR_TRACKING_POINT, SLEEP_WHEN_BATT_BELOW_2V5, APRS_REGION_FREQ, 10, PROT_APRS_AFSK ); \ - MODULE_POSITION (WAIT_FOR_TRACKING_POINT, SLEEP_WHEN_BATT_BELOW_3V0,CUSTOM_FREQ, 10, PROT_RAW_CW ); \ -} -``` - -## Module TRACKING (or tracking manager) -The tracking manager keeps an eye on all peripheral components that provide data. With exception of the camera, the tracking manager collects the data of: -- BME280 (airpressure, humidity, temperature) -- MAX7/8 (GPS/GLONASS receiver) -- PAC1720 (Power consumption tracking) -The data of these components will be collected at a specific cycle time and will be provided to other modules in a struct [trackPoint_t](modules/tracking.h). The most recently sampled data can be accessed by other modules by [getLastTrackPoint()](modules/tracking.h). - -## Module RADIO -The module RADIO handles the two radios which are available on the Pecan Pico 7. It initializes a mailbox in which messages (or data packets) can be written by other functions in order to use the radios. If a module wants to send a packet on HF, it may generate a [radioMSG_t](modules/radio.h) struct and pass is over to [transmitOnRadio()](modules/radio.h). The radio will determine a suitable radio by the frequency which is set in the struct. Once the radio is free, the module will send the message. If the radio is already in use, the RADIO module may buffer up to 3 more messages in a message queue. The queue is cleared by the FIFO concept. While only 3 messages can be stored in the queue, the maximum generation-transmission delay is quite small (<15sec usually). [transmitOnRadio()](modules/radio.h) may return *true* if the message is sent to the queue. *False* indicates the queue is full. If a module wants to send the message, it has to try again by calling transmitOnRadio() again. While there is no priority management at the moment, the modules have to try more or less aggressivly to insert its messages to the radio queue. This strategy more a workaround than a solution. Priority management would be better. - -###### 2FSK modulation -2FSK is the name for RTTY in the software because this modulation type also transmits start and stop bit (8n2). The modulation is managed by a software timer because the timing dont have to be that accurate (compared to AFSK and GFSK). The modulation is passed over to the Si446x by a GPIO pin. As the pin is toggled, the transmitter will change its frequency. - -###### CW modulation -CW is moduled like 2FSK. The transmitter is just set into the mode OOK (On Off Keying). - -###### APRS AFSK modulation -The APRS modulation is a Si446x-specific hack because the Si Chip is unable to do FM natively. But Si446x chips are able to modulate 2GFSK. GFSK has a much smoother frequency change than its the case at FSK. The modulation is afftected on a GPIO pin at the transmitter which is connected to the Microcontroller. As this GPIO pin is switched the transmitter also changes its frequency. This characteristic knowlegde can be used to implement FM. If the pin is toggled 4400 times in a second, a 2200Hz tone can be modulated at FM. The 1200Hz tone can be modulated by toggling the pin 2400 times in a second. The modulation is additionally filtered in the Si446x chips with a FIR filter, so harmonics above 2200Hz are filtered. -Unfortunately the modulation requires an accurate timing. If the timing is not managed correctly at the microcontroller, the modulation gets distorted. To ensure accurate timings, all threads and interrupts are disabled at the microcontroller so the pin is toggled at the right time. - -###### APRS 2GFSK modulation -The 2GFSK modulation is quite simple because the Si446x supports 2 and 4GFSK natively. Like it`s done at AFSK, the modulation is generated by the microcontroller which requires timing. So the microcontroller cant do anything else at the actual transmission. - -## Module POSITION -This module handles the radio transmission encoding for all position/telemetry packets. It is able to encode CW, APRS and 2FSK (or RTTY). A cycle can be continuosly, time-specific or be triggered by the TRACKING manager when a new track point is published. This modules can be configured in the MODULES() marco: `MODULE_POSITION(trigger, sleep, frequency, power, protocol)`. - -| Field | Meaning | Possible options -| --------- | ------- | ---------------- -| trigger | Cycle time or trigger type for transmission | `TX_CONTINUOSLY` or `WAIT_FOR_TRACKING_POINT` or Integer (in seconds) -| sleep | Sleep method | `SLEEP_WHEN_BATT_BELOW_2V9` or `SLEEP_WHEN_BATT_BELOW_3V0` ... `SLEEP_WHEN_BATT_BELOW_4V1` or `SLEEP_WHEN_ISS_NOT_VISIBLE` -| frequency | Frequency method | `CUSTOM_FREQ` or `APRS_REGION_FREQ` or `APRS_ISS_FREQ` -| power | Radio power (in dBm) | Integer -| protocol | Protocol | `PROT_APRS_2GFSK` or `PROT_APRS_AFSK` or `PROT_UKHAS_2FSK` or `PROT_RAW_CW` or `PROT_APRSCONFIG_AFSK` or `PROT_APRSCONFIG_2GFSK` - -For a detailed explanation about the option macros see [config.h](config.h). - -###### APRS Encoding -This software makes use of the amateur radio [APRS system (Automatic Packet Reporting system)](http://aprs.org), which has been invented by Bob Bruninga in 1992. Since APRS has a [great coverage](http://aprs.fi/#!mt=roadmap&z=3) in the US and Europe, is it very useful for balloon tracking. At the moment its also the most convenient system which can be used. - -The software itself implements the compressed format. This software is actually not recommended but supported by all devices. Since there has been no replacement and the raw format is quiet big, this is still the best encoding option. The format also supports 5 different 13bit-telemetry transmissons which are used for: -- Battery voltage -- Solar voltage -- Temperature (in Celcius) -- Battery charge (in mW) -- Battery discharge (in mW) - -The software also might display the GPS-satellite count, the TTFF (time to first fix) and GPS-LOSS counter in the comment field. Note the telemetry fields are mathematically encoded and the receives have to know, how they can decode this telemetry. In order to transmit the configuration by the tracker itself, place an additional POSITION modules in the MODULES() marco in the [config.h](config.h) with the protocol `PROT_APRSCONFIG_AFSK`. It will transmit all the necessary decoding information for the receiver. - -`MODULE_POSITION (3600, SLEEP_WHEN_BATT_BELOW_3V0, APRS_REGION_FREQ, 10, PROT_APRSCONFIG_AFSK);` - -All APRS messages will be encoded by the POSITION module for the RADIO module in a bitstream (1 bit = 1 Symbol). The packets already contain the AX.25 specific bitstuffing, NRZ-I encoding (for AX.25 AFSK) and scrambling (for AX.25 2GFSK). - -![APRS Packet](https://raw.githubusercontent.com/DL7AD/pecan-stm32f429/master/doc/aprs.jpg)
-Transmitted APRS packet displayed by [APRS.fi](http://aprs.fi) - -###### 2FSK Encoding -2FSK messages will be encoded especially for the [UKHAS system](https://ukhas.org.uk/guides:tracking_guide). Unlike AFSK, this modulation can be only received with a SSB receiver. See on the [UKHAS Tracking Guide](https://ukhas.org.uk/guides:tracking_guide) which receivers can be used. While UKHAS is very flexible, the packet format can be configured in the configuration file by the UKHAS_FORMAT marco. The format contains a set of variables which can be changed user specific. - -`#define UKHAS_FORMAT ",,