Compare commits

...

23 Commits

Author SHA1 Message Date
Just Call Me Koko
ba92978080 Merge pull request #500 from justcallmekoko/develop
UI and Bootloop fixes, Adafruit Reverse Feather
2024-02-27 13:11:48 -05:00
Just Call Me Koko
d183894223 Increased Mini button list size to 100
This will allow for larger AP lists. Mfers in apartment buildings will still be mad
2024-02-24 20:44:12 -05:00
Just Call Me Koko
194549427a Fix mini SD update display text 2024-02-24 20:23:32 -05:00
Just Call Me Koko
4ea3166f1a Fix v6 status bar ram refresh 2024-02-24 20:13:25 -05:00
Just Call Me Koko
4188819965 Fix mini and v6 status bar channel refresh 2024-02-24 19:59:23 -05:00
Just Call Me Koko
2cf39700ee Fix num sats on status bar 2024-02-24 19:41:06 -05:00
Just Call Me Koko
cfb582c847 Fix TFT_eSPI tag name 2024-02-23 00:03:52 -05:00
Just Call Me Koko
5bd4b647b5 Add support for Adafruit Reverse Feather ESP32-S2 2024-02-22 23:54:03 -05:00
Just Call Me Koko
58c93ed401 Add remove SD files for Mini 2024-02-20 15:40:52 -05:00
Just Call Me Koko
a10434329a Merge pull request #485 from justcallmekoko/master
Merge pull request #484 from justcallmekoko/develop
2024-02-16 12:20:02 -05:00
Just Call Me Koko
e80fab89b7 Merge pull request #484 from justcallmekoko/develop
Develop
2024-02-16 12:01:49 -05:00
Just Call Me Koko
8b53b56d48 Merge branch 'develop' of https://github.com/justcallmekoko/ESP32Marauder into develop 2024-02-14 02:30:26 -05:00
Just Call Me Koko
f8cf90a298 Add Mini Keyboard 2024-02-14 02:30:21 -05:00
Just Call Me Koko
c7f1b5cb38 Merge pull request #481 from 0xchocolate/develop
Fix Portal to prompt for sign-in on Android
2024-02-13 15:32:38 -05:00
Just Call Me Koko
4c9adac032 Add mini SMA enclosure 2024-02-13 15:31:47 -05:00
0xchocolate
23015fe49e Change EP default IP address 2024-02-11 10:37:08 -08:00
Just Call Me Koko
0b0247f6ba Fix mini enclosure 2024-02-07 11:45:12 -05:00
Just Call Me Koko
eed4d7c31f Merge pull request #474 from justcallmekoko/master
Merge pull request #473 from justcallmekoko/develop
2024-02-04 14:22:43 -05:00
Just Call Me Koko
c75bd6a098 Merge pull request #473 from justcallmekoko/develop
Develop
2024-02-04 14:07:15 -05:00
Just Call Me Koko
b5337fcff5 Add disable touch 2024-02-04 13:43:01 -05:00
Just Call Me Koko
24a1862ef6 Merge pull request #469 from justcallmekoko/master
Merge pull request #468 from justcallmekoko/develop
2024-02-01 10:35:33 -05:00
Just Call Me Koko
971abc5390 Merge pull request #468 from justcallmekoko/develop
Develop
2024-02-01 10:13:29 -05:00
Just Call Me Koko
43c82dd5a3 Merge pull request #467 from justcallmekoko/unified-serial
Unified serial
2024-02-01 09:55:10 -05:00
25 changed files with 1068 additions and 235 deletions

View File

@@ -56,19 +56,12 @@ jobs:
repository: bigbrodude6119/ESPAsyncWebServer
ref: master
path: CustomESPAsyncWebServer
#- name: Install TFT_eSPI
# uses: actions/checkout@v2
# with:
# repository: justcallmekoko/TFT_eSPI
# ref: master
# path: CustomTFT_eSPI
- name: Install TFT_eSPI
uses: actions/checkout@v2
with:
repository: Bodmer/TFT_eSPI
ref: 2.2.23
ref: V2.5.34
path: CustomTFT_eSPI
- name: Install lv_arduino
@@ -106,12 +99,12 @@ jobs:
ref: v6.18.2
path: CustomArduinoJson
- name: Install SwitchLib
uses: actions/checkout@v2
with:
repository: justcallmekoko/SwitchLib
ref: main
path: CustomSwitchLib
#- name: Install SwitchLib
# uses: actions/checkout@v2
# with:
# repository: justcallmekoko/SwitchLib
# ref: main
# path: CustomSwitchLib
- name: Install LinkedList
uses: actions/checkout@v2
@@ -138,6 +131,7 @@ jobs:
cp User_Setup_marauder_mini.h CustomTFT_eSPI/
cp User_Setup_og_marauder.h CustomTFT_eSPI/
cp User_Setup_marauder_m5stickc.h CustomTFT_eSPI/
cp User_Setup_marauder_rev_feather.h CustomTFT_eSPI/
pwd
ls -la
ls -la CustomTFT_eSPI
@@ -182,6 +176,7 @@ jobs:
- name: Configure configs.h for Flipper Zero WiFi Dev Board
run: |
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
@@ -218,9 +213,11 @@ jobs:
- name: Configure TFT_eSPI and configs.h for OG Marauder
run: |
pwd
find /home/runner/ -name "*TFT_eSPI*"
find /home/runner/ -name "*TFT_eSPI*"
sed -i 's/^#include <User_Setup_marauder_rev_feather.h>/\/\/#include <User_Setup_marauder_rev_feather.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^#include <User_Setup_marauder_mini.h>/\/\/#include <User_Setup_marauder_mini.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^\/\/#include <User_Setup_og_marauder.h>/#include <User_Setup_og_marauder.h>/' /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
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
@@ -244,8 +241,10 @@ jobs:
- name: Configure TFT_eSPI and configs.h for Marauder v6
run: |
sed -i 's/^#include <User_Setup_marauder_rev_feather.h>/\/\/#include <User_Setup_marauder_rev_feather.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^#include <User_Setup_marauder_mini.h>/\/\/#include <User_Setup_marauder_mini.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^\/\/#include <User_Setup_og_marauder.h>/#include <User_Setup_og_marauder.h>/' /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
sed -i 's/^ \/\/#define MARAUDER_V6/ #define MARAUDER_V6/' esp32_marauder/configs.h
@@ -286,6 +285,7 @@ jobs:
- name: Configure TFT_eSPI and configs.h for Marauder v6.1
run: |
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
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
@@ -311,6 +311,7 @@ jobs:
run: |
sed -i 's/^#include <User_Setup_marauder_mini.h>/\/\/#include <User_Setup_marauder_mini.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^\/\/#include <User_Setup_og_marauder.h>/#include <User_Setup_og_marauder.h>/' /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
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
@@ -336,6 +337,7 @@ jobs:
run: |
sed -i 's/^\/\/#include <User_Setup_marauder_mini.h>/#include <User_Setup_marauder_mini.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^#include <User_Setup_og_marauder.h>/\/\/#include <User_Setup_og_marauder.h>/' /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
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
@@ -359,6 +361,7 @@ jobs:
- name: Configure TFT_eSPI and configs.h for ESP32 LDDB
run: |
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
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
@@ -382,6 +385,7 @@ jobs:
- name: Configure TFT_eSPI and configs.h for Marauder Dev Board Pro
run: |
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
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
@@ -409,6 +413,7 @@ jobs:
find /home/runner/ -name "*TFT_eSPI*"
sed -i 's/^#include <User_Setup_marauder_mini.h>/\/\/#include <User_Setup_marauder_mini.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^\/\/#include <User_Setup_marauder_m5stickc.h>/#include <User_Setup_marauder_m5stickc.h>/' /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
sed -i 's/^ #define MARAUDER_V6/ \/\/#define MARAUDER_V6/' esp32_marauder/configs.h
@@ -430,6 +435,36 @@ jobs:
- name: Rename Marauder M5StickC bin
run: |
mv ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.m5stickc_plus.bin
- name: Configure TFT_eSPI and configs.h for Marauder Rev Feather
run: |
pwd
find /home/runner/ -name "*TFT_eSPI*"
sed -i 's/^\/\/#include <User_Setup_marauder_rev_feather.h>/#include <User_Setup_marauder_rev_feather.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^#include <User_Setup_marauder_mini.h>/\/\/#include <User_Setup_marauder_mini.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.h
sed -i 's/^#include <User_Setup_marauder_m5stickc.h>/\/\/#include <User_Setup_marauder_m5stickc.h>/' /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
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 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
sed -i 's/^ #define MARAUDER_M5STICKC/ \/\/#define MARAUDER_M5STICKC/' esp32_marauder/configs.h
- name: Build Marauder for Marauder Rev Feather
uses: ArminJo/arduino-test-compile@v3.2.1
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=4M,PSRAM=enabled
extra-arduino-cli-args: "--warnings none"
- name: Rename Marauder Marauder Rev Feather
run: |
mv ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.rev_feather.bin
- name: Display finished bins
run: |
@@ -505,6 +540,13 @@ jobs:
path: ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.m5stickc_plus.bin
retention-days: 5
- name: 'Upload Rev Feather Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.rev_feather.bin
path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.rev_feather.bin
retention-days: 5
- name: Create Release
id: create_release
uses: actions/create-release@v1
@@ -636,3 +678,15 @@ jobs:
asset_name: esp32_marauder.m5stickc_plus.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'
- name: Upload Rev Feather Asset
id: upload-rev-feather-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.rev_feather.bin
asset_name: esp32_marauder.rev_feather.bin
asset_content_type: application/bin
if: github.event_name != 'pull_request'

View File

@@ -24,6 +24,7 @@
#include <User_Setup_og_marauder.h>
//#include <User_Setup_marauder_mini.h>
//#include <User_Setup_marauder_m5stickc.h>
//#include <User_Setup_marauder_rev_feather.h>
//#include <User_Setups/Setup1_ILI9341.h> // Setup file configured for my ILI9341
//#include <User_Setups/Setup2_ST7735.h> // Setup file configured for my ST7735

View File

@@ -43,8 +43,8 @@
// For ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display
// Try ONE option at a time to find the correct colour order for your display
#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
// For M5Stack ESP32 module with integrated ILI9341 display ONLY, remove // in line below

View File

@@ -0,0 +1,59 @@
// ST7789 135 x 240 display with no chip select line
#define ST7789_DRIVER // Configure all registers
#define TFT_WIDTH 135
#define TFT_HEIGHT 240
#define CGRAM_OFFSET // Library will add offsets required
//#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
// DSTIKE stepup
//#define TFT_DC 23
//#define TFT_RST 32
//#define TFT_MOSI 26
//#define TFT_SCLK 27
// Generic ESP32 setup
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS -1 // Not connected
//#define TFT_DC 2
//#define TFT_RST 4 // Connect reset to ensure display initialises
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
#define TFT_MISO 37
#define TFT_MOSI 35
#define TFT_SCLK 36
#define TFT_CS 42 // Define as not used
#define TFT_DC 40 // Data Command control pin
#define TFT_RST 41 // TFT reset pin (could connect to NodeMCU RST, see next line)
#define TFT_BL 45
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
#define SMOOTH_FONT
// #define SPI_FREQUENCY 27000000
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 20000000
#define SPI_TOUCH_FREQUENCY 2500000
// #define SUPPORT_TRANSACTIONS

View File

@@ -0,0 +1,8 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
]
}

View File

@@ -200,7 +200,10 @@ PROGMEM static const unsigned char menu_icons[][66] = {
0x1F, 0xD0, 0x3F, 0x3F, 0xE0, 0x3F, 0x5F, 0xF0, 0x3F, 0xEF, 0xE8, 0x3F,
0xF7, 0xE5, 0x3B, 0xFB, 0xDE, 0x3A, 0x7D, 0xFF, 0x3A, 0xBB, 0x7F, 0x3B,
0xD7, 0x9F, 0x3D, 0xEF, 0xFF, 0x3E, 0xFF, 0x0F, 0x3F, 0xFF, 0xFF, 0x3F,
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
{0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3, // DISABLED TOUCH: 34
0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0,
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF}
};
#ifndef MARAUDER_MINI

View File

@@ -28,6 +28,10 @@ void Display::RunSetup()
tft.setRotation(1);
#endif
#ifdef MARAUDER_REV_FEATHER
tft.setRotation(1);
#endif
tft.setCursor(0, 0);
#ifdef HAS_ILI9341
@@ -53,6 +57,14 @@ void Display::RunSetup()
#ifdef KIT
pinMode(KIT_LED_BUILTIN, OUTPUT);
#endif
#ifdef MARAUDER_REV_FEATHER
pinMode(7, OUTPUT);
delay(10);
digitalWrite(7, HIGH);
#endif
}
void Display::drawFrame()

View File

