From c3751634a5941c3b346567c232d531f403899d56 Mon Sep 17 00:00:00 2001 From: Fab501 <52047809+Fab501@users.noreply.github.com> Date: Sun, 10 Jan 2021 22:31:41 +0100 Subject: [PATCH 1/4] Add files via upload Add the Selection of the First DispPage after Boot --- main/config.h | 40 ++++++++++++++++++++++------------------ main/disp.cpp | 4 ++-- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/main/config.h b/main/config.h index 72419cf..098abf4 100644 --- a/main/config.h +++ b/main/config.h @@ -1,17 +1,18 @@ -#define DEFAULT_AcftType 1 // [0..15] default aircraft-type: glider +#define DEFAULT_AcftType 8 // [0..15] default aircraft-type: Powered Aircraft #define DEFAULT_GeoidSepar 40 // [m] #define DEFAULT_CONbaud 115200 #define DEFAULT_PPSdelay 100 #define DEFAULT_FreqPlan 0 +#define DEFAULT_DispPage 3 // Fab501 Page to Display After Boot or Reset // #define WITH_HELTEC // HELTEC module: PCB LED on GPI025 // #define WITH_HELTEC_V2 // HELTEC module v2 // #define WITH_TTGO // TTGO module: PCB LED on GPIO2, GPIO25 free to use as DAC2 output // #define WITH_TBEAM // T-Beam module -// #define WITH_TBEAM_V10 // T-Beam module +#define WITH_TBEAM_V10 // T-Beam module // #define WITH_M5_JACEK // JACEK M5 ESP32 OGN-Tracker -#define WITH_FollowMe // by Avionix +// #define WITH_FollowMe // by Avionix // #define WITH_ILI9341 // 320x240 M5stack // #define WITH_ST7789 // IPS 240x240 ST7789 @@ -20,29 +21,29 @@ // #define WITH_OLED2 // 2nd OLED display, I2C address next higher #define WITH_U8G2_OLED // I2C OLED through the U8g2 library #define WITH_U8G2_SH1106 // correct controller for the bigger OLED -#define WITH_U8G2_FLIP // flip the OLED screen (rotate by 180deg) +// #define WITH_U8G2_FLIP // flip the OLED screen (rotate by 180deg) #define WITH_RFM95 // RF chip selection: both HELTEC and TTGO use sx1276 which is same as RFM95 // #define WITH_SLEEP // with software sleep mode controlled by the long-press on the button -// #define WITH_AXP // with AXP192 power controller (T-BEAM V1.0) +#define WITH_AXP // with AXP192 power controller (T-BEAM V1.0) // #define WITH_BQ // with BQ24295 power controller (FollowMe) // #define WITH_LED_RX // #define WITH_LED_TX -#define WITH_GPS_ENABLE // use GPS_ENABLE control line to turn the GPS ON/OFF +// #define WITH_GPS_ENABLE // use GPS_ENABLE control line to turn the GPS ON/OFF #define WITH_GPS_PPS // use the PPS signal from GPS for precise time-sync. #define WITH_GPS_CONFIG // attempt to configure higher GPS baud rate and airborne mode -// #define WITH_GPS_UBX // GPS understands UBX -#define WITH_GPS_MTK // GPS understands MTK +#define WITH_GPS_UBX // GPS understands UBX +// #define WITH_GPS_MTK // GPS understands MTK // #define WITH_GPS_SRF // #define WITH_MAVLINK -// #define WITH_GPS_UBX_PASS // to pass directly UBX packets to/from GPS -// #define WITH_GPS_NMEA_PASS // to pass directly NMEA to/from GPS +#define WITH_GPS_UBX_PASS // to pass directly UBX packets to/from GPS +#define WITH_GPS_NMEA_PASS // to pass directly NMEA to/from GPS // #define WITH_BMP180 // BMP180 pressure sensor // #define WITH_BMP280 // BMP280 pressure sensor @@ -52,8 +53,9 @@ // #define WITH_BMX055 // BMX055 magnetic and IMU sensor -#define WITH_LORAWAN // LoRaWAN connectivity -#define WITH_FANET // FANET transmission and reception +// #define WITH_LORAWAN // LoRaWAN connectivity +// #define WITH_FANET // FANET transmission and reception +#define WITH_PAW // Add PAW transmission #define WITH_PFLAA // PFLAU and PFLAA for compatibility with XCsoar and LK8000 // #define WITH_POGNT @@ -63,21 +65,23 @@ #define WITH_CONFIG // interpret the console input: $POGNS to change parameters -// #define WITH_BEEPER // with digital buzzer +#define WITH_BEEPER // with digital buzzer // #define WITH_SOUND // with analog sound produced by DAC on pin 25 // #define WITH_KNOB // #define WITH_VARIO -#define WITH_SD // use the SD card in SPI mode and FAT file system +// #define WITH_SD // use the SD card in SPI mode and FAT file system #define WITH_SPIFFS // use SPIFFS file system in Flash -#define WITH_SPIFFS_FAT +// #define WITH_SPIFFS_FAT #define WITH_LOG // log own positions and other received to SPIFFS -#define WITH_SDLOG // log own position and other data to uSD card +// #define WITH_SDLOG // log own position and other data to uSD card -// #define WITH_STRATUX +#define WITH_STRATUX #define WITH_BT_SPP // Bluetooth serial port for smartphone/tablet link -// #define WITH_WIFI // attempt to connect to the wifi router for uploading the log files +#define WITH_WIFI // attempt to connect to the wifi router for uploading the log files +// #define WITH_AP // Open Access Point MOde +#define WITH_HTTP // Open Web Interface // #define WITH_ENCRYPT // Encrypt (optionally) the position diff --git a/main/disp.cpp b/main/disp.cpp index bfbdad7..4edc369 100644 --- a/main/disp.cpp +++ b/main/disp.cpp @@ -26,11 +26,11 @@ #ifdef WITH_U8G2_OLED const uint8_t DISP_Pages = 12; -static uint8_t DISP_Page = 0; +static uint8_t DISP_Page = DEFAULT_DispPage ; //Fab501 before 0 #endif #if defined(WITH_ST7789) || defined(WITH_ILI9341) const uint8_t DISP_Pages = 9; -static uint8_t DISP_Page = 0; +static uint8_t DISP_Page = DEFAULT_DispPage ; //Fab501 before 0 #endif From 57cb2111773b2974c93752d4e7adc4f75ddf12da Mon Sep 17 00:00:00 2001 From: Fab501 <52047809+Fab501@users.noreply.github.com> Date: Sun, 10 Jan 2021 22:32:46 +0100 Subject: [PATCH 2/4] Add files via upload Config for Oled SH1106 with Stratux with BME280 --- T-Beam_V10_OLED_SH1106_STRATUX_BT | 87 +++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 T-Beam_V10_OLED_SH1106_STRATUX_BT diff --git a/T-Beam_V10_OLED_SH1106_STRATUX_BT b/T-Beam_V10_OLED_SH1106_STRATUX_BT new file mode 100644 index 0000000..098abf4 --- /dev/null +++ b/T-Beam_V10_OLED_SH1106_STRATUX_BT @@ -0,0 +1,87 @@ +#define DEFAULT_AcftType 8 // [0..15] default aircraft-type: Powered Aircraft +#define DEFAULT_GeoidSepar 40 // [m] +#define DEFAULT_CONbaud 115200 +#define DEFAULT_PPSdelay 100 +#define DEFAULT_FreqPlan 0 +#define DEFAULT_DispPage 3 // Fab501 Page to Display After Boot or Reset + + +// #define WITH_HELTEC // HELTEC module: PCB LED on GPI025 +// #define WITH_HELTEC_V2 // HELTEC module v2 +// #define WITH_TTGO // TTGO module: PCB LED on GPIO2, GPIO25 free to use as DAC2 output +// #define WITH_TBEAM // T-Beam module +#define WITH_TBEAM_V10 // T-Beam module +// #define WITH_M5_JACEK // JACEK M5 ESP32 OGN-Tracker +// #define WITH_FollowMe // by Avionix + +// #define WITH_ILI9341 // 320x240 M5stack +// #define WITH_ST7789 // IPS 240x240 ST7789 +// #define WITH_TFT_LCD // TFT LCD +// #define WITH_OLED // OLED display on the I2C: some TTGO modules are without OLED display +// #define WITH_OLED2 // 2nd OLED display, I2C address next higher +#define WITH_U8G2_OLED // I2C OLED through the U8g2 library +#define WITH_U8G2_SH1106 // correct controller for the bigger OLED +// #define WITH_U8G2_FLIP // flip the OLED screen (rotate by 180deg) + +#define WITH_RFM95 // RF chip selection: both HELTEC and TTGO use sx1276 which is same as RFM95 + +// #define WITH_SLEEP // with software sleep mode controlled by the long-press on the button + +#define WITH_AXP // with AXP192 power controller (T-BEAM V1.0) +// #define WITH_BQ // with BQ24295 power controller (FollowMe) + +// #define WITH_LED_RX +// #define WITH_LED_TX + +// #define WITH_GPS_ENABLE // use GPS_ENABLE control line to turn the GPS ON/OFF +#define WITH_GPS_PPS // use the PPS signal from GPS for precise time-sync. +#define WITH_GPS_CONFIG // attempt to configure higher GPS baud rate and airborne mode + +#define WITH_GPS_UBX // GPS understands UBX +// #define WITH_GPS_MTK // GPS understands MTK +// #define WITH_GPS_SRF +// #define WITH_MAVLINK + +#define WITH_GPS_UBX_PASS // to pass directly UBX packets to/from GPS +#define WITH_GPS_NMEA_PASS // to pass directly NMEA to/from GPS + +// #define WITH_BMP180 // BMP180 pressure sensor +// #define WITH_BMP280 // BMP280 pressure sensor +#define WITH_BME280 // BMP280 with humidity (but still works with BMP280) +// #define WITH_MS5607 // MS5607 pressure sensor +// #define WITH_MS5611 // MS5611 pressure sensor + +// #define WITH_BMX055 // BMX055 magnetic and IMU sensor + +// #define WITH_LORAWAN // LoRaWAN connectivity +// #define WITH_FANET // FANET transmission and reception +#define WITH_PAW // Add PAW transmission + +#define WITH_PFLAA // PFLAU and PFLAA for compatibility with XCsoar and LK8000 +// #define WITH_POGNT +// #define WITH_GDL90 +// #define WITH_PGAV5 +#define WITH_LOOKOUT + +#define WITH_CONFIG // interpret the console input: $POGNS to change parameters + +#define WITH_BEEPER // with digital buzzer +// #define WITH_SOUND // with analog sound produced by DAC on pin 25 + +// #define WITH_KNOB +// #define WITH_VARIO + +// #define WITH_SD // use the SD card in SPI mode and FAT file system +#define WITH_SPIFFS // use SPIFFS file system in Flash +// #define WITH_SPIFFS_FAT +#define WITH_LOG // log own positions and other received to SPIFFS +// #define WITH_SDLOG // log own position and other data to uSD card + +#define WITH_STRATUX +#define WITH_BT_SPP // Bluetooth serial port for smartphone/tablet link +#define WITH_WIFI // attempt to connect to the wifi router for uploading the log files +// #define WITH_AP // Open Access Point MOde +#define WITH_HTTP // Open Web Interface + +// #define WITH_ENCRYPT // Encrypt (optionally) the position + From 5b2e39f957b0904b37a91f949e02346b3bc2d254 Mon Sep 17 00:00:00 2001 From: Fab501 <52047809+Fab501@users.noreply.github.com> Date: Sun, 31 Jan 2021 15:31:33 +0100 Subject: [PATCH 3/4] Add Possibility to Change Default IP Adresse Usual IP Address of 192.168.4.1 change to 192.168.1.1 for futur compatibility with Skydemon You can put your IP address in begin of config.h --- main/config.h | 21 ++++++++++++++++----- main/wifi.cpp | 20 ++++++++++++++++++-- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/main/config.h b/main/config.h index 098abf4..2c6a94c 100644 --- a/main/config.h +++ b/main/config.h @@ -4,7 +4,18 @@ #define DEFAULT_PPSdelay 100 #define DEFAULT_FreqPlan 0 #define DEFAULT_DispPage 3 // Fab501 Page to Display After Boot or Reset - +#define WIFI_ADDRESS_IP1 192 // 192.168.1.1 for IP Address +#define WIFI_ADDRESS_IP2 168 +#define WIFI_ADDRESS_IP3 1 +#define WIFI_ADDRESS_IP4 1 +#define WIFI_ADDRESS_GW1 0 // 0.0.0.0 for Gateway +#define WIFI_ADDRESS_GW2 0 +#define WIFI_ADDRESS_GW3 0 +#define WIFI_ADDRESS_GW4 0 +#define WIFI_ADDRESS_MK1 255 // 255.255.255.0 for Mask +#define WIFI_ADDRESS_MK2 255 +#define WIFI_ADDRESS_MK3 255 +#define WIFI_ADDRESS_MK4 0 // #define WITH_HELTEC // HELTEC module: PCB LED on GPI025 // #define WITH_HELTEC_V2 // HELTEC module v2 @@ -53,8 +64,8 @@ // #define WITH_BMX055 // BMX055 magnetic and IMU sensor -// #define WITH_LORAWAN // LoRaWAN connectivity -// #define WITH_FANET // FANET transmission and reception +#define WITH_LORAWAN // LoRaWAN connectivity +#define WITH_FANET // FANET transmission and reception #define WITH_PAW // Add PAW transmission #define WITH_PFLAA // PFLAU and PFLAA for compatibility with XCsoar and LK8000 @@ -77,10 +88,10 @@ #define WITH_LOG // log own positions and other received to SPIFFS // #define WITH_SDLOG // log own position and other data to uSD card -#define WITH_STRATUX +//#define WITH_STRATUX #define WITH_BT_SPP // Bluetooth serial port for smartphone/tablet link #define WITH_WIFI // attempt to connect to the wifi router for uploading the log files -// #define WITH_AP // Open Access Point MOde +#define WITH_AP // Open Access Point MOde #define WITH_HTTP // Open Web Interface // #define WITH_ENCRYPT // Encrypt (optionally) the position diff --git a/main/wifi.cpp b/main/wifi.cpp index 241d05d..bb50a7a 100644 --- a/main/wifi.cpp +++ b/main/wifi.cpp @@ -1,5 +1,5 @@ #include - +#include "config.h" //Added By Fab501 #include "wifi.h" #include "format.h" @@ -48,7 +48,23 @@ static esp_err_t WIFI_event_handler(void *ctx, system_event_t *event) return ESP_OK; } esp_err_t WIFI_Init(void) -{ esp_err_t Err; +{ + + //Fab501 test to change IP to 192.168.1.1 for comptability with SkyDemon + + esp_netif_init(); + ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_t* wifiAP = esp_netif_create_default_wifi_ap(); + esp_netif_ip_info_t ipInfo; + IP4_ADDR(&ipInfo.ip, WIFI_ADDRESS_IP1,WIFI_ADDRESS_IP2,WIFI_ADDRESS_IP3,WIFI_ADDRESS_IP4); // Change IP in config.h + IP4_ADDR(&ipInfo.gw, WIFI_ADDRESS_GW1,WIFI_ADDRESS_GW2,WIFI_ADDRESS_GW3,WIFI_ADDRESS_GW4); // Change GATEWAY in config.h + IP4_ADDR(&ipInfo.netmask, WIFI_ADDRESS_MK1,WIFI_ADDRESS_MK2,WIFI_ADDRESS_MK3,WIFI_ADDRESS_MK4); // change MASK in config.h + esp_netif_dhcps_stop(wifiAP); + esp_netif_set_ip_info(wifiAP, &ipInfo); + esp_netif_dhcps_start(wifiAP); + + // end of Fab501 changes + esp_err_t Err; tcpip_adapter_init(); Err = esp_event_loop_init(WIFI_event_handler, NULL); if(Err!=ESP_OK) return Err; wifi_init_config_t Config = WIFI_INIT_CONFIG_DEFAULT(); From f09ef68db8f3c08c60c353722fb76763381787c3 Mon Sep 17 00:00:00 2001 From: Fab501 Date: Tue, 2 Feb 2021 22:30:08 +0100 Subject: [PATCH 4/4] =?UTF-8?q?config.h=20modifi=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/config.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/config.h b/main/config.h index 2c6a94c..beba1ff 100644 --- a/main/config.h +++ b/main/config.h @@ -35,6 +35,7 @@ // #define WITH_U8G2_FLIP // flip the OLED screen (rotate by 180deg) #define WITH_RFM95 // RF chip selection: both HELTEC and TTGO use sx1276 which is same as RFM95 +//#define WITH_SX1262 // SX1262 Support // #define WITH_SLEEP // with software sleep mode controlled by the long-press on the button @@ -74,6 +75,8 @@ // #define WITH_PGAV5 #define WITH_LOOKOUT +#define WITH_SKYDEMON //Adapt NMEA Output for SKYDEMON + #define WITH_CONFIG // interpret the console input: $POGNS to change parameters #define WITH_BEEPER // with digital buzzer