diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index 867149351..78a79c8a4 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install ESP32 Boards and Compile TestFile uses: ArminJo/arduino-test-compile@v3.2.1 @@ -23,77 +23,77 @@ jobs: platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.10/package_esp32_dev_index.json - name: Pull arduino-esp32 v2.0.4 - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: espressif/arduino-esp32 ref: 2.0.4 path: 2.0.4arduino-esp32 - name: Pull arduino-esp32 v2.0.10 - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: espressif/arduino-esp32 ref: 2.0.10 path: 2.0.10 - name: Install AsyncTCP - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: me-no-dev/AsyncTCP ref: master path: CustomAsyncTCP - name: Install MicroNMEA - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: stevemarple/MicroNMEA ref: v2.0.6 path: CustomMicroNMEA - name: Install ESPAsyncWebServer - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: bigbrodude6119/ESPAsyncWebServer ref: master path: CustomESPAsyncWebServer - name: Install TFT_eSPI - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: Bodmer/TFT_eSPI ref: V2.5.34 path: CustomTFT_eSPI - name: Install lv_arduino - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: lvgl/lv_arduino ref: 3.0.0 path: Customlv_arduino - name: Install JPEGDecoder - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: Bodmer/JPEGDecoder ref: 1.8.0 path: CustomJPEGDecoder - name: Install NimBLE-Arduino - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: h2zero/NimBLE-Arduino - ref: 1.2.0 + ref: 1.4.1 path: CustomNimBLE-Arduino - name: Install Adafruit_NeoPixel - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: adafruit/Adafruit_NeoPixel ref: 1.10.7 path: CustomAdafruit_NeoPixel - name: Install ArduinoJson - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: bblanchon/ArduinoJson ref: v6.18.2 @@ -107,14 +107,14 @@ jobs: # path: CustomSwitchLib - name: Install LinkedList - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: ivanseidel/LinkedList ref: v1.3.3 path: CustomLinkedList - name: Install EspSoftwareSerial - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: plerup/espsoftwareserial ref: 8.1.0 @@ -127,6 +127,7 @@ jobs: - name: Configure TFT_eSPI run: | rm -f CustomTFT_eSPI/User_Setup_Select.h + cp Setup206_LilyGo_T_Display_S3.h CustomTFT_eSPI/ cp User_Setup_Select.h CustomTFT_eSPI/ cp User_Setup_marauder_mini.h CustomTFT_eSPI/ cp User_Setup_og_marauder.h CustomTFT_eSPI/ @@ -184,6 +185,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ \/\/#define MARAUDER_FLIPPER/ #define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -216,6 +218,7 @@ jobs: find /home/runner/ -name "*TFT_eSPI*" sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^\/\/#include /#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^ #define MARAUDER_REV_FEATHER/ \/\/#define MARAUDER_REV_FEATHER/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_MINI/ \/\/#define MARAUDER_MINI/' esp32_marauder/configs.h @@ -224,6 +227,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -239,10 +243,41 @@ jobs: run: | mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.og.bin + - name: Configure configs.h for LILYGO T3 display + run: | + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^\/\/#include /#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^ #define MARAUDER_REV_FEATHER/ \/\/#define MARAUDER_REV_FEATHER/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_M5STICKC/ \/\/#define MARAUDER_M5STICKC/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_MINI/ \/\/#define MARAUDER_MINI/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_V4/ \/\/#define MARAUDER_V4/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h + sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h + sed -i 's/^ \/\/#define LILYGO_T_DISPLAY_S3R8/ #define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h + sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h + sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h + + - name: Build Marauder for Lilygo T3-display + uses: ArminJo/arduino-test-compile@v3.2.1 + with: + sketch-names: esp32_marauder.ino + arduino-board-fqbn: esp32:esp32:lilygo_t_display_s3:PartitionScheme=app3M_fat9M_16MB + extra-arduino-cli-args: "--warnings none" + + - name: Rename Marauder Lilygo T3 display bin + run: | + mv ./esp32_marauder/build/esp32.esp32.lilygo_t_display_s3/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.lilygo_t_display_s3/esp32_marauder.t3_display.bin + - name: Configure TFT_eSPI and configs.h for Marauder v6 run: | sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^\/\/#include /#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^ #define MARAUDER_REV_FEATHER/ \/\/#define MARAUDER_REV_FEATHER/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_MINI/ \/\/#define MARAUDER_MINI/' esp32_marauder/configs.h @@ -251,6 +286,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -292,6 +328,7 @@ jobs: sed -i 's/^ \/\/#define MARAUDER_V6_1/ #define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -311,6 +348,7 @@ jobs: run: | sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^\/\/#include /#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^ #define MARAUDER_REV_FEATHER/ \/\/#define MARAUDER_REV_FEATHER/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_MINI/ \/\/#define MARAUDER_MINI/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_V4/ \/\/#define MARAUDER_V4/' esp32_marauder/configs.h @@ -318,6 +356,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ \/\/#define MARAUDER_KIT/ #define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -337,6 +376,7 @@ jobs: run: | sed -i 's/^\/\/#include /#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^ #define MARAUDER_REV_FEATHER/ \/\/#define MARAUDER_REV_FEATHER/' esp32_marauder/configs.h sed -i 's/^ \/\/#define MARAUDER_MINI/ #define MARAUDER_MINI/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_V4/ \/\/#define MARAUDER_V4/' esp32_marauder/configs.h @@ -344,6 +384,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -368,6 +409,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ \/\/#define ESP32_LDDB/ #define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -392,6 +434,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ \/\/#define MARAUDER_DEV_BOARD_PRO/ #define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -413,6 +456,7 @@ jobs: find /home/runner/ -name "*TFT_eSPI*" sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^\/\/#include /#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^ #define MARAUDER_REV_FEATHER/ \/\/#define MARAUDER_REV_FEATHER/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_MINI/ \/\/#define MARAUDER_MINI/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_V4/ \/\/#define MARAUDER_V4/' esp32_marauder/configs.h @@ -420,6 +464,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -443,6 +488,7 @@ jobs: sed -i 's/^\/\/#include /#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h + sed -i 's/^#include /\/\/#include /' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h sed -i 's/^ \/\/#define MARAUDER_REV_FEATHER/ #define MARAUDER_REV_FEATHER/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_MINI/ \/\/#define MARAUDER_MINI/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_V4/ \/\/#define MARAUDER_V4/' esp32_marauder/configs.h @@ -450,6 +496,7 @@ jobs: sed -i 's/^ #define MARAUDER_V6_1/ \/\/#define MARAUDER_V6_1/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_KIT/ \/\/#define MARAUDER_KIT/' esp32_marauder/configs.h sed -i 's/^ #define GENERIC_ESP32/ \/\/#define GENERIC_ESP32/' esp32_marauder/configs.h + sed -i 's/^ #define LILYGO_T_DISPLAY_S3R8/ \/\/#define LILYGO_T_DISPLAY_S3R8/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_FLIPPER/ \/\/#define MARAUDER_FLIPPER/' esp32_marauder/configs.h sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h @@ -470,6 +517,13 @@ jobs: run: | find ./esp32_marauder/build -name "*.bin" + - name: 'Upload Lilygo T3 display Artifact' + uses: actions/upload-artifact@v3 + with: + name: esp32_marauder.t3_display.bin + path: ./esp32_marauder/build/esp32.esp32.lilygo_t_display_s3/esp32_marauder.t3_display.bin + retention-days: 5 + - name: 'Upload Flipper Artifact' uses: actions/upload-artifact@v3 with: diff --git a/Setup206_LilyGo_T_Display_S3.h b/Setup206_LilyGo_T_Display_S3.h new file mode 100644 index 000000000..7a58eca6c --- /dev/null +++ b/Setup206_LilyGo_T_Display_S3.h @@ -0,0 +1,47 @@ +// ST7789 using 8-bit Parallel + +#define USER_SETUP_ID 206 + +#define ST7789_DRIVER +#define INIT_SEQUENCE_3 // Using this initialisation sequence improves the display image + +#define CGRAM_OFFSET +#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue +//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red + +#define TFT_INVERSION_ON +// #define TFT_INVERSION_OFF + +#define TFT_PARALLEL_8_BIT + +#define TFT_WIDTH 170 +#define TFT_HEIGHT 320 + +#define TFT_CS 6 +#define TFT_DC 7 +#define TFT_RST 5 + +#define TFT_WR 8 +#define TFT_RD 9 + +#define TFT_D0 39 +#define TFT_D1 40 +#define TFT_D2 41 +#define TFT_D3 42 +#define TFT_D4 45 +#define TFT_D5 46 +#define TFT_D6 47 +#define TFT_D7 48 + +#define TFT_BL 38 +#define TFT_BACKLIGHT_ON HIGH + +#define LOAD_GLCD +#define LOAD_FONT2 +#define LOAD_FONT4 +#define LOAD_FONT6 +#define LOAD_FONT7 +#define LOAD_FONT8 +#define LOAD_GFXFF + +#define SMOOTH_FONT diff --git a/User_Setup_Select.h b/User_Setup_Select.h index 82c61d38a..92a51b865 100644 --- a/User_Setup_Select.h +++ b/User_Setup_Select.h @@ -25,6 +25,7 @@ //#include //#include //#include +//#include //#include // Setup file configured for my ILI9341 //#include // Setup file configured for my ST7735 diff --git a/esp32_marauder/Buffer.cpp b/esp32_marauder/Buffer.cpp index 78a3cb929..3cf6cac07 100644 --- a/esp32_marauder/Buffer.cpp +++ b/esp32_marauder/Buffer.cpp @@ -24,6 +24,10 @@ void Buffer::createFile(String name, bool is_pcap){ Serial.println(fileName); file = fs->open(fileName, FILE_WRITE); + if(!file) { + Serial.println("failed to create file " + fileName); + return; + } file.close(); } @@ -49,6 +53,7 @@ void Buffer::open(bool is_pcap){ void Buffer::openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap) { bool save_pcap = settings_obj.loadSetting("SavePCAP"); if (!save_pcap) { + Serial.println("Save pcap disabled"); this->fs = NULL; this->serial = false; writing = false; @@ -57,11 +62,15 @@ void Buffer::openFile(String file_name, fs::FS* fs, bool serial, bool is_pcap) { this->fs = fs; this->serial = serial; if (this->fs) { + Serial.print("Creating file "); + Serial.println(file_name); createFile(file_name, is_pcap); } if (this->fs || this->serial) { open(is_pcap); + Serial.println("File open"); } else { + Serial.println("Writing disabled"); writing = false; } } diff --git a/esp32_marauder/Buffer.h b/esp32_marauder/Buffer.h index b88badaa4..5d23bbffb 100644 --- a/esp32_marauder/Buffer.h +++ b/esp32_marauder/Buffer.h @@ -45,7 +45,11 @@ class Buffer { bool useA = true; // writing to bufA or bufB bool saving = false; // currently saving onto the SD card + #ifdef USE_FFAT + String fileName = "/0.cap"; + #else String fileName = "/0.pcap"; + #endif File file; fs::FS* fs; bool serial; diff --git a/esp32_marauder/CommandLine.cpp b/esp32_marauder/CommandLine.cpp index d9337d845..704cffe03 100644 --- a/esp32_marauder/CommandLine.cpp +++ b/esp32_marauder/CommandLine.cpp @@ -472,7 +472,11 @@ void CommandLine::runCommand(String input) { int da_sw = this->argSearch(&cmd_args, "disable"); // disable setting if (re_sw != -1) { - settings_obj.createDefaultSettings(SPIFFS); + #ifndef USE_FFAT + settings_obj.createDefaultSettings(SPIFFS); + #else + settings_obj.createDefaultSettings(FFat); + #endif return; } diff --git a/esp32_marauder/Display.cpp b/esp32_marauder/Display.cpp index f150e5c29..4c900a32c 100644 --- a/esp32_marauder/Display.cpp +++ b/esp32_marauder/Display.cpp @@ -1,5 +1,6 @@ #include "Display.h" #include "lang_var.h" +#include "FFat.h" #ifdef HAS_SCREEN @@ -624,9 +625,15 @@ void Display::jpegInfo() { // Open a Jpeg file and send it to the Serial port in a C array compatible format //==================================================================================== void createArray(const char *filename) { + fs::File jpgFile; // Open the named file - fs::File jpgFile = SPIFFS.open( filename, "r"); // File handle reference for SPIFFS + #ifndef USE_FFAT + jpgFile = SPIFFS.open( filename, "r"); // File handle reference for SPIFFS + #else + jpgFile = FFat.open( filename, "r"); // File handle reference for FFat + #endif + // File jpgFile = SD.open( filename, FILE_READ); // or, file handle reference for SD library if ( !jpgFile ) { @@ -672,9 +679,14 @@ void createArray(const char *filename) { #ifdef ESP8266 void Display::listFiles(void) { Serial.println(); - Serial.println(F("SPIFFS files found:")); + Serial.println(F("Files found:")); + #ifndef USE_FFAT fs::Dir dir = SPIFFS.openDir("/"); // Root directory + #else + fs::Dir dir = FFat.openDir("/"); // Root directory + #endif + String line = "====================================="; Serial.println(line); @@ -705,13 +717,17 @@ void Display::listFiles(void) { #ifdef ESP32 void Display::listFiles(void) { + #ifndef USE_FFAT listDir(SPIFFS, "/", 0); + #else + listDir(FFat, "/", 0); + #endif } void Display::listDir(fs::FS &fs, const char * dirname, uint8_t levels) { Serial.println(); - Serial.println(F("SPIFFS files found:")); + Serial.println(F("Files found:")); Serial.printf("Listing directory: %s\n", "/"); String line = "====================================="; diff --git a/esp32_marauder/EvilPortal.cpp b/esp32_marauder/EvilPortal.cpp index cd1aa3ade..28b6118a3 100644 --- a/esp32_marauder/EvilPortal.cpp +++ b/esp32_marauder/EvilPortal.cpp @@ -1,5 +1,9 @@ #include "EvilPortal.h" + +char apName[MAX_AP_NAME_SIZE] = "PORTAL"; +char index_html[MAX_HTML_SIZE] = "TEST"; + AsyncWebServer server(80); EvilPortal::EvilPortal() { diff --git a/esp32_marauder/EvilPortal.h b/esp32_marauder/EvilPortal.h index 4e5635ade..41e5172f1 100644 --- a/esp32_marauder/EvilPortal.h +++ b/esp32_marauder/EvilPortal.h @@ -36,8 +36,8 @@ extern Buffer buffer_obj; #define MAX_AP_NAME_SIZE 30 #define WIFI_SCAN_EVIL_PORTAL 30 -char apName[MAX_AP_NAME_SIZE] = "PORTAL"; -char index_html[MAX_HTML_SIZE] = "TEST"; +extern char apName[]; +extern char index_html[]; struct ssid { String essid; diff --git a/esp32_marauder/LedInterface.cpp b/esp32_marauder/LedInterface.cpp index be97b664f..3cd3e0d13 100644 --- a/esp32_marauder/LedInterface.cpp +++ b/esp32_marauder/LedInterface.cpp @@ -6,6 +6,7 @@ LedInterface::LedInterface() { void LedInterface::RunSetup() { //Serial.println("Setting neopixel to black..."); + #ifdef HAS_NEOPIXEL_LED strip.setBrightness(0); strip.begin(); strip.setPixelColor(0, strip.Color(0, 0, 0)); @@ -15,9 +16,11 @@ void LedInterface::RunSetup() { strip.setPixelColor(0, strip.Color(0, 0, 0)); strip.show(); this->initTime = millis(); + #endif } void LedInterface::main(uint32_t currentTime) { + #ifdef HAS_NEOPIXEL_LED if ((!settings_obj.loadSetting("EnableLED")) || (this->current_mode == MODE_OFF)) { this->ledOff(); @@ -39,6 +42,7 @@ void LedInterface::main(uint32_t currentTime) { else { this->ledOff(); } + #endif }; void LedInterface::setMode(uint8_t new_mode) { @@ -50,23 +54,32 @@ uint8_t LedInterface::getMode() { } void LedInterface::setColor(int r, int g, int b) { + #ifdef HAS_NEOPIXEL_LED strip.setPixelColor(0, strip.Color(r, g, b)); strip.show(); + #endif } void LedInterface::sniffLed() { + #ifdef HAS_NEOPIXEL_LED this->setColor(0, 0, 255); + #endif } void LedInterface::attackLed() { + #ifdef HAS_NEOPIXEL_LED this->setColor(255, 0, 0); + #endif } void LedInterface::ledOff() { + #ifdef HAS_NEOPIXEL_LED this->setColor(0, 0, 0); + #endif } void LedInterface::rainbow() { + #ifdef HAS_NEOPIXEL_LED strip.setPixelColor(0, this->Wheel((0 * 256 / 100 + this->wheel_pos) % 256)); strip.show(); @@ -75,9 +88,11 @@ void LedInterface::rainbow() { this->wheel_pos = this->wheel_pos - this->wheel_speed; if (this->wheel_pos < 0) this->wheel_pos = 255; + #endif } uint32_t LedInterface::Wheel(byte WheelPos) { + #ifdef HAS_NEOPIXEL_LED WheelPos = 255 - WheelPos; if(WheelPos < 85) { return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); @@ -88,4 +103,5 @@ uint32_t LedInterface::Wheel(byte WheelPos) { } WheelPos -= 170; return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); + #endif } \ No newline at end of file diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index 5a7fd68ba..1ec7339a1 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -745,7 +745,7 @@ void MenuFunctions::main(uint32_t currentTime) #ifdef HAS_BUTTONS #if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1)) - #ifndef MARAUDER_M5STICKC + #ifdef HAS_U if (u_btn.justPressed()){ if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) || (wifi_scan_obj.currentScanMode == OTA_UPDATE)) { @@ -781,6 +781,7 @@ void MenuFunctions::main(uint32_t currentTime) } } #endif + #ifdef HAS_D if (d_btn.justPressed()){ if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) || (wifi_scan_obj.currentScanMode == OTA_UPDATE)) { @@ -815,6 +816,7 @@ void MenuFunctions::main(uint32_t currentTime) wifi_scan_obj.changeChannel(14); } } + #endif if(c_btn_press){ current_menu->list->get(current_menu->selected).callable(); } @@ -930,27 +932,29 @@ void MenuFunctions::updateStatusBar() bool status_changed = false; - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.setFreeFont(NULL); #endif uint16_t the_color; + // GPS Stuff + #ifdef HAS_GPS + if (this->old_gps_sat_count != gps_obj.getNumSats()) { this->old_gps_sat_count = gps_obj.getNumSats(); display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR); status_changed = true; } - // GPS Stuff - #ifdef HAS_GPS if (gps_obj.getGpsModuleStatus()) { if (gps_obj.getFixStatus()) the_color = TFT_GREEN; else the_color = TFT_RED; - #ifdef HAS_ILI9341 + #if 1 + //#ifdef HAS_ILI9341 display_obj.tft.drawXBitmap(4, 0, menu_icons[STATUS_GPS], @@ -973,7 +977,7 @@ void MenuFunctions::updateStatusBar() // WiFi Channel Stuff if ((wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) || (status_changed)) { wifi_scan_obj.old_channel = wifi_scan_obj.set_channel; - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.fillRect(43, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR); #else display_obj.tft.fillRect(50, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR); @@ -982,7 +986,7 @@ void MenuFunctions::updateStatusBar() display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2); #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1); #endif } @@ -996,7 +1000,7 @@ void MenuFunctions::updateStatusBar() display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2); #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1); #endif } @@ -1028,7 +1032,8 @@ void MenuFunctions::updateStatusBar() else the_color = TFT_RED; - #ifdef HAS_ILI9341 + #if 1 + //#ifdef HAS_ILI9341 display_obj.tft.drawXBitmap(170, 0, menu_icons[STATUS_SD], @@ -1039,7 +1044,7 @@ void MenuFunctions::updateStatusBar() #endif #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR); display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1); #endif @@ -1048,7 +1053,7 @@ void MenuFunctions::updateStatusBar() void MenuFunctions::drawStatusBar() { display_obj.tft.setTextSize(1); - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.setFreeFont(NULL); #endif display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR); @@ -1063,7 +1068,7 @@ void MenuFunctions::drawStatusBar() the_color = TFT_GREEN; else the_color = TFT_RED; - + #ifdef HAS_ILI9341 display_obj.tft.drawXBitmap(4, 0, @@ -1084,7 +1089,7 @@ void MenuFunctions::drawStatusBar() // WiFi Channel Stuff wifi_scan_obj.old_channel = wifi_scan_obj.set_channel; - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.fillRect(43, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR); #else display_obj.tft.fillRect(50, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR); @@ -1093,7 +1098,7 @@ void MenuFunctions::drawStatusBar() display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2); #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1); #endif @@ -1105,7 +1110,7 @@ void MenuFunctions::drawStatusBar() display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2); #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1); #endif @@ -1147,7 +1152,7 @@ void MenuFunctions::drawStatusBar() #endif #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR); display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1); #endif @@ -1340,7 +1345,7 @@ void MenuFunctions::RunSetup() this->addNodes(&wifiMenu, text_table1[32], TFT_RED, NULL, ATTACKS, [this]() { this->changeMenu(&wifiAttackMenu); }); - this->addNodes(&wifiMenu, text_table1[33], TFT_PURPLE, NULL, GENERAL_APPS, [this]() { + this->addNodes(&wifiMenu, text_table1[33], TFT_BLUE, NULL, GENERAL_APPS, [this]() { this->changeMenu(&wifiGeneralMenu); }); @@ -1487,14 +1492,14 @@ void MenuFunctions::RunSetup() wifi_scan_obj.RunGenerateSSIDs(); }); #ifdef HAS_ILI9341 - this->addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, text_table1[1], TFT_BLUE, NULL, KEYBOARD_ICO, [this](){ display_obj.clearScreen(); wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_YELLOW); addSSIDGFX(); }); #endif #if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS)) - this->addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){ + this->addNodes(&wifiGeneralMenu, text_table1[1], TFT_BLUE, NULL, KEYBOARD_ICO, [this](){ this->changeMenu(&miniKbMenu); this->miniKeyboard(&miniKbMenu); }); @@ -1537,6 +1542,7 @@ void MenuFunctions::RunSetup() #if (defined(HAS_BUTTONS) && defined(HAS_SD)) #if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1)) while(true) { + #ifdef HAS_D if (d_btn.justPressed()) { if (evil_portal_obj.selected_html_index > 0) evil_portal_obj.selected_html_index--; @@ -1547,7 +1553,8 @@ void MenuFunctions::RunSetup() this->buildButtons(&htmlMenu); this->displayCurrentMenu(); } - #ifndef MARAUDER_M5STICKC + #endif + #ifdef HAS_U if (u_btn.justPressed()) { if (evil_portal_obj.selected_html_index < evil_portal_obj.html_files->size() - 1) evil_portal_obj.selected_html_index++; @@ -1581,7 +1588,7 @@ void MenuFunctions::RunSetup() #endif htmlMenu.parentMenu = &wifiGeneralMenu; - this->addNodes(&htmlMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { + this->addNodes(&htmlMenu, text09, TFT_RED, NULL, 0, [this]() { this->changeMenu(htmlMenu.parentMenu); }); @@ -1703,7 +1710,7 @@ void MenuFunctions::RunSetup() this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_SAMSUNG_SPAM, TFT_RED); }); - this->addNodes(&bluetoothAttackMenu, "Google BLE Spam", TFT_PURPLE, NULL, LANGUAGE, [this]() { + this->addNodes(&bluetoothAttackMenu, "Google BLE Spam", TFT_BLUE, NULL, LANGUAGE, [this]() { display_obj.clearScreen(); this->drawStatusBar(); wifi_scan_obj.StartScan(BT_ATTACK_GOOGLE_SPAM, TFT_RED); @@ -1772,7 +1779,7 @@ void MenuFunctions::RunSetup() // Start button loop while(true) { - #ifndef MARAUDER_M5STICKC + #ifdef HAS_U if (u_btn.justPressed()) { if (sd_file_index > 0) sd_file_index--; @@ -1784,6 +1791,7 @@ void MenuFunctions::RunSetup() this->displayCurrentMenu(); } #endif + #ifdef HAS_D if (d_btn.justPressed()) { if (sd_file_index < sd_obj.sd_files->size() - 1) sd_file_index++; @@ -1794,6 +1802,7 @@ void MenuFunctions::RunSetup() this->buildButtons(&sdDeleteMenu, 0, sd_obj.sd_files->get(sd_file_index)); this->displayCurrentMenu(); } + #endif if (c_btn.justPressed()) { if (sd_obj.sd_files->get(sd_file_index) != "Back") { if (sd_obj.removeFile("/" + sd_obj.sd_files->get(sd_file_index))) @@ -2188,7 +2197,7 @@ void MenuFunctions::displayCurrentMenu(uint8_t start_index) display_obj.tft.setFreeFont(MENU_FONT); #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) display_obj.tft.setFreeFont(NULL); display_obj.tft.setTextSize(1); #endif @@ -2211,15 +2220,22 @@ void MenuFunctions::displayCurrentMenu(uint8_t start_index) #endif - #if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) - if ((current_menu->selected == i) || (current_menu->list->get(i).selected)) + #if defined(LILYGO_T_DISPLAY_S3R8) || defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) + if ((current_menu->selected == i) || (current_menu->list->get(i).selected)) { display_obj.key[i - start_index].drawButton(true, current_menu->list->get(i).name); - else + } + else + { display_obj.key[i - start_index].drawButton(false, current_menu->list->get(i).name); + } #endif } display_obj.tft.setFreeFont(NULL); } + else + { + Serial.println("Current list is null"); + } } #endif diff --git a/esp32_marauder/MenuFunctions.h b/esp32_marauder/MenuFunctions.h index 489797614..41e95a7bd 100644 --- a/esp32_marauder/MenuFunctions.h +++ b/esp32_marauder/MenuFunctions.h @@ -76,8 +76,13 @@ extern Settings settings_obj; PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p); PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data); +#ifdef LILYGO_T_DISPLAY_S3R8 +PROGMEM static lv_disp_drv_t disp_buf; +PROGMEM static lv_color_t buf[TFT_WIDTH * 10]; +#else PROGMEM static lv_disp_buf_t disp_buf; PROGMEM static lv_color_t buf[LV_HOR_RES_MAX * 10]; +#endif PROGMEM static void ta_event_cb(lv_obj_t * ta, lv_event_t event); PROGMEM static void add_ssid_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event); diff --git a/esp32_marauder/SDInterface.cpp b/esp32_marauder/SDInterface.cpp index c5a769eb0..4367015d3 100644 --- a/esp32_marauder/SDInterface.cpp +++ b/esp32_marauder/SDInterface.cpp @@ -1,6 +1,8 @@ #include "SDInterface.h" #include "lang_var.h" - +#ifdef LILYGO_T_DISPLAY_S3R8 +#include "SD_MMC.h" +#endif bool SDInterface::initSD() { #ifdef HAS_SD @@ -33,8 +35,12 @@ bool SDInterface::initSD() { */ enum { SPI_SCK = 0, SPI_MISO = 36, SPI_MOSI = 26 }; this->spiExt = new SPIClass(); - this->spiExt->begin(SPI_SCK, SPI_MISO, SPI_MOSI, SD_CS); + this->spiExt->begin(SPI_SCK, SPI_MOSI, SPI_MISO, SD_CS); if (!SD.begin(SD_CS, *(this->spiExt))) { + #elif defined(LILYGO_T_DISPLAY_S3R8) + enum { SPI_SCK = 11, SPI_MISO = 12, SPI_MOSI = 13 }; + SD_MMC.setPins(SPI_SCK, SPI_MOSI, SPI_MISO); + if (!SD_MMC.begin("/sdcard", true, true)) { #else if (!SD.begin(SD_CS)) { #endif @@ -44,7 +50,13 @@ bool SDInterface::initSD() { } else { this->supported = true; + #ifdef LILYGO_T_DISPLAY_S3R8 + this->cardType = SD_MMC.cardType(); + this->cardSizeMB = SD_MMC.cardSize() / (1024 * 1024); + #else this->cardType = SD.cardType(); + this->cardSizeMB = SD.cardSize() / (1024 * 1024); + #endif //if (cardType == CARD_MMC) // Serial.println(F("SD: MMC Mounted")); //else if(cardType == CARD_SD) @@ -53,8 +65,6 @@ bool SDInterface::initSD() { // Serial.println(F("SD: SDHC Mounted")); //else // Serial.println(F("SD: UNKNOWN Card Mounted")); - - this->cardSizeMB = SD.cardSize() / (1024 * 1024); //Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB); @@ -73,10 +83,13 @@ bool SDInterface::initSD() { this->card_sz = sz; } + #ifdef LILYGO_T_DISPLAY_S3R8 + if (!SD_MMC.exists("/SCRIPTS")) { + SD_MMC.mkdir("/SCRIPTS"); + #else if (!SD.exists("/SCRIPTS")) { - Serial.println("/SCRIPTS does not exist. Creating..."); - SD.mkdir("/SCRIPTS"); + #endif Serial.println("/SCRIPTS created"); } @@ -95,7 +108,11 @@ bool SDInterface::initSD() { File SDInterface::getFile(String path) { if (this->supported) { + #ifdef LILYGO_T_DISPLAY_S3R8 + File file = SD_MMC.open(path, FILE_READ); + #else File file = SD.open(path, FILE_READ); + #endif //if (file) return file; @@ -103,7 +120,11 @@ File SDInterface::getFile(String path) { } bool SDInterface::removeFile(String file_path) { + #ifdef LILYGO_T_DISPLAY_S3R8 + if (SD_MMC.remove(file_path)) + #else if (SD.remove(file_path)) + #endif return true; else return false; @@ -111,7 +132,11 @@ bool SDInterface::removeFile(String file_path) { void SDInterface::listDirToLinkedList(LinkedList* file_names, String str_dir, String ext) { if (this->supported) { + #ifdef LILYGO_T_DISPLAY_S3R8 + File dir = SD_MMC.open(str_dir); + #else File dir = SD.open(str_dir); + #endif while (true) { File entry = dir.openNextFile(); @@ -137,7 +162,11 @@ void SDInterface::listDirToLinkedList(LinkedList* file_names, String str void SDInterface::listDir(String str_dir){ if (this->supported) { + #ifdef LILYGO_T_DISPLAY_S3R8 + File dir = SD_MMC.open(str_dir); + #else File dir = SD.open(str_dir); + #endif while (true) { File entry = dir.openNextFile(); @@ -167,7 +196,11 @@ void SDInterface::runUpdate() { display_obj.tft.println(F(text15)); #endif + #ifdef LILYGO_T_DISPLAY_S3R8 + File updateBin = SD_MMC.open("/update.bin"); + #else File updateBin = SD.open("/update.bin"); + #endif if (updateBin) { if(updateBin.isDirectory()){ #ifdef HAS_SCREEN @@ -210,7 +243,7 @@ void SDInterface::runUpdate() { display_obj.tft.println(F(text_table2[3])); #endif Serial.println(F("rebooting...")); - //SD.remove("/update.bin"); + //SD.remove("/update.bin"); delay(1000); ESP.restart(); } diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 01f024d94..361e5815e 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -1,5 +1,8 @@ #include "WiFiScan.h" #include "lang_var.h" +#ifdef LILYGO_T_DISPLAY_S3R8 +#include "SD_MMC.h" +#endif int num_beacon = 0; int num_deauth = 0; @@ -10,13 +13,6 @@ LinkedList* ssids; LinkedList* access_points; LinkedList* stations; -extern "C" int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3){ - if (arg == 31337) - return 1; - else - return 0; -} - extern "C" { uint8_t esp_base_mac_addr[6]; esp_err_t esp_ble_gap_set_rand_addr(const uint8_t *rand_addr); @@ -306,10 +302,7 @@ WiFiScan::WiFiScan() } void WiFiScan::RunSetup() { - if (ieee80211_raw_frame_sanity_check(31337, 0, 0) == 1) - this->wsl_bypass_enabled = true; - else - this->wsl_bypass_enabled = false; + this->wsl_bypass_enabled = true; ssids = new LinkedList(); access_points = new LinkedList(); @@ -345,7 +338,7 @@ void WiFiScan::RunSetup() { {0x20, "Green Watch6 Classic 43m"}, }; - NimBLEDevice::setScanFilterMode(CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE); + NimBLEDevice::setScanFilterMode(0); NimBLEDevice::setScanDuplicateCacheSize(200); NimBLEDevice::init(""); pBLEScan = NimBLEDevice::getScan(); //create new scan @@ -934,7 +927,11 @@ void WiFiScan::startPcap(String file_name) { buffer_obj.pcapOpen( file_name, #if defined(HAS_SD) + #ifdef LILYGO_T_DISPLAY_S3R8 + sd_obj.supported ? &SD_MMC : + #else sd_obj.supported ? &SD : + #endif #endif NULL, save_serial // Set with commandline options @@ -945,7 +942,11 @@ void WiFiScan::startLog(String file_name) { buffer_obj.logOpen( file_name, #if defined(HAS_SD) + #ifdef LILYGO_T_DISPLAY_S3R8 + sd_obj.supported ? &SD_MMC : + #else sd_obj.supported ? &SD : + #endif #endif NULL, save_serial // Set with commandline options @@ -1062,8 +1063,11 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color) display_obj.tft.setTouch(calData); #endif - + //#ifdef LILYGO_T_DISPLAY_S3R8 + //lv_obj_t * scr = lv_menu_cont_create(NULL); + //#else lv_obj_t * scr = lv_cont_create(NULL, NULL); + //#endif lv_disp_load_scr(scr); } @@ -2150,7 +2154,7 @@ void WiFiScan::RunBluetoothScan(uint8_t scan_mode, uint16_t color) #endif if (scan_mode != BT_SCAN_WAR_DRIVE_CONT) { - NimBLEDevice::setScanFilterMode(CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE); + NimBLEDevice::setScanFilterMode(0); NimBLEDevice::setScanDuplicateCacheSize(200); } NimBLEDevice::init(""); diff --git a/esp32_marauder/configs.h b/esp32_marauder/configs.h index 22c5b9fe7..7fc789f4e 100644 --- a/esp32_marauder/configs.h +++ b/esp32_marauder/configs.h @@ -8,17 +8,18 @@ //// BOARD TARGETS //#define MARAUDER_M5STICKC - #define MARAUDER_MINI + //#define MARAUDER_MINI //#define MARAUDER_V4 //#define MARAUDER_V6 //#define MARAUDER_V6_1 //#define MARAUDER_KIT - //#define GENERIC_ESP32 + //#define GENERIC_ESP32 //#define MARAUDER_FLIPPER //#define ESP32_LDDB //#define MARAUDER_DEV_BOARD_PRO //#define XIAO_ESP32_S3 //#define MARAUDER_REV_FEATHER + #define LILYGO_T_DISPLAY_S3R8 //// END BOARD TARGETS #define MARAUDER_VERSION "v0.13.9" @@ -46,6 +47,8 @@ #define HARDWARE_NAME "Flipper Zero Dev Board Pro" #elif defined(XIAO_ESP32_S3) #define HARDWARE_NAME "XIAO ESP32 S3" + #elif defined(LILYGO_T_DISPLAY_S3R8) + #define HARDWARE_NAME "LilyGO T-Display S3" #else #define HARDWARE_NAME "ESP32" #endif @@ -118,10 +121,26 @@ #define HAS_NEOPIXEL_LED //#define HAS_PWR_MGMT #define HAS_SCREEN + //#define HAS_SD + //#define USE_SD + #define HAS_TEMP_SENSOR + //#define HAS_GPS + #endif + + #if defined(LILYGO_T_DISPLAY_S3R8) + //#define FLIPPER_ZERO_HAT + //#define HAS_BATTERY + #define HAS_BT + #define HAS_BT_REMOTE + #define HAS_BUTTONS + //#define HAS_NEOPIXEL_LED + //#define HAS_PWR_MGMT + #define HAS_SCREEN #define HAS_SD #define USE_SD #define HAS_TEMP_SENSOR - #define HAS_GPS + //#define HAS_GPS + #define USE_FFAT #endif #ifdef MARAUDER_KIT @@ -278,6 +297,26 @@ #define D_PULL true #endif + #ifdef LILYGO_T_DISPLAY_S3R8 + #define L_BTN -1 + #define C_BTN 14 + #define U_BTN -1 + #define R_BTN -1 + #define D_BTN 0 + + //#define HAS_L + //#define HAS_R + //#define HAS_U + #define HAS_D + #define HAS_C + + #define L_PULL true + #define C_PULL true + #define U_PULL true + #define R_PULL true + #define D_PULL true + #endif + #ifdef MARAUDER_V6 #define L_BTN -1 #define C_BTN 0 @@ -449,6 +488,73 @@ #define KIT_LED_BUILTIN 13 #endif + #if defined(LILYGO_T_DISPLAY_S3R8) + #define SCREEN_CHAR_WIDTH 28 + //#define TFT_MISO 19 + //#define TFT_MOSI 15 + //#define TFT_SCLK 13 + //#define TFT_CS 5 + //#define TFT_DC 23 + //#define TFT_RST 18 + //#define TFT_BL -1 + //#define TOUCH_CS -1 + //#define SD_CS 1 + //#define HAS_ILI9341 + + #define BANNER_TEXT_SIZE 2 + + #ifndef TFT_WIDTH + #define TFT_WIDTH 170 + #endif + + #ifndef TFT_HEIGHT + #define TFT_HEIGHT 320 + #endif + + #define TFT_DIY + + #define SCREEN_WIDTH TFT_WIDTH + #define SCREEN_HEIGHT TFT_HEIGHT + #define HEIGHT_1 TFT_WIDTH + #define WIDTH_1 TFT_HEIGHT + #define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font + #define TEXT_HEIGHT 16 // Height of text to be printed and scrolled + #define BOT_FIXED_AREA 0 // Number of lines in bottom fixed area (lines counted from bottom of screen) + #define TOP_FIXED_AREA 48 // Number of lines in top fixed area (lines counted from top of screen) + #define YMAX 320 // Bottom of screen area + #define minimum(a,b) (((a) < (b)) ? (a) : (b)) + //#define MENU_FONT NULL + #define MENU_FONT &FreeMono9pt7b // Winner + //#define MENU_FONT &FreeMonoBold9pt7b + //#define MENU_FONT &FreeSans9pt7b + //#define MENU_FONT &FreeSansBold9pt7b + #define BUTTON_SCREEN_LIMIT 12 + #define BUTTON_ARRAY_LEN 12 + #define STATUS_BAR_WIDTH 16 + #define LVGL_TICK_PERIOD 6 + + #define FRAME_X 100 + #define FRAME_Y 64 + #define FRAME_W 120 + #define FRAME_H 50 + + // Red zone size + #define REDBUTTON_X FRAME_X + #define REDBUTTON_Y FRAME_Y + #define REDBUTTON_W (FRAME_W/2) + #define REDBUTTON_H FRAME_H + + // Green zone size + #define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W) + #define GREENBUTTON_Y FRAME_Y + #define GREENBUTTON_W (FRAME_W/2) + #define GREENBUTTON_H FRAME_H + + #define STATUSBAR_COLOR 0x4A49 + + #define KIT_LED_BUILTIN 13 + #endif + #if defined(MARAUDER_V6) || defined(MARAUDER_V6_1) #define SCREEN_CHAR_WIDTH 40 #define HAS_ILI9341 @@ -723,6 +829,25 @@ //#define BUTTON_ARRAY_LEN 5 #endif + #if defined(LILYGO_T_DISPLAY_S3R8) + #define BANNER_TIME 100 + + #define COMMAND_PREFIX "!" + + // Keypad start position, key sizes and spacing + #define KEY_X 85 // Centre of key + #define KEY_Y 50 + #define KEY_W 170 // Width and height + #define KEY_H 22 + #define KEY_SPACING_X 0 // X and Y gap + #define KEY_SPACING_Y 1 + #define KEY_TEXTSIZE 1 // Font size multiplier + #define ICON_W 22 + #define ICON_H 22 + #define BUTTON_PADDING 22 + //#define BUTTON_ARRAY_LEN 5 + #endif + #if defined(MARAUDER_V6) || defined(MARAUDER_V6_1) #define BANNER_TIME 100 @@ -823,6 +948,10 @@ #define SD_CS 12 #endif + #ifdef LILYGO_T_DISPLAY_S3R8 + #define SD_CS 10 + #endif + #ifdef MARAUDER_V6 #define SD_CS 12 #endif @@ -916,6 +1045,8 @@ #define MEM_LOWER_LIM 20000 #elif defined(XIAO_ESP32_S3) #define MEM_LOWER_LIM 20000 + #else + #define MEM_LOWER_LIM 20000 #endif //// END MEMORY LOWER LIMIT STUFF diff --git a/esp32_marauder/esp32_marauder.ino b/esp32_marauder/esp32_marauder.ino index a974e19e9..8e3aa0b26 100644 --- a/esp32_marauder/esp32_marauder.ino +++ b/esp32_marauder/esp32_marauder.ino @@ -289,7 +289,7 @@ void setup() xiao_led.RunSetup(); #elif defined(MARAUDER_M5STICKC) stickc_led.RunSetup(); - #else + #else defined(HAS_NEOPIXEL_LED) led_obj.RunSetup(); #endif diff --git a/esp32_marauder/lang_var.c b/esp32_marauder/lang_var.c new file mode 100644 index 000000000..e12ac4f58 --- /dev/null +++ b/esp32_marauder/lang_var.c @@ -0,0 +1,189 @@ +#pragma once + +#ifndef lang_var_h +#define lang_var_h + +//#include "configs.h" + +//Starting window texts +const char text0_0[] = "Giving room for HardwareSerial..."; +const char text0_1[] = "Started Serial"; +const char text0_2[] = "Checked RAM"; +const char text0_3[] = "Initialized SD Card"; +const char text0_4[] = "Failed to Initialize SD Card"; +const char text0_5[] = "Checked battery configuration"; +const char text0_6[] = "Initialized temperature interface"; +const char text0_7[] = "Initialized LED Interface"; +const char text0_8[] = "Starting..."; + +//Single library (action) texts/Often used +const char text00[] = "Battery Level changed: "; +const char text01[] = "file closed"; +const char text02[] = "Failed to open file '"; +const char text03[] = "ON"; +const char text04[] = "OFF"; +const char text05[] = "Load"; +const char text06[] = "Save As"; +const char text07[] = "Exit"; +const char text08[] = "Settings"; +const char text09[] = "Back"; +const char text10[] = "Channel:"; +const char text11[] = "Touch screen to exit"; +const char text12[] = "Cancel"; +const char text13[] = "Save"; +const char text14[] = "Yes"; +const char text15[] = "Opening /update.bin..."; +const char text16[] = "Close"; +const char text17[] = "FAIL"; +const char text18[] = "packets/sec: "; + + +//Menufunctions.cpp texts +const char text1_0[] = "SSID List"; +const char text1_1[] = "Add SSIDs"; +const char text1_2[] = "SSID: "; +const char text1_3[] = "Password:"; +const char text1_4[] = "Setting disabled"; +const char text1_5[] = "Setting on"; +const char text1_6[] = "ESP32 Marauder "; +const char text1_7[] = "WiFi "; +const char text1_8[] = "Bad USB "; +const char text1_9[] = "Device "; +const char text1_10[] = "General Apps "; +const char text1_11[] = "Updating... "; +const char text1_12[] = "Select Method "; +const char text1_13[] = "Confirm Update "; +const char text1_14[] = "ESP8266 Update "; +const char text1_15[] = "Update Firmware "; +const char text1_16[] = "Language "; +const char text1_17[] = "Device Info "; +const char text1_18[] = "Settings "; +const char text1_19[] = "Bluetooth "; +const char text1_20[] = "WiFi Sniffers "; +const char text1_21[] = "WiFi Attacks "; +const char text1_22[] = "WiFi General "; +const char text1_23[] = "Bluetooth Sniffers "; +const char text1_24[] = "Bluetooth General "; +const char text1_25[] = "Shutdown WiFi "; +const char text1_26[] = "Shutdown BLE "; +const char text1_27[] = "Generate SSIDs "; +const char text1_28[] = "Clear SSIDs "; +const char text1_29[] = "Clear APs "; +const char text1_30[] = "Reboot"; +const char text1_31[] = "Sniffers"; +const char text1_32[] = "Attacks"; +const char text1_33[] = "General"; +const char text1_34[] = "Bluetooth Sniffer"; +const char text1_35[] = "Detect Card Skimmers"; +const char text1_36[] = "Test BadUSB"; +const char text1_37[] = "Run Ducky Script"; +const char text1_38[] = "Draw"; +const char text1_39[] = "Web Update"; +const char text1_40[] = "SD Update"; +const char text1_41[] = "ESP8266 Update"; +const char text1_42[] = "Probe Request Sniff"; +const char text1_43[] = "Beacon Sniff"; +const char text1_44[] = "Deauth Sniff"; +const char text1_45[] = "Packet Monitor"; +const char text1_46[] = "EAPOL/PMKID Scan"; +const char text1_47[] = "Detect Pwnagotchi"; +const char text1_48[] = "Detect Espressif"; +const char text1_49[] = "Scan APs"; +const char text1_50[] = "Beacon Spam List"; +const char text1_51[] = "Beacon Spam Random"; +const char text1_52[] = "Rick Roll Beacon"; +const char text1_53[] = "Probe Req Flood"; +const char text1_54[] = "Deauth Flood"; +const char text1_55[] = "Join WiFi"; +const char text1_56[] = "Select APs"; +const char text1_57[] = "AP Clone Spam"; +const char text1_58[] = "Raw Capture"; +const char text1_59[] = "Station Sniff"; +const char text1_60[] = "Clear Stations"; +const char text1_61[] = "Select Stations"; +const char text1_62[] = "Deauth Targeted"; + + +//SDInterface.cpp texts +const char text2_0[] = "Error, could not find update.bin"; +const char text2_1[] = "Starting SD Update..."; +const char text2_2[] = "Error, update.bin is empty"; +const char text2_3[] = "\nRebooting...\n"; +const char text2_4[] = "Could not load update.bin from /"; +const char text2_5[] = "File size: "; +const char text2_6[] = "Writing file to partition..."; +const char text2_7[] = "Written: "; +const char text2_8[] = "Written only : "; +const char text2_9[] = ". Retry?"; +const char text2_10[] = " successfully"; +const char text2_11[] = "Update complete"; +const char text2_12[] = "Update could not complete"; +const char text2_13[] = "Error Occurred. Error #: "; +const char text2_14[] = "Not enough space to begin OTA"; + +//Web.cpp texts +const char text3_0[] = "Configuring update server...\n\n"; +const char text3_1[] = "IP address: "; +const char text3_2[] = "Update: "; +const char text3_3[] = "Bytes complete: "; +const char text3_4[] = "Update Success: "; +const char text3_5[] = "\nCompleted update server setup"; + +//WiFiScan.cpp texts +const char text4_0[] = " RSSI: "; +const char text4_1[] = "Potential Skimmer: "; +const char text4_2[] = "Already Connected"; +const char text4_3[] = "Failed to connect"; +const char text4_4[] = "Connected"; +const char text4_5[] = "ForcePMKID"; +const char text4_6[] = "ForceProbe"; +const char text4_7[] = "SavePCAP"; +const char text4_8[] = "Probe Flood"; +const char text4_9[] = "Clearing APs..."; +const char text4_10[] = "APs Cleared: "; +const char text4_11[] = "Clearing SSIDs..."; +const char text4_12[] = "SSIDs Cleared: "; +const char text4_13[] = "Generating SSIDs..."; +const char text4_14[] = "SSIDs Generated: "; //Add spaces before to match : [15] +const char text4_15[] = " Total SSIDs: "; //Add spaces beforer to match : [14] +const char text4_16[] = "Shutting down WiFi..."; +const char text4_17[] = "WiFi not currently initialized"; +const char text4_18[] = "Shutting down BLE..."; +const char text4_19[] = "BLE not currently initialized"; +const char text4_20[] = "Firmware: Marauder"; //From 20 to 35 add spaces so : is in line like it is now +const char text4_21[] = "Version: "; +const char text4_22[] = "ESP-IDF: "; +const char text4_23[] = "WSL Bypass: enabled"; +const char text4_24[] = "WSL Bypass: disabled"; +const char text4_25[] = "Station MAC: "; +const char text4_26[] = "AP MAC: "; +const char text4_27[] = ""; +const char text4_28[] = "SD Card: Connected"; +const char text4_29[] = "SD Card Size: "; +const char text4_30[] = "SD Card: Not Connected"; +const char text4_31[] = "SD Card Size: 0"; +const char text4_32[] = "IP5306 I2C: supported"; +const char text4_33[] = "Battery Lvl: "; +const char text4_34[] = "IP5306 I2C: not supported"; +const char text4_35[] = "Internal temp: "; +const char text4_36[] = " Detect Espressif "; +const char text4_37[] = " Detect Pwnagotchi "; +const char text4_38[] = " Beacon Sniffer "; +const char text4_39[] = " Deauthentication Sniffer "; +const char text4_40[] = " Probe Request Sniffer "; +const char text4_41[] = " Bluetooth Sniff "; +const char text4_42[] = " Detect Card Skimmers "; +const char text4_43[] = "Scanning for\nBluetooth-enabled skimmers\nHC-03, HC-05, and HC-06..."; +const char text4_44[] = " AP Scan "; +const char text4_45[] = "Clearing Stations..."; +const char text4_46[] = "Stations Cleared: "; +const char text4_47[] = "Targeted Deauth"; + +//Making tables +const char *text_table0[] = {text0_0,text0_1, text0_2, text0_3, text0_4, text0_5, text0_6, text0_7, text0_8}; +const char *text_table1[] = {text1_0,text1_1,text1_2,text1_3,text1_4,text1_5,text1_6,text1_7,text1_8,text1_9,text1_10,text1_11,text1_12,text1_13,text1_14,text1_15,text1_16,text1_17,text1_18,text1_19,text1_20,text1_21,text1_22,text1_23,text1_24,text1_25,text1_26,text1_27,text1_28,text1_29,text1_30,text1_31,text1_32,text1_33,text1_34,text1_35,text1_36,text1_37,text1_38,text1_39,text1_40,text1_41,text1_42,text1_43,text1_44,text1_45,text1_46,text1_47,text1_48,text1_49,text1_50,text1_51,text1_52,text1_53,text1_54,text1_55,text1_56,text1_57,text1_58,text1_59,text1_60,text1_61,text1_62}; +const char *text_table2[] = {text2_0,text2_1,text2_2,text2_3,text2_4,text2_5,text2_6,text2_7,text2_8,text2_9,text2_10,text2_11,text2_12,text2_13,text2_14}; +const char *text_table3[] = {text3_0,text3_1,text3_2,text3_3,text3_4,text3_5}; +const char *text_table4[] = {text4_0,text4_1,text4_2,text4_3,text4_4,text4_5,text4_6,text4_7,text1_54,text4_9,text4_10,text4_11,text4_12,text4_13,text4_14,text4_15,text4_16,text4_17,text4_18,text4_19,text4_20,text4_21,text4_22,text4_23,text4_24,text4_25,text4_26,text4_27,text4_28,text4_29,text4_30,text4_31,text4_32,text4_33,text4_34,text4_35,text4_36,text4_37,text4_38,text4_39,text4_40,text4_41,text4_42,text4_43,text4_44,text4_45,text4_46,text4_47}; + +#endif diff --git a/esp32_marauder/lang_var.h b/esp32_marauder/lang_var.h index 3b4ffc325..7a2bb931f 100644 --- a/esp32_marauder/lang_var.h +++ b/esp32_marauder/lang_var.h @@ -7,184 +7,184 @@ #include "configs.h" //Starting window texts -PROGMEM const char text0_0[] = "Giving room for HardwareSerial..."; -PROGMEM const char text0_1[] = "Started Serial"; -PROGMEM const char text0_2[] = "Checked RAM"; -PROGMEM const char text0_3[] = "Initialized SD Card"; -PROGMEM const char text0_4[] = "Failed to Initialize SD Card"; -PROGMEM const char text0_5[] = "Checked battery configuration"; -PROGMEM const char text0_6[] = "Initialized temperature interface"; -PROGMEM const char text0_7[] = "Initialized LED Interface"; -PROGMEM const char text0_8[] = "Starting..."; +extern const char text0_0[]; +extern const char text0_1[]; +extern const char text0_2[]; +extern const char text0_3[]; +extern const char text0_4[]; +extern const char text0_5[]; +extern const char text0_6[]; +extern const char text0_7[]; +extern const char text0_8[]; //Single library (action) texts/Often used -PROGMEM const char text00[] = "Battery Level changed: "; -PROGMEM const char text01[] = "file closed"; -PROGMEM const char text02[] = "Failed to open file '"; -PROGMEM const char text03[] = "ON"; -PROGMEM const char text04[] = "OFF"; -PROGMEM const char text05[] = "Load"; -PROGMEM const char text06[] = "Save As"; -PROGMEM const char text07[] = "Exit"; -PROGMEM const char text08[] = "Settings"; -PROGMEM const char text09[] = "Back"; -PROGMEM const char text10[] = "Channel:"; -PROGMEM const char text11[] = "Touch screen to exit"; -PROGMEM const char text12[] = "Cancel"; -PROGMEM const char text13[] = "Save"; -PROGMEM const char text14[] = "Yes"; -PROGMEM const char text15[] = "Opening /update.bin..."; -PROGMEM const char text16[] = "Close"; -PROGMEM const char text17[] = "FAIL"; -PROGMEM const char text18[] = "packets/sec: "; +extern const char text00[]; +extern const char text01[]; +extern const char text02[]; +extern const char text03[]; +extern const char text04[]; +extern const char text05[]; +extern const char text06[]; +extern const char text07[]; +extern const char text08[]; +extern const char text09[]; +extern const char text10[]; +extern const char text11[]; +extern const char text12[]; +extern const char text13[]; +extern const char text14[]; +extern const char text15[]; +extern const char text16[]; +extern const char text17[]; +extern const char text18[]; //Menufunctions.cpp texts -PROGMEM const char text1_0[] = "SSID List"; -PROGMEM const char text1_1[] = "Add SSIDs"; -PROGMEM const char text1_2[] = "SSID: "; -PROGMEM const char text1_3[] = "Password:"; -PROGMEM const char text1_4[] = "Setting disabled"; -PROGMEM const char text1_5[] = "Setting on"; -PROGMEM const char text1_6[] = "ESP32 Marauder "; -PROGMEM const char text1_7[] = "WiFi "; -PROGMEM const char text1_8[] = "Bad USB "; -PROGMEM const char text1_9[] = "Device "; -PROGMEM const char text1_10[] = "General Apps "; -PROGMEM const char text1_11[] = "Updating... "; -PROGMEM const char text1_12[] = "Select Method "; -PROGMEM const char text1_13[] = "Confirm Update "; -PROGMEM const char text1_14[] = "ESP8266 Update "; -PROGMEM const char text1_15[] = "Update Firmware "; -PROGMEM const char text1_16[] = "Language "; -PROGMEM const char text1_17[] = "Device Info "; -PROGMEM const char text1_18[] = "Settings "; -PROGMEM const char text1_19[] = "Bluetooth "; -PROGMEM const char text1_20[] = "WiFi Sniffers "; -PROGMEM const char text1_21[] = "WiFi Attacks "; -PROGMEM const char text1_22[] = "WiFi General "; -PROGMEM const char text1_23[] = "Bluetooth Sniffers "; -PROGMEM const char text1_24[] = "Bluetooth General "; -PROGMEM const char text1_25[] = "Shutdown WiFi "; -PROGMEM const char text1_26[] = "Shutdown BLE "; -PROGMEM const char text1_27[] = "Generate SSIDs "; -PROGMEM const char text1_28[] = "Clear SSIDs "; -PROGMEM const char text1_29[] = "Clear APs "; -PROGMEM const char text1_30[] = "Reboot"; -PROGMEM const char text1_31[] = "Sniffers"; -PROGMEM const char text1_32[] = "Attacks"; -PROGMEM const char text1_33[] = "General"; -PROGMEM const char text1_34[] = "Bluetooth Sniffer"; -PROGMEM const char text1_35[] = "Detect Card Skimmers"; -PROGMEM const char text1_36[] = "Test BadUSB"; -PROGMEM const char text1_37[] = "Run Ducky Script"; -PROGMEM const char text1_38[] = "Draw"; -PROGMEM const char text1_39[] = "Web Update"; -PROGMEM const char text1_40[] = "SD Update"; -PROGMEM const char text1_41[] = "ESP8266 Update"; -PROGMEM const char text1_42[] = "Probe Request Sniff"; -PROGMEM const char text1_43[] = "Beacon Sniff"; -PROGMEM const char text1_44[] = "Deauth Sniff"; -PROGMEM const char text1_45[] = "Packet Monitor"; -PROGMEM const char text1_46[] = "EAPOL/PMKID Scan"; -PROGMEM const char text1_47[] = "Detect Pwnagotchi"; -PROGMEM const char text1_48[] = "Detect Espressif"; -PROGMEM const char text1_49[] = "Scan APs"; -PROGMEM const char text1_50[] = "Beacon Spam List"; -PROGMEM const char text1_51[] = "Beacon Spam Random"; -PROGMEM const char text1_52[] = "Rick Roll Beacon"; -PROGMEM const char text1_53[] = "Probe Req Flood"; -PROGMEM const char text1_54[] = "Deauth Flood"; -PROGMEM const char text1_55[] = "Join WiFi"; -PROGMEM const char text1_56[] = "Select APs"; -PROGMEM const char text1_57[] = "AP Clone Spam"; -PROGMEM const char text1_58[] = "Raw Capture"; -PROGMEM const char text1_59[] = "Station Sniff"; -PROGMEM const char text1_60[] = "Clear Stations"; -PROGMEM const char text1_61[] = "Select Stations"; -PROGMEM const char text1_62[] = "Deauth Targeted"; +extern const char text1_0[]; +extern const char text1_1[]; +extern const char text1_2[]; +extern const char text1_3[]; +extern const char text1_4[]; +extern const char text1_5[]; +extern const char text1_6[]; +extern const char text1_7[]; +extern const char text1_8[]; +extern const char text1_9[]; +extern const char text1_10[]; +extern const char text1_11[]; +extern const char text1_12[]; +extern const char text1_13[]; +extern const char text1_14[]; +extern const char text1_15[]; +extern const char text1_16[]; +extern const char text1_17[]; +extern const char text1_18[]; +extern const char text1_19[]; +extern const char text1_20[]; +extern const char text1_21[]; +extern const char text1_22[]; +extern const char text1_23[]; +extern const char text1_24[]; +extern const char text1_25[]; +extern const char text1_26[]; +extern const char text1_27[]; +extern const char text1_28[]; +extern const char text1_29[]; +extern const char text1_30[]; +extern const char text1_31[]; +extern const char text1_32[]; +extern const char text1_33[]; +extern const char text1_34[]; +extern const char text1_35[]; +extern const char text1_36[]; +extern const char text1_37[]; +extern const char text1_38[]; +extern const char text1_39[]; +extern const char text1_40[]; +extern const char text1_41[]; +extern const char text1_42[]; +extern const char text1_43[]; +extern const char text1_44[]; +extern const char text1_45[]; +extern const char text1_46[]; +extern const char text1_47[]; +extern const char text1_48[]; +extern const char text1_49[]; +extern const char text1_50[]; +extern const char text1_51[]; +extern const char text1_52[]; +extern const char text1_53[]; +extern const char text1_54[]; +extern const char text1_55[]; +extern const char text1_56[]; +extern const char text1_57[]; +extern const char text1_58[]; +extern const char text1_59[]; +extern const char text1_60[]; +extern const char text1_61[]; +extern const char text1_62[]; //SDInterface.cpp texts -PROGMEM const char text2_0[] = "Error, could not find update.bin"; -PROGMEM const char text2_1[] = "Starting SD Update..."; -PROGMEM const char text2_2[] = "Error, update.bin is empty"; -PROGMEM const char text2_3[] = "\nRebooting...\n"; -PROGMEM const char text2_4[] = "Could not load update.bin from /"; -PROGMEM const char text2_5[] = "File size: "; -PROGMEM const char text2_6[] = "Writing file to partition..."; -PROGMEM const char text2_7[] = "Written: "; -PROGMEM const char text2_8[] = "Written only : "; -PROGMEM const char text2_9[] = ". Retry?"; -PROGMEM const char text2_10[] = " successfully"; -PROGMEM const char text2_11[] = "Update complete"; -PROGMEM const char text2_12[] = "Update could not complete"; -PROGMEM const char text2_13[] = "Error Occurred. Error #: "; -PROGMEM const char text2_14[] = "Not enough space to begin OTA"; +extern const char text2_0[]; +extern const char text2_1[]; +extern const char text2_2[]; +extern const char text2_3[]; +extern const char text2_4[]; +extern const char text2_5[]; +extern const char text2_6[]; +extern const char text2_7[]; +extern const char text2_8[]; +extern const char text2_9[]; +extern const char text2_10[]; +extern const char text2_11[]; +extern const char text2_12[]; +extern const char text2_13[]; +extern const char text2_14[]; //Web.cpp texts -PROGMEM const char text3_0[] = "Configuring update server...\n\n"; -PROGMEM const char text3_1[] = "IP address: "; -PROGMEM const char text3_2[] = "Update: "; -PROGMEM const char text3_3[] = "Bytes complete: "; -PROGMEM const char text3_4[] = "Update Success: "; -PROGMEM const char text3_5[] = "\nCompleted update server setup"; +extern const char text3_0[]; +extern const char text3_1[]; +extern const char text3_2[]; +extern const char text3_3[]; +extern const char text3_4[]; +extern const char text3_5[]; //WiFiScan.cpp texts -PROGMEM const char text4_0[] = " RSSI: "; -PROGMEM const char text4_1[] = "Potential Skimmer: "; -PROGMEM const char text4_2[] = "Already Connected"; -PROGMEM const char text4_3[] = "Failed to connect"; -PROGMEM const char text4_4[] = "Connected"; -PROGMEM const char text4_5[] = "ForcePMKID"; -PROGMEM const char text4_6[] = "ForceProbe"; -PROGMEM const char text4_7[] = "SavePCAP"; -PROGMEM const char text4_8[] = "Probe Flood"; -PROGMEM const char text4_9[] = "Clearing APs..."; -PROGMEM const char text4_10[] = "APs Cleared: "; -PROGMEM const char text4_11[] = "Clearing SSIDs..."; -PROGMEM const char text4_12[] = "SSIDs Cleared: "; -PROGMEM const char text4_13[] = "Generating SSIDs..."; -PROGMEM const char text4_14[] = "SSIDs Generated: "; //Add spaces before to match : [15] -PROGMEM const char text4_15[] = " Total SSIDs: "; //Add spaces beforer to match : [14] -PROGMEM const char text4_16[] = "Shutting down WiFi..."; -PROGMEM const char text4_17[] = "WiFi not currently initialized"; -PROGMEM const char text4_18[] = "Shutting down BLE..."; -PROGMEM const char text4_19[] = "BLE not currently initialized"; -PROGMEM const char text4_20[] = "Firmware: Marauder"; //From 20 to 35 add spaces so : is in line like it is now -PROGMEM const char text4_21[] = "Version: "; -PROGMEM const char text4_22[] = "ESP-IDF: "; -PROGMEM const char text4_23[] = "WSL Bypass: enabled"; -PROGMEM const char text4_24[] = "WSL Bypass: disabled"; -PROGMEM const char text4_25[] = "Station MAC: "; -PROGMEM const char text4_26[] = "AP MAC: "; -PROGMEM const char text4_27[] = ""; -PROGMEM const char text4_28[] = "SD Card: Connected"; -PROGMEM const char text4_29[] = "SD Card Size: "; -PROGMEM const char text4_30[] = "SD Card: Not Connected"; -PROGMEM const char text4_31[] = "SD Card Size: 0"; -PROGMEM const char text4_32[] = "IP5306 I2C: supported"; -PROGMEM const char text4_33[] = "Battery Lvl: "; -PROGMEM const char text4_34[] = "IP5306 I2C: not supported"; -PROGMEM const char text4_35[] = "Internal temp: "; -PROGMEM const char text4_36[] = " Detect Espressif "; -PROGMEM const char text4_37[] = " Detect Pwnagotchi "; -PROGMEM const char text4_38[] = " Beacon Sniffer "; -PROGMEM const char text4_39[] = " Deauthentication Sniffer "; -PROGMEM const char text4_40[] = " Probe Request Sniffer "; -PROGMEM const char text4_41[] = " Bluetooth Sniff "; -PROGMEM const char text4_42[] = " Detect Card Skimmers "; -PROGMEM const char text4_43[] = "Scanning for\nBluetooth-enabled skimmers\nHC-03, HC-05, and HC-06..."; -PROGMEM const char text4_44[] = " AP Scan "; -PROGMEM const char text4_45[] = "Clearing Stations..."; -PROGMEM const char text4_46[] = "Stations Cleared: "; -PROGMEM const char text4_47[] = "Targeted Deauth"; +extern const char text4_0[]; +extern const char text4_1[]; +extern const char text4_2[]; +extern const char text4_3[]; +extern const char text4_4[]; +extern const char text4_5[]; +extern const char text4_6[]; +extern const char text4_7[]; +extern const char text4_8[]; +extern const char text4_9[]; +extern const char text4_10[]; +extern const char text4_11[]; +extern const char text4_12[]; +extern const char text4_13[]; +extern const char text4_14[]; //Add spaces before to match : [15] +extern const char text4_15[]; //Add spaces beforer to match : [14] +extern const char text4_16[]; +extern const char text4_17[]; +extern const char text4_18[]; +extern const char text4_19[]; +extern const char text4_20[]; //From 20 to 35 add spaces so : is in line like it is now +extern const char text4_21[]; +extern const char text4_22[]; +extern const char text4_23[]; +extern const char text4_24[]; +extern const char text4_25[]; +extern const char text4_26[]; +extern const char text4_27[]; +extern const char text4_28[]; +extern const char text4_29[]; +extern const char text4_30[]; +extern const char text4_31[]; +extern const char text4_32[]; +extern const char text4_33[]; +extern const char text4_34[]; +extern const char text4_35[]; +extern const char text4_36[]; +extern const char text4_37[]; +extern const char text4_38[]; +extern const char text4_39[]; +extern const char text4_40[]; +extern const char text4_41[]; +extern const char text4_42[]; +extern const char text4_43[]; +extern const char text4_44[]; +extern const char text4_45[]; +extern const char text4_46[]; +extern const char text4_47[]; //Making tables -PROGMEM const char *text_table0[] = {text0_0,text0_1, text0_2, text0_3, text0_4, text0_5, text0_6, text0_7, text0_8}; -PROGMEM const char *text_table1[] = {text1_0,text1_1,text1_2,text1_3,text1_4,text1_5,text1_6,text1_7,text1_8,text1_9,text1_10,text1_11,text1_12,text1_13,text1_14,text1_15,text1_16,text1_17,text1_18,text1_19,text1_20,text1_21,text1_22,text1_23,text1_24,text1_25,text1_26,text1_27,text1_28,text1_29,text1_30,text1_31,text1_32,text1_33,text1_34,text1_35,text1_36,text1_37,text1_38,text1_39,text1_40,text1_41,text1_42,text1_43,text1_44,text1_45,text1_46,text1_47,text1_48,text1_49,text1_50,text1_51,text1_52,text1_53,text1_54,text1_55,text1_56,text1_57,text1_58,text1_59,text1_60,text1_61,text1_62}; -PROGMEM const char *text_table2[] = {text2_0,text2_1,text2_2,text2_3,text2_4,text2_5,text2_6,text2_7,text2_8,text2_9,text2_10,text2_11,text2_12,text2_13,text2_14}; -PROGMEM const char *text_table3[] = {text3_0,text3_1,text3_2,text3_3,text3_4,text3_5}; -PROGMEM const char *text_table4[] = {text4_0,text4_1,text4_2,text4_3,text4_4,text4_5,text4_6,text4_7,text1_54,text4_9,text4_10,text4_11,text4_12,text4_13,text4_14,text4_15,text4_16,text4_17,text4_18,text4_19,text4_20,text4_21,text4_22,text4_23,text4_24,text4_25,text4_26,text4_27,text4_28,text4_29,text4_30,text4_31,text4_32,text4_33,text4_34,text4_35,text4_36,text4_37,text4_38,text4_39,text4_40,text4_41,text4_42,text4_43,text4_44,text4_45,text4_46,text4_47}; +extern const char *text_table0[]; +extern const char *text_table1[]; +extern const char *text_table2[]; +extern const char *text_table3[]; +extern const char *text_table4[]; #endif diff --git a/esp32_marauder/settings.cpp b/esp32_marauder/settings.cpp index 83bc12550..a6d4c5bd6 100644 --- a/esp32_marauder/settings.cpp +++ b/esp32_marauder/settings.cpp @@ -5,35 +5,59 @@ String Settings::getSettingsString() { } bool Settings::begin() { + #ifndef USE_FFAT if(!SPIFFS.begin(FORMAT_SPIFFS_IF_FAILED)){ Serial.println("Settings SPIFFS Mount Failed"); return false; } + #else + if(!FFat.begin(FORMAT_SPIFFS_IF_FAILED)){ + return false; + } + Serial.println("Using FFat"); + + File root = FFat.open("/"); + if(!root){ + Serial.println("failed to open root directory - formatiing"); + FFat.format(); + } + else { + Serial.println("FFat root good"); + root.close(); + } + Serial.println("Found default fs FFat"); + #endif File settingsFile; //SPIFFS.remove("/settings.json"); // NEED TO REMOVE THIS LINE + #ifndef USE_FFAT if (SPIFFS.exists("/settings.json")) { - settingsFile = SPIFFS.open("/settings.json", FILE_READ); - - if (!settingsFile) { + settingsFile = SPIFFS.open("/settings.json", FILE_READ); + } + #else + if(FFat.exists("/settings.json")) { + settingsFile = FFat.open("/settings.json", FILE_READ); + } + #endif + + if (!settingsFile) { settingsFile.close(); Serial.println(F("Could not find settings file")); + #ifndef USE_FFAT if (this->createDefaultSettings(SPIFFS)) return true; + #else + if (this->createDefaultSettings(FFat)) + return true; + #endif else - return false; - } - } - else { - Serial.println("Settings file does not exist"); - if (this->createDefaultSettings(SPIFFS)) - return true; - else - return false; + return false; } + Serial.println("Created settings file"); + String json_string; DynamicJsonDocument jsonBuffer(1024); DeserializationError error = deserializeJson(jsonBuffer, settingsFile); @@ -131,6 +155,7 @@ bool Settings::saveSetting(String key, bool value) { } String settings_string; + File settingsFile; for (int i = 0; i < json["Settings"].size(); i++) { if (json["Settings"][i]["name"].as() == key) { @@ -138,10 +163,15 @@ bool Settings::saveSetting(String key, bool value) { Serial.println("Saving setting..."); - File settingsFile = SPIFFS.open("/settings.json", FILE_WRITE); - + #ifndef USE_FFAT + settingsFile = SPIFFS.open("/settings.json", FILE_WRITE); + #else + settingsFile = FFat.open("/settings.json", FILE_WRITE); + #endif + if (!settingsFile) { - Serial.println(F("Failed to create settings file")); + Serial.print(F("Failed to create settings file - ")); + Serial.println(settingsFile, DEC); return false; } @@ -245,7 +275,8 @@ bool Settings::createDefaultSettings(fs::FS &fs) { File settingsFile = fs.open("/settings.json", FILE_WRITE); if (!settingsFile) { - Serial.println(F("Failed to create settings file")); + Serial.print(F("Failed to create settings file - ")); + Serial.println(settingsFile, DEC); return false; } diff --git a/esp32_marauder/settings.h b/esp32_marauder/settings.h index c85b67516..b7be2051b 100644 --- a/esp32_marauder/settings.h +++ b/esp32_marauder/settings.h @@ -5,7 +5,11 @@ #include "configs.h" +#ifndef USE_FFAT #include "SPIFFS.h" +#else +#include "FFat.h" +#endif #include #include