@@ -92,7 +92,11 @@ bool EvilPortal::setHtml() {
return true;
}
Serial.println("Setting HTML...");
File html_file = sd_obj.getFile("/" + this->target_html_name);
#ifdef HAS_SD
File html_file = sd_obj.getFile("/" + this->target_html_name);
#else
File html_file;
#endif
if (!html_file) {
#ifdef HAS_SCREEN
this->sendToDisplay("Could not find /" + this->target_html_name);
@@ -139,7 +143,11 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
// If there are no SSIDs and there are no APs selected, pull from file
// This means the file is last resort
if ((ssids->size() <= 0) && (temp_ap_name == "")) {
File ap_config_file = sd_obj.getFile("/ap.config.txt");
#ifdef HAS_SD
File ap_config_file = sd_obj.getFile("/ap.config.txt");
#else
File ap_config_file;
#endif
// Could not open config file. return false
if (!ap_config_file) {
#ifdef HAS_SCREEN
@@ -234,10 +242,13 @@ bool EvilPortal::setAP(LinkedList<ssid>* ssids, LinkedList<AccessPoint>* access_
}
void EvilPortal::startAP() {
const IPAddress AP_IP(172, 0, 0, 1);
Serial.print("starting ap ");
Serial.println(apName);
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(AP_IP, AP_IP, IPAddress(255, 255, 255, 0));
WiFi.softAP(apName);
#ifdef HAS_SCREEN

View File

@@ -12,7 +12,7 @@ HardwareSerial Serial2(GPS_SERIAL_INDEX);
void GpsInterface::begin() {
#ifdef MARAUDER_MINI
/*#ifdef MARAUDER_MINI
pinMode(26, OUTPUT);
delay(1);
@@ -22,7 +22,7 @@ void GpsInterface::begin() {
Serial.println("Activated GPS");
delay(100);
#endif
#endif*/
Serial2.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX);
@@ -37,8 +37,13 @@ void GpsInterface::begin() {
if (Serial2.available()) {
Serial.println("GPS Attached Successfully");
this->gps_enabled = true;
while (Serial2.available())
Serial2.read();
while (Serial2.available()) {
//Fetch the character one by one
char c = Serial2.read();
//Serial.print(c);
//Pass the character to the library
nmea.process(c);
}
}
else {
this->gps_enabled = false;
@@ -525,6 +530,10 @@ String GpsInterface::getNumSatsString() {
return (String)num_sats;
}
int GpsInterface::getNumSats() {
return num_sats;
}
bool GpsInterface::getFixStatus() {
return this->good_fix;
}

View File

@@ -39,6 +39,7 @@ class GpsInterface {
void begin();
void main();
int getNumSats();
String getNumSatsString();
bool getFixStatus();
String getFixStatusAsString();

View File

@@ -519,9 +519,6 @@ void MenuFunctions::main(uint32_t currentTime)
if ((wifi_scan_obj.currentScanMode != LV_JOIN_WIFI) &&
(wifi_scan_obj.currentScanMode != LV_ADD_SSID))
this->updateStatusBar();
//#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
// display_obj.updateBanner(current_menu->name);
//#endif
}
}
@@ -548,7 +545,8 @@ void MenuFunctions::main(uint32_t currentTime)
// getTouch causes a 10ms delay which makes beacon spam less effective
#ifdef HAS_ILI9341
pressed = this->updateTouch(&t_x, &t_y);
if (!this->disable_touch)
pressed = this->updateTouch(&t_x, &t_y);
#endif
@@ -615,67 +613,70 @@ void MenuFunctions::main(uint32_t currentTime)
#ifdef HAS_BUTTONS
bool c_btn_press = c_btn.justPressed();
#ifndef HAS_ILI9341
if ((c_btn_press) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
(wifi_scan_obj.currentScanMode != ESP_UPDATE) &&
(wifi_scan_obj.currentScanMode != SHOW_INFO) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA))
{
// Stop the current scan
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AP_SPAM) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AUTH) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_ALL) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_GOOGLE_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR))
if ((c_btn_press) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
(wifi_scan_obj.currentScanMode != ESP_UPDATE) &&
(wifi_scan_obj.currentScanMode != SHOW_INFO) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_DATA) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_GPS_NMEA))
{
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
// If we don't do this, the text and button coordinates will be off
display_obj.tft.init();
// Take us back to the menu
changeMenu(current_menu);
// Stop the current scan
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_PROBE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EVIL_PORTAL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ESPRESSIF) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ALL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_DEAUTH) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AP_SPAM) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_AUTH) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_MANUAL) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_DEAUTH_TARGETED) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_MIMIC) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
(wifi_scan_obj.currentScanMode == WIFI_ATTACK_BEACON_LIST) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_ALL) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SOUR_APPLE) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SWIFTPAIR_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SPAM_ALL) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_SAMSUNG_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_ATTACK_GOOGLE_SPAM) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_WAR_DRIVE_CONT) ||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR))
{
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
// If we don't do this, the text and button coordinates will be off
display_obj.tft.init();
// Take us back to the menu
changeMenu(current_menu);
}
x = -1;
y = -1;
return;
}
x = -1;
y = -1;
return;
}
#endif
#endif
@@ -926,13 +927,21 @@ void MenuFunctions::battery2(bool initial)
void MenuFunctions::updateStatusBar()
{
display_obj.tft.setTextSize(1);
bool status_changed = false;
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER)
display_obj.tft.setFreeFont(NULL);
#endif
uint16_t the_color;
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()) {
@@ -962,53 +971,75 @@ void MenuFunctions::updateStatusBar()
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
// WiFi Channel Stuff
if (wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) {
if ((wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) || (status_changed)) {
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
display_obj.tft.fillRect(50, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#if 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);
#endif
#ifdef HAS_ILI9341
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
#endif
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if 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
}
// RAM Stuff
wifi_scan_obj.freeRAM();
if (wifi_scan_obj.free_ram != wifi_scan_obj.old_free_ram) {
if ((wifi_scan_obj.free_ram != wifi_scan_obj.old_free_ram) || (status_changed)) {
wifi_scan_obj.old_free_ram = wifi_scan_obj.free_ram;
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifdef HAS_ILI9341
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
#endif
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if 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
}
// Draw battery info
MenuFunctions::battery(false);
//MenuFunctions::battery(false);
display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifdef HAS_ILI9341
#ifdef HAS_BUTTONS
if (this->disable_touch) {
display_obj.tft.setCursor(0, 1);
display_obj.tft.drawXBitmap(190,
0,
menu_icons[DISABLE_TOUCH],
16,
16,
STATUSBAR_COLOR,
TFT_RED);
}
#endif
#endif
// Draw SD info
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
#ifdef HAS_SD
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
#ifdef HAS_ILI9341
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
16,
16,
STATUSBAR_COLOR,
the_color);
#ifdef HAS_ILI9341
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
16,
16,
STATUSBAR_COLOR,
the_color);
#endif
#endif
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if 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
@@ -1017,7 +1048,7 @@ void MenuFunctions::updateStatusBar()
void MenuFunctions::drawStatusBar()
{
display_obj.tft.setTextSize(1);
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if 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);
@@ -1053,12 +1084,16 @@ void MenuFunctions::drawStatusBar()
// WiFi Channel Stuff
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#if 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);
#endif
#ifdef HAS_ILI9341
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
#endif
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if 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
@@ -1070,30 +1105,49 @@ 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)
#if 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
MenuFunctions::battery2(true);
// Draw SD info
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
//MenuFunctions::battery2(true);
display_obj.tft.fillRect(190, 0, SCREEN_WIDTH, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#ifdef HAS_ILI9341
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
16,
16,
STATUSBAR_COLOR,
the_color);
#ifdef HAS_BUTTONS
if (this->disable_touch) {
display_obj.tft.setCursor(0, 1);
display_obj.tft.drawXBitmap(190,
0,
menu_icons[DISABLE_TOUCH],
16,
16,
STATUSBAR_COLOR,
TFT_RED);
}
#endif
#endif
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
// Draw SD info
#ifdef HAS_SD
if (sd_obj.supported)
the_color = TFT_GREEN;
else
the_color = TFT_RED;
#ifdef HAS_ILI9341
display_obj.tft.drawXBitmap(170,
0,
menu_icons[STATUS_SD],
16,
16,
STATUSBAR_COLOR,
the_color);
#endif
#endif
#if 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
@@ -1168,6 +1222,8 @@ void MenuFunctions::displaySetting(String key, Menu* menu, int index) {
void MenuFunctions::RunSetup()
{
extern LinkedList<AccessPoint>* access_points;
this->disable_touch = false;
#ifdef HAS_ILI9341
this->initLVGL();
@@ -1204,6 +1260,16 @@ void MenuFunctions::RunSetup()
// WiFi HTML menu stuff
htmlMenu.list = new LinkedList<MenuNode>();
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
miniKbMenu.list = new LinkedList<MenuNode>();
#endif
#ifndef HAS_ILI9341
#ifdef HAS_BUTTONS
#ifdef HAS_SD
sdDeleteMenu.list = new LinkedList<MenuNode>();
#endif
#endif
#endif
// Bluetooth menu stuff
bluetoothSnifferMenu.list = new LinkedList<MenuNode>();
@@ -1239,6 +1305,14 @@ void MenuFunctions::RunSetup()
gpsInfoMenu.name = "GPS Data";
#endif
htmlMenu.name = "EP HTML List";
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
miniKbMenu.name = "Mini Keyboard";
#endif
#ifdef HAS_SD
#ifndef HAS_ILI9341
sdDeleteMenu.name = "Delete SD Files";
#endif
#endif
// Build Main Menu
mainMenu.parentMenu = NULL;
@@ -1419,6 +1493,12 @@ void MenuFunctions::RunSetup()
addSSIDGFX();
});
#endif
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
this->addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
this->changeMenu(&miniKbMenu);
this->miniKeyboard(&miniKbMenu);
});
#endif
this->addNodes(&wifiGeneralMenu, text_table1[28], TFT_SILVER, NULL, CLEAR_ICO, [this]() {
this->changeMenu(&clearSSIDsMenu);
wifi_scan_obj.RunClearSSIDs();
@@ -1451,10 +1531,10 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED);
selectEPHTMLGFX();
});
#else
#else // Mini EP HTML select
this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){
this->changeMenu(&htmlMenu);
#ifdef HAS_BUTTONS
#if (defined(HAS_BUTTONS) && defined(HAS_SD))
#if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1))
while(true) {
if (d_btn.justPressed()) {
@@ -1463,7 +1543,6 @@ void MenuFunctions::RunSetup()
else
evil_portal_obj.selected_html_index = evil_portal_obj.html_files->size() - 1;
//Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(&htmlMenu);
this->displayCurrentMenu();
@@ -1475,7 +1554,6 @@ void MenuFunctions::RunSetup()
else
evil_portal_obj.selected_html_index = 0;
//Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(&htmlMenu, 0, evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index));
this->displayCurrentMenu();
@@ -1495,22 +1573,18 @@ void MenuFunctions::RunSetup()
#endif
});
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
miniKbMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&miniKbMenu, "a", TFT_CYAN, NULL, 0, [this]() {
this->changeMenu(miniKbMenu.parentMenu);
});
#endif
htmlMenu.parentMenu = &wifiGeneralMenu;
this->addNodes(&htmlMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(htmlMenu.parentMenu);
});
/*int loopLimit = min(evil_portal_obj.html_files->size(), BUTTON_ARRAY_LEN);
for (int i = 0; i < loopLimit - 1; i++) {
this->addNodes(&htmlMenu, evil_portal_obj.html_files->get(i), TFT_CYAN, NULL, 0, [this, i]() {
evil_portal_obj.target_html_name = (String)evil_portal_obj.html_files->get(i);
Serial.println("Set Evil Portal HTML as " + evil_portal_obj.target_html_name);
evil_portal_obj.using_serial_html = false;
this->changeMenu(htmlMenu.parentMenu);
});
}*/
// Select APs on Mini
this->addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
wifiAPMenu.list->clear();
@@ -1663,6 +1737,98 @@ void MenuFunctions::RunSetup()
this->addNodes(&deviceMenu, text08, TFT_NAVY, NULL, KEYBOARD_ICO, [this]() {
this->changeMenu(&settingsMenu);
});
#ifdef HAS_SD
if (sd_obj.supported) {
this->addNodes(&deviceMenu, "Delete SD Files", TFT_CYAN, NULL, SD_UPDATE, [this]() {
#ifndef HAS_ILI9341
#ifdef HAS_BUTTONS
this->changeMenu(&sdDeleteMenu);
#if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1))
bool deleting = true;
display_obj.tft.setTextWrap(false);
display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3);
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.tft.println("Loading...");
while (deleting) {
// Build list of files
sd_obj.sd_files->clear();
delete sd_obj.sd_files;
sd_obj.sd_files = new LinkedList<String>();
sd_obj.sd_files->add("Back");
sd_obj.listDirToLinkedList(sd_obj.sd_files);
int sd_file_index = 0;
this->sdDeleteMenu.list->set(0, MenuNode{sd_obj.sd_files->get(sd_file_index), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(&sdDeleteMenu);
this->displayCurrentMenu();
// Start button loop
while(true) {
#ifndef MARAUDER_M5STICKC
if (u_btn.justPressed()) {
if (sd_file_index > 0)
sd_file_index--;
else
sd_file_index = sd_obj.sd_files->size() - 1;
this->sdDeleteMenu.list->set(0, MenuNode{sd_obj.sd_files->get(sd_file_index), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(&sdDeleteMenu);
this->displayCurrentMenu();
}
#endif
if (d_btn.justPressed()) {
if (sd_file_index < sd_obj.sd_files->size() - 1)
sd_file_index++;
else
sd_file_index = 0;
this->sdDeleteMenu.list->set(0, MenuNode{sd_obj.sd_files->get(sd_file_index), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(&sdDeleteMenu, 0, sd_obj.sd_files->get(sd_file_index));
this->displayCurrentMenu();
}
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)))
Serial.println("Successfully Removed File: /" + sd_obj.sd_files->get(sd_file_index));
display_obj.tft.setTextWrap(false);
display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3);
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.tft.println("Deleting /" + sd_obj.sd_files->get(sd_file_index) + "...");
}
else {
this->changeMenu(sdDeleteMenu.parentMenu);
deleting = false;
}
break;
}
}
}
#endif
#endif
#endif
});
}
#endif
#ifdef HAS_SD
#ifndef HAS_ILI9341
#ifdef HAS_BUTTONS
sdDeleteMenu.parentMenu = &deviceMenu;
this->addNodes(&sdDeleteMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(sdDeleteMenu.parentMenu);
});
#endif
#endif
#endif
// GPS Menu
#ifdef HAS_GPS
if (gps_obj.getGpsModuleStatus()) {
@@ -1715,21 +1881,23 @@ void MenuFunctions::RunSetup()
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
this->changeMenu(whichUpdateMenu.parentMenu);
});
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE;
this->changeMenu(&confirmMenu);
});
#ifdef HAS_SD
if (sd_obj.supported) addNodes(&whichUpdateMenu, text_table1[40], TFT_MAGENTA, NULL, SD_UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE;
this->changeMenu(&confirmMenu);
});
// Confirm SD update menu
confirmMenu.parentMenu = &whichUpdateMenu;
this->addNodes(&confirmMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(confirmMenu.parentMenu);
});
this->addNodes(&confirmMenu, text14, TFT_ORANGE, NULL, UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE;
this->changeMenu(&failedUpdateMenu);
sd_obj.runUpdate();
});
// Confirm SD update menu
confirmMenu.parentMenu = &whichUpdateMenu;
this->addNodes(&confirmMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
this->changeMenu(confirmMenu.parentMenu);
});
this->addNodes(&confirmMenu, text14, TFT_ORANGE, NULL, UPDATE, [this]() {
wifi_scan_obj.currentScanMode = OTA_UPDATE;
this->changeMenu(&failedUpdateMenu);
sd_obj.runUpdate();
});
#endif
// Web Update
updateMenu.parentMenu = &deviceMenu;
@@ -1759,6 +1927,187 @@ void MenuFunctions::RunSetup()
this->initTime = millis();
}
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
void MenuFunctions::miniKeyboard(Menu * targetMenu) {
// Prepare a char array and reset temp SSID string
extern LinkedList<ssid>* ssids;
bool pressed = true;
wifi_scan_obj.current_mini_kb_ssid = "";
if (c_btn.isHeld()) {
while (!c_btn.justReleased())
delay(1);
}
int str_len = wifi_scan_obj.alfa.length() + 1;
char char_array[str_len];
wifi_scan_obj.alfa.toCharArray(char_array, str_len);
// Button loop until hold center button
#ifdef HAS_BUTTONS
#if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1))
while(true) {
// Cycle char previous
#ifdef HAS_L
if (l_btn.justPressed()) {
pressed = true;
if (this->mini_kb_index > 0)
this->mini_kb_index--;
else
this->mini_kb_index = str_len - 2;
targetMenu->list->set(0, MenuNode{String(char_array[this->mini_kb_index]).c_str(), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(targetMenu);
while (!l_btn.justReleased())
delay(1);
}
#endif
// Cycle char next
#ifdef HAS_R
if (r_btn.justPressed()) {
pressed = true;
if (this->mini_kb_index < str_len - 2)
this->mini_kb_index++;
else
this->mini_kb_index = 0;
targetMenu->list->set(0, MenuNode{String(char_array[this->mini_kb_index]).c_str(), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(targetMenu, 0, String(char_array[this->mini_kb_index]).c_str());
while (!r_btn.justReleased())
delay(1);
}
#endif
//// 5-WAY SWITCH STUFF
// Add character
#if (defined(HAS_D) && defined(HAS_R))
if (d_btn.justPressed()) {
pressed = true;
wifi_scan_obj.current_mini_kb_ssid.concat(String(char_array[this->mini_kb_index]).c_str());
while (!d_btn.justReleased())
delay(1);
}
#endif
// Remove character
#if (defined(HAS_U) && defined(HAS_L))
if (u_btn.justPressed()) {
pressed = true;
wifi_scan_obj.current_mini_kb_ssid.remove(wifi_scan_obj.current_mini_kb_ssid.length() - 1);
while (!u_btn.justReleased())
delay(1);
}
#endif
//// PARTIAL SWITCH STUFF
// Advance char or add char
#if (defined(HAS_D) && !defined(HAS_R))
if (d_btn.justPressed()) {
bool was_held = false;
pressed = true;
while(!d_btn.justReleased()) {
d_btn.justPressed();
// Add letter to string
if (d_btn.isHeld()) {
wifi_scan_obj.current_mini_kb_ssid.concat(String(char_array[this->mini_kb_index]).c_str());
was_held = true;
break;
}
}
if (!was_held) {
if (this->mini_kb_index < str_len - 2)
this->mini_kb_index++;
else
this->mini_kb_index = 0;
targetMenu->list->set(0, MenuNode{String(char_array[this->mini_kb_index]).c_str(), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(targetMenu, 0, String(char_array[this->mini_kb_index]).c_str());
}
}
#endif
// Prev char or remove char
#if (defined(HAS_U) && !defined(HAS_L))
if (u_btn.justPressed()) {
bool was_held = false;
pressed = true;
while(!u_btn.justReleased()) {
u_btn.justPressed();
// Remove letter from string
if (u_btn.isHeld()) {
wifi_scan_obj.current_mini_kb_ssid.remove(wifi_scan_obj.current_mini_kb_ssid.length() - 1);
was_held = true;
break;
}
}
if (!was_held) {
if (this->mini_kb_index > 0)
this->mini_kb_index--;
else
this->mini_kb_index = str_len - 2;
targetMenu->list->set(0, MenuNode{String(char_array[this->mini_kb_index]).c_str(), false, TFT_CYAN, 0, NULL, true, NULL});
this->buildButtons(targetMenu);
}
}
#endif
// Add SSID
#ifdef HAS_C
if (c_btn.justPressed()) {
while (!c_btn.justReleased()) {
c_btn.justPressed(); // Need to continue updating button hold status. My shitty library.
// Exit
if (c_btn.isHeld()) {
this->changeMenu(targetMenu->parentMenu);
return;
}
delay(1);
}
// If we have a string, add it to list of SSIDs
if (wifi_scan_obj.current_mini_kb_ssid != "") {
pressed = true;
ssid s = {wifi_scan_obj.current_mini_kb_ssid, random(1, 12), {random(256), random(256), random(256), random(256), random(256), random(256)}, false};
ssids->unshift(s);
wifi_scan_obj.current_mini_kb_ssid = "";
}
}
#endif
// Display info on screen
if (pressed) {
this->displayCurrentMenu();
display_obj.tft.setTextWrap(false);
display_obj.tft.fillRect(0, SCREEN_HEIGHT / 3, SCREEN_WIDTH, STATUS_BAR_WIDTH, TFT_BLACK);
display_obj.tft.fillRect(0, SCREEN_HEIGHT / 3 + TEXT_HEIGHT * 2, SCREEN_WIDTH, STATUS_BAR_WIDTH, TFT_BLACK);
display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3);
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.tft.println(wifi_scan_obj.current_mini_kb_ssid + "\n");
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println(ssids->get(0).essid);
display_obj.tft.setTextColor(TFT_ORANGE, TFT_BLACK);
display_obj.tft.println("U/D - Rem/Add Char");
display_obj.tft.println("L/R - Prev/Nxt Char");
display_obj.tft.println("C - Save");
display_obj.tft.println("C(Hold) - Exit");
pressed = false;
}
}
#endif
#endif
}
#endif
// Function to change menu
void MenuFunctions::changeMenu(Menu * menu)
{
@@ -1825,7 +2174,6 @@ void MenuFunctions::buildButtons(Menu * menu, int starting_index, String button_
}
}
void MenuFunctions::displayCurrentMenu(uint8_t start_index)
{
//Serial.println(F("Displaying current menu..."));
@@ -1840,7 +2188,7 @@ void MenuFunctions::displayCurrentMenu(uint8_t start_index)
display_obj.tft.setFreeFont(MENU_FONT);
#endif
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER)
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setTextSize(1);
#endif
@@ -1863,7 +2211,7 @@ void MenuFunctions::displayCurrentMenu(uint8_t start_index)
#endif
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
#if 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

View File

@@ -15,12 +15,12 @@
#include "settings.h"
#ifdef HAS_BUTTONS
#include <SwitchLib.h>
extern SwitchLib u_btn;
extern SwitchLib d_btn;
extern SwitchLib l_btn;
extern SwitchLib r_btn;
extern SwitchLib c_btn;
#include "Switches.h"
extern Switches u_btn;
extern Switches d_btn;
extern Switches l_btn;
extern Switches r_btn;
extern Switches c_btn;
#endif
extern WiFiScan wifi_scan_obj;
@@ -71,6 +71,7 @@ extern Settings settings_obj;
#define LANGUAGE 31
#define STATUS_GPS 32
#define GPS_MENU 33
#define DISABLE_TOUCH 34
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);
@@ -120,7 +121,8 @@ class MenuFunctions
uint32_t initTime = 0;
uint8_t menu_start_index = 0;
uint8_t mini_kb_index = 0;
uint8_t old_gps_sat_count = 0;
// Main menu stuff
Menu mainMenu;
@@ -139,6 +141,7 @@ class MenuFunctions
Menu specSettingMenu;
Menu infoMenu;
Menu languageMenu;
Menu sdDeleteMenu;
// WiFi menu stuff
Menu wifiSnifferMenu;
@@ -148,6 +151,7 @@ class MenuFunctions
// WiFi General Menu
Menu htmlMenu;
Menu miniKbMenu;
// Bluetooth menu stuff
Menu bluetoothSnifferMenu;
@@ -163,7 +167,6 @@ class MenuFunctions
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable, bool selected = false, String command = "");
void updateStatusBar();
void battery(bool initial = false);
void battery2(bool initial = false);
void showMenuList(Menu* menu, int layer);
@@ -172,6 +175,9 @@ class MenuFunctions
void displaySetting(String key, Menu* menu, int index);
void buttonSelected(uint8_t b, int8_t x = -1);
void buttonNotSelected(uint8_t b, int8_t x = -1);
#if (!defined(HAS_ILI9341) && defined(HAS_BUTTONS))
void miniKeyboard(Menu * targetMenu);
#endif
uint8_t updateTouch(uint16_t *x, uint16_t *y, uint16_t threshold = 600);
@@ -192,11 +198,14 @@ class MenuFunctions
uint16_t x = -1, y = -1;
boolean pressed = false;
bool disable_touch;
String loaded_file = "";
void initLVGL();
void deinitLVGL();
void selectEPHTMLGFX();
void updateStatusBar();
void addSSIDGFX();
void addAPGFX();
void addStationGFX();

View File

@@ -79,6 +79,10 @@ bool SDInterface::initSD() {
SD.mkdir("/SCRIPTS");
Serial.println("/SCRIPTS created");
}
this->sd_files = new LinkedList<String>();
this->sd_files->add("Back");
return true;
}
@@ -98,6 +102,13 @@ File SDInterface::getFile(String path) {
}
}
bool SDInterface::removeFile(String file_path) {
if (SD.remove(file_path))
return true;
else
return false;
}
void SDInterface::listDirToLinkedList(LinkedList<String>* file_names, String str_dir, String ext) {
if (this->supported) {
File dir = SD.open(str_dir);
@@ -108,12 +119,18 @@ void SDInterface::listDirToLinkedList(LinkedList<String>* file_names, String str
{
break;
}
if (entry.isDirectory())
continue;
String file_name = entry.name();
if (ext != "") {
String file_name = entry.name();
if (file_name.endsWith(ext)) {
file_names->add(file_name);
}
}
else
file_names->add(file_name);
}
}
}
@@ -144,7 +161,7 @@ void SDInterface::runUpdate() {
#ifdef HAS_SCREEN
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setCursor(0, TFT_HEIGHT / 3);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_WHITE);

View File

@@ -43,12 +43,15 @@ class SDInterface {
bool initSD();
LinkedList<String>* sd_files;
void listDir(String str_dir);
void listDirToLinkedList(LinkedList<String>* file_names, String str_dir = "/", String ext = "");
File getFile(String path);
void runUpdate();
void performUpdate(Stream &updateSource, size_t updateSize);
void main();
bool removeFile(String file_path);
};
#endif

View File

@@ -0,0 +1,98 @@
#include "Switches.h"
Switches::Switches() {
this->pin = 0;
this->pin = false;
this->pressed = false;
this->hold_lim = 2000;
this->cur_hold = 0;
this->isheld = false;
pinMode(this->pin, INPUT);
return;
}
Switches::Switches(int pin, uint32_t hold_lim, bool pullup) {
this->pin = pin;
this->pullup = pullup;
this->pressed = false;
this->hold_lim = hold_lim;
this->cur_hold = 0;
this->isheld = false;
if (pullup)
pinMode(this->pin, INPUT_PULLUP);
else
pinMode(this->pin, INPUT_PULLDOWN);
return;
}
int Switches::getPin() {
return this->pin;
}
bool Switches::getPullup() {
return this->pullup;
}
bool Switches::isHeld() {
return this->isheld;
}
bool Switches::getButtonState() {
int buttonState = digitalRead(this->pin);
if ((this->pullup) && (buttonState == LOW))
return true;
else if ((!this->pullup) && (buttonState == HIGH))
return true;
else
return false;
}
bool Switches::justPressed() {
bool btn_state = this->getButtonState();
// Button was JUST pressed
if (btn_state && !this->pressed) {
this->hold_init = millis();
this->pressed = btn_state;
return true;
}
else if (btn_state) { // Button is STILL pressed
// Check if button is held
//Serial.println("cur_hold: " + (String)this->cur_hold);
if ((millis() - this->hold_init) < this->hold_lim) {
this->isheld = false;
}
else {
this->isheld = true;
}
this->pressed = btn_state;
return false;
}
else { // Button is not pressed
this->pressed = btn_state;
this->isheld = false;
return false;
}
}
bool Switches::justReleased() {
bool btn_state = this->getButtonState();
// Button was JUST released
if (!btn_state && this->pressed) {
this->isheld = false;
this->pressed = btn_state;
return true;
}
else { // Button is STILL released
this->pressed = btn_state;
return false;
}
}

35
esp32_marauder/Switches.h Normal file
View File

@@ -0,0 +1,35 @@
#ifndef Switches_h
#define Switches_h
#include <Arduino.h>
class Switches {
private:
int pin;
uint32_t hold_lim;
uint32_t cur_hold;
uint32_t hold_init = millis();
bool isheld;
bool pullup;
bool pressed;
bool getButtonState();
public:
Switches();
Switches(int pin, uint32_t hold_lim, bool pullup);
int getPin();
bool getPullup();
bool justPressed();
bool justReleased();
bool isHeld();
};
#endif

View File

@@ -1058,7 +1058,9 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
uint16_t calData[5] = { 213, 3469, 320, 3446, 1 }; // Landscape TFT DIY
Serial.println("Using TFT DIY");
#endif
display_obj.tft.setTouch(calData);
#ifdef HAS_ILI9341
display_obj.tft.setTouch(calData);
#endif
lv_obj_t * scr = lv_cont_create(NULL, NULL);
@@ -4035,7 +4037,9 @@ void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
uint16_t t_x = 0, t_y = 0; // To store the touch coordinates
// Do the touch stuff
pressed = display_obj.tft.getTouch(&t_x, &t_y);
#ifdef HAS_ILI9341
pressed = display_obj.tft.getTouch(&t_x, &t_y);
#endif
if (pressed) {
Serial.print("Got touch | X: ");
@@ -4186,7 +4190,9 @@ void WiFiScan::activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t
uint16_t t_x = 0, t_y = 0; // To store the touch coordinates
// Do the touch stuff
pressed = display_obj.tft.getTouch(&t_x, &t_y);
#ifdef HAS_ILI9341
pressed = display_obj.tft.getTouch(&t_x, &t_y);
#endif
if (pressed) {
Serial.print("Got touch | X: ");

View File

@@ -196,7 +196,6 @@ class WiFiScan
//String connected_network = "";
//const String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
const String alfa = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789-=[];',./`\\_+{}:\"<>?~|!@#$%^&*()";
const char* rick_roll[8] = {
"01 Never gonna give you up",
@@ -356,6 +355,9 @@ class WiFiScan
String dst_mac = "ff:ff:ff:ff:ff:ff";
byte src_mac[6] = {};
String current_mini_kb_ssid = "";
const String alfa = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789-=[];',./`\\_+{}:\"<>?~|!@#$%^&*()";
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
wifi_config_t ap_config;

View File

@@ -8,9 +8,9 @@
//// BOARD TARGETS
//#define MARAUDER_M5STICKC
//#define MARAUDER_MINI
#define MARAUDER_MINI
//#define MARAUDER_V4
#define MARAUDER_V6
//#define MARAUDER_V6
//#define MARAUDER_V6_1
//#define MARAUDER_KIT
//#define GENERIC_ESP32
@@ -18,15 +18,18 @@
//#define ESP32_LDDB
//#define MARAUDER_DEV_BOARD_PRO
//#define XIAO_ESP32_S3
//#define MARAUDER_REV_FEATHER
//// END BOARD TARGETS
#define MARAUDER_VERSION "v0.13.7"
#define MARAUDER_VERSION "v0.13.9"
//// HARDWARE NAMES
#ifdef MARAUDER_M5STICKC
#define HARDWARE_NAME "M5Stick-C Plus"
#elif defined(MARAUDER_MINI)
#define HARDWARE_NAME "Marauder Mini"
#elif defined(MARAUDER_REV_FEATHER)
#define HARDWARE_NAME "Adafruit Feather ESP32-S2 Reverse TFT"
#elif defined(MARAUDER_V4)
#define HARDWARE_NAME "Marauder v4"
#elif defined(MARAUDER_V6)
@@ -78,6 +81,20 @@
#define HAS_GPS
#endif
#ifdef MARAUDER_REV_FEATHER
//#define FLIPPER_ZERO_HAT
//#define HAS_BATTERY
//#define HAS_BT
#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
#endif
#ifdef MARAUDER_V4
//#define FLIPPER_ZERO_HAT
#define HAS_BATTERY
@@ -201,12 +218,44 @@
//// BUTTON DEFINITIONS
#ifdef HAS_BUTTONS
#ifdef MARAUDER_REV_FEATHER
#define L_BTN -1
#define C_BTN 1
#define U_BTN 0
#define R_BTN -1
#define D_BTN 2
//#define HAS_L
//#define HAS_R
#define HAS_U
#define HAS_D
#define HAS_C
#define L_PULL true
#define C_PULL false
#define U_PULL true
#define R_PULL true
#define D_PULL false
#endif
#ifdef MARAUDER_MINI
#define L_BTN 13
#define C_BTN 34
#define U_BTN 36
#define R_BTN 39
#define D_BTN 35
#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_M5STICKC
@@ -215,6 +264,18 @@
#define U_BTN -1
#define R_BTN -1
#define D_BTN 39
//#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
@@ -223,6 +284,18 @@
#define U_BTN -1
#define R_BTN -1
#define D_BTN -1
//#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_1
@@ -231,6 +304,18 @@
#define U_BTN -1
#define R_BTN -1
#define D_BTN -1
//#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
#endif
@@ -282,7 +367,7 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 6
#define BUTTON_ARRAY_LEN 13
#define BUTTON_ARRAY_LEN 100
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
@@ -524,7 +609,74 @@
//#define MENU_FONT &FreeSans9pt7b
//#define MENU_FONT &FreeSansBold9pt7b
#define BUTTON_SCREEN_LIMIT 10
#define BUTTON_ARRAY_LEN 13
#define BUTTON_ARRAY_LEN 100
#define STATUS_BAR_WIDTH (TFT_HEIGHT/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
#endif
#ifdef MARAUDER_REV_FEATHER
#define SCREEN_CHAR_WIDTH 40
//#define TFT_MISO 37
//#define TFT_MOSI 35
//#define TFT_SCLK 36
#define TFT_CS 42
#define TFT_DC 40
#define TFT_RST 41
#define TFT_BL 45
//#define TOUCH_CS 21
#define SD_CS 4
#define SCREEN_BUFFER
#define MAX_SCREEN_BUFFER 9
#define BANNER_TEXT_SIZE 1
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 135
#endif
#define CHAR_WIDTH 6
#define SCREEN_WIDTH TFT_WIDTH // Originally 240
#define SCREEN_HEIGHT TFT_HEIGHT // Originally 320
#define HEIGHT_1 TFT_WIDTH
#define WIDTH_1 TFT_WIDTH
#define STANDARD_FONT_CHAR_LIMIT (TFT_WIDTH/6) // number of characters on a single line with normal font
#define TEXT_HEIGHT (TFT_HEIGHT/10) // 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 TFT_HEIGHT // 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 5
#define BUTTON_ARRAY_LEN 100
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
#define LVGL_TICK_PERIOD 6
@@ -627,6 +779,24 @@
#define BUTTON_PADDING 10
#endif
#ifdef MARAUDER_REV_FEATHER
#define BANNER_TIME 50
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X (TFT_WIDTH/2) // Centre of key
#define KEY_Y (TFT_HEIGHT/4.5)
#define KEY_W TFT_WIDTH // Width and height
#define KEY_H (TFT_HEIGHT/12.8)
#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 10
#endif
#ifdef MARAUDER_M5STICKC
#define BANNER_TIME 50
@@ -669,6 +839,10 @@
#define SD_CS 4
#endif
#ifdef MARAUDER_REV_FEATHER
#define SD_CS 5
#endif
#ifdef MARAUDER_M5STICKC
#define SD_CS -1
#endif
@@ -724,6 +898,8 @@
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_MINI)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_REV_FEATHER)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_V4)
#define MEM_LOWER_LIM 20000
#elif defined(MARAUDER_V6) || defined(MARAUDER_V6_1)
@@ -750,6 +926,8 @@
#define PIN 17
#elif defined(MARAUDER_DEV_BOARD_PRO)
#define PIN 16
#elif defined(MARAUDER_REV_FEATHER)
#define PIN 33
#else
#define PIN 25
#endif
@@ -762,6 +940,8 @@
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_MINI)
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_REV_FEATHER)
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_V4)
#define MAX_HTML_SIZE 11400
#elif defined(MARAUDER_V6) || defined(MARAUDER_V6_1)
@@ -820,6 +1000,11 @@
#define GPS_TX 33
#define GPS_RX 32
#define mac_history_len 512
#elif defined(MARAUDER_REV_FEATHER)
#define GPS_SERIAL_INDEX 1
#define GPS_TX 6
#define GPS_RX 9
#define mac_history_len 512
#endif
#else
#define mac_history_len 512
@@ -835,6 +1020,8 @@
#define MARAUDER_TITLE_BYTES 13578
#elif defined(MARAUDER_MINI)
#define MARAUDER_TITLE_BYTES 13578
#elif defined(MARAUDER_REV_FEATHER)
#define MARAUDER_TITLE_BYTES 13578
#else
#define MARAUDER_TITLE_BYTES 13578
#endif

