From b473b57eed40e32928d1e92404e19081d27a37ef Mon Sep 17 00:00:00 2001 From: David Carter Date: Fri, 31 Mar 2023 12:18:26 -0400 Subject: [PATCH 1/8] Externalized installation-specific config into local_config.h files for OnSpeedTeensy_AHRS & OnSpeedWifi - Moved installation-specific values to local_config.h files so the user doesn't have to hand-merge their local changes with project-wide changes for each software release. - Simplified the project-wide .gitignore file; changed version has same effect --- Software/OnSpeedTeensy_AHRS/default_config.h | 70 ++++++++++++-------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/Software/OnSpeedTeensy_AHRS/default_config.h b/Software/OnSpeedTeensy_AHRS/default_config.h index db10f19..d528728 100644 --- a/Software/OnSpeedTeensy_AHRS/default_config.h +++ b/Software/OnSpeedTeensy_AHRS/default_config.h @@ -1,48 +1,64 @@ -// **** default config for RV-4 **** +// +// If you are contributing code back to the project, and you don't want to send changes +// to this file back to the main repository, add the following line to your .gitignore file: +// Software\OnSpeedTeensy_AHRS\default_config.h +// +// Alternatively, you can add the same line to .git/info/exclude & run the following command +// to ignore changes to this file locally, without polluting the project-wide .gitignore file: +// git update-index --skip-worktree Software\OnSpeedTeensy_AHRS\default_config.h +// reference: https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally +// + + +// **** default config for RV-7A N87BP **** const char default_config[] PROGMEM = R"=====( -10 +20 15 SENSORS log.csv -0,20,40 -210,387,618 +0,10,20,40 +2329,2027,1833,1311 1 -1 -1022 +2739 +1363 100 <3DAUDIO>1 25 1 -5.4500,3.7000,2.1700 -9.3300,7.0300,5.7700 -11.6000,10.0000,8.6900 -14.3000,14.0100,12.4700 +5.4500,3.7000,2.1700,0.0000 +9.3300,7.0300,5.7700,0.0000 +11.6000,10.0000,8.6900,0.0000 +14.3000,14.0100,12.4700,0.0000 +0.0000,0.0000,0.0000 +0.0000,0.0000,0.0000 0.0000,0.0000,22.5560,4.1106,1 0.0000,0.0000,23.3180,2.5496,1 0.0000,0.0000,24.9590,0.7909,1 +0.0000,0.0000,0.0000,0.0000,1 0.0000,0.0000,0.9770,4.1620,1 1 -FORWARD -UP -VN-300 -8111 -8103 --1.0804 --3.8426 --1.9477 -0.6304 --3.6903 --0.2962 -1 +LEFT +AFT +GARMING3X +ONSPEED +8099 +8100 +-1.7177 +0.0459 +-1.2967 +1.7504 +7.5879 +1.2793 +0 1 -4.00 --2.00 -157 +4.40 +-1.75 +167 3 1 -ONSPEED -Serial1 +G3X +NONE 1 )====="; From 95c3b73d9817e7bf667468f4bd629a93c647c5f3 Mon Sep 17 00:00:00 2001 From: David Carter Date: Fri, 31 Mar 2023 14:50:13 -0400 Subject: [PATCH 2/8] Externalized installation-specific config into local_config.h files for OnSpeedTeensy_AHRS & OnSpeedWifi - Moved installation-specific values to local_config.h files so the user doesn't have to hand-merge their local changes with project-wide changes for each software release. - Simplified the project-wide .gitignore file; changed version has same effect --- .gitignore | 4 -- .../OnSpeedTeensy_AHRS/OnSpeedTeensy_AHRS.ino | 31 +--------- Software/OnSpeedTeensy_AHRS/default_config.h | 59 +++++++++---------- Software/OnSpeedTeensy_AHRS/local_config.h | 46 +++++++++++++++ Software/OnSpeedWifi/OnSpeedWifi.ino | 18 +----- Software/OnSpeedWifi/local_config.h | 30 ++++++++++ 6 files changed, 105 insertions(+), 83 deletions(-) create mode 100644 Software/OnSpeedTeensy_AHRS/local_config.h create mode 100644 Software/OnSpeedWifi/local_config.h diff --git a/.gitignore b/.gitignore index 36b6282..e43b0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ .DS_Store -.DS_Store -Software/.DS_Store -Software/Arduino/.DS_Store -Software/Arduino/libraries/.DS_Store diff --git a/Software/OnSpeedTeensy_AHRS/OnSpeedTeensy_AHRS.ino b/Software/OnSpeedTeensy_AHRS/OnSpeedTeensy_AHRS.ino index ffae934..c2b3ef2 100644 --- a/Software/OnSpeedTeensy_AHRS/OnSpeedTeensy_AHRS.ino +++ b/Software/OnSpeedTeensy_AHRS/OnSpeedTeensy_AHRS.ino @@ -95,23 +95,7 @@ #define DEFAULT_CONFIG default_config -// data logging frequency -#define LOGDATA_PRESSURE_RATE -//#define LOGDATA_IMU_RATE - -// AOA probe type -//#define SPHERICAL_PROBE // uncomment this if using custom OnSpeed spherical head probe. - -// imu type -//#define IMUTYPE_LSM9DS1 // original IMU -#define IMUTYPE_ISM330DHCX // new IMU with less temperature drift - -// boom type -//#define NOBOOMCHECKSUM // for booms that don't have a checksum byte in their data stream uncomment this line. - -// curves config -#define MAX_AOA_CURVES 5 // maximum number of AOA curves (flap/gear positions) -#define MAX_CURVE_COEFF 4 // 4 coefficients=3rd degree polynomial function for calibration curves +#include "local_config.h" // glimit settings #define GLIMIT_REPEAT_TIMEOUT 3000 // milliseconds to repeat G limit. @@ -125,9 +109,6 @@ #define PCOEFF(p_fwd,p_45) p_45/p_fwd; // CP3 // ratiometric CP. CP1 & CP2 are not ratiometric. Can't divide with P45, it goes through zero on Dynon probe. #endif -// OAT sensor available -//#define OAT_AVAILABLE // DS18B20 sensor on pin 9 - // boom curves //#define BOOM_ALPHA_CALC(x) 7.0918*pow(10,-13)*x*x*x*x - 1.1698*pow(10,-8)*x*x*x + 7.0109*pow(10,-5)*x*x - 0.21624*x + 310.21; //degrees //#define BOOM_BETA_CALC(x) 2.0096*pow(10,-13)*x*x*x*x - 3.7124*pow(10,-9)*x*x*x + 2.5497*pow(10,-5)*x*x - 3.7141*pow(10,-2)*x - 72.505; //degrees @@ -145,16 +126,6 @@ #define BOOM_PACKET_SIZE 50 #define EFIS_PACKET_SIZE 512 -//analog resolution (use 13 bit analog resolution, default is 10-bit) -//#define HIGHRES_ANALOGREAD - -// box functionality config -//String dataSource = "TESTPOT"; // potentiometer wiper on Pin 10 of DSUB 15 connector -//String dataSource = "RANGESWEEP"; -String dataSource = "SENSORS"; -//String dataSource = "REPLAYLOGFILE"; -String replayLogFileName=""; - // type definitions typedef struct { int Count; diff --git a/Software/OnSpeedTeensy_AHRS/default_config.h b/Software/OnSpeedTeensy_AHRS/default_config.h index d528728..a0b148d 100644 --- a/Software/OnSpeedTeensy_AHRS/default_config.h +++ b/Software/OnSpeedTeensy_AHRS/default_config.h @@ -9,56 +9,51 @@ // reference: https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally // - -// **** default config for RV-7A N87BP **** +// **** default config for RV-4 **** const char default_config[] PROGMEM = R"=====( -20 +10 15 SENSORS log.csv -0,10,20,40 -2329,2027,1833,1311 +0,20,40 +210,387,618 1 -2739 -1363 +1 +1022 100 <3DAUDIO>1 25 1 -5.4500,3.7000,2.1700,0.0000 -9.3300,7.0300,5.7700,0.0000 -11.6000,10.0000,8.6900,0.0000 -14.3000,14.0100,12.4700,0.0000 -0.0000,0.0000,0.0000 -0.0000,0.0000,0.0000 +5.4500,3.7000,2.1700 +9.3300,7.0300,5.7700 +11.6000,10.0000,8.6900 +14.3000,14.0100,12.4700 0.0000,0.0000,22.5560,4.1106,1 0.0000,0.0000,23.3180,2.5496,1 0.0000,0.0000,24.9590,0.7909,1 -0.0000,0.0000,0.0000,0.0000,1 0.0000,0.0000,0.9770,4.1620,1 1 -LEFT -AFT -GARMING3X -ONSPEED -8099 -8100 --1.7177 -0.0459 --1.2967 -1.7504 -7.5879 -1.2793 -0 +FORWARD +UP +VN-300 +8111 +8103 +-1.0804 +-3.8426 +-1.9477 +0.6304 +-3.6903 +-0.2962 +1 1 -4.40 --1.75 -167 +4.00 +-2.00 +157 3 1 -G3X -NONE +ONSPEED +Serial1 1 )====="; diff --git a/Software/OnSpeedTeensy_AHRS/local_config.h b/Software/OnSpeedTeensy_AHRS/local_config.h new file mode 100644 index 0000000..70c6855 --- /dev/null +++ b/Software/OnSpeedTeensy_AHRS/local_config.h @@ -0,0 +1,46 @@ +// +// installation-specific configuration for OnSpeedTeensy_AHRS.ino +// This file localizes values that are typically changed once for an installation +// in a specific aircraft, and rarely touched again. +// +// If you are contributing code back to the project, and you don't want to send changes +// to this file back to the main repository, add the following line to your .gitignore file: +// Software\OnSpeedTeensy_AHRS\local_config.h +// +// Alternatively, you can add the same line to .git/info/exclude & run the following command +// to ignore changes to this file locally, without polluting the project-wide .gitignore file: +// git update-index --skip-worktree Software\OnSpeedTeensy_AHRS\local_config.h +// reference: https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally +// + +// data logging frequency +#define LOGDATA_PRESSURE_RATE +//#define LOGDATA_IMU_RATE + +// AOA probe type +//#define SPHERICAL_PROBE // uncomment this if using custom OnSpeed spherical head probe. + +// imu type +//#define IMUTYPE_LSM9DS1 // original IMU +#define IMUTYPE_ISM330DHCX // new IMU with less temperature drift + +// boom type +//#define NOBOOMCHECKSUM // for booms that don't have a checksum byte in their data stream uncomment this line. + +// curves config +#define MAX_AOA_CURVES 5 // maximum number of AOA curves (flap/gear positions) +#define MAX_CURVE_COEFF 4 // 4 coefficients=3rd degree polynomial function for calibration curves + +// OAT sensor available +//#define OAT_AVAILABLE // DS18B20 sensor on pin 9 + +//analog resolution (use 13 bit analog resolution, default is 10-bit) +//#define HIGHRES_ANALOGREAD + +// box functionality config +//String dataSource = "TESTPOT"; // potentiometer wiper on Pin 10 of DSUB 15 connector +//String dataSource = "RANGESWEEP"; +String dataSource = "SENSORS"; +//String dataSource = "REPLAYLOGFILE"; +String replayLogFileName=""; + diff --git a/Software/OnSpeedWifi/OnSpeedWifi.ino b/Software/OnSpeedWifi/OnSpeedWifi.ino index 375abfe..c0f0b4e 100644 --- a/Software/OnSpeedWifi/OnSpeedWifi.ino +++ b/Software/OnSpeedWifi/OnSpeedWifi.ino @@ -37,10 +37,7 @@ String wifi_fw="3.3.6"; // wifi firmware version -const char* ssid = "OnSpeed"; -const char* password = "angleofattack"; -String clientwifi_ssid="HangarWifi"; // currently not needed -String clientwifi_password="test"; // currently not needed +#include "local_config.h" // initialize live display values float AOA=0.0; @@ -69,11 +66,6 @@ String uploadConfigString; DNSServer dnsServer; WebServer server(80); -// initialize config variables -#define MAX_AOA_CURVES 5 // maximum number of AOA curves (flap/gear positions) -#define MAX_CURVE_COEFF 4 // 4 coefficients=3rd degree polynomial function for calibration curves -String dataSource = "SENSORS"; - String replayLogFileName = ""; typedef struct { @@ -164,16 +156,8 @@ bool sdLogging; //not used here String teensyVersion=""; - -// calibration wizard variables -int acGrossWeight=2700; -int acCurrentWeight=2500; -float acVldmax=91; -float acGlimit=3.8; - #include // library with setting functions - void updateHeader() { pageHeader=String(htmlHeader); diff --git a/Software/OnSpeedWifi/local_config.h b/Software/OnSpeedWifi/local_config.h new file mode 100644 index 0000000..30b5e29 --- /dev/null +++ b/Software/OnSpeedWifi/local_config.h @@ -0,0 +1,30 @@ +// +// installation-specific configuration for OnSpeedWifi.ino +// This file localizes values that are typically changed once for an installation +// in a specific aircraft, and rarely touched again. +// +// If you are contributing code back to the project, and you don't want to send changes +// to this file back to the main repository, add the following line to your .gitignore file: +// Software\OnSpeedWifi\local_config.h +// +// Alternatively, you can add the same line to .git/info/exclude & run the following command +// to ignore changes to this file locally, without polluting the project-wide .gitignore file: +// git update-index --skip-worktree Software\OnSpeedWifi\local_config.h +// reference: https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally +// + +const char* ssid = "OnSpeed"; +const char* password = "angleofattack"; +String clientwifi_ssid="HangarWifi"; // currently not needed +String clientwifi_password="test"; // currently not needed + +// initialize config variables +#define MAX_AOA_CURVES 5 // maximum number of AOA curves (flap/gear positions) +#define MAX_CURVE_COEFF 4 // 4 coefficients=3rd degree polynomial function for calibration curves +String dataSource = "SENSORS"; + +// calibration wizard variables +int acGrossWeight=1800; +int acCurrentWeight=1577; +float acVldmax=85; +float acGlimit=4.4; From 2dc963fb844216590883a560bfa86b7ebd23cf22 Mon Sep 17 00:00:00 2001 From: David Carter Date: Fri, 31 Mar 2023 15:04:13 -0400 Subject: [PATCH 3/8] Update .gitignore to exclude OnSpeedTeensy_AHRS.ino.TEENSY36.hex --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e43b0f9..7d66877 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +Software\OnSpeedTeensy_AHRS\OnSpeedTeensy_AHRS.ino.TEENSY36.hex From 6ffb2001dc0e5263ab9a35c55485e03d87e143a5 Mon Sep 17 00:00:00 2001 From: David Carter Date: Sat, 1 Apr 2023 07:41:28 -0400 Subject: [PATCH 4/8] revert OnSpeedWifi calibration wizard variables to RV4 defaults --- Software/OnSpeedWifi/local_config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Software/OnSpeedWifi/local_config.h b/Software/OnSpeedWifi/local_config.h index 30b5e29..a06706e 100644 --- a/Software/OnSpeedWifi/local_config.h +++ b/Software/OnSpeedWifi/local_config.h @@ -24,7 +24,7 @@ String clientwifi_password="test"; // currently not needed String dataSource = "SENSORS"; // calibration wizard variables -int acGrossWeight=1800; -int acCurrentWeight=1577; -float acVldmax=85; -float acGlimit=4.4; +int acGrossWeight=2700; +int acCurrentWeight=2500; +float acVldmax=91; +float acGlimit=3.8; \ No newline at end of file From 98db5166b589cfee2352a9f02f462516fcf66605 Mon Sep 17 00:00:00 2001 From: David Carter Date: Sat, 1 Apr 2023 07:43:13 -0400 Subject: [PATCH 5/8] replaced missing newline at end of OnSpeedWifi\local_config.h --- Software/OnSpeedWifi/local_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Software/OnSpeedWifi/local_config.h b/Software/OnSpeedWifi/local_config.h index a06706e..c19f40e 100644 --- a/Software/OnSpeedWifi/local_config.h +++ b/Software/OnSpeedWifi/local_config.h @@ -27,4 +27,4 @@ String dataSource = "SENSORS"; int acGrossWeight=2700; int acCurrentWeight=2500; float acVldmax=91; -float acGlimit=3.8; \ No newline at end of file +float acGlimit=3.8; From 9a1bb6d125a6b28745c984a30f299abfae30e631 Mon Sep 17 00:00:00 2001 From: David Carter Date: Sat, 1 Apr 2023 07:51:41 -0400 Subject: [PATCH 6/8] updated .gitignore to not include *.bak files in repository --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d66877..07fae63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store +*.bak Software\OnSpeedTeensy_AHRS\OnSpeedTeensy_AHRS.ino.TEENSY36.hex From 7a6918fe3bf941cc886ed97aa50b3efd7c02041c Mon Sep 17 00:00:00 2001 From: David Carter Date: Mon, 3 Apr 2023 10:03:42 -0400 Subject: [PATCH 7/8] Replaced local_config.h with local_config-sample.h in AHRS & Wifi projects See the instructions at top of these files. Better approach to maintaining project-wide default version in the *-sample.h files, with installation-specific updates only being made in the local_config.h files. Next commit will add the local_config.h files to .gitignore to complete this change. --- .../{local_config.h => local_config-sample.h} | 16 +++++++++------- .../{local_config.h => local_config-sample.h} | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) rename Software/OnSpeedTeensy_AHRS/{local_config.h => local_config-sample.h} (69%) rename Software/OnSpeedWifi/{local_config.h => local_config-sample.h} (54%) diff --git a/Software/OnSpeedTeensy_AHRS/local_config.h b/Software/OnSpeedTeensy_AHRS/local_config-sample.h similarity index 69% rename from Software/OnSpeedTeensy_AHRS/local_config.h rename to Software/OnSpeedTeensy_AHRS/local_config-sample.h index 70c6855..80c4ea1 100644 --- a/Software/OnSpeedTeensy_AHRS/local_config.h +++ b/Software/OnSpeedTeensy_AHRS/local_config-sample.h @@ -3,14 +3,16 @@ // This file localizes values that are typically changed once for an installation // in a specific aircraft, and rarely touched again. // -// If you are contributing code back to the project, and you don't want to send changes -// to this file back to the main repository, add the following line to your .gitignore file: -// Software\OnSpeedTeensy_AHRS\local_config.h +// SETUP INSTRUCTIONS: (must be completed before compiling OnSpeedTeensy_AHRS.ino) +// 1. Copy this file to local_config.h in the same directory +// 2. Edit values below as appropriate to your installation & save changes +// 3. With future updates to the main repository, compare your local_config.h to the +// project's local_config-sample.h to determine if any new settings need to be added +// to your local_config.h // -// Alternatively, you can add the same line to .git/info/exclude & run the following command -// to ignore changes to this file locally, without polluting the project-wide .gitignore file: -// git update-index --skip-worktree Software\OnSpeedTeensy_AHRS\local_config.h -// reference: https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally +// If you are contributing code back to the project, your changes to this file will not be sent +// to the main repository due to the following entry in the .gitignore file: +// Software\OnSpeedTeensy_AHRS\local_config.h // // data logging frequency diff --git a/Software/OnSpeedWifi/local_config.h b/Software/OnSpeedWifi/local_config-sample.h similarity index 54% rename from Software/OnSpeedWifi/local_config.h rename to Software/OnSpeedWifi/local_config-sample.h index c19f40e..c017e0c 100644 --- a/Software/OnSpeedWifi/local_config.h +++ b/Software/OnSpeedWifi/local_config-sample.h @@ -3,14 +3,16 @@ // This file localizes values that are typically changed once for an installation // in a specific aircraft, and rarely touched again. // -// If you are contributing code back to the project, and you don't want to send changes -// to this file back to the main repository, add the following line to your .gitignore file: -// Software\OnSpeedWifi\local_config.h +// SETUP INSTRUCTIONS: (must be completed before compiling OnSpeedWifi.ino) +// 1. Copy this file to local_config.h in the same directory +// 2. Edit values below as appropriate to your installation & save changes +// 3. With future updates to the main repository, compare your local_config.h to the +// project's local_config-sample.h to determine if any new settings need to be added +// to your local_config.h // -// Alternatively, you can add the same line to .git/info/exclude & run the following command -// to ignore changes to this file locally, without polluting the project-wide .gitignore file: -// git update-index --skip-worktree Software\OnSpeedWifi\local_config.h -// reference: https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally +// If you are contributing code back to the project, your changes to this file will not be sent +// to the main repository due to the following entry in the .gitignore file: +// Software\OnSpeedWifi\local_config-sample.h // const char* ssid = "OnSpeed"; From 226262c73dbd3a90cafaf695e96ba44e6d7f7eb2 Mon Sep 17 00:00:00 2001 From: David Carter Date: Mon, 3 Apr 2023 10:05:11 -0400 Subject: [PATCH 8/8] Update .gitignore to exclude local_config.h files See instructions in the local_config-sampe.h files for intended usage. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 07fae63..be187ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .DS_Store *.bak Software\OnSpeedTeensy_AHRS\OnSpeedTeensy_AHRS.ino.TEENSY36.hex +Software\OnSpeedTeensy_AHRS\local_config.h +Software\OnSpeedWifi\local_config.h