Compare commits

...

120 Commits

Author SHA1 Message Date
Just Call Me Koko
d2b8cf76ef No "v" in tag 2022-08-30 09:02:49 -04:00
Just Call Me Koko
83c84054bf Specify NimBLE 1.2.0 2022-08-30 09:00:54 -04:00
Just Call Me Koko
0b1089ff6e Switch configs 2022-08-30 08:51:42 -04:00
Just Call Me Koko
e564924f48 Fix blank PCAPs 2022-08-30 08:47:23 -04:00
Just Call Me Koko
fa2ea87a5a Only allow manual workflow 2022-08-21 00:12:51 -04:00
Just Call Me Koko
a11531975e Update README.md 2022-08-21 00:03:21 -04:00
Just Call Me Koko
b813972365 Create draft release 2022-08-20 23:31:50 -04:00
Just Call Me Koko
dd27b25757 Compile for other platforms 2022-08-20 23:02:16 -04:00
Just Call Me Koko
a9aeef2c78 Fix path to TFT_eSPI 2022-08-20 22:44:47 -04:00
Just Call Me Koko
e59e58f673 Update locations of libraries 2022-08-20 22:38:09 -04:00
Just Call Me Koko
6352b67de3 Update start location for find 2022-08-20 22:33:59 -04:00
Just Call Me Koko
213645d3a3 Look for TFT_eSPI 2022-08-20 22:29:56 -04:00
Just Call Me Koko
0c46326da3 Update build_push.yml 2022-08-20 22:23:44 -04:00
Just Call Me Koko
e22627fdda Update build_push.yml 2022-08-20 22:19:16 -04:00
Just Call Me Koko
0c92d3c568 Fix sed file locations 2022-08-20 22:14:17 -04:00
Just Call Me Koko
ba13305b7b Configure libs and configs 2022-08-20 22:08:08 -04:00
Just Call Me Koko
0f7d786445 Add configure TFT_eSPI 2022-08-20 21:44:57 -04:00
Just Call Me Koko
118c46817f Add TFT Setup files 2022-08-20 21:12:03 -04:00
Just Call Me Koko
8afa68d132 Add upload artifacts 2022-08-20 20:52:31 -04:00
Just Call Me Koko
7c4b0483aa Add more build params 2022-08-20 20:46:19 -04:00
Just Call Me Koko
e6d7ac39c8 More Minimal SPIFFS syntax 2022-08-20 20:37:12 -04:00
Just Call Me Koko
0cc7c8d64c Minimal SPIFFS syntax 2022-08-20 20:31:59 -04:00
Just Call Me Koko
456823ce45 minimal spiffs 2022-08-20 20:28:25 -04:00
Just Call Me Koko
84371818c8 Add display bins 2022-08-20 20:18:51 -04:00
Just Call Me Koko
ee9c8dc1b2 Add muldefs to ESP32 and ESP32S2 2022-08-20 20:10:13 -04:00
Just Call Me Koko
4f3d0cce2e find and replace 2022-08-20 20:03:05 -04:00
Just Call Me Koko
19a5ce334a Update build_push.yml 2022-08-20 19:54:24 -04:00
Just Call Me Koko
2872dd0162 Add bash for loop for platform 2022-08-20 19:51:52 -04:00
Just Call Me Koko
a929b6a76b Update build_push.yml 2022-08-20 19:45:31 -04:00
Just Call Me Koko
d2402ad801 Add install boards 2022-08-20 19:42:13 -04:00
Just Call Me Koko
20ea935c42 Update build_push.yml 2022-08-20 19:31:43 -04:00
Just Call Me Koko
a3ec0ac1af Cat platform file 2022-08-20 19:24:06 -04:00
Just Call Me Koko
7b2ffed45a Update build_push.yml 2022-08-20 19:18:28 -04:00
Just Call Me Koko
c0cdcc9818 Update build_push.yml 2022-08-20 19:07:57 -04:00
Just Call Me Koko
8049c2834c Update build_push.yml 2022-08-20 19:00:52 -04:00
Just Call Me Koko
9057d3919c Add find and replace 2022-08-20 18:54:31 -04:00
Just Call Me Koko
7d576d1863 Fix quote placement 2022-08-20 18:30:22 -04:00
Just Call Me Koko
ba53d7ac38 Full build property string 2022-08-20 18:21:53 -04:00
Just Call Me Koko
f2d5c6b73e Specify build property 2022-08-20 18:17:49 -04:00
Just Call Me Koko
96c14d37e3 Update build_push.yml 2022-08-20 17:55:24 -04:00
Just Call Me Koko
93760f24e5 Add muldefs arg to cli 2022-08-20 17:47:09 -04:00
Just Call Me Koko
c63e052374 Fix warnings flag 2022-08-20 17:41:36 -04:00
Just Call Me Koko
420e29476d Jobs together 2022-08-20 17:38:53 -04:00
Just Call Me Koko
f920d7a283 Separate lib install 2022-08-20 17:30:58 -04:00
Just Call Me Koko
808be3234f Update version of arduino test compile 2022-08-20 17:24:16 -04:00
Just Call Me Koko
3206d4b5e1 Fix multdefs 2022-08-20 17:22:17 -04:00
Just Call Me Koko
589b7c7962 Lib args 2022-08-20 17:20:38 -04:00
Just Call Me Koko
d1ac7234f4 Update compile args 2022-08-20 17:14:02 -04:00
Just Call Me Koko
c839e66ff3 Add compiler switches 2022-08-20 16:57:56 -04:00
Just Call Me Koko
8e83bb1874 Specify package version for ESP32 2022-08-20 16:47:25 -04:00
Just Call Me Koko
da22ba0819 Update board fqdn 2022-08-20 16:42:54 -04:00
Just Call Me Koko
d2155cc9d4 Add ESP32 Board 2022-08-20 16:36:46 -04:00
Just Call Me Koko
26bc9c63f8 Adjust ref for SwitchLib 2022-08-20 16:27:31 -04:00
Just Call Me Koko
2026381e9b Spelling 2022-08-20 16:24:25 -04:00
Just Call Me Koko
f175ba5e4e Fix library red 2022-08-20 16:22:24 -04:00
Just Call Me Koko
f09b0c4e5f Add libraries 2022-08-20 15:58:53 -04:00
Just Call Me Koko
0729a2368b Create build_push.yml 2022-08-20 15:33:14 -04:00
Just Call Me Koko
07b57ae7b8 Release v0.9.13 2022-08-06 12:57:07 -04:00
Just Call Me Koko
2e469d1410 Add rssi and setting reset 2022-08-06 12:37:09 -04:00
improving-rigmarole
d0d3c40ad3 fix sniffpmkid SSID visible (#140) 2022-08-04 18:55:57 -04:00
Just Call Me Koko
9c0f627176 Fix stopscan and sniffpmkid 2022-08-04 09:07:11 -04:00
Just Call Me Koko
3d602d7555 Release v0.9.13-rc1 2022-08-02 14:19:22 -04:00
Just Call Me Koko
e8693c95f4 Fix mini update menu 2022-08-02 14:03:43 -04:00
Just Call Me Koko
cebfc5b5c1 Release v0.9.12 2022-08-01 18:03:48 -04:00
Just Call Me Koko
1291c7f322 Add settings command and SD CS 2022-08-01 17:03:07 -04:00
Just Call Me Koko
b234cee7ea Update README.md 2022-07-31 15:50:59 -04:00
Just Call Me Koko
792b4e5ac9 Release v0.9.11 2022-07-31 15:42:56 -04:00
Just Call Me Koko
09de10d95c packet monitor eapol scan formatting 2022-07-31 14:53:21 -04:00
Just Call Me Koko
898dd1242d Fix screen buffer formatting 2022-07-31 11:45:28 -04:00
Just Call Me Koko
4f04e91d0a Add screen buffer for mini 2022-07-30 20:48:25 -04:00
Just Call Me Koko
b7c2d668b5 Select all and flipper LED 2022-07-30 14:12:51 -04:00
Just Call Me Koko
cbcfa10330 v0.9.10 Release 2022-07-18 18:50:30 -04:00
Just Call Me Koko
88777524e0 Release v0.9.9 2022-06-28 15:26:44 -04:00
Just Call Me Koko
f2d48d229a PMKID deauth optional 2022-06-22 19:17:25 -04:00
Just Call Me Koko
4aa93e2cc3 Send deauth for pmkid 2022-06-20 21:17:06 -04:00
Just Call Me Koko
00a785343c Update README.md 2022-06-18 19:55:01 -04:00
Just Call Me Koko
01b0520aec AP obfuscation attack 2022-06-18 03:22:13 -04:00
Just Call Me Koko
2468abba22 Save a beacon packet 2022-06-14 23:09:58 -04:00
Just Call Me Koko
355236dc42 Add targeted ap beacon spam 2022-06-13 20:18:20 -04:00
Just Call Me Koko
80f99f78a7 Add channel arg to pmkid sniff 2022-06-13 19:36:51 -04:00
Just Call Me Koko
809f0fb19d Release v0.9.8 2022-06-10 16:34:43 -04:00
Just Call Me Koko
71d5391066 Add help command 2022-06-03 21:02:20 -04:00
Just Call Me Koko
1988ec5808 Fix OTA update shutdown via CLI 2022-06-03 15:31:44 -04:00
Just Call Me Koko
2b130b9d11 Add more sniff and attack commands 2022-06-03 15:21:57 -04:00
Just Call Me Koko
0091c5642a print eapol when received 2022-06-03 12:39:44 -04:00
Just Call Me Koko
a80bba9b18 Add SSID commands 2022-06-02 17:13:54 -04:00
Just Call Me Koko
d686353322 Add attack command to CLI 2022-06-01 18:11:47 -04:00
Just Call Me Koko
ae8f8e870f Add more cmd, clean serial, add ascii 2022-05-31 22:46:28 -04:00
Gregor Hermani
d11faf5996 add OG-Marauder enclosure (#124)
* add Marauder Mini Case and rearrange files

* Add OG-Marauder Enclosure
2022-05-31 12:26:21 -04:00
Just Call Me Koko
6ae350dded Re-release v0.9.7 2022-05-28 14:50:00 -04:00
Just Call Me Koko
9a1ee15345 v0.9.7 Release 2022-05-28 14:29:15 -04:00
Just Call Me Koko
da538934e3 Trims serial input for PuTTY 2022-05-28 13:51:12 -04:00
Just Call Me Koko
e2b52f74e5 Merge pull request #122 from justcallmekoko/develop
Fix Marauder OTA for Flipper Zero
2022-05-28 09:51:00 -04:00
Just Call Me Koko
546afc63a7 Fix Marauder OTA for Flipper Zero 2022-05-28 09:47:06 -04:00
Just Call Me Koko
2f0d05a538 Develop (#121)
* Adding new library, changing way of displaying texts (#118)

* Adding custom icon for language button

* Adding new library, changing way of displaying texts

Added new library to make incoming translation possible to exists at the same time.

* Prepare for flipper integration

* More flipper wifi dev board work

* Add command parse

* Add set channel

* Create bins for release v0.9.6

Co-authored-by: mlodawy <105587112+mlodawy@users.noreply.github.com>
2022-05-28 09:06:59 -04:00
mlodawy
9f013d3d52 Adding custom icon for language button (#117) 2022-05-16 11:10:54 -04:00
mlodawy
45db8f3c22 Merge pull request #1 from justcallmekoko/master (#116) 2022-05-15 11:04:36 -04:00
Just Call Me Koko
e490b40196 Merge branch 'master' into master 2022-05-15 11:01:25 -04:00
mlodawy
72edd3d43d Add langauge button 2022-05-15 16:54:53 +02:00
Just Call Me Koko
bc6a07f5cb Add polish potato 2022-05-15 10:17:32 -04:00
Just Call Me Koko
bd7a350a9b Resize Marauder logo 2022-05-11 23:48:30 -04:00
Just Call Me Koko
cdd0ee5976 Add sniff deauth command 2022-05-11 18:53:55 -04:00
Just Call Me Koko
d7aac68866 Center click exit scan 2022-05-09 20:30:08 -04:00
Just Call Me Koko
0f58a0657b PROGMEM commands and remove mini lv_arduino 2022-05-07 14:36:44 -04:00
Gregor Hermani
d9a6966574 add Marauder Mini Case and rearrange files (#112) 2022-05-04 10:12:57 -04:00
Just Call Me Koko
5341c559be Add come cli commands 2022-05-03 00:44:07 -04:00
Just Call Me Koko
2c4edd012d Add some command line stuff 2022-05-03 00:22:11 -04:00
Just Call Me Koko
3b09650363 Merge branch 'master' of https://github.com/justcallmekoko/ESP32Marauder 2022-05-02 21:44:43 -04:00
Just Call Me Koko
7d6d0517e1 Add Marauder Mini Configuration 2022-05-02 21:44:42 -04:00
Just Call Me Koko
30020dd710 Add files via upload 2022-04-29 11:51:46 -04:00
Just Call Me Koko
3d2bb75081 Add files via upload 2022-04-29 11:51:29 -04:00
Just Call Me Koko
95841e5384 Add files via upload 2022-04-29 11:50:14 -04:00
Just Call Me Koko
a73ae2bbcb Create README.md 2022-04-29 11:48:52 -04:00
Just Call Me Koko
ae1aebde50 Add files via upload 2022-04-29 11:46:44 -04:00
Just Call Me Koko
9134280c6a Add files via upload 2022-04-29 11:45:23 -04:00
Just Call Me Koko
93d0f2e1d2 Create PCB_ESP32 Marauder 3.5 Kit V3 PCB_2022-04-29.json 2022-04-29 11:40:20 -04:00
Just Call Me Koko
e3f365febf Create PCB_ESP32 Marauder 3.7 OG PCB_2022-04-29.json 2022-04-29 11:38:31 -04:00
Just Call Me Koko
66576c1908 Create PCB_ESP32 Marauder 6 PCB_2022-04-29.json 2022-04-29 11:28:22 -04:00
Just Call Me Koko
8c53ac679f Update README.md 2022-01-19 11:36:25 -05:00
Just Call Me Koko
2d33c0b5ab Re-release v0.9.5
Fix some screen issues I guess?
2022-01-19 11:30:18 -05:00
112 changed files with 541702 additions and 4031 deletions

314
.github/workflows/build_push.yml vendored Normal file
View File

@@ -0,0 +1,314 @@
name: Build and Push
on:
workflow_dispatch:
jobs:
# This workflow contains a single job called "build"
build:
name: Build Marauder Binaries
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install TFT_eSPI
uses: actions/checkout@v2
with:
repository: justcallmekoko/TFT_eSPI
ref: master
path: CustomTFT_eSPI
- name: Install LinkedList
uses: actions/checkout@v2
with:
repository: ivanseidel/LinkedList
ref: master
path: CustomLinkedList
- name: Install lv_arduino
uses: actions/checkout@v2
with:
repository: lvgl/lv_arduino
ref: master
path: Customlv_arduino
- name: Install JPEGDecoder
uses: actions/checkout@v2
with:
repository: Bodmer/JPEGDecoder
ref: master
path: CustomJPEGDecoder
- name: Install NimBLE-Arduino
uses: actions/checkout@v2
with:
repository: h2zero/NimBLE-Arduino
ref: 1.2.0
path: CustomNimBLE-Arduino
- name: Install Adafruit_NeoPixel
uses: actions/checkout@v2
with:
repository: adafruit/Adafruit_NeoPixel
ref: master
path: CustomAdafruit_NeoPixel
- name: Install ArduinoJson
uses: actions/checkout@v2
with:
repository: bblanchon/ArduinoJson
ref: v6.18.2
path: CustomArduinoJson
- name: Install SwitchLib
uses: actions/checkout@v2
with:
repository: justcallmekoko/SwitchLib
ref: main
path: CustomSwitchLib
- name: Configure TFT_eSPI
run: |
rm -f CustomTFT_eSPI/User_Setup_Select.h
cp User_Setup_Select.h CustomTFT_eSPI/
cp User_Setup_marauder_mini.h CustomTFT_eSPI/
cp User_Setup_og_marauder.h CustomTFT_eSPI/
pwd
ls -la
ls -la CustomTFT_eSPI
- name: Install ESP32 Boards and Compile MarauderOTA
uses: ArminJo/arduino-test-compile@v3.2.0
with:
sketch-names: MarauderOTA.ino
arduino-board-fqbn: esp32:esp32:esp32s2
platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.0-rc1/package_esp32_dev_index.json
- name: Modify platform.txt
run: |
echo "Chicken"
for i in $(find /home/runner/.arduino15/packages/esp32/hardware/esp32/ -name "platform.txt"); do
sed -i 's/compiler.c.elf.libs.esp32s2=/compiler.c.elf.libs.esp32s2=-zmuldefs /' "$i"
sed -i 's/compiler.c.elf.libs.esp32=/compiler.c.elf.libs.esp32=-zmuldefs /' "$i"
cat "$i" | grep compiler.c.elf.libs.esp32s2
cat "$i" | grep compiler.c.elf.libs.esp32
done
- name: Build Marauder for Flipper Zero WiFi Dev Board
uses: ArminJo/arduino-test-compile@v3.2.0
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:esp32s2:PartitionScheme=min_spiffs,FlashSize=16M,PSRAM=enabled
#platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.0-rc1/package_esp32_dev_index.json
extra-arduino-cli-args: "--warnings none"
#extra-arduino-lib-install-args: "-zmuldefs"
- name: Rename Marauder Flipper bin
run: |
mv ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
- name: Configure TFT_eSPI and configs.h for OG Marauder
run: |
pwd
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_og_marauder.h>/#include <User_Setup_og_marauder.h>/' /home/runner/Arduino/libraries/CustomTFT_eSPI/User_Setup_Select.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_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
- name: Build Marauder for OG Marauder
uses: ArminJo/arduino-test-compile@v3.2.0
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
#platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.0-rc1/package_esp32_dev_index.json
extra-arduino-cli-args: "--warnings none"
#extra-arduino-lib-install-args: "-zmuldefs"
- name: Rename OG Marauder bin
run: |
mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.og.bin
- name: Configure TFT_eSPI and configs.h for Marauder v6
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_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_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
- name: Build Marauder for v6 Marauder
uses: ArminJo/arduino-test-compile@v3.2.0
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
#platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.0-rc1/package_esp32_dev_index.json
extra-arduino-cli-args: "--warnings none"
#extra-arduino-lib-install-args: "-zmuldefs"
- name: Rename v6 Marauder bin
run: |
mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6.bin
- name: Configure TFT_eSPI and configs.h for Marauder Kit
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_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_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
- name: Build Marauder for Marauder Kit
uses: ArminJo/arduino-test-compile@v3.2.0
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
#platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.0-rc1/package_esp32_dev_index.json
extra-arduino-cli-args: "--warnings none"
#extra-arduino-lib-install-args: "-zmuldefs"
- name: Rename Marauder Kit bin
run: |
mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.kit.bin
- name: Configure TFT_eSPI and configs.h for Marauder Mini
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_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_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
- name: Build Marauder for Marauder Mini
uses: ArminJo/arduino-test-compile@v3.2.0
with:
sketch-names: esp32_marauder.ino
arduino-board-fqbn: esp32:esp32:d32:PartitionScheme=min_spiffs
#platform-url: https://github.com/espressif/arduino-esp32/releases/download/2.0.0-rc1/package_esp32_dev_index.json
extra-arduino-cli-args: "--warnings none"
#extra-arduino-lib-install-args: "-zmuldefs"
- name: Rename Marauder Mini bin
run: |
mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.mini.bin
- name: Display finished bins
run: |
find ./esp32_marauder/build -name "*.bin"
- name: 'Upload Flipper Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.flipper.bin
path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
retention-days: 5
- name: 'Upload OG Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.og.bin
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.og.bin
retention-days: 5
- name: 'Upload v6 Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.v6.bin
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6.bin
retention-days: 5
- name: 'Upload Kit Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.kit.bin
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.kit.bin
retention-days: 5
- name: 'Upload Mini Artifact'
uses: actions/upload-artifact@v3
with:
name: esp32_marauder.mini.bin
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.mini.bin
retention-days: 5
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload Flipper Asset
id: upload-flipper-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.flipper.bin
asset_name: esp32_marauder.flipper.bin
asset_content_type: application/bin
- name: Upload OG Asset
id: upload-og-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.d32/esp32_marauder.og.bin
asset_name: esp32_marauder.og.bin
asset_content_type: application/bin
- name: Upload v6 Asset
id: upload-v6-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.d32/esp32_marauder.v6.bin
asset_name: esp32_marauder.v6.bin
asset_content_type: application/bin
- name: Upload Kit Asset
id: upload-kit-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.d32/esp32_marauder.kit.bin
asset_name: esp32_marauder.kit.bin
asset_content_type: application/bin
- name: Upload Mini Asset
id: upload-mini-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.d32/esp32_marauder.mini.bin
asset_name: esp32_marauder.mini.bin
asset_content_type: application/bin

View File

@@ -1,3 +1,13 @@
//#define MARAUDER_V4
//#define MARAUDER_V6
//#define MARAUDER_KIT
//#define MARAUDER_MINI
#define MARAUDER_FLIPPER
#ifndef MARAUDER_FLIPPER
#define HAS_BT
#endif
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
@@ -5,7 +15,9 @@
#include <Update.h>
#include "esp_wifi.h"
#include "esp_wifi_types.h"
#include "esp_bt.h"
#ifdef HAS_BT
#include "esp_bt.h"
#endif
#define jquery_min_js_v3_2_1_gz_len 30178

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

1
PCBs/v4(OG)/README.md Normal file
View File

@@ -0,0 +1 @@
Further resources can be found [here](http://www.lcdwiki.com/2.8inch_SPI_Module_ILI9341_SKU:MSP2807)

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -3,7 +3,7 @@
<!---[![Build Status](https://travis-ci.com/justcallmekoko/ESP32Marauder.svg?branch=master)](https://travis-ci.com/justcallmekoko/ESP32Marauder)--->
<!---Shields/Badges https://shields.io/--->
# ESP32 Marauder v0.9.3
# ESP32 Marauder v0.9.13
<p align="center"><img alt="Marauder logo" src="https://github.com/justcallmekoko/ESP32Marauder/blob/master/pictures/marauder3L.jpg?raw=true" width="300"></p>
<p align="center">
<b>A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32</b>
@@ -20,6 +20,8 @@
<a href="https://www.twitch.tv/willstunforfood"><img src="https://assets.stickpng.com/images/580b57fcd9996e24bc43c540.png" alt="Twitch WillStunForFood" width="200"></a>
</p>
[![Build and Push](https://github.com/justcallmekoko/ESP32Marauder/actions/workflows/build_push.yml/badge.svg)](https://github.com/justcallmekoko/ESP32Marauder/actions/workflows/build_push.yml)
## Getting Started
Download the [latest release](https://github.com/justcallmekoko/ESP32Marauder/releases/latest) of the firmware.

180
User_Setup_Select.h Normal file
View File

@@ -0,0 +1,180 @@
// This header file contains a list of user setup files and defines which one the
// compiler uses when the IDE performs a Verify/Compile or Upload.
//
// Users can create configurations for different Espressif boards and TFT displays.
// This makes selecting between hardware setups easy by "uncommenting" one line.
// The advantage of this hardware configuration method is that the examples provided
// with the library should work with different setups immediately without any other
// changes being needed. It also improves the portability of users sketches to other
// hardware configurations and compatible libraries.
//
// Create a shortcut to this file on your desktop to permit quick access for editing.
// Re-compile and upload after making and saving any changes to this file.
// Customised User_Setup files are stored in the "User_Setups" folder.
#ifndef USER_SETUP_LOADED // Lets PlatformIO users define settings in
// platformio.ini, see notes in "Tools" folder.
// Only ONE line below should be uncommented. Add extra lines and files as needed.
//#include <User_Setup.h> // Default setup is root library folder
//#include <User_Setup_og_marauder.h>
#include <User_Setup_marauder_mini.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
//#include <User_Setups/Setup3_ILI9163.h> // Setup file configured for my ILI9163
//#include <User_Setups/Setup4_S6D02A1.h> // Setup file configured for my S6D02A1
//#include <User_Setups/Setup5_RPi_ILI9486.h> // Setup file configured for my stock RPi TFT
//#include <User_Setups/Setup6_RPi_Wr_ILI9486.h> // Setup file configured for my modified RPi TFT
//#include <User_Setups/Setup7_ST7735_128x128.h> // Setup file configured for my ST7735 128x128 display
//#include <User_Setups/Setup8_ILI9163_128x128.h> // Setup file configured for my ILI9163 128x128 display
//#include <User_Setups/Setup9_ST7735_Overlap.h> // Setup file configured for my ST7735
//#include <User_Setups/Setup10_RPi_touch_ILI9486.h> // Setup file configured for ESP8266 and RPi TFT with touch
//#include <User_Setups/Setup11_RPi_touch_ILI9486.h> // Setup file configured for ESP32 and RPi TFT with touch
//#include <User_Setups/Setup12_M5Stack.h> // Setup file for the ESP32 based M5Stack
//#include <User_Setups/Setup13_ILI9481_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
//#include <User_Setups/Setup14_ILI9341_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
//#include <User_Setups/Setup15_HX8357D.h> // Setup file configured for HX8357D (untested)
//#include <User_Setups/Setup16_ILI9488_Parallel.h> // Setup file for the ESP32 with parallel bus TFT
//#include <User_Setups/Setup17_ePaper.h> // Setup file for any Waveshare ePaper display
//#include <User_Setups/Setup18_ST7789.h> // Setup file configured for ST7789
//#include <User_Setups/Setup19_RM68140_Parallel.h> // Setup file configured for RM68140 with parallel bus
//#include <User_Setups/Setup20_ILI9488.h> // Setup file for ESP8266 and ILI9488 SPI bus TFT
//#include <User_Setups/Setup21_ILI9488.h> // Setup file for ESP32 and ILI9488 SPI bus TFT
//#include <User_Setups/Setup22_TTGO_T4.h> // Setup file for ESP32 and TTGO T4 (BTC) ILI9341 SPI bus TFT
//#include <User_Setups/Setup23_TTGO_TM.h> // Setup file for ESP32 and TTGO TM ST7789 SPI bus TFT
//#include <User_Setups/Setup24_ST7789.h> // Setup file configured for ST7789 240 x 240
//#include <User_Setups/Setup25_TTGO_T_Display.h> // Setup file for ESP32 and TTGO T-Display ST7789V SPI bus TFT
//#include <User_Setups/Setup26_TTGO_T_Wristband.h> // Setup file for ESP32 and TTGO T-Wristband ST7735 SPI bus TFT
//#include <User_Setups/Setup27_RPi_ST7796_ESP32.h> // ESP32 RPi MHS-4.0 inch Display-B
//#include <User_Setups/Setup28_RPi_ST7796_ESP8266.h> // ESP8266 RPi MHS-4.0 inch Display-B
//#include <User_Setups/Setup29_ILI9341_STM32.h> // Setup for Nucleo board
//#include <User_Setups/Setup30_ILI9341_Parallel_STM32.h> // Setup for Nucleo board and parallel display
//#include <User_Setups/Setup31_ST7796_Parallel_STM32.h> // Setup for Nucleo board and parallel display
//#include <User_Setups/Setup32_ILI9341_STM32F103.h> // Setup for "Blue Pill"
//#include <User_Setups/Setup43_ST7735.h> // Setup file configured for my ST7735S 80x160
//#include <User_Setups/Setup135_ST7789.h> // Setup file for ESP8266 and ST7789 135 x 240 TFT
//#include <User_Setups/SetupX_Template.h>
#endif // USER_SETUP_LOADED
/////////////////////////////////////////////////////////////////////////////////////
// //
// DON'T TINKER WITH ANY OF THE FOLLOWING LINES, THESE ADD THE TFT DRIVERS //
// AND ESP8266 PIN DEFINITONS, THEY ARE HERE FOR BODMER'S CONVENIENCE! //
// //
/////////////////////////////////////////////////////////////////////////////////////
// Identical looking TFT displays may have a different colour ordering in the 16 bit colour
#define TFT_BGR 0 // Colour order Blue-Green-Red
#define TFT_RGB 1 // Colour order Red-Green-Blue
// Legacy setup support, RPI_DISPLAY_TYPE replaces RPI_DRIVER
#if defined (RPI_DRIVER)
#if !defined (RPI_DISPLAY_TYPE)
#define RPI_DISPLAY_TYPE
#endif
#endif
// Legacy setup support, RPI_ILI9486_DRIVER form is deprecated
// Instead define RPI_DISPLAY_TYPE and also define driver (e.g. ILI9486_DRIVER)
#if defined (RPI_ILI9486_DRIVER)
#if !defined (ILI9486_DRIVER)
#define ILI9486_DRIVER
#endif
#if !defined (RPI_DISPLAY_TYPE)
#define RPI_DISPLAY_TYPE
#endif
#endif
// Load the right driver definition - do not tinker here !
#if defined (ILI9341_DRIVER)
#include <TFT_Drivers/ILI9341_Defines.h>
#define TFT_DRIVER 0x9341
#elif defined (ST7735_DRIVER)
#include <TFT_Drivers/ST7735_Defines.h>
#define TFT_DRIVER 0x7735
#elif defined (ILI9163_DRIVER)
#include <TFT_Drivers/ILI9163_Defines.h>
#define TFT_DRIVER 0x9163
#elif defined (S6D02A1_DRIVER)
#include <TFT_Drivers/S6D02A1_Defines.h>
#define TFT_DRIVER 0x6D02
#elif defined (ST7796_DRIVER)
#include "TFT_Drivers/ST7796_Defines.h"
#define TFT_DRIVER 0x7796
#elif defined (ILI9486_DRIVER)
#include <TFT_Drivers/ILI9486_Defines.h>
#define TFT_DRIVER 0x9486
#elif defined (ILI9481_DRIVER)
#include <TFT_Drivers/ILI9481_Defines.h>
#define TFT_DRIVER 0x9481
#elif defined (ILI9488_DRIVER)
#include <TFT_Drivers/ILI9488_Defines.h>
#define TFT_DRIVER 0x9488
#elif defined (HX8357D_DRIVER)
#include "TFT_Drivers/HX8357D_Defines.h"
#define TFT_DRIVER 0x8357
#elif defined (EPD_DRIVER)
#include "TFT_Drivers/EPD_Defines.h"
#define TFT_DRIVER 0xE9D
#elif defined (ST7789_DRIVER)
#include "TFT_Drivers/ST7789_Defines.h"
#define TFT_DRIVER 0x7789
#elif defined (R61581_DRIVER)
#include "TFT_Drivers/R61581_Defines.h"
#define TFT_DRIVER 0x6158
#elif defined (ST7789_2_DRIVER)
#include "TFT_Drivers/ST7789_2_Defines.h"
#define TFT_DRIVER 0x778B
#elif defined (RM68140_DRIVER)
#include "TFT_Drivers/RM68140_Defines.h"
#define TFT_DRIVER 0x6814
// <<<<<<<<<<<<<<<<<<<<<<<< ADD NEW DRIVER HERE
// XYZZY_init.h and XYZZY_rotation.h must also be added in TFT_eSPI.c
#elif defined (XYZZY_DRIVER)
#include "TFT_Drivers/XYZZY_Defines.h"
#define TFT_DRIVER 0x0000
#else
#define TFT_DRIVER 0x0000
#endif
// These are the pins for ESP8266 boards
// Name GPIO NodeMCU Function
#define PIN_D0 16 // GPIO16 WAKE
#define PIN_D1 5 // GPIO5 User purpose
#define PIN_D2 4 // GPIO4 User purpose
#define PIN_D3 0 // GPIO0 Low on boot means enter FLASH mode
#define PIN_D4 2 // GPIO2 TXD1 (must be high on boot to go to UART0 FLASH mode)
#define PIN_D5 14 // GPIO14 HSCLK
#define PIN_D6 12 // GPIO12 HMISO
#define PIN_D7 13 // GPIO13 HMOSI RXD2
#define PIN_D8 15 // GPIO15 HCS TXD0 (must be low on boot to enter UART0 FLASH mode)
#define PIN_D9 3 // RXD0
#define PIN_D10 1 // TXD0
#define PIN_MOSI 8 // SD1 FLASH and overlap mode
#define PIN_MISO 7 // SD0
#define PIN_SCLK 6 // CLK
#define PIN_HWCS 0 // D3
#define PIN_D11 9 // SD2
#define PIN_D12 10 // SD4

316
User_Setup_marauder_mini.h Normal file
View File

@@ -0,0 +1,316 @@
// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc
//
// See the User_Setup_Select.h file if you wish to be able to define multiple
// setups and then easily select which setup file is used by the compiler.
//
// If this file is edited correctly then all the library example sketches should
// run without the need to make any more changes for a particular hardware setup!
// Note that some sketches are designed for a particular TFT pixel width/height
// ##################################################################################
//
// Section 1. Call up the right driver file and any options for it
//
// ##################################################################################
// Display type - only define if RPi display
//#define RPI_DRIVER
// Only define one driver, the other ones must be commented out
//#define ILI9341_DRIVER // OG Marauder
#define ST7735_DRIVER // Marauder Mini // Define additional parameters below for this display
//#define ILI9163_DRIVER // Define additional parameters below for this display
//#define S6D02A1_DRIVER
//#define RPI_ILI9486_DRIVER // 20MHz maximum SPI
//#define HX8357D_DRIVER
//#define ILI9481_DRIVER
//#define ILI9486_DRIVER
//#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
//#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display
//#define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display
//#define R61581_DRIVER
//#define RM68140_DRIVER
//#define ST7796_DRIVER
// Some displays support SPI reads via the MISO pin, other displays have a single
// bi-directional SDA pin and the library will try to read this via the MOSI line.
// To use the SDA line for reading data from the TFT uncomment the following line:
// #define TFT_SDA_READ // This option is for ESP32 ONLY, tested with ST7789 display only
// 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
// For M5Stack ESP32 module with integrated ILI9341 display ONLY, remove // in line below
// #define M5STACK
// For ST7789, ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation
// #define TFT_WIDTH 80
#define TFT_WIDTH 128 // Marauder Mini
// #define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320
// #define TFT_HEIGHT 160
#define TFT_HEIGHT 128 // Marauder Mini
// #define TFT_HEIGHT 240 // ST7789 240 x 240
// #define TFT_HEIGHT 320 // ST7789 240 x 320
// For ST7735 ONLY, define the type of display, originally this was based on the
// colour of the tab on the screen protector film but this is not always true, so try
// out the different options below if the screen does not display graphics correctly,
// e.g. colours wrong, mirror images, or tray pixels at the edges.
// Comment out ALL BUT ONE of these options for a ST7735 display driver, save this
// this User_Setup file, then rebuild and upload the sketch to the board again:
// #define ST7735_INITB
// #define ST7735_GREENTAB
// #define ST7735_GREENTAB2
#define ST7735_GREENTAB3
// #define ST7735_GREENTAB128 // For 128 x 128 display
// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
// #define ST7735_REDTAB
// #define ST7735_BLACKTAB
// #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset
// If colours are inverted (white shows as black) then uncomment one of the next
// 2 lines try both options, one of the options should correct the inversion.
// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF
// If a backlight control signal is available then define the TFT_BL pin in Section 2
// below. The backlight will be turned ON when tft.begin() is called, but the library
// needs to know if the LEDs are ON with the pin HIGH or LOW. If the LEDs are to be
// driven with a PWM signal or turned OFF/ON then this must be handled by the user
// sketch. e.g. with digitalWrite(TFT_BL, LOW);
#define TFT_BACKLIGHT_ON LOW // HIGH or LOW are options
// ##################################################################################
//
// Section 2. Define the pins that are used to interface with the display here
//
// ##################################################################################
// We must use hardware SPI, a minimum of 3 GPIO pins is needed.
// Typical setup for ESP8266 NodeMCU ESP-12 is :
//
// Display SDO/MISO to NodeMCU pin D6 (or leave disconnected if not reading TFT)
// Display LED to NodeMCU pin VIN (or 5V, see below)
// Display SCK to NodeMCU pin D5
// Display SDI/MOSI to NodeMCU pin D7
// Display DC (RS/AO)to NodeMCU pin D3
// Display RESET to NodeMCU pin D4 (or RST, see below)
// Display CS to NodeMCU pin D8 (or GND, see below)
// Display GND to NodeMCU pin GND (0V)
// Display VCC to NodeMCU 5V or 3.3V
//
// The TFT RESET pin can be connected to the NodeMCU RST pin or 3.3V to free up a control pin
//
// The DC (Data Command) pin may be labeled AO or RS (Register Select)
//
// With some displays such as the ILI9341 the TFT CS pin can be connected to GND if no more
// SPI devices (e.g. an SD Card) are connected, in this case comment out the #define TFT_CS
// line below so it is NOT defined. Other displays such at the ST7735 require the TFT CS pin
// to be toggled during setup, so in these cases the TFT_CS line must be defined and connected.
//
// The NodeMCU D0 pin can be used for RST
//
//
// Note: only some versions of the NodeMCU provide the USB 5V on the VIN pin
// If 5V is not available at a pin you can use 3.3V but backlight brightness
// will be lower.
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP8266 SETUP ######
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
//#define TFT_CS PIN_D8 // Chip select control pin D8
//#define TFT_DC PIN_D3 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
//#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin)
//#define TOUCH_CS PIN_D2 // Chip select pin (T_CS) of touch screen
//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
// ###### FOR ESP8266 OVERLAP MODE EDIT THE PIN NUMBERS IN THE FOLLOWING LINES ######
// Overlap mode shares the ESP8266 FLASH SPI bus with the TFT so has a performance impact
// but saves pins for other functions. It is best not to connect MISO as some displays
// do not tristate that line wjen chip select is high!
// On NodeMCU 1.0 SD0=MISO, SD1=MOSI, CLK=SCLK to connect to TFT in overlap mode
// On NodeMCU V3 S0 =MISO, S1 =MOSI, S2 =SCLK
// In ESP8266 overlap mode the following must be defined
//#define TFT_SPI_OVERLAP
// In ESP8266 overlap mode the TFT chip select MUST connect to pin D3
//#define TFT_CS PIN_D3
//#define TFT_DC PIN_D5 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP ######
// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins
// Marauder Mini
#define TFT_CS 17 // Chip select control pin D8
#define TFT_DC 16 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to NodeMCU RST, see next line)
#define TOUCH_CS -1
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_BL 32
/*
// ESP32 Marauder
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 17 // Chip select control pin
#define TFT_DC 16 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
*/
/////////////////////////////
// ESP32 Centauri
/*
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 27 // Chip select control pin
#define TFT_DC 26 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
*/
/////////////////////////////
//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only
// For the M5Stack module use these #define lines
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS 14 // Chip select control pin
//#define TFT_DC 27 // Data Command control pin
//#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
//#define TFT_BL 32 // LED back-light (required for M5Stack)
// ###### EDIT THE PINs BELOW TO SUIT YOUR ESP32 PARALLEL TFT SETUP ######
// The library supports 8 bit parallel TFTs with the ESP32, the pin
// selection below is compatible with ESP32 boards in UNO format.
// Wemos D32 boards need to be modified, see diagram in Tools folder.
// Only ILI9481 and ILI9341 based displays have been tested!
// Parallel bus is only supported on ESP32
// Uncomment line below to use ESP32 Parallel interface instead of SPI
//#define ESP32_PARALLEL
// The ESP32 and TFT the pins used for testing are:
//#define TFT_CS 33 // Chip select control pin (library pulls permanently low
//#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31
//#define TFT_RST 32 // Reset pin, toggles on startup
//#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31
//#define TFT_RD 2 // Read strobe control pin
//#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus
//#define TFT_D1 13 // so a single register write sets/clears all bits.
//#define TFT_D2 26 // Pins can be randomly assigned, this does not affect
//#define TFT_D3 25 // TFT screen update performance.
//#define TFT_D4 17
//#define TFT_D5 16
//#define TFT_D6 27
//#define TFT_D7 14
// ##################################################################################
//
// Section 3. Define the fonts that are to be used here
//
// ##################################################################################
// Comment out the #defines below with // to stop that font being loaded
// The ESP8366 and ESP32 have plenty of memory so commenting out fonts is not
// normally necessary. If all fonts are loaded the extra FLASH space required is
// about 17Kbytes. To save FLASH space only enable the fonts you need!
#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
// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT
// ##################################################################################
//
// Section 4. Other options
//
// ##################################################################################
// Define the SPI clock frequency, this affects the graphics rendering speed. Too
// fast and the TFT driver will not keep up and display corruption appears.
// With an ILI9341 display 40MHz works OK, 80MHz sometimes fails
// With a ST7735 display more than 27MHz may not work (spurious pixels and lines)
// With an ILI9163 display 27 MHz works OK.
// #define SPI_FREQUENCY 1000000
//#define SPI_FREQUENCY 5000000
// #define SPI_FREQUENCY 10000000
#define SPI_FREQUENCY 20000000
//#define SPI_FREQUENCY 27000000 // Marauder // Actually sets it to 26.67MHz = 80/3
// #define SPI_FREQUENCY 40000000
// #define SPI_FREQUENCY 80000000
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000
// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
//#define USE_HSPI_PORT
// Comment out the following #define if "SPI Transactions" do not need to be
// supported. When commented out the code size will be smaller and sketches will
// run slightly faster, so leave it commented out unless you need it!
// Transaction support is needed to work with SD library but not needed with TFT_SdFat
// Transaction support is required if other SPI devices are connected.
// Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex)
// so changing it here has no effect
// #define SUPPORT_TRANSACTIONS

316
User_Setup_og_marauder.h Normal file
View File

@@ -0,0 +1,316 @@
// USER DEFINED SETTINGS
// Set driver type, fonts to be loaded, pins used and SPI control method etc
//
// See the User_Setup_Select.h file if you wish to be able to define multiple
// setups and then easily select which setup file is used by the compiler.
//
// If this file is edited correctly then all the library example sketches should
// run without the need to make any more changes for a particular hardware setup!
// Note that some sketches are designed for a particular TFT pixel width/height
// ##################################################################################
//
// Section 1. Call up the right driver file and any options for it
//
// ##################################################################################
// Display type - only define if RPi display
//#define RPI_DRIVER
// Only define one driver, the other ones must be commented out
#define ILI9341_DRIVER // OG Marauder
//#define ST7735_DRIVER // Marauder Mini // Define additional parameters below for this display
//#define ILI9163_DRIVER // Define additional parameters below for this display
//#define S6D02A1_DRIVER
//#define RPI_ILI9486_DRIVER // 20MHz maximum SPI
//#define HX8357D_DRIVER
//#define ILI9481_DRIVER
//#define ILI9486_DRIVER
//#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
//#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display
//#define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display
//#define R61581_DRIVER
//#define RM68140_DRIVER
//#define ST7796_DRIVER
// Some displays support SPI reads via the MISO pin, other displays have a single
// bi-directional SDA pin and the library will try to read this via the MOSI line.
// To use the SDA line for reading data from the TFT uncomment the following line:
// #define TFT_SDA_READ // This option is for ESP32 ONLY, tested with ST7789 display only
// 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
// For M5Stack ESP32 module with integrated ILI9341 display ONLY, remove // in line below
// #define M5STACK
// For ST7789, ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation
// #define TFT_WIDTH 80
// #define TFT_WIDTH 128 // Marauder Mini
// #define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320
// #define TFT_HEIGHT 160
// #define TFT_HEIGHT 128 // Marauder Mini
// #define TFT_HEIGHT 240 // ST7789 240 x 240
// #define TFT_HEIGHT 320 // ST7789 240 x 320
// For ST7735 ONLY, define the type of display, originally this was based on the
// colour of the tab on the screen protector film but this is not always true, so try
// out the different options below if the screen does not display graphics correctly,
// e.g. colours wrong, mirror images, or tray pixels at the edges.
// Comment out ALL BUT ONE of these options for a ST7735 display driver, save this
// this User_Setup file, then rebuild and upload the sketch to the board again:
// #define ST7735_INITB
// #define ST7735_GREENTAB
// #define ST7735_GREENTAB2
// #define ST7735_GREENTAB3
// #define ST7735_GREENTAB128 // For 128 x 128 display
// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset)
// #define ST7735_REDTAB
// #define ST7735_BLACKTAB
// #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset
// If colours are inverted (white shows as black) then uncomment one of the next
// 2 lines try both options, one of the options should correct the inversion.
// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF
// If a backlight control signal is available then define the TFT_BL pin in Section 2
// below. The backlight will be turned ON when tft.begin() is called, but the library
// needs to know if the LEDs are ON with the pin HIGH or LOW. If the LEDs are to be
// driven with a PWM signal or turned OFF/ON then this must be handled by the user
// sketch. e.g. with digitalWrite(TFT_BL, LOW);
// #define TFT_BACKLIGHT_ON LOW // HIGH or LOW are options
// ##################################################################################
//
// Section 2. Define the pins that are used to interface with the display here
//
// ##################################################################################
// We must use hardware SPI, a minimum of 3 GPIO pins is needed.
// Typical setup for ESP8266 NodeMCU ESP-12 is :
//
// Display SDO/MISO to NodeMCU pin D6 (or leave disconnected if not reading TFT)
// Display LED to NodeMCU pin VIN (or 5V, see below)
// Display SCK to NodeMCU pin D5
// Display SDI/MOSI to NodeMCU pin D7
// Display DC (RS/AO)to NodeMCU pin D3
// Display RESET to NodeMCU pin D4 (or RST, see below)
// Display CS to NodeMCU pin D8 (or GND, see below)
// Display GND to NodeMCU pin GND (0V)
// Display VCC to NodeMCU 5V or 3.3V
//
// The TFT RESET pin can be connected to the NodeMCU RST pin or 3.3V to free up a control pin
//
// The DC (Data Command) pin may be labeled AO or RS (Register Select)
//
// With some displays such as the ILI9341 the TFT CS pin can be connected to GND if no more
// SPI devices (e.g. an SD Card) are connected, in this case comment out the #define TFT_CS
// line below so it is NOT defined. Other displays such at the ST7735 require the TFT CS pin
// to be toggled during setup, so in these cases the TFT_CS line must be defined and connected.
//
// The NodeMCU D0 pin can be used for RST
//
//
// Note: only some versions of the NodeMCU provide the USB 5V on the VIN pin
// If 5V is not available at a pin you can use 3.3V but backlight brightness
// will be lower.
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP8266 SETUP ######
// For NodeMCU - use pin numbers in the form PIN_Dx where Dx is the NodeMCU pin designation
//#define TFT_CS PIN_D8 // Chip select control pin D8
//#define TFT_DC PIN_D3 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
//#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin)
//#define TOUCH_CS PIN_D2 // Chip select pin (T_CS) of touch screen
//#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only
// ###### FOR ESP8266 OVERLAP MODE EDIT THE PIN NUMBERS IN THE FOLLOWING LINES ######
// Overlap mode shares the ESP8266 FLASH SPI bus with the TFT so has a performance impact
// but saves pins for other functions. It is best not to connect MISO as some displays
// do not tristate that line wjen chip select is high!
// On NodeMCU 1.0 SD0=MISO, SD1=MOSI, CLK=SCLK to connect to TFT in overlap mode
// On NodeMCU V3 S0 =MISO, S1 =MOSI, S2 =SCLK
// In ESP8266 overlap mode the following must be defined
//#define TFT_SPI_OVERLAP
// In ESP8266 overlap mode the TFT chip select MUST connect to pin D3
//#define TFT_CS PIN_D3
//#define TFT_DC PIN_D5 // Data Command control pin
//#define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP ######
// For ESP32 Dev board (only tested with ILI9341 display)
// The hardware SPI can be mapped to any pins
// Marauder Mini
/*
#define TFT_CS 17 // Chip select control pin D8
#define TFT_DC 16 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_BL 32
*/
// ESP32 Marauder
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 17 // Chip select control pin
#define TFT_DC 16 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
/////////////////////////////
// ESP32 Centauri
/*
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 27 // Chip select control pin
#define TFT_DC 26 // Data Command control pin
#define TFT_RST 5 // Reset pin (could connect to RST pin)
//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST
#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin)
#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen
*/
/////////////////////////////
//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only
// For the M5Stack module use these #define lines
//#define TFT_MISO 19
//#define TFT_MOSI 23
//#define TFT_SCLK 18
//#define TFT_CS 14 // Chip select control pin
//#define TFT_DC 27 // Data Command control pin
//#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin)
//#define TFT_BL 32 // LED back-light (required for M5Stack)
// ###### EDIT THE PINs BELOW TO SUIT YOUR ESP32 PARALLEL TFT SETUP ######
// The library supports 8 bit parallel TFTs with the ESP32, the pin
// selection below is compatible with ESP32 boards in UNO format.
// Wemos D32 boards need to be modified, see diagram in Tools folder.
// Only ILI9481 and ILI9341 based displays have been tested!
// Parallel bus is only supported on ESP32
// Uncomment line below to use ESP32 Parallel interface instead of SPI
//#define ESP32_PARALLEL
// The ESP32 and TFT the pins used for testing are:
//#define TFT_CS 33 // Chip select control pin (library pulls permanently low
//#define TFT_DC 15 // Data Command control pin - must use a pin in the range 0-31
//#define TFT_RST 32 // Reset pin, toggles on startup
//#define TFT_WR 4 // Write strobe control pin - must use a pin in the range 0-31
//#define TFT_RD 2 // Read strobe control pin
//#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus
//#define TFT_D1 13 // so a single register write sets/clears all bits.
//#define TFT_D2 26 // Pins can be randomly assigned, this does not affect
//#define TFT_D3 25 // TFT screen update performance.
//#define TFT_D4 17
//#define TFT_D5 16
//#define TFT_D6 27
//#define TFT_D7 14
// ##################################################################################
//
// Section 3. Define the fonts that are to be used here
//
// ##################################################################################
// Comment out the #defines below with // to stop that font being loaded
// The ESP8366 and ESP32 have plenty of memory so commenting out fonts is not
// normally necessary. If all fonts are loaded the extra FLASH space required is
// about 17Kbytes. To save FLASH space only enable the fonts you need!
#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
// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT
// ##################################################################################
//
// Section 4. Other options
//
// ##################################################################################
// Define the SPI clock frequency, this affects the graphics rendering speed. Too
// fast and the TFT driver will not keep up and display corruption appears.
// With an ILI9341 display 40MHz works OK, 80MHz sometimes fails
// With a ST7735 display more than 27MHz may not work (spurious pixels and lines)
// With an ILI9163 display 27 MHz works OK.
// #define SPI_FREQUENCY 1000000
//#define SPI_FREQUENCY 5000000
// #define SPI_FREQUENCY 10000000
// #define SPI_FREQUENCY 20000000
#define SPI_FREQUENCY 27000000 // Marauder // Actually sets it to 26.67MHz = 80/3
// #define SPI_FREQUENCY 40000000
// #define SPI_FREQUENCY 80000000
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000
// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
//#define USE_HSPI_PORT
// Comment out the following #define if "SPI Transactions" do not need to be
// supported. When commented out the code size will be smaller and sketches will
// run slightly faster, so leave it commented out unless you need it!
// Transaction support is needed to work with SD library but not needed with TFT_SdFat
// Transaction support is required if other SPI devices are connected.
// Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex)
// so changing it here has no effect
// #define SUPPORT_TRANSACTIONS

File diff suppressed because one or more lines are too long

View File

@@ -1,43 +1,49 @@
#include "BatteryInterface.h"
#include "lang_var.h"
BatteryInterface::BatteryInterface() {
}
void BatteryInterface::main(uint32_t currentTime) {
if (currentTime != 0) {
if (currentTime - initTime >= 3000) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
int8_t new_level = this->getBatteryLevel();
//this->battery_level = this->getBatteryLevel();
if (this->battery_level != new_level) {
Serial.println("Battery Level changed: " + (String)new_level);
this->battery_level = new_level;
#ifndef MARAUDER_FLIPPER
if (currentTime != 0) {
if (currentTime - initTime >= 3000) {
//Serial.println("Checking Battery Level");
this->initTime = millis();
int8_t new_level = this->getBatteryLevel();
//this->battery_level = this->getBatteryLevel();
if (this->battery_level != new_level) {
Serial.println(text00 + (String)new_level);
this->battery_level = new_level;
}
}
}
}
#endif
}
void BatteryInterface::RunSetup() {
Wire.begin(I2C_SDA, I2C_SCL);
this->initTime = millis();
#ifndef MARAUDER_FLIPPER
Wire.begin(I2C_SDA, I2C_SCL);
this->initTime = millis();
#endif
}
int8_t BatteryInterface::getBatteryLevel() {
Wire.beginTransmission(IP5306_ADDR);
Wire.write(0x78);
if (Wire.endTransmission(false) == 0 &&
Wire.requestFrom(0x75, 1)) {
this->i2c_supported = true;
switch (Wire.read() & 0xF0) {
case 0xE0: return 25;
case 0xC0: return 50;
case 0x80: return 75;
case 0x00: return 100;
default: return 0;
#ifndef MARAUDER_FLIPPER
Wire.beginTransmission(IP5306_ADDR);
Wire.write(0x78);
if (Wire.endTransmission(false) == 0 &&
Wire.requestFrom(0x75, 1)) {
this->i2c_supported = true;
switch (Wire.read() & 0xF0) {
case 0xE0: return 25;
case 0xC0: return 50;
case 0x80: return 75;
case 0x00: return 100;
default: return 0;
}
}
}
this->i2c_supported = false;
return -1;
this->i2c_supported = false;
return -1;
#endif
}

View File

@@ -3,7 +3,11 @@
#include <Arduino.h>
#include <Wire.h>
#include "configs.h"
#ifndef MARAUDER_FLIPPER
#include <Wire.h>
#endif
#define I2C_SDA 33
#define I2C_SCL 22

View File

@@ -1,4 +1,5 @@
#include "Buffer.h"
#include "lang_var.h"
Buffer::Buffer(){
bufA = (uint8_t*)malloc(BUF_SIZE);
@@ -37,7 +38,7 @@ void Buffer::close(fs::FS* fs){
if(!writing) return;
forceSave(fs);
writing = false;
Serial.println("file closed");
Serial.println(text01);
}
void Buffer::addPacket(uint8_t* buf, uint32_t len){
@@ -123,7 +124,7 @@ void Buffer::save(fs::FS* fs){
file = fs->open(fileName, FILE_APPEND);
if (!file) {
Serial.println("Failed to open file '"+fileName+"'");
Serial.println(text02 + fileName+"'");
//useSD = false;
return;
}
@@ -159,7 +160,7 @@ void Buffer::forceSave(fs::FS* fs){
file = fs->open(fileName, FILE_APPEND);
if (!file) {
Serial.println("Failed to open file '"+fileName+"'");
Serial.println(text02+fileName+"'");
//useSD = false;
return;
}

View File

@@ -0,0 +1,609 @@
#include "CommandLine.h"
CommandLine::CommandLine() {
}
void CommandLine::RunSetup() {
Serial.println(this->ascii_art);
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.print("> ");
}
String CommandLine::getSerialInput() {
String input = "";
if (Serial.available() > 0)
input = Serial.readStringUntil('\n');
input.trim();
return input;
}
void CommandLine::main(uint32_t currentTime) {
String input = this->getSerialInput();
this->runCommand(input);
if (input != "")
Serial.print("> ");
}
LinkedList<String> CommandLine::parseCommand(String input, char* delim) {
LinkedList<String> cmd_args;
if (input != "") {
char fancy[input.length() + 1] = {};
input.toCharArray(fancy, input.length() + 1);
char* ptr = strtok(fancy, delim);
while (ptr != NULL) {
cmd_args.add(String(ptr));
ptr = strtok(NULL, delim);
}
}
return cmd_args;
}
int CommandLine::argSearch(LinkedList<String>* cmd_args_list, String key) {
for (int i = 0; i < cmd_args_list->size(); i++) {
if (cmd_args_list->get(i) == key)
return i;
}
return -1;
}
bool CommandLine::checkValueExists(LinkedList<String>* cmd_args_list, int index) {
if (index < cmd_args_list->size() - 1)
return true;
return false;
}
bool CommandLine::inRange(int max, int index) {
if ((index >= 0) && (index < max))
return true;
return false;
}
bool CommandLine::apSelected() {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected)
return true;
}
return false;
}
bool CommandLine::hasSSIDs() {
if (ssids->size() == 0)
return false;
return true;
}
void CommandLine::runCommand(String input) {
if (input != "")
Serial.println("#" + input);
else
return;
LinkedList<String> cmd_args = this->parseCommand(input, " ");
//// Admin commands
// Help
if (cmd_args.get(0) == HELP_CMD) {
Serial.println(HELP_HEAD);
Serial.println(HELP_CH_CMD);
Serial.println(HELP_SETTINGS_CMD);
Serial.println(HELP_CLEARAP_CMD_A);
Serial.println(HELP_CLEARAP_CMD_B);
Serial.println(HELP_REBOOT_CMD);
Serial.println(HELP_UPDATE_CMD_A);
Serial.println(HELP_UPDATE_CMD_B);
// WiFi sniff/scan
Serial.println(HELP_SCANAP_CMD);
Serial.println(HELP_SNIFF_BEACON_CMD);
Serial.println(HELP_SNIFF_PROBE_CMD);
Serial.println(HELP_SNIFF_PWN_CMD);
Serial.println(HELP_SNIFF_ESP_CMD);
Serial.println(HELP_SNIFF_DEAUTH_CMD);
Serial.println(HELP_SNIFF_PMKID_CMD);
Serial.println(HELP_STOPSCAN_CMD);
// WiFi attack
Serial.println(HELP_ATTACK_CMD);
// WiFi Aux
Serial.println(HELP_LIST_AP_CMD_A);
Serial.println(HELP_LIST_AP_CMD_B);
Serial.println(HELP_SEL_CMD_A);
Serial.println(HELP_SEL_CMD_B);
Serial.println(HELP_SSID_CMD_A);
Serial.println(HELP_SSID_CMD_B);
// Bluetooth sniff/scan
Serial.println(HELP_BT_SNIFF_CMD);
Serial.println(HELP_BT_SKIM_CMD);
Serial.println(HELP_FOOT);
return;
}
// Stop Scan
if (cmd_args.get(0) == STOPSCAN_CMD) {
if (wifi_scan_obj.currentScanMode == OTA_UPDATE) {
wifi_scan_obj.currentScanMode = WIFI_SCAN_OFF;
//#ifdef HAS_SCREEN
// menu_function_obj.changeMenu(menu_function_obj.updateMenu.parentMenu);
//#endif
WiFi.softAPdisconnect(true);
web_obj.shutdownServer();
return;
}
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
Serial.println("Stopping WiFi tran/recv");
// If we don't do this, the text and button coordinates will be off
#ifdef HAS_SCREEN
display_obj.tft.init();
menu_function_obj.changeMenu(menu_function_obj.current_menu);
#endif
}
// Channel command
else if (cmd_args.get(0) == CH_CMD) {
// Search for channel set arg
int ch_set = this->argSearch(&cmd_args, "-s");
if (cmd_args.size() == 1) {
Serial.println("Current channel: " + (String)wifi_scan_obj.set_channel);
}
else if (ch_set != -1) {
wifi_scan_obj.set_channel = cmd_args.get(ch_set + 1).toInt();
wifi_scan_obj.changeChannel();
Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
}
}
// Clear APs
else if (cmd_args.get(0) == CLEARAP_CMD) {
int ap_sw = this->argSearch(&cmd_args, "-a"); // APs
int ss_sw = this->argSearch(&cmd_args, "-s"); // SSIDs
if (ap_sw != -1)
wifi_scan_obj.RunClearAPs();
if (ss_sw != -1)
wifi_scan_obj.RunClearSSIDs();
}
else if (cmd_args.get(0) == SETTINGS_CMD) {
int ss_sw = this->argSearch(&cmd_args, "-s"); // Set setting
int re_sw = this->argSearch(&cmd_args, "-r"); // Reset setting
int en_sw = this->argSearch(&cmd_args, "enable"); // enable setting
int da_sw = this->argSearch(&cmd_args, "disable"); // disable setting
if (re_sw != -1) {
settings_obj.createDefaultSettings(SPIFFS);
return;
}
if (ss_sw == -1) {
settings_obj.printJsonSettings(settings_obj.getSettingsString());
}
else {
bool result = false;
String setting_name = cmd_args.get(ss_sw + 1);
if (en_sw != -1)
result = settings_obj.saveSetting<bool>(setting_name, true);
else if (da_sw != -1)
result = settings_obj.saveSetting<bool>(setting_name, false);
else {
Serial.println("You did not properly enable/disable this setting.");
return;
}
if (!result) {
Serial.println("Could not successfully update setting \"" + setting_name + "\"");
return;
}
}
}
else if (cmd_args.get(0) == REBOOT_CMD) {
Serial.println("Rebooting...");
ESP.restart();
}
//// WiFi/Bluetooth Scan/Attack commands
if (!wifi_scan_obj.scanning()) {
// AP Scan
if (cmd_args.get(0) == SCANAP_CMD) {
int full_sw = -1;
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
if (full_sw == -1) {
Serial.println("Starting AP scan. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP, TFT_MAGENTA);
}
else {
Serial.println("Starting Full AP scan. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_TARGET_AP_FULL, TFT_MAGENTA);
}
}
// Beacon sniff
else if (cmd_args.get(0) == SNIFF_BEACON_CMD) {
Serial.println("Starting Beacon sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
}
// Probe sniff
else if (cmd_args.get(0) == SNIFF_PROBE_CMD) {
Serial.println("Starting Probe sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_MAGENTA);
}
// Deauth sniff
else if (cmd_args.get(0) == SNIFF_DEAUTH_CMD) {
Serial.println("Starting Deauth sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
}
// Pwn sniff
else if (cmd_args.get(0) == SNIFF_PWN_CMD) {
Serial.println("Starting Pwnagotchi sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_MAGENTA);
}
// Espressif sniff
else if (cmd_args.get(0) == SNIFF_ESP_CMD) {
Serial.println("Starting Espressif device sniff. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_MAGENTA);
}
// PMKID sniff
else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
int ch_sw = this->argSearch(&cmd_args, "-c");
int d_sw = this->argSearch(&cmd_args, "-d"); // Deauth for pmkid
if (ch_sw != -1) {
wifi_scan_obj.set_channel = cmd_args.get(ch_sw + 1).toInt();
wifi_scan_obj.changeChannel();
Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
}
if (d_sw == -1) {
Serial.println("Starting PMKID sniff on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
}
else {
Serial.println("Starting PMKID sniff with deauthentication on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_SCAN_ACTIVE_EAPOL, TFT_VIOLET);
}
}
//// WiFi attack commands
// attack
if (cmd_args.get(0) == ATTACK_CMD) {
int attack_type_switch = this->argSearch(&cmd_args, "-t"); // Required
int list_beacon_sw = this->argSearch(&cmd_args, "-l");
int rand_beacon_sw = this->argSearch(&cmd_args, "-r");
int ap_beacon_sw = this->argSearch(&cmd_args, "-a");
if (attack_type_switch == -1) {
Serial.println("You must specify an attack type");
return;
}
else {
String attack_type = cmd_args.get(attack_type_switch + 1);
// Branch on attack type
// Deauth
if (attack_type == ATTACK_TYPE_DEAUTH) {
if (!this->apSelected()) {
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
return;
}
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting Deauthentication attack. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH, TFT_RED);
}
// Beacon
else if (attack_type == ATTACK_TYPE_BEACON) {
// spam by list
if (list_beacon_sw != -1) {
if (!this->hasSSIDs()) {
Serial.println("You don't have any SSIDs in your list. Use " + (String)SSID_CMD);
return;
}
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting Beacon list spam. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_LIST, TFT_RED);
}
// spam with random
else if (rand_beacon_sw != -1) {
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting random Beacon spam. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);
}
// Spam from AP list
else if (ap_beacon_sw != -1) {
if (!this->apSelected()) {
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
return;
}
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
Serial.println("Starting Targeted AP Beacon spam. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.StartScan(WIFI_ATTACK_AP_SPAM, TFT_MAGENTA);
}
else {
Serial.println("You did not specify a beacon attack type");
}
}
else if (attack_type == ATTACK_TYPE_PROBE) {
if (!this->apSelected()) {
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
return;
}
Serial.println("Starting Probe spam. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED);
}
else if (attack_type == ATTACK_TYPE_RR) {
Serial.println("Starting Rick Roll Beacon spam. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);
}
else {
Serial.println("Attack type not properly defined");
return;
}
}
}
//// Bluetooth scan/attack commands
// Bluetooth scan
if (cmd_args.get(0) == BT_SNIFF_CMD) {
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
}
// Bluetooth CC Skimmer scan
else if (cmd_args.get(0) == BT_SKIM_CMD) {
Serial.println("Starting Bluetooth CC Skimmer scan. Stop with " + (String)STOPSCAN_CMD);
#ifdef HAS_SCREEN
display_obj.clearScreen();
menu_function_obj.drawStatusBar();
#endif
wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
}
// Update command
if (cmd_args.get(0) == UPDATE_CMD) {
int w_sw = this->argSearch(&cmd_args, "-w"); // Web update
int sd_sw = this->argSearch(&cmd_args, "-s"); // SD Update
// Update via OTA
if (w_sw != -1) {
Serial.println("Starting Marauder OTA Update. Stop with " + (String)STOPSCAN_CMD);
wifi_scan_obj.currentScanMode = OTA_UPDATE;
//#ifdef HAS_SCREEN
// menu_function_obj.changeMenu(menu_function_obj.updateMenu);
//#endif
web_obj.setupOTAupdate();
}
// Update via SD
else if (sd_sw != -1) {
if (!sd_obj.supported) {
Serial.println("SD card is not connected. Cannot perform SD Update");
return;
}
}
}
}
//// WiFi aux commands
// List access points
if (cmd_args.get(0) == LIST_AP_CMD) {
int ap_sw = this->argSearch(&cmd_args, "-a");
int ss_sw = this->argSearch(&cmd_args, "-s");
// List APs
if (ap_sw != -1) {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected)
Serial.println("[" + (String)i + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi + " (selected)");
else
Serial.println("[" + (String)i + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi);
}
}
// List SSIDs
else if (ss_sw != -1) {
for (int i = 0; i < ssids->size(); i++) {
if (ssids->get(i).selected)
Serial.println("[" + (String)i + "] " + ssids->get(i).essid + " (selected)");
else
Serial.println("[" + (String)i + "] " + ssids->get(i).essid);
}
}
else {
Serial.println("You did not specify which list to show");
return;
}
}
// Select access points or stations
else if (cmd_args.get(0) == SEL_CMD) {
// Get switches
int ap_sw = this->argSearch(&cmd_args, "-a");
int ss_sw = this->argSearch(&cmd_args, "-s");
// select Access points
if (ap_sw != -1) {
// Get list of indices
LinkedList<String> ap_index = this->parseCommand(cmd_args.get(ap_sw + 1), ",");
// Select ALL APs
if (cmd_args.get(ap_sw + 1) == "all") {
for (int i = 0; i < access_points->size(); i++) {
if (access_points->get(i).selected) {
// Unselect "selected" ap
AccessPoint new_ap = access_points->get(i);
new_ap.selected = false;
access_points->set(i, new_ap);
}
else {
// Select "unselected" ap
AccessPoint new_ap = access_points->get(i);
new_ap.selected = true;
access_points->set(i, new_ap);
}
}
}
// Select specific APs
else {
// Mark APs as selected
for (int i = 0; i < ap_index.size(); i++) {
int index = ap_index.get(i).toInt();
if (!this->inRange(access_points->size(), index)) {
Serial.println("Index not in range: " + (String)index);
continue;
}
if (access_points->get(index).selected) {
// Unselect "selected" ap
AccessPoint new_ap = access_points->get(index);
new_ap.selected = false;
access_points->set(index, new_ap);
}
else {
// Select "unselected" ap
AccessPoint new_ap = access_points->get(index);
new_ap.selected = true;
access_points->set(index, new_ap);
}
}
}
}
// select ssids
else if (ss_sw != -1) {
// Get list of indices
LinkedList<String> ss_index = this->parseCommand(cmd_args.get(ss_sw + 1), ",");
// Mark APs as selected
for (int i = 0; i < ss_index.size(); i++) {
int index = ss_index.get(i).toInt();
if (!this->inRange(ssids->size(), index)) {
Serial.println("Index not in range: " + (String)index);
continue;
}
if (ssids->get(index).selected) {
// Unselect "selected" ap
ssid new_ssid = ssids->get(index);
new_ssid.selected = false;
ssids->set(index, new_ssid);
}
else {
// Select "unselected" ap
ssid new_ssid = ssids->get(index);
new_ssid.selected = true;
ssids->set(index, new_ssid);
}
}
}
else {
Serial.println("You did not specify which list to select from");
return;
}
}
// SSID stuff
else if (cmd_args.get(0) == SSID_CMD) {
int add_sw = this->argSearch(&cmd_args, "-a");
int gen_sw = this->argSearch(&cmd_args, "-g");
int spc_sw = this->argSearch(&cmd_args, "-n");
int rem_sw = this->argSearch(&cmd_args, "-r");
// Add ssid
if (add_sw != -1) {
// Generate random
if (gen_sw != -1) {
int gen_count = cmd_args.get(gen_sw + 1).toInt();
wifi_scan_obj.generateSSIDs(gen_count);
}
// Add specific
else if (spc_sw != -1) {
String essid = cmd_args.get(spc_sw + 1);
wifi_scan_obj.addSSID(essid);
}
else {
Serial.println("You did not specify how to add SSIDs");
}
}
// Remove SSID
else if (rem_sw != -1) {
int index = cmd_args.get(rem_sw + 1).toInt();
if (!this->inRange(ssids->size(), index)) {
Serial.println("Index not in range: " + (String)index);
return;
}
ssids->remove(index);
}
else {
Serial.println("You did not specify whether to add or remove SSIDs");
return;
}
}
}

View File

@@ -0,0 +1,149 @@
#ifndef CommandLine_h
#define CommandLine_h
#include "configs.h"
#ifdef HAS_SCREEN
#include "MenuFunctions.h"
#include "Display.h"
#endif
#include "WiFiScan.h"
#include "Web.h"
#include "SDInterface.h"
#include "settings.h"
#ifdef HAS_SCREEN
extern MenuFunctions menu_function_obj;
extern Display display_obj;
#endif
extern WiFiScan wifi_scan_obj;
extern Web web_obj;
extern SDInterface sd_obj;
extern Settings settings_obj;
extern LinkedList<AccessPoint>* access_points;
extern LinkedList<ssid>* ssids;
extern const String PROGMEM version_number;
//// Commands
// Admin
const char PROGMEM CH_CMD[] = "channel";
const char PROGMEM CLEARAP_CMD[] = "clearlist";
const char PROGMEM REBOOT_CMD[] = "reboot";
const char PROGMEM UPDATE_CMD[] = "update";
const char PROGMEM HELP_CMD[] = "help";
const char PROGMEM SETTINGS_CMD[] = "settings";
// WiFi sniff/scan
const char PROGMEM SCANAP_CMD[] = "scanap";
const char PROGMEM SNIFF_BEACON_CMD[] = "sniffbeacon";
const char PROGMEM SNIFF_PROBE_CMD[] = "sniffprobe";
const char PROGMEM SNIFF_PWN_CMD[] = "sniffpwn";
const char PROGMEM SNIFF_ESP_CMD[] = "sniffesp";
const char PROGMEM SNIFF_DEAUTH_CMD[] = "sniffdeauth";
const char PROGMEM SNIFF_PMKID_CMD[] = "sniffpmkid";
const char PROGMEM STOPSCAN_CMD[] = "stopscan";
// WiFi attack
const char PROGMEM ATTACK_CMD[] = "attack";
const char PROGMEM ATTACK_TYPE_DEAUTH[] = "deauth";
const char PROGMEM ATTACK_TYPE_BEACON[] = "beacon";
const char PROGMEM ATTACK_TYPE_PROBE[] = "probe";
const char PROGMEM ATTACK_TYPE_RR[] = "rickroll";
// WiFi Aux
const char PROGMEM LIST_AP_CMD[] = "list";
const char PROGMEM SEL_CMD[] = "select";
const char PROGMEM SSID_CMD[] = "ssid";
// Bluetooth sniff/scan
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM BT_SKIM_CMD[] = "sniffskim";
//// Command help messages
// Admin
const char PROGMEM HELP_HEAD[] = "============ Commands ============";
const char PROGMEM HELP_CH_CMD[] = "channel [-s <channel>]";
const char PROGMEM HELP_CLEARAP_CMD_A[] = "clearlist -a";
const char PROGMEM HELP_CLEARAP_CMD_B[] = "clearlist -s";
const char PROGMEM HELP_REBOOT_CMD[] = "reboot";
const char PROGMEM HELP_UPDATE_CMD_A[] = "update -s";
const char PROGMEM HELP_UPDATE_CMD_B[] = "update -w";
const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>]/[-r]";
// WiFi sniff/scan
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
const char PROGMEM HELP_SNIFF_BEACON_CMD[] = "sniffbeacon";
const char PROGMEM HELP_SNIFF_PROBE_CMD[] = "sniffprobe";
const char PROGMEM HELP_SNIFF_PWN_CMD[] = "sniffpwn";
const char PROGMEM HELP_SNIFF_ESP_CMD[] = "sniffesp";
const char PROGMEM HELP_SNIFF_DEAUTH_CMD[] = "sniffdeauth";
const char PROGMEM HELP_SNIFF_PMKID_CMD[] = "sniffpmkid [-c <channel>]";
const char PROGMEM HELP_STOPSCAN_CMD[] = "stopscan";
// WiFi attack
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth/probe/rickroll>";
// WiFi Aux
const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
const char PROGMEM HELP_LIST_AP_CMD_B[] = "list -a";
const char PROGMEM HELP_SEL_CMD_A[] = "select -a <index (comma separated)>";
const char PROGMEM HELP_SEL_CMD_B[] = "select -s <index (comma separated)>";
const char PROGMEM HELP_SSID_CMD_A[] = "ssid -a [-g <count>/-n <name>]";
const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
// Bluetooth sniff/scan
const char PROGMEM HELP_BT_SNIFF_CMD[] = "sniffbt";
const char PROGMEM HELP_BT_SKIM_CMD[] = "sniffskim";
const char PROGMEM HELP_FOOT[] = "==================================";
class CommandLine {
private:
String getSerialInput();
LinkedList<String> parseCommand(String input, char* delim);
void runCommand(String input);
bool checkValueExists(LinkedList<String>* cmd_args_list, int index);
bool inRange(int max, int index);
bool apSelected();
bool hasSSIDs();
int argSearch(LinkedList<String>* cmd_args, String key);
const char* ascii_art =
"\r\n"
" @@@@@@ \r\n"
" @@@@@@@@ \r\n"
" @@@@@@@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
"@@@@@@@ @@@@@@@@@@@@@@@@ \r\n"
"@@@@@ @@@@@@@@@@@@@@@ \r\n"
"@@@@@ @@@@@@@ \r\n"
"@@@@@ @@@@@@ \r\n"
"@@@@@@ @@@@@@@ \r\n"
" @@@@@@ @@@@@@@@@@@@\r\n"
" @@@@@@@ @@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@ @@@@@@ \r\n"
" @@@@@@ @@@@@@ \r\n"
" @@@@@@@@@ \r\n"
" @@@@@@ \r\n"
" @@@@ \r\n"
"\r\n";
public:
CommandLine();
void RunSetup();
void main(uint32_t currentTime);
};
#endif

View File

@@ -1,15 +1,7 @@
#include "Display.h"
#include "lang_var.h"
/*
Big thanks to bodmer for having great TFT and JPEG libraries
https://github.com/bodmer
*/
//PROGMEM lv_obj_t * slider_label;
//PROGMEM lv_obj_t * ta1;
//PROGMEM lv_obj_t * ta2;
#ifdef HAS_SCREEN
Display::Display()
{
@@ -22,128 +14,41 @@ void Display::RunSetup()
// Need to declare new
display_buffer = new LinkedList<String>();
#ifdef SCREEN_BUFFER
screen_buffer = new LinkedList<String>();
#endif
tft.init();
tft.setRotation(0); // Portrait
tft.setCursor(0, 0);
//tft.setFreeFont(&FreeMonoBold9pt7b);
// Calibration data
//uint16_t calData[5] = { 390, 3516, 253, 3520, 7 }; tft.setRotation(1); // Portrait
#ifndef MARAUDER_MINI
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
//Serial.println(F("Using TFT Shield"));
#else if defined(TFT_DIY)
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
//Serial.println(F("Using TFT DIY"));
#endif
tft.setTouch(calData);
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
Serial.println(F("Using TFT Shield"));
#else if defined(TFT_DIY)
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
Serial.println(F("Using TFT DIY"));
#endif
tft.setTouch(calData);
//tft.fillScreen(TFT_BLACK);
clearScreen();
Serial.println("SPI_FREQUENCY: " + (String)SPI_FREQUENCY);
Serial.println("SPI_READ_FREQUENCY: " + (String)SPI_READ_FREQUENCY);
Serial.println("SPI_TOUCH_FREQUENCY: " + (String)SPI_TOUCH_FREQUENCY);
// Initialize file system
// This should probably have its own class
//if (!SPIFFS.begin()) {
// Serial.println(F("SPIFFS initialisation failed!"));
//while (1) yield(); // Stay here twiddling thumbs waiting
//}
//this->initLVGL();
// Draw the title screen
//drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
//showCenterText(version_number, 250);
//tft.drawCentreString(version_number, 120, 250, 2);
//digitalWrite(TFT_BL, HIGH);
//delay(5000);
//Serial.println("SPI_FREQUENCY: " + (String)SPI_FREQUENCY);
//Serial.println("SPI_READ_FREQUENCY:" + (String)SPI_READ_FREQUENCY);
//Serial.println("SPI_TOUCH_FREQUENCY: " + (String)SPI_TOUCH_FREQUENCY);
#ifdef KIT
pinMode(KIT_LED_BUILTIN, OUTPUT);
#endif
}
/* Interrupt driven periodic handler */
/*
void Display::lv_tick_handler()
{
lv_tick_inc(LVGL_TICK_PERIOD);
}*/
/* Display flushing */
/*
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
extern Display display_obj;
uint16_t c;
display_obj.tft.startWrite();
display_obj.tft.setAddrWindow(area->x1, area->y1, (area->x2 - area->x1 + 1), (area->y2 - area->y1 + 1));
for (int y = area->y1; y <= area->y2; y++) {
for (int x = area->x1; x <= area->x2; x++) {
c = color_p->full;
display_obj.tft.writeColor(c, 1);
color_p++;
}
}
display_obj.tft.endWrite();
lv_disp_flush_ready(disp);
}
bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
{
extern Display display_obj;
uint16_t touchX, touchY;
bool touched = display_obj.tft.getTouch(&touchX, &touchY, 600);
if(!touched)
{
return false;
}
if(touchX>WIDTH_1 || touchY > HEIGHT_1)
{
Serial.println("Y or y outside of expected parameters..");
Serial.print("y:");
Serial.print(touchX);
Serial.print(" x:");
Serial.print(touchY);
}
else
{
data->state = touched ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
//if(data->state == LV_INDEV_STATE_PR) touchpad_get_xy(&last_x, &last_y);
data->point.x = touchX;
data->point.y = touchY;
Serial.print("Data x");
Serial.println(touchX);
Serial.print("Data y");
Serial.println(touchY);
}
return false;
}*/
void Display::drawFrame()
{
tft.drawRect(FRAME_X, FRAME_Y, FRAME_W, FRAME_H, TFT_BLACK);
@@ -156,7 +61,7 @@ void Display::tftDrawRedOnOffButton() {
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setTextDatum(MC_DATUM);
tft.drawString("ON", GREENBUTTON_X + (GREENBUTTON_W / 2), GREENBUTTON_Y + (GREENBUTTON_H / 2));
tft.drawString(text03, GREENBUTTON_X + (GREENBUTTON_W / 2), GREENBUTTON_Y + (GREENBUTTON_H / 2));
this->SwitchOn = false;
}
@@ -167,7 +72,7 @@ void Display::tftDrawGreenOnOffButton() {
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setTextDatum(MC_DATUM);
tft.drawString("OFF", REDBUTTON_X + (REDBUTTON_W / 2) + 1, REDBUTTON_Y + (REDBUTTON_H / 2));
tft.drawString(text04, REDBUTTON_X + (REDBUTTON_W / 2) + 1, REDBUTTON_Y + (REDBUTTON_H / 2));
this->SwitchOn = true;
}
@@ -269,7 +174,7 @@ void Display::tftDrawYScaleButtons(byte y_scale)
void Display::tftDrawChannelScaleButtons(int set_channel)
{
tft.drawFastVLine(178, 0, 20, TFT_WHITE);
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print("Channel:"); tft.print(set_channel);
tft.setCursor(145, 21); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.print(text10); tft.print(set_channel);
key[4].initButton(&tft, // channel - box
164,
@@ -339,42 +244,69 @@ void Display::touchToExit()
{
tft.setTextColor(TFT_BLACK, TFT_LIGHTGREY);
tft.fillRect(0,32,HEIGHT_1,16, TFT_LIGHTGREY);
tft.drawCentreString("Touch screen to exit",120,32,2);
tft.drawCentreString(text11,120,32,2);
}
// Function to just draw the screen black
void Display::clearScreen()
{
Serial.println(F("clearScreen()"));
//Serial.println(F("clearScreen()"));
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0);
}
#ifdef SCREEN_BUFFER
void Display::scrollScreenBuffer(bool down) {
// Scroll screen normal direction (Up)
if (!down) {
this->screen_buffer->shift();
}
}
#endif
void Display::displayBuffer(bool do_clear)
{
if (this->display_buffer->size() > 0)
{
delay(1);
while (display_buffer->size() > 0)
{
xPos = 0;
if ((display_buffer->size() > 0) && (!loading))
{
printing = true;
delay(print_delay_1);
yDraw = scroll_line(TFT_RED);
tft.setCursor(xPos, yDraw);
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.print(display_buffer->shift());
printing = false;
delay(print_delay_2);
}
if (!tteBar)
blank[(18+(yStart - TOP_FIXED_AREA) / TEXT_HEIGHT)%19] = xPos;
else
blank[(18+(yStart - TOP_FIXED_AREA_2) / TEXT_HEIGHT)%19] = xPos;
#ifndef SCREEN_BUFFER
xPos = 0;
if ((display_buffer->size() > 0) && (!loading))
{
printing = true;
delay(print_delay_1);
yDraw = scroll_line(TFT_RED);
tft.setCursor(xPos, yDraw);
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.print(display_buffer->shift());
printing = false;
delay(print_delay_2);
}
if (!tteBar)
blank[(18+(yStart - TOP_FIXED_AREA) / TEXT_HEIGHT)%19] = xPos;
else
blank[(18+(yStart - TOP_FIXED_AREA_2) / TEXT_HEIGHT)%19] = xPos;
#else
xPos = 0;
if (this->screen_buffer->size() >= MAX_SCREEN_BUFFER)
this->scrollScreenBuffer();
screen_buffer->add(display_buffer->shift());
for (int i = 0; i < this->screen_buffer->size(); i++) {
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
for (int x = 0; x < TFT_WIDTH / CHAR_WIDTH; x++)
tft.print(" ");
tft.setCursor(xPos, (i * 12) + (SCREEN_HEIGHT / 6));
tft.setTextColor(TFT_GREEN, TFT_BLACK);
tft.print(this->screen_buffer->get(i));
}
#endif
}
}
}
@@ -388,7 +320,7 @@ void Display::showCenterText(String text, int y)
void Display::initScrollValues(bool tte)
{
Serial.println(F("initScrollValues()"));
//Serial.println(F("initScrollValues()"));
yDraw = YMAX - BOT_FIXED_AREA - TEXT_HEIGHT;
xPos = 0;
@@ -444,24 +376,28 @@ int Display::scroll_line(uint32_t color) {
// Function to setup hardware scroll for TFT screen
void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
Serial.println(F("setupScrollArea()"));
Serial.println(" tfa: " + (String)tfa);
Serial.println(" bfa: " + (String)bfa);
Serial.println("yStart: " + (String)this->yStart);
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
tft.writedata(tfa >> 8); // Top Fixed Area line count
tft.writedata(tfa);
tft.writedata((YMAX-tfa-bfa)>>8); // Vertical Scrolling Area line count
tft.writedata(YMAX-tfa-bfa);
tft.writedata(bfa >> 8); // Bottom Fixed Area line count
tft.writedata(bfa);
//Serial.println(F("setupScrollArea()"));
//Serial.println(" tfa: " + (String)tfa);
//Serial.println(" bfa: " + (String)bfa);
//Serial.println("yStart: " + (String)this->yStart);
#ifndef MARAUDER_MINI
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
tft.writedata(tfa >> 8); // Top Fixed Area line count
tft.writedata(tfa);
tft.writedata((YMAX-tfa-bfa)>>8); // Vertical Scrolling Area line count
tft.writedata(YMAX-tfa-bfa);
tft.writedata(bfa >> 8); // Bottom Fixed Area line count
tft.writedata(bfa);
#endif
}
void Display::scrollAddress(uint16_t vsp) {
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
tft.writedata(vsp>>8);
tft.writedata(vsp);
#ifndef MARAUDER_MINI
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
tft.writedata(vsp>>8);
tft.writedata(vsp);
#endif
}
@@ -494,9 +430,9 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
// render the image onto the screen at given coordinates
jpegRender(xpos, ypos);
}
else {
Serial.println(F("Jpeg file format not supported!"));
}
//else {
// Serial.println(F("Jpeg file format not supported!"));
//}
}
void Display::setupDraw() {
@@ -516,7 +452,7 @@ void Display::drawStylus()
boolean pressed = tft.getTouch(&x, &y);
if ((x <= 10) && (y <= 10) && (pressed)) {
Serial.println(F("Exit draw function"));
//Serial.println(F("Exit draw function"));
this->draw_tft = false;
this->exit_draw = true;
return;
@@ -649,7 +585,7 @@ void Display::jpegRender(int xpos, int ypos) {
// Print information decoded from the Jpeg image
//====================================================================================
void Display::jpegInfo() {
/*
Serial.println("===============");
Serial.println("JPEG image info");
Serial.println("===============");
@@ -663,7 +599,7 @@ void Display::jpegInfo() {
Serial.print ("MCU height :"); Serial.println(JpegDec.MCUHeight);
Serial.println("===============");
Serial.println("");
*/
}
//====================================================================================
@@ -840,7 +776,7 @@ void Display::buildBanner(String msg, int xpos)
//img.fillCircle(SCREEN_WIDTH / 2, TEXT_HEIGHT / 2, 10, TFT_ORANGE);
// Now print text on top of the graphics
img.setTextSize(2); // Font size scaling is x1
img.setTextSize(BANNER_TEXT_SIZE); // Font size scaling is x1
img.setTextFont(0); // Font 4 selected
img.setTextColor(TFT_WHITE); // Black text, no background colour
img.setTextWrap(false); // Turn of wrap so we can print past end of sprite
@@ -853,112 +789,6 @@ void Display::buildBanner(String msg, int xpos)
img.print(msg);
}
/*
void Display::initLVGL() {
tick.attach_ms(LVGL_TICK_PERIOD, lv_tick_handler);
lv_init();
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = WIDTH_1;
disp_drv.ver_res = HEIGHT_1;
disp_drv.flush_cb = my_disp_flush;
disp_drv.buffer = &disp_buf;
lv_disp_drv_register(&disp_drv);
lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = my_touchpad_read;
lv_indev_drv_register(&indev_drv);
}
void Display::deinitLVGL() {
Serial.println(F("Deinit LVGL"));
//lv_deinit();
}
void Display::joinWiFiGFX(){
// Create one text area
ta1 = lv_textarea_create(lv_scr_act(), NULL);
lv_textarea_set_one_line(ta1, true);
lv_obj_set_width(ta1, LV_HOR_RES / 2 - 20);
lv_obj_set_pos(ta1, 5, 20);
//lv_ta_set_cursor_type(ta, LV_CURSOR_BLOCK);
lv_textarea_set_text(ta1, "");
lv_obj_set_event_cb(ta1, ta_event_cb);
// Create first label
lv_obj_t * ssid_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(ssid_label, "SSID:");
lv_obj_align(ssid_label, ta1, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
// Create second text area
ta2 = lv_textarea_create(lv_scr_act(), ta1);
//lv_textarea_set_pwd_mode(ta2, true); // This shit makes it so backspace does not work
//lv_textarea_set_pwd_show_time(ta2, 1000);
lv_textarea_set_cursor_hidden(ta2, true);
lv_obj_align(ta2, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
// Create second label
lv_obj_t * pw_label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(pw_label, "Password:");
lv_obj_align(pw_label, ta2, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
// Create a keyboard and apply the styles
kb = lv_keyboard_create(lv_scr_act(), NULL);
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
lv_obj_set_event_cb(kb, keyboard_event_cb);
// Focus it on one of the text areas to start
lv_keyboard_set_textarea(kb, ta1);
lv_keyboard_set_cursor_manage(kb, true);
}
void keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event){
extern Display display_obj;
lv_keyboard_def_event_cb(kb, event);
if(event == LV_EVENT_APPLY){
printf("LV_EVENT_APPLY\n");
//String ta1_text = lv_textarea_get_text(lv_keyboard_get_textarea(kb));
String ta1_text = lv_textarea_get_text(ta1);
String ta2_text = lv_textarea_get_text(ta2);
Serial.println(ta1_text);
Serial.println(ta2_text);
//joinWiFi(ta1_text, ta2_text);
}else if(event == LV_EVENT_CANCEL){
printf("LV_EVENT_CANCEL\n");
//lv_textarea_set_text(lv_keyboard_get_textarea(kb), "");
display_obj.deinitLVGL();
display_obj.exit_draw = true; // set everything back to normal
}
}
void ta_event_cb(lv_obj_t * ta, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
if(kb != NULL)
lv_keyboard_set_textarea(kb, ta);
}
//else if(event == LV_EVENT_INSERT) {
// const char * str = lv_event_get_data();
// if(str[0] == '\n') {
// printf("Ready\n");
// }
//}
}*/
void Display::main(uint8_t scan_mode)
{
if ((scan_mode == LV_JOIN_WIFI) ||
@@ -967,3 +797,5 @@ void Display::main(uint8_t scan_mode)
return;
}
// End SPIFFS_functions
#endif

View File

@@ -1,6 +1,9 @@
#ifndef Display_h
#define Display_h
#include "configs.h"
#ifdef HAS_SCREEN
#include <FS.h>
#include <functional>
@@ -16,16 +19,6 @@
#include <TFT_eSPI.h>
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 27
#define TFT_DC 26
#define TFT_RST 5
#define TFT_BL 32
#define TOUCH_CS 21
#define SD_CS 4
// WiFi stuff
#define OTA_UPDATE 100
#define SHOW_INFO 101
@@ -46,50 +39,6 @@
#define LV_ADD_SSID 14
#define WIFI_ATTACK_BEACON_LIST 15
#define TFT_SHIELD
//#define TFT_DIY
//#define KIT
#define SCREEN_WIDTH 240
#define SCREEN_HEIGHT 320
#define HEIGHT_1 240
#define WIDTH_1 320
#define STANDARD_FONT_CHAR_LIMIT 40 // 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_ARRAY_LEN 9
#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
/*
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);
@@ -104,6 +53,9 @@ PROGMEM static void keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
PROGMEM static lv_obj_t *kb;
*/
// #define KIT
// #define TFT_DIY
class Display
{
private:
@@ -120,6 +72,10 @@ class Display
void drawFrame();
#ifdef SCREEN_BUFFER
void scrollScreenBuffer(bool down = false);
#endif
//void addNodes(Menu* menu, String name, Menu* child, std::function<void()> callable);
//void changeMenu(Menu* menu);
//void showMenuList(Menu* menu, int layer);
@@ -131,7 +87,7 @@ class Display
TFT_eSPI tft = TFT_eSPI();
TFT_eSprite img = TFT_eSprite(&tft);
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
const String PROGMEM version_number = "v0.9.5";
const String PROGMEM version_number = MARAUDER_VERSION;
bool printing = false;
bool loading = false;
@@ -151,6 +107,10 @@ class Display
LinkedList<String>* display_buffer;
#ifdef SCREEN_BUFFER
LinkedList<String>* screen_buffer;
#endif
// The initial y coordinate of the top of the bottom text line
uint16_t yDraw = YMAX - BOT_FIXED_AREA - TEXT_HEIGHT;
@@ -202,3 +162,4 @@ class Display
void updateBanner(String msg);
};
#endif
#endif

View File

@@ -5,7 +5,7 @@ LedInterface::LedInterface() {
}
void LedInterface::RunSetup() {
Serial.println("Setting neopixel to black...");
//Serial.println("Setting neopixel to black...");
strip.setBrightness(0);
strip.begin();
strip.setPixelColor(0, strip.Color(0, 0, 0));

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,10 @@
#ifndef MenuFunctions_h
#define MenuFunctions_h
#include "configs.h"
#ifdef HAS_SCREEN
#define BATTERY_ANALOG_ON 0
#include "WiFiScan.h"
@@ -12,6 +16,14 @@
#include "a32u4_interface.h"
#include "settings.h"
#ifdef MARAUDER_MINI
#include <SwitchLib.h>
extern SwitchLib u_btn;
extern SwitchLib d_btn;
extern SwitchLib l_btn;
extern SwitchLib r_btn;
extern SwitchLib c_btn;
#endif
extern Display display_obj;
extern WiFiScan wifi_scan_obj;
@@ -22,19 +34,6 @@ extern EspInterface esp_obj;
extern A32u4Interface a32u4_obj;
extern Settings settings_obj;
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // 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
#define FLASH_BUTTON 0
#if BATTERY_ANALOG_ON == 1
@@ -79,6 +78,7 @@ extern Settings settings_obj;
#define ESP_UPDATE_ICO 32
#define BAD_USB_ICO 33
#define TEST_BAD_USB_ICO 34
#define LANGUAGE 35
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);
@@ -106,6 +106,7 @@ struct Menu;
struct MenuNode {
String name;
String command;
uint16_t color;
int icon;
TFT_eSPI_Button* button;
@@ -118,7 +119,7 @@ struct Menu {
String name;
LinkedList<MenuNode>* list;
Menu * parentMenu;
//uint8_t selected;
uint8_t selected = 0;
};
@@ -150,6 +151,7 @@ class MenuFunctions
Menu settingsMenu;
Menu specSettingMenu;
Menu infoMenu;
Menu languageMenu;
// WiFi menu stuff
Menu wifiSnifferMenu;
@@ -174,8 +176,7 @@ class MenuFunctions
//TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable, bool selected = false);
void drawStatusBar();
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);
@@ -183,6 +184,8 @@ class MenuFunctions
String callSetting(String key);
void runBoolSetting(String ley);
void displaySetting(String key, Menu* menu, int index);
void buttonSelected(uint8_t b);
void buttonNotSelected(uint8_t b);
public:
MenuFunctions();
@@ -206,6 +209,7 @@ class MenuFunctions
void buildButtons(Menu* menu);
void changeMenu(Menu* menu);
void drawStatusBar();
void displayCurrentMenu();
void main(uint32_t currentTime);
void RunSetup();
@@ -213,5 +217,5 @@ class MenuFunctions
};
#endif
#endif

View File

@@ -1,4 +1,5 @@
#include "SDInterface.h"
#include "lang_var.h"
bool SDInterface::initSD() {
String display_string = "";
@@ -23,27 +24,20 @@ bool SDInterface::initSD() {
else {
this->supported = true;
this->cardType = SD.cardType();
if (cardType == CARD_MMC)
Serial.println(F("SD: MMC Mounted"));
else if(cardType == CARD_SD)
Serial.println(F("SD: SDSC Mounted"));
else if(cardType == CARD_SDHC)
Serial.println(F("SD: SDHC Mounted"));
else
Serial.println(F("SD: UNKNOWN Card Mounted"));
//if (cardType == CARD_MMC)
// Serial.println(F("SD: MMC Mounted"));
//else if(cardType == CARD_SD)
// Serial.println(F("SD: SDSC Mounted"));
//else if(cardType == CARD_SDHC)
// Serial.println(F("SD: SDHC Mounted"));
//else
// Serial.println(F("SD: UNKNOWN Card Mounted"));
//this->cardSizeBT = SD.cardSize();
//this->cardSizeKB = SD.cardSize() / 1024;
this->cardSizeMB = SD.cardSize() / (1024 * 1024);
//this->cardSizeGB = SD.cardSize() / (1024 * 1024 * 1024);
//Serial.printf("SD Card Size: %llu Bytes\n", this->cardSizeBT);
//Serial.printf("SD Card Size: %lluKB\n", this->cardSizeKB);
Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
//Serial.printf("SD Card Size: %lluGB\n", this->cardSizeGB);
//Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
if (this->supported) {
//display_obj.tft.println((byte)(sd_obj.cardSizeMB % 10));
const int NUM_DIGITS = log10(this->cardSizeMB) + 1;
char sz[NUM_DIGITS + 1];
@@ -55,16 +49,11 @@ bool SDInterface::initSD() {
display_string.concat((String)sz[i]);
}
//this->card_sz = display_string;
this->card_sz = sz;
}
buffer_obj = Buffer();
//if (this->supported)
// buffer_obj.open(&SD);
// Check for SCRIPTS folder
if (!SD.exists("/SCRIPTS")) {
Serial.println("/SCRIPTS does not exist. Creating...");
@@ -78,7 +67,6 @@ bool SDInterface::initSD() {
void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
if ((this->supported) && (this->do_save)) {
//Serial.println("Adding packet to buffer...");
buffer_obj.addPacket(buf, len);
}
}
@@ -89,21 +77,26 @@ void SDInterface::openCapture(String file_name) {
}
void SDInterface::runUpdate() {
//display_obj.clearScreen();
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_WHITE);
display_obj.tft.println(F("Opening /update.bin..."));
#ifdef HAS_SCREEN
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_WHITE);
display_obj.tft.println(F(text15));
#endif
File updateBin = SD.open("/update.bin");
if (updateBin) {
if(updateBin.isDirectory()){
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F("Error, could not find update.bin"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F(text_table2[0]));
#endif
Serial.println(F("Error, update.bin is not a file"));
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
updateBin.close();
return;
}
@@ -111,70 +104,98 @@ void SDInterface::runUpdate() {
size_t updateSize = updateBin.size();
if (updateSize > 0) {
display_obj.tft.println(F("Starting SD Update..."));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table2[1]));
#endif
Serial.println(F("Try to start update"));
this->performUpdate(updateBin, updateSize);
}
else {
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F("Error, update.bin is empty"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F(text_table2[2]));
#endif
Serial.println(F("Error, file is empty"));
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
return;
}
updateBin.close();
// whe finished remove the binary from sd card to indicate end of the process
display_obj.tft.println(F("rebooting..."));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table2[3]));
#endif
Serial.println(F("rebooting..."));
//SD.remove("/update.bin");
delay(1000);
ESP.restart();
}
else {
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F("Could not load update.bin from /"));
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(F(text_table2[4]));
#endif
Serial.println(F("Could not load update.bin from sd root"));
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
}
}
void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
if (Update.begin(updateSize)) {
display_obj.tft.println("File size: " + String(updateSize));
display_obj.tft.println(F("Writing file to partition..."));
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[5] + String(updateSize));
display_obj.tft.println(F(text_table2[6]));
#endif
size_t written = Update.writeStream(updateSource);
if (written == updateSize) {
display_obj.tft.println("Written: " + String(written) + " successfully");
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[7] + String(written) + text_table2[10]);
#endif
Serial.println("Written : " + String(written) + " successfully");
}
else {
display_obj.tft.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[8] + String(written) + "/" + String(updateSize) + text_table2[9]);
#endif
Serial.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
}
if (Update.end()) {
Serial.println("OTA done!");
if (Update.isFinished()) {
display_obj.tft.println(F("Update complete"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table2[11]));
#endif
Serial.println(F("Update successfully completed. Rebooting."));
}
else {
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println("Update could not complete");
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED);
display_obj.tft.println(text_table2[12]);
#endif
Serial.println("Update not finished? Something went wrong!");
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_WHITE);
#endif
}
}
else {
display_obj.tft.println("Error Occurred. Error #: " + String(Update.getError()));
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[13] + String(Update.getError()));
#endif
Serial.println("Error Occurred. Error #: " + String(Update.getError()));
}
}
else
{
display_obj.tft.println("Not enough space to begin OTA");
#ifdef HAS_SCREEN
display_obj.tft.println(text_table2[14]);
#endif
Serial.println("Not enough space to begin OTA");
}
}
@@ -202,8 +223,3 @@ void SDInterface::main() {
}
}
}
//void SDInterface::savePacket(uint8_t* buf, uint32_t len) {
// if (this->supported)
// buffer_obj.save(
//}

View File

@@ -1,15 +1,19 @@
#ifndef SDInterface_h
#define SDInterface_h
#include "configs.h"
#include "SD.h"
#include "Buffer.h"
#include "Display.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <Update.h>
extern Buffer buffer_obj;
extern Display display_obj;
#define SD_CS 12
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
#ifdef KIT
#define SD_DET 4

View File

@@ -19,7 +19,10 @@ void TemperatureInterface::RunSetup() {
}
uint8_t TemperatureInterface::getCurrentTemp() {
return ((temprature_sens_read() - 32) / 1.8);
#ifndef MARAUDER_FLIPPER
return ((temprature_sens_read() - 32) / 1.8);
#endif
return 0;
}
void TemperatureInterface::main(uint32_t currentTime) {

View File

@@ -1,6 +1,8 @@
#ifndef TemperatureInterface_h
#define TemperatureInterface_h
#include "configs.h"
#include <Arduino.h>
class TemperatureInterface {

View File

@@ -1,4 +1,5 @@
#include "Web.h"
#include "lang_var.h"
WebServer server(80);
@@ -9,7 +10,6 @@ Web::Web()
void Web::main()
{
//Serial.println("Running the shits");
// Notify if client has connected to the update server
@@ -44,18 +44,24 @@ void Web::onJavaScript(void) {
void Web::setupOTAupdate()
{
uint8_t newMACAddress[] = {0x06, 0x07, 0x0D, 0x09, 0x0E, 0x0D};
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_WHITE);
#ifdef HAS_SCREEN
display_obj.tft.setTextWrap(false);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_WHITE);
#endif
Serial.println(wifi_scan_obj.freeRAM());
display_obj.tft.print("Configuring update server...\n\n");
#ifdef HAS_SCREEN
display_obj.tft.print(text_table3[0]);
#endif
Serial.println("Configuring update server...");
display_obj.tft.setTextColor(TFT_YELLOW);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_YELLOW);
#endif
// Start WiFi AP
Serial.println("Initializing WiFi...");
@@ -76,25 +82,16 @@ void Web::setupOTAupdate()
Serial.println(wifi_scan_obj.freeRAM());
Serial.println("Displaying settings to TFT...");
display_obj.tft.print("SSID: ");
display_obj.tft.println(ssid);
display_obj.tft.print("IP address: ");
display_obj.tft.print(WiFi.softAPIP());
display_obj.tft.print("\n");
#ifdef HAS_SCREEN
display_obj.tft.print(text_table1[2]);
display_obj.tft.println(ssid);
display_obj.tft.print(text_table3[1]);
display_obj.tft.print(WiFi.softAPIP());
display_obj.tft.print("\n");
#endif
Serial.print("IP address: ");
Serial.println(WiFi.softAPIP());
/*use mdns for host name resolution*/
/*
if (!MDNS.begin(host)) { //http://esp32.local
Serial.println("Error setting up MDNS responder!");
while (1) {
delay(1000);
}
}
Serial.println("mDNS responder started");
*/
// return javascript jquery
Serial.println("Setting server behavior...");
Serial.println(wifi_scan_obj.freeRAM());
@@ -116,11 +113,12 @@ void Web::setupOTAupdate()
}, [this]() {
HTTPUpload& upload = server.upload();
if (upload.status == UPLOAD_FILE_START) {
display_obj.tft.setTextColor(TFT_YELLOW);
display_obj.tft.print("Update: ");
display_obj.tft.print(upload.filename.c_str());
display_obj.tft.print("\n");
//display_obj.updateBanner(menu_function_obj.current_menu->name);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_YELLOW);
display_obj.tft.print(text_table3[2]);
display_obj.tft.print(upload.filename.c_str());
display_obj.tft.print("\n");
#endif
Serial.printf("Update: %s\n", upload.filename.c_str());
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
Update.printError(Serial);
@@ -130,30 +128,23 @@ void Web::setupOTAupdate()
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
Update.printError(Serial);
}
//display_obj.tft.println(upload.totalSize);
/*
String display_string = "";
display_obj.tft.setCursor(0, 164);
for (int i = 0; i < 40; i++) {
display_string.concat(" ");
}
*/
display_obj.tft.setTextColor(TFT_CYAN);
display_obj.tft.fillRect(0, 164, 240, 8, TFT_BLACK);
//delay(1);
//display_obj.tft.print(display_string);
display_obj.tft.setCursor(0, 164);
display_obj.tft.print("Bytes complete: ");
display_obj.tft.print(upload.totalSize);
display_obj.tft.print("\n");
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_CYAN);
display_obj.tft.fillRect(0, 164, 240, 8, TFT_BLACK);
display_obj.tft.setCursor(0, 164);
display_obj.tft.print(text_table3[3]);
display_obj.tft.print(upload.totalSize);
display_obj.tft.print("\n");
#endif
//Serial.println(upload.totalSize);
} else if (upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.print("Update Success: ");
display_obj.tft.print(upload.totalSize);
display_obj.tft.print("\nRebooting...\n");
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.print(text_table3[4]);
display_obj.tft.print(upload.totalSize);
display_obj.tft.print(text_table2[3]);
#endif
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
delay(1000);
} else {
@@ -168,8 +159,10 @@ void Web::setupOTAupdate()
Serial.println("Starting server...");
server.begin();
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.println("\nCompleted update server setup");
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.println(text_table3[5]);
#endif
Serial.println("Completed update server setup");
Serial.println(wifi_scan_obj.freeRAM());
}

View File

@@ -5,6 +5,8 @@
Code taken from espressif ESP32 OTA Update example
*/
#include "configs.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
@@ -12,10 +14,17 @@ Code taken from espressif ESP32 OTA Update example
#include <Update.h>
#include "Assets.h"
#include "Display.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include "WiFiScan.h"
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
extern WiFiScan wifi_scan_obj;
class Web

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,8 @@
#ifndef WiFiScan_h
#define WiFiScan_h
#include "configs.h"
//#include <BLEDevice.h>
//#include <BLEUtils.h>
//#include <BLEScan.h>
@@ -8,21 +10,27 @@
#include <ArduinoJson.h>
// Testing NimBLE
#include <NimBLEDevice.h>
//#include <NimBLEAdvertisedDevice.h>
#ifdef HAS_BT
#include <NimBLEDevice.h>
#endif
#include <WiFi.h>
#include <math.h>
#include "esp_wifi.h"
#include "esp_wifi_types.h"
#include "esp_bt.h"
#include "Display.h"
#ifdef HAS_BT
#include "esp_bt.h"
#endif
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include "SDInterface.h"
#include "Buffer.h"
#include "BatteryInterface.h"
#include "TemperatureInterface.h"
#include "settings.h"
#include "Assets.h"
#include "flipperLED.h"
//#include "MenuFunctions.h"
#define bad_list_length 3
@@ -51,17 +59,23 @@
#define WIFI_ATTACK_AUTH 18
#define WIFI_ATTACK_MIMIC 19
#define WIFI_ATTACK_DEAUTH 20
#define WIFI_ATTACK_AP_SPAM 21
#define WIFI_SCAN_TARGET_AP_FULL 22
#define WIFI_SCAN_ACTIVE_EAPOL 23
#define GRAPH_REFRESH 100
#define MAX_CHANNEL 14
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
extern SDInterface sd_obj;
extern Buffer buffer_obj;
extern BatteryInterface battery_obj;
extern TemperatureInterface temp_obj;
extern Settings settings_obj;
extern flipperLED flipper_led;
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
@@ -69,6 +83,7 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
struct ssid {
String essid;
int bssid[6];
bool selected;
};
struct AccessPoint {
@@ -76,6 +91,8 @@ struct AccessPoint {
int channel;
int bssid[6];
bool selected;
LinkedList<char>* beacon;
int rssi;
};
class WiFiScan
@@ -112,7 +129,9 @@ class WiFiScan
int bluetoothScanTime = 5;
int packets_sent = 0;
const wifi_promiscuous_filter_t filt = {.filter_mask=WIFI_PROMIS_FILTER_MASK_MGMT | WIFI_PROMIS_FILTER_MASK_DATA};
NimBLEScan* pBLEScan;
#ifdef HAS_BT
NimBLEScan* pBLEScan;
#endif
//String connected_network = "";
String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
@@ -207,7 +226,6 @@ class WiFiScan
void packetMonitorMain(uint32_t currentTime);
void eapolMonitorMain(uint32_t currentTime);
void changeChannel();
void updateMidway();
void tftDrawXScalButtons();
void tftDrawYScaleButtons();
@@ -216,8 +234,10 @@ class WiFiScan
void tftDrawGraphObjects();
void sendProbeAttack(uint32_t currentTime);
void sendDeauthAttack(uint32_t currentTime);
void sendDeauthFrame(uint8_t bssid[6], int channel);
void broadcastRandomSSID(uint32_t currentTime);
void broadcastCustomBeacon(uint32_t current_time, ssid custom_ssid);
void broadcastCustomBeacon(uint32_t current_time, AccessPoint custom_ssid);
void broadcastSetSSID(uint32_t current_time, char* ESSID);
void RunAPScan(uint8_t scan_mode, uint16_t color);
//void RunRickRoll(uint8_t scan_mode, uint16_t color);
@@ -235,7 +255,9 @@ class WiFiScan
void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
void RunLvJoinWiFi(uint8_t scan_mode, uint16_t color);
static void scanCompleteCB(BLEScanResults scanResults);
#ifdef HAS_BT
static void scanCompleteCB(BLEScanResults scanResults);
#endif
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
@@ -267,17 +289,20 @@ class WiFiScan
int clearSSIDs();
int clearAPs();
bool addSSID(String essid);
int generateSSIDs();
int generateSSIDs(int count = 20);
bool shutdownWiFi();
bool shutdownBLE();
bool scanning();
void joinWiFi(String ssid, String password);
String getStaMAC();
String getApMAC();
String freeRAM();
void changeChannel();
void changeChannel(int chan);
void RunInfo();
void RunShutdownWiFi();
void RunShutdownBLE();
void RunGenerateSSIDs();
void RunGenerateSSIDs(int count = 20);
void RunClearSSIDs();
void RunClearAPs();
void channelHop();
@@ -291,9 +316,11 @@ class WiFiScan
static void pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void apSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void apSnifferCallbackFull(void* buf, wifi_promiscuous_pkt_type_t type);
static void deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void beaconListSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void activeEapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
static void wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
};

View File

@@ -25,14 +25,18 @@ void A32u4Interface::begin() {
if (a32u4_rep != 0) {
this->supported = true;
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
}
else {
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ATmega32U4 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
Serial.print("A32U4 Said: ");
Serial.println(a32u4_rep);
}
@@ -62,5 +66,4 @@ void A32u4Interface::main(uint32_t current_time) {
}
}
//delay(1);*/
}

View File

@@ -1,12 +1,18 @@
#ifndef a32u4_interface_h
#define a32u4_interface_h
#include "Display.h"
#include "configs.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <HardwareSerial.h>
#define BAUD32U4 115200
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
class A32u4Interface {
public:

405
esp32_marauder/configs.h Normal file
View File

@@ -0,0 +1,405 @@
#ifndef configs_h
#define configs_h
#define POLISH_POTATO
//#define MARAUDER_MINI
//#define MARAUDER_V4
//#define MARAUDER_V6
//#define MARAUDER_KIT
//#define GENERIC_ESP32
#define MARAUDER_FLIPPER
#define MARAUDER_VERSION "v0.9.14"
//// BUTTON DEFINITIONS
#ifdef MARAUDER_MINI
#define L_BTN 13
#define C_BTN 34
#define U_BTN 36
#define R_BTN 39
#define D_BTN 35
#endif
#ifdef MARAUDER_V4
#endif
//// END BUTTON DEFINITIONS
//// DISPLAY DEFINITIONS
#ifdef MARAUDER_V4
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#define TFT_SHIELD
#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_ARRAY_LEN 9
#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
#ifdef MARAUDER_V6
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#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_ARRAY_LEN 9
#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
#ifdef MARAUDER_KIT
#define BANNER_TEXT_SIZE 2
#ifndef TFT_WIDTH
#define TFT_WIDTH 240
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 320
#endif
#define TFT_DIY
#define KIT
#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_ARRAY_LEN 9
#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
#ifdef MARAUDER_MINI
#define TFT_MISO 19
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS 27
#define TFT_DC 26
#define TFT_RST 5
#define TFT_BL 32
#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 128
#endif
#ifndef TFT_HEIGHT
#define TFT_HEIGHT 128
#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_ARRAY_LEN 9
#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
//// END DISPLAY DEFINITIONS
//// MENU DEFINITIONS
#ifdef MARAUDER_V4
#define BANNER_TIME 100
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // 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
#ifdef MARAUDER_V6
#define BANNER_TIME 100
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // 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
#ifdef MARAUDER_KIT
#define BANNER_TIME 100
#define COMMAND_PREFIX "!"
// Keypad start position, key sizes and spacing
#define KEY_X 120 // Centre of key
#define KEY_Y 50
#define KEY_W 240 // 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
#ifdef MARAUDER_MINI
#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
//// END MENU DEFINITIONS
//// SD DEFINITIONS
#ifdef MARAUDER_V4
#define SD_CS 12
#endif
#ifdef MARAUDER_V6
#define SD_CS 12
#endif
#ifdef MARAUDER_KIT
#define SD_CS 12
#endif
#ifdef MARAUDER_MINI
#define SD_CS 4
#endif
#ifdef MARAUDER_FLIPPER
#define SD_CS 10
#endif
//// END SD DEFINITIONS
//// SCREEN STUFF
#ifdef MARAUDER_MINI
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef MARAUDER_V4
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef MARAUDER_V6
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef MARAUDER_KIT
#define HAS_SCREEN
#define HAS_BT
#endif
#ifdef GENERIC_ESP32
#define HAS_BT
#endif
#ifndef HAS_SCREEN
#define TFT_CYAN 0
#define TFT_BLUE 0
#define TFT_RED 0
#define TFT_GREEN 0
#define TFT_GREY 0
#define TFT_GRAY 0
#define TFT_MAGENTA 0
#define TFT_VIOLET 0
#define TFT_ORANGE 0
#define TFT_YELLOW 0
#define STANDARD_FONT_CHAR_LIMIT 40
#define FLASH_BUTTON -1
#include <FS.h>
#include <functional>
#include <LinkedList.h>
#include "SPIFFS.h"
#include "Assets.h"
#endif
//// END SCREEN STUFF
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -5,6 +5,13 @@ Partition Scheme: Minimal SPIFFS
https://www.online-utility.org/image/convert/to/XBM
*/
#include "configs.h"
#ifndef HAS_SCREEN
#define MenuFunctions_h
#define Display_h
#endif
#include <WiFi.h>
#include <Wire.h>
#include "esp_wifi.h"
@@ -15,11 +22,8 @@ https://www.online-utility.org/image/convert/to/XBM
#include "esp_system.h"
#include <Arduino.h>
#include "Assets.h"
#include "Display.h"
#include "WiFiScan.h"
#include "MenuFunctions.h"
#include "SDInterface.h"
#include "Web.h"
#include "Buffer.h"
@@ -27,24 +31,27 @@ https://www.online-utility.org/image/convert/to/XBM
#include "TemperatureInterface.h"
#include "LedInterface.h"
#include "esp_interface.h"
#include "a32u4_interface.h"
#include "settings.h"
//#include "icons.h"
#include "CommandLine.h"
#include "lang_var.h"
#include "flipperLED.h"
/*
#ifdef __cplusplus
extern "C" {
#ifdef HAS_SCREEN
#include "Display.h"
#include "MenuFunctions.h"
#include "a32u4_interface.h"
#endif
#ifdef MARAUDER_MINI
#include <SwitchLib.h>
SwitchLib u_btn = SwitchLib(U_BTN, 1000, true);
SwitchLib d_btn = SwitchLib(D_BTN, 1000, true);
SwitchLib l_btn = SwitchLib(L_BTN, 1000, true);
SwitchLib r_btn = SwitchLib(R_BTN, 1000, true);
SwitchLib c_btn = SwitchLib(C_BTN, 1000, true);
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif
uint8_t temprature_sens_read();
*/
Display display_obj;
WiFiScan wifi_scan_obj;
MenuFunctions menu_function_obj;
SDInterface sd_obj;
Web web_obj;
Buffer buffer_obj;
@@ -52,213 +59,278 @@ BatteryInterface battery_obj;
TemperatureInterface temp_obj;
LedInterface led_obj;
EspInterface esp_obj;
A32u4Interface a32u4_obj;
Settings settings_obj;
CommandLine cli_obj;
flipperLED flipper_led;
#ifdef HAS_SCREEN
Display display_obj;
MenuFunctions menu_function_obj;
A32u4Interface a32u4_obj;
#endif
const String PROGMEM version_number = MARAUDER_VERSION;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
uint32_t currentTime = 0;
void backlightOn() {
#ifdef HAS_SCREEN
#ifdef MARAUDER_MINI
digitalWrite(TFT_BL, LOW);
#endif
#ifndef MARAUDER_MINI
digitalWrite(TFT_BL, HIGH);
#endif
#endif
}
void backlightOff() {
#ifdef HAS_SCREEN
#ifdef MARAUDER_MINI
digitalWrite(TFT_BL, HIGH);
#endif
#ifndef MARAUDER_MINI
digitalWrite(TFT_BL, LOW);
#endif
#endif
}
void setup()
{
pinMode(FLASH_BUTTON, INPUT);
pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, LOW);
#ifdef HAS_SCREEN
pinMode(TFT_BL, OUTPUT);
#endif
backlightOff();
#if BATTERY_ANALOG_ON == 1
pinMode(BATTERY_PIN, OUTPUT);
pinMode(CHARGING_PIN, INPUT);
#endif
// Preset SPI CS pins to avoid bus conflicts
digitalWrite(TFT_CS, HIGH);
#ifdef HAS_SCREEN
digitalWrite(TFT_CS, HIGH);
#endif
digitalWrite(SD_CS, HIGH);
Serial.begin(115200);
//Serial.begin(115200);
Serial.println("\n\nHello, World!\n");
//Serial.println("\n\nHello, World!\n");
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
display_obj.RunSetup();
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
digitalWrite(TFT_BL, LOW);
//#ifdef HAS_SCREEN
// Serial.println("Has Screen");
//#else
// Serial.println("Does not have screen");
//#endif
#ifdef MARAUDER_FLIPPER
flipper_led.RunSetup();
#endif
#ifdef HAS_SCREEN
display_obj.RunSetup();
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
#endif
backlightOff();
// Draw the title screen
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
#ifdef HAS_SCREEN
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
#endif
//showCenterText(version_number, 250);
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
digitalWrite(TFT_BL, HIGH); // Need this
delay(2000);
display_obj.clearScreen();
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.tft.println("Giving room for HardwareSerial...");
delay(2000);
display_obj.tft.println("Marauder " + display_obj.version_number + "\n");
display_obj.tft.println("Started Serial");
#ifdef HAS_SCREEN
//showCenterText(version_number, 250);
#ifndef MARAUDER_MINI
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
#endif
Serial.println(F("\n\n--------------------------------\n"));
Serial.println(F(" ESP32 Marauder \n"));
Serial.println(" " + display_obj.version_number + "\n");
Serial.println(F(" By: justcallmekoko\n"));
Serial.println(F("--------------------------------\n\n"));
#ifdef MARAUDER_MINI
display_obj.tft.drawCentreString(display_obj.version_number, TFT_WIDTH/2, TFT_HEIGHT, 1);
#endif
#endif
backlightOn(); // Need this
#ifdef HAS_SCREEN
delay(2000);
display_obj.clearScreen();
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
display_obj.tft.println(text_table0[0]);
delay(2000);
display_obj.tft.println("Marauder " + display_obj.version_number + "\n");
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");
//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());
//Serial.println(wifi_scan_obj.freeRAM());
display_obj.tft.println("Checked RAM");
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[2]));
#endif
// Do some SD stuff
if(sd_obj.initSD()) {
Serial.println(F("SD Card supported"));
display_obj.tft.println(F("Initialized SD Card"));
//Serial.println(F("SD Card supported"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[3]));
#endif
}
else {
Serial.println(F("SD Card NOT Supported"));
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println(F("Failed to Initialize SD Card"));
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println(F(text_table0[4]));
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
}
// Run display setup
Serial.println(wifi_scan_obj.freeRAM());
//display_obj.RunSetup();
// Build menus
Serial.println(wifi_scan_obj.freeRAM());
//menu_function_obj.RunSetup();
//display_obj.tft.println("Created Menu Structure");
// Battery stuff
Serial.println(wifi_scan_obj.freeRAM());
battery_obj.RunSetup();
display_obj.tft.println(F("Checked battery configuration"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[5]));
#endif
// Temperature stuff
Serial.println(wifi_scan_obj.freeRAM());
temp_obj.RunSetup();
#ifndef MARAUDER_FLIPPER
temp_obj.RunSetup();
#endif
display_obj.tft.println(F("Initialized temperature interface"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[6]));
#endif
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"));
Serial.println(wifi_scan_obj.freeRAM());
#ifndef MARAUDER_FLIPPER
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
led_obj.RunSetup();
#ifndef MARAUDER_FLIPPER
led_obj.RunSetup();
#endif
display_obj.tft.println(F("Initialized LED Interface"));
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[7]));
//display_obj.tft.println(F("Starting..."));
delay(500);
#endif
delay(500);
//display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
// OG Logo Section
/*
digitalWrite(TFT_BL, LOW);
// Draw the title screen
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
//showCenterText(version_number, 250);
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
digitalWrite(TFT_BL, HIGH);
*/
//esp_obj.begin();
#ifdef HAS_SCREEN
display_obj.tft.println(F(text_table0[8]));
//a32u4_obj.begin(); // This goes last to make sure nothing is messed up when reading serial
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
delay(2000);
#endif
display_obj.tft.println(F("Starting..."));
#ifdef HAS_SCREEN
menu_function_obj.RunSetup();
#endif
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
delay(2000);
menu_function_obj.RunSetup();
//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("CLI Ready");
cli_obj.RunSetup();
}
void loop()
{
// get the current time
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
currentTime = millis();
bool mini = false;
#ifdef MARAUDER_MINI
mini = true;
#endif
// Update all of our objects
//if ((!display_obj.draw_tft) &&
// (wifi_scan_obj.currentScanMode != OTA_UPDATE))
if ((!display_obj.draw_tft) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
#ifdef HAS_SCREEN
bool do_draw = display_obj.draw_tft;
#else
bool do_draw = false;
#endif
if ((!do_draw) && (wifi_scan_obj.currentScanMode != ESP_UPDATE))
{
display_obj.main(wifi_scan_obj.currentScanMode);
cli_obj.main(currentTime);
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
#endif
wifi_scan_obj.main(currentTime);
sd_obj.main();
battery_obj.main(currentTime);
temp_obj.main(currentTime);
#ifndef MARAUDER_FLIPPER
battery_obj.main(currentTime);
temp_obj.main(currentTime);
#endif
settings_obj.main(currentTime);
//esp_obj.main(currentTime);
//a32u4_obj.main(currentTime);
//led_obj.main(currentTime);
//if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM))
if ((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) &&
(wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL))
menu_function_obj.main(currentTime);
if (((wifi_scan_obj.currentScanMode != WIFI_PACKET_MONITOR) && (wifi_scan_obj.currentScanMode != WIFI_SCAN_EAPOL)) ||
(mini)) {
#ifdef HAS_SCREEN
menu_function_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
}
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
web_obj.main();
delay(1);
}
else if ((display_obj.draw_tft) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE))
{
display_obj.drawStylus();
#ifdef HAS_SCREEN
delay(1);
#else
delay(50);
#endif
}
#ifdef HAS_SCREEN
else if ((display_obj.draw_tft) &&
(wifi_scan_obj.currentScanMode != OTA_UPDATE))
{
display_obj.drawStylus();
}
#endif
else if (wifi_scan_obj.currentScanMode == ESP_UPDATE) {
display_obj.main(wifi_scan_obj.currentScanMode);
menu_function_obj.main(currentTime);
//esp_obj.program();
#ifdef HAS_SCREEN
display_obj.main(wifi_scan_obj.currentScanMode);
menu_function_obj.main(currentTime);
#endif
//cli_obj.main(currentTime);
delay(1);
}
//else
//{
// web_obj.main();
//}
//Serial.println(wifi_scan_obj.currentScanMode);
//Serial.print("Run Time: ");
//Serial.print(millis() - currentTime);
//Serial.println("ms");
}

Binary file not shown.

View File

@@ -16,7 +16,9 @@ void EspInterface::begin() {
delay(100);
display_obj.tft.println("Checking for ESP8266...");
#ifdef HAS_SCREEN
display_obj.tft.println("Checking for ESP8266...");
#endif
this->bootRunMode();
@@ -40,16 +42,20 @@ void EspInterface::begin() {
Serial.println("\nDisplay string: " + (String)display_string);
if (display_string == "ESP8266 Pong") {
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ESP8266 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK);
display_obj.tft.println("ESP8266 Found!");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
Serial.println("ESP8266 Found!");
this->supported = true;
}
else {
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ESP8266 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#ifdef HAS_SCREEN
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
display_obj.tft.println("ESP8266 Not Found");
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
#endif
}
this->initTime = millis();
@@ -57,16 +63,17 @@ void EspInterface::begin() {
void EspInterface::RunUpdate() {
this->bootProgramMode();
#ifdef HAS_SCREEN
display_obj.tft.setTextWrap(true);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.setTextWrap(true);
display_obj.tft.setFreeFont(NULL);
display_obj.tft.setCursor(0, 100);
display_obj.tft.setTextSize(1);
display_obj.tft.setTextColor(TFT_GREEN);
display_obj.tft.println("Waiting for serial data...");
display_obj.tft.setTextColor(TFT_WHITE);
display_obj.tft.println("Waiting for serial data...");
display_obj.tft.setTextColor(TFT_WHITE);
#endif
}
void EspInterface::bootProgramMode() {
@@ -103,7 +110,9 @@ void EspInterface::program() {
}
if (Serial.available()) {
display_obj.tft.print(".");
#ifdef HAS_SCREEN
display_obj.tft.print(".");
#endif
while (Serial.available()) {
MySerial.write((uint8_t)Serial.read());
}

View File

@@ -1,14 +1,21 @@
#ifndef esp_interface_h
#define esp_interface_h
#include "Display.h"
#include "configs.h"
#ifdef HAS_SCREEN
#include "Display.h"
#endif
#include <HardwareSerial.h>
#define ESP_RST 14
#define ESP_ZERO 13
#define BAUD 115200
extern Display display_obj;
#ifdef HAS_SCREEN
extern Display display_obj;
#endif
class EspInterface {
public:

View File

@@ -0,0 +1,41 @@
#include "flipperLED.h"
void flipperLED::RunSetup() {
pinMode(B_PIN, OUTPUT);
pinMode(G_PIN, OUTPUT);
pinMode(R_PIN, OUTPUT);
delay(50);
digitalWrite(B_PIN, LOW);
delay(500);
digitalWrite(B_PIN, HIGH);
digitalWrite(G_PIN, LOW);
delay(500);
digitalWrite(G_PIN, HIGH);
digitalWrite(R_PIN, LOW);
delay(500);
digitalWrite(R_PIN, HIGH);
}
void flipperLED::attackLED() {
digitalWrite(B_PIN, HIGH);
digitalWrite(G_PIN, HIGH);
digitalWrite(R_PIN, HIGH);
delay(10);
digitalWrite(R_PIN, LOW);
}
void flipperLED::sniffLED() {
digitalWrite(B_PIN, HIGH);
digitalWrite(G_PIN, HIGH);
digitalWrite(R_PIN, HIGH);
delay(10);
digitalWrite(B_PIN, LOW);
}
void flipperLED::offLED() {
digitalWrite(B_PIN, HIGH);
digitalWrite(G_PIN, HIGH);
digitalWrite(R_PIN, HIGH);
}

View File

@@ -0,0 +1,19 @@
#ifndef flipperLED_h
#define flipperLED_h
#include <Arduino.h>
#define B_PIN 4
#define G_PIN 5
#define R_PIN 6
class flipperLED {
public:
void RunSetup();
void attackLED();
void sniffLED();
void offLED();
};
#endif

180
esp32_marauder/lang_var.h Normal file
View File

@@ -0,0 +1,180 @@
#ifndef lang_var_h
#define lang_var_h
#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...";
//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: ";
//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";
//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";
//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";
//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 ";
//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};
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};
#endif

View File

@@ -38,8 +38,8 @@ bool Settings::begin() {
DynamicJsonDocument jsonBuffer(1024);
DeserializationError error = deserializeJson(jsonBuffer, settingsFile);
serializeJson(jsonBuffer, json_string);
Serial.println("Settings: " + (String)json_string + "\n");
this->printJsonSettings(json_string);
//Serial.println("Settings: " + (String)json_string + "\n");
//this->printJsonSettings(json_string);
this->json_settings_string = json_string;
@@ -162,6 +162,7 @@ bool Settings::saveSetting<bool>(String key, bool value) {
return true;
}
}
return false;
}
bool Settings::toggleSetting(String key) {
@@ -263,19 +264,19 @@ bool Settings::createDefaultSettings(fs::FS &fs) {
//jsonBuffer["Settings"][1]["range"]["min"] = 1;
//jsonBuffer["Settings"][1]["range"]["max"] = 10;
jsonBuffer["Settings"][0]["name"] = "Force PMKID";
jsonBuffer["Settings"][0]["name"] = "ForcePMKID";
jsonBuffer["Settings"][0]["type"] = "bool";
jsonBuffer["Settings"][0]["value"] = true;
jsonBuffer["Settings"][0]["range"]["min"] = false;
jsonBuffer["Settings"][0]["range"]["max"] = true;
jsonBuffer["Settings"][1]["name"] = "Force Probe";
jsonBuffer["Settings"][1]["name"] = "ForceProbe";
jsonBuffer["Settings"][1]["type"] = "bool";
jsonBuffer["Settings"][1]["value"] = true;
jsonBuffer["Settings"][1]["range"]["min"] = false;
jsonBuffer["Settings"][1]["range"]["max"] = true;
jsonBuffer["Settings"][2]["name"] = "Save PCAP";
jsonBuffer["Settings"][2]["name"] = "SavePCAP";
jsonBuffer["Settings"][2]["type"] = "bool";
jsonBuffer["Settings"][2]["value"] = true;
jsonBuffer["Settings"][2]["range"]["min"] = false;

View File

@@ -1,23 +1,24 @@
#ifndef Settings_h
#define Settings_h
#include "configs.h"
#include "SPIFFS.h"
#include <FS.h>
#include <ArduinoJson.h>
#define FORMAT_SPIFFS_IF_FAILED true
#include "Display.h"
#ifdef HAS_SCREEN
#include "Display.h"
extern Display display_obj;
extern Display display_obj;
#endif
class Settings {
private:
String json_settings_string;
void printJsonSettings(String json_string);
bool createDefaultSettings(fs::FS &fs);
public:
bool begin();
@@ -46,6 +47,8 @@ class Settings {
//uint8_t loadSetting<uint8_t>(String key);
String getSettingsString();
bool createDefaultSettings(fs::FS &fs);
void printJsonSettings(String json_string);
void main(uint32_t currentTime);
};

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More