View File

@@ -13,7 +13,6 @@ https://www.online-utility.org/image/convert/to/XBM
#endif
#include <WiFi.h>
//#include "Web.h"
#include "EvilPortal.h"
#include <Wire.h>
#include "esp_wifi.h"
@@ -41,11 +40,10 @@ https://www.online-utility.org/image/convert/to/XBM
#include "xiaoLED.h"
#elif defined(MARAUDER_M5STICKC)
#include "stickcLED.h"
#else
#elif defined(HAS_NEOPIXEL_LED)
#include "LedInterface.h"
#endif
//#include "esp_interface.h"
#include "settings.h"
#include "CommandLine.h"
#include "lang_var.h"
@@ -54,42 +52,35 @@ https://www.online-utility.org/image/convert/to/XBM
#include "BatteryInterface.h"
#endif
//#ifdef HAS_TEMP_SENSOR
// #include "TemperatureInterface.h"
//#endif
#ifdef HAS_SCREEN
#include "Display.h"
#include "MenuFunctions.h"
//#include "a32u4_interface.h"
#endif
#ifdef HAS_BUTTONS
#include <SwitchLib.h>
#include "Switches.h"
#if (U_BTN >= 0)
SwitchLib u_btn = SwitchLib(U_BTN, 1000, true);
Switches u_btn = Switches(U_BTN, 1000, U_PULL);
#endif
#if (D_BTN >= 0)
SwitchLib d_btn = SwitchLib(D_BTN, 1000, true);
Switches d_btn = Switches(D_BTN, 1000, D_PULL);
#endif
#if (L_BTN >= 0)
SwitchLib l_btn = SwitchLib(L_BTN, 1000, true);
Switches l_btn = Switches(L_BTN, 1000, L_PULL);
#endif
#if (R_BTN >= 0)
SwitchLib r_btn = SwitchLib(R_BTN, 1000, true);
Switches r_btn = Switches(R_BTN, 1000, R_PULL);
#endif
#if (C_BTN >= 0)
SwitchLib c_btn = SwitchLib(C_BTN, 1000, true);
Switches c_btn = Switches(C_BTN, 1000, C_PULL);
#endif
#endif
WiFiScan wifi_scan_obj;
EvilPortal evil_portal_obj;
//Web web_obj;
Buffer buffer_obj;
//EspInterface esp_obj;
Settings settings_obj;
CommandLine cli_obj;
@@ -101,14 +92,9 @@ CommandLine cli_obj;
BatteryInterface battery_obj;
#endif
//#ifdef HAS_TEMP_SENSOR
// TemperatureInterface temp_obj;
//#endif
#ifdef HAS_SCREEN
Display display_obj;
MenuFunctions menu_function_obj;
//A32u4Interface a32u4_obj;
#endif
#ifdef HAS_SD
@@ -169,8 +155,6 @@ void setup()
axp192_obj.begin();
#endif
//pinMode(FLASH_BUTTON, INPUT);
#ifdef HAS_SCREEN
pinMode(TFT_BL, OUTPUT);
#endif
@@ -198,16 +182,8 @@ void setup()
Serial.begin(115200);
//Serial.println("\n\nHello, World!\n");
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
//#ifdef HAS_SCREEN
// Serial.println("Has Screen");
//#else
// Serial.println("Does not have screen");
//#endif
#ifdef HAS_SCREEN
display_obj.RunSetup();
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
@@ -225,7 +201,6 @@ void setup()
#endif
#ifdef HAS_SCREEN
//showCenterText(version_number, 250);
#ifndef MARAUDER_MINI
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
#endif
@@ -264,20 +239,10 @@ void setup()
display_obj.tft.println(text_table0[1]);
#endif
//Serial.println("Internal Temp: " + (String)((temprature_sens_read() - 32) / 1.8));
settings_obj.begin();
//Serial.println("This is a test Channel: " + (String)settings_obj.loadSetting<uint8_t>("Channel"));
//if (settings_obj.loadSetting<bool>( "Force PMKID"))
// Serial.println("This is a test Force PMKID: true");
//else
// Serial.println("This is a test Force PMKID: false");
wifi_scan_obj.RunSetup();
//Serial.println(wifi_scan_obj.freeRAM());
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[2]));
#endif
@@ -309,23 +274,12 @@ void setup()
display_obj.tft.println(F(text_table0[5]));
#endif
// Temperature stuff
//#ifdef HAS_TEMP_SENSOR
// temp_obj.RunSetup();
//#endif
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[6]));
#endif
#ifdef HAS_BATTERY
battery_obj.battery_level = battery_obj.getBatteryLevel();
// if (battery_obj.i2c_supported) {
// Serial.println(F("IP5306 I2C Supported: true"));
// }
// else
// Serial.println(F("IP5306 I2C Supported: false"));
#endif
// Do some LED stuff
@@ -366,12 +320,6 @@ void setup()
#ifdef HAS_SCREEN
menu_function_obj.RunSetup();
#endif
//Serial.println(F("\n\n--------------------------------\n"));
//Serial.println(F(" ESP32 Marauder \n"));
//Serial.println(" " + version_number + "\n");
//Serial.println(F(" By: justcallmekoko\n"));
//Serial.println(F("--------------------------------\n\n"));
Serial.println(F("CLI Ready"));
cli_obj.RunSetup();
@@ -387,6 +335,22 @@ void loop()
mini = true;
#endif
#ifdef HAS_ILI9341
#ifdef HAS_BUTTONS
if (c_btn.isHeld()) {
if (menu_function_obj.disable_touch)
menu_function_obj.disable_touch = false;
else
menu_function_obj.disable_touch = true;
menu_function_obj.updateStatusBar();
while (!c_btn.justReleased())
delay(1);
}
#endif
#endif
// Update all of our objects
/*#ifdef HAS_SCREEN
bool do_draw = display_obj.draw_tft;

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

View File

@@ -0,0 +1,6 @@
#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_width 16
#define ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_height 16
static char ce2b329463664e43e1607d0384f46ac1NszJo7o8A3Pedgwr_bits[] = {
0xFF, 0xFF, 0xFD, 0xBF, 0x0B, 0xD0, 0xE7, 0xE7, 0xEF, 0xF7, 0xCF, 0xF3,
0xAF, 0xF5, 0x6F, 0xF6, 0x6F, 0xF6, 0xAF, 0xF5, 0xCF, 0xF3, 0x0F, 0xF0,
0xE7, 0xE7, 0x0B, 0xD0, 0xFD, 0xBF, 0xFF, 0xFF, };