mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 15:50:36 -08:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d269b383b | ||
|
|
0a90e6aedc | ||
|
|
6b4e2952d6 | ||
|
|
a84ee7e58e | ||
|
|
1eeedac84c | ||
|
|
e556309746 | ||
|
|
b21ee85b83 | ||
|
|
f2c1d01d13 | ||
|
|
cbe6d0196b | ||
|
|
6ab706c848 | ||
|
|
999dd77643 | ||
|
|
99210984e4 | ||
|
|
9ae60eeecf | ||
|
|
6ff61f4991 | ||
|
|
f4486ec191 | ||
|
|
ce6a40e554 | ||
|
|
09615832b3 | ||
|
|
0a9fc2a485 | ||
|
|
d555031b54 | ||
|
|
8efa79a407 | ||
|
|
59739b331d | ||
|
|
9f181d73a6 | ||
|
|
37788fe1a9 | ||
|
|
db6d23f3e4 | ||
|
|
6c8e77cba2 | ||
|
|
accd8f5730 | ||
|
|
7661b47a42 | ||
|
|
3e16378993 | ||
|
|
b51df45dec | ||
|
|
93bb2c6a85 | ||
|
|
5da426de99 | ||
|
|
07d5e8787e | ||
|
|
7a6a880cb9 | ||
|
|
1546fad676 | ||
|
|
785545c185 |
61
.github/workflows/build_push.yml
vendored
61
.github/workflows/build_push.yml
vendored
@@ -89,6 +89,7 @@ jobs:
|
|||||||
cp User_Setup_Select.h CustomTFT_eSPI/
|
cp User_Setup_Select.h CustomTFT_eSPI/
|
||||||
cp User_Setup_marauder_mini.h CustomTFT_eSPI/
|
cp User_Setup_marauder_mini.h CustomTFT_eSPI/
|
||||||
cp User_Setup_og_marauder.h CustomTFT_eSPI/
|
cp User_Setup_og_marauder.h CustomTFT_eSPI/
|
||||||
|
cp User_Setup_marauder_m5stickc.h CustomTFT_eSPI/
|
||||||
pwd
|
pwd
|
||||||
ls -la
|
ls -la
|
||||||
ls -la CustomTFT_eSPI
|
ls -la CustomTFT_eSPI
|
||||||
@@ -134,7 +135,7 @@ jobs:
|
|||||||
- name: Configure SD Serial for Flipper Zero SD Serial
|
- name: Configure SD Serial for Flipper Zero SD Serial
|
||||||
run: |
|
run: |
|
||||||
pwd
|
pwd
|
||||||
sed -i 's/^ \/\/#define WRITE_PACKETS_SERIAL/ #define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
|
sed -i 's/^ \/\/#define WRITE_PACKETS_SERIAL/ #define WRITE_PACKETS_SERIAL/' esp32_marauder/configs.h
|
||||||
|
|
||||||
- name: Build Marauder SD Serial for Flipper Zero WiFi Dev Board
|
- name: Build Marauder SD Serial for Flipper Zero WiFi Dev Board
|
||||||
uses: ArminJo/arduino-test-compile@v3.2.0
|
uses: ArminJo/arduino-test-compile@v3.2.0
|
||||||
@@ -150,7 +151,7 @@ jobs:
|
|||||||
- name: Remove SD Serial
|
- name: Remove SD Serial
|
||||||
run: |
|
run: |
|
||||||
pwd
|
pwd
|
||||||
sed -i 's/^ #define WRITE_PACKETS_SERIAL/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
|
sed -i 's/^ #define WRITE_PACKETS_SERIAL/ \/\/#define WRITE_PACKETS_SERIAL/' esp32_marauder/configs.h
|
||||||
|
|
||||||
- name: Build Marauder for Flipper Zero Multi Board
|
- name: Build Marauder for Flipper Zero Multi Board
|
||||||
uses: ArminJo/arduino-test-compile@v3.2.0
|
uses: ArminJo/arduino-test-compile@v3.2.0
|
||||||
@@ -304,6 +305,33 @@ jobs:
|
|||||||
- name: Rename Marauder for Marauder Dev Board Pro
|
- name: Rename Marauder for Marauder Dev Board Pro
|
||||||
run: |
|
run: |
|
||||||
mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
|
mv ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
|
||||||
|
|
||||||
|
- name: Configure TFT_eSPI and configs.h for Marauder M5StickC
|
||||||
|
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_marauder_m5stickc.h>/#include <User_Setup_marauder_m5stickc.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
|
||||||
|
sed -i 's/^ #define ESP32_LDDB/ \/\/#define ESP32_LDDB/' esp32_marauder/configs.h
|
||||||
|
sed -i 's/^ #define MARAUDER_DEV_BOARD_PRO/ \/\/#define MARAUDER_DEV_BOARD_PRO/' esp32_marauder/configs.h
|
||||||
|
sed -i 's/^ \/\/#define MARAUDER_M5STICKC/ #define MARAUDER_M5STICKC/' esp32_marauder/configs.h
|
||||||
|
|
||||||
|
- name: Build Marauder for Marauder M5StickC
|
||||||
|
uses: ArminJo/arduino-test-compile@v3.2.0
|
||||||
|
with:
|
||||||
|
sketch-names: esp32_marauder.ino
|
||||||
|
arduino-board-fqbn: esp32:esp32:m5stick-c:PartitionScheme=min_spiffs
|
||||||
|
extra-arduino-cli-args: "--warnings none"
|
||||||
|
|
||||||
|
- name: Rename Marauder M5StickC bin
|
||||||
|
run: |
|
||||||
|
mv ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.ino.bin ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.m5stickc_plus.bin
|
||||||
|
|
||||||
- name: Display finished bins
|
- name: Display finished bins
|
||||||
run: |
|
run: |
|
||||||
@@ -372,6 +400,13 @@ jobs:
|
|||||||
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
|
path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
|
- name: 'Upload Marauder M5StickC Plus Artifact'
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: esp32_marauder.m5stickc_plus.bin
|
||||||
|
path: ./esp32_marauder/build/esp32.esp32.m5stick-c/esp32_marauder.m5stickc_plus.bin
|
||||||
|
retention-days: 5
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
@@ -382,6 +417,7 @@ jobs:
|
|||||||
release_name: Release ${{ github.ref }}
|
release_name: Release ${{ github.ref }}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload Flipper Asset
|
- name: Upload Flipper Asset
|
||||||
id: upload-flipper-release-asset
|
id: upload-flipper-release-asset
|
||||||
@@ -393,6 +429,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper.bin
|
||||||
asset_name: esp32_marauder.flipper.bin
|
asset_name: esp32_marauder.flipper.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload Flipper SD Serial Asset
|
- name: Upload Flipper SD Serial Asset
|
||||||
id: upload-flipper-sd-serial-release-asset
|
id: upload-flipper-sd-serial-release-asset
|
||||||
@@ -404,6 +441,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s2/esp32_marauder.flipper_sd_serial.bin
|
||||||
asset_name: esp32_marauder.flipper_sd_serial.bin
|
asset_name: esp32_marauder.flipper_sd_serial.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload MultiboardS3 Asset
|
- name: Upload MultiboardS3 Asset
|
||||||
id: upload-mutliboardS3-release-asset
|
id: upload-mutliboardS3-release-asset
|
||||||
@@ -415,6 +453,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s3/esp32_marauder.multiboardS3.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.esp32s3/esp32_marauder.multiboardS3.bin
|
||||||
asset_name: esp32_marauder.mutliboardS3.bin
|
asset_name: esp32_marauder.mutliboardS3.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload OG Asset
|
- name: Upload OG Asset
|
||||||
id: upload-og-release-asset
|
id: upload-og-release-asset
|
||||||
@@ -426,6 +465,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.og.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.og.bin
|
||||||
asset_name: esp32_marauder.og.bin
|
asset_name: esp32_marauder.og.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload v6 Asset
|
- name: Upload v6 Asset
|
||||||
id: upload-v6-release-asset
|
id: upload-v6-release-asset
|
||||||
@@ -437,6 +477,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.v6.bin
|
||||||
asset_name: esp32_marauder.v6.bin
|
asset_name: esp32_marauder.v6.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload Kit Asset
|
- name: Upload Kit Asset
|
||||||
id: upload-kit-release-asset
|
id: upload-kit-release-asset
|
||||||
@@ -448,6 +489,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.kit.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.kit.bin
|
||||||
asset_name: esp32_marauder.kit.bin
|
asset_name: esp32_marauder.kit.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload Mini Asset
|
- name: Upload Mini Asset
|
||||||
id: upload-mini-release-asset
|
id: upload-mini-release-asset
|
||||||
@@ -459,6 +501,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.mini.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.mini.bin
|
||||||
asset_name: esp32_marauder.mini.bin
|
asset_name: esp32_marauder.mini.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload ESP32 LDDB Asset
|
- name: Upload ESP32 LDDB Asset
|
||||||
id: upload-esp32-lddb-release-asset
|
id: upload-esp32-lddb-release-asset
|
||||||
@@ -470,6 +513,7 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.esp32_lddb.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.esp32_lddb.bin
|
||||||
asset_name: esp32_marauder.esp32_lddb.bin
|
asset_name: esp32_marauder.esp32_lddb.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
- name: Upload Marauder Dev Board Pro Asset
|
- name: Upload Marauder Dev Board Pro Asset
|
||||||
id: upload-marauder-dev-board-pro-release-asset
|
id: upload-marauder-dev-board-pro-release-asset
|
||||||
@@ -481,3 +525,16 @@ jobs:
|
|||||||
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
|
asset_path: ./esp32_marauder/build/esp32.esp32.d32/esp32_marauder.marauder_dev_board_pro.bin
|
||||||
asset_name: esp32_marauder.marauder_dev_board_pro.bin
|
asset_name: esp32_marauder.marauder_dev_board_pro.bin
|
||||||
asset_content_type: application/bin
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
|
- name: Upload Marauder M5StickC Plus Asset
|
||||||
|
id: upload-m5stickc-plus-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.m5stick-c/esp32_marauder.m5stickc_plus.bin
|
||||||
|
asset_name: esp32_marauder.m5stickc_plus.bin
|
||||||
|
asset_content_type: application/bin
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!---[](https://travis-ci.com/justcallmekoko/ESP32Marauder)--->
|
<!---[](https://travis-ci.com/justcallmekoko/ESP32Marauder)--->
|
||||||
<!---Shields/Badges https://shields.io/--->
|
<!---Shields/Badges https://shields.io/--->
|
||||||
|
|
||||||
# ESP32 Marauder v0.10.1
|
# ESP32 Marauder v0.10.4
|
||||||
<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"><img alt="Marauder logo" src="https://github.com/justcallmekoko/ESP32Marauder/blob/master/pictures/marauder3L.jpg?raw=true" width="300"></p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<b>A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32</b>
|
<b>A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32</b>
|
||||||
|
|||||||
@@ -21,8 +21,9 @@
|
|||||||
|
|
||||||
//#include <User_Setup.h> // Default setup is root library folder
|
//#include <User_Setup.h> // Default setup is root library folder
|
||||||
|
|
||||||
//#include <User_Setup_og_marauder.h>
|
#include <User_Setup_og_marauder.h>
|
||||||
#include <User_Setup_marauder_mini.h>
|
//#include <User_Setup_marauder_mini.h>
|
||||||
|
//#include <User_Setup_marauder_m5stickc.h>
|
||||||
|
|
||||||
//#include <User_Setups/Setup1_ILI9341.h> // Setup file configured for my ILI9341
|
//#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/Setup2_ST7735.h> // Setup file configured for my ST7735
|
||||||
|
|||||||
316
User_Setup_marauder_m5stickc.h
Normal file
316
User_Setup_marauder_m5stickc.h
Normal 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 240 // Marauder Mini
|
||||||
|
// #define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320
|
||||||
|
// #define TFT_HEIGHT 160
|
||||||
|
#define TFT_HEIGHT 135 // 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 5 // Chip select control pin D8
|
||||||
|
#define TFT_DC 23 // Data Command control pin
|
||||||
|
#define TFT_RST 18 // Reset pin (could connect to NodeMCU RST, see next line)
|
||||||
|
#define TOUCH_CS -1
|
||||||
|
//#define TFT_MISO 19
|
||||||
|
#define TFT_MOSI 15
|
||||||
|
#define TFT_SCLK 13
|
||||||
|
//#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
|
||||||
435
esp32_marauder/AXP192.cpp
Normal file
435
esp32_marauder/AXP192.cpp
Normal file
@@ -0,0 +1,435 @@
|
|||||||
|
#include "AXP192.h"
|
||||||
|
|
||||||
|
AXP192::AXP192() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::begin(void) {
|
||||||
|
Wire1.begin(21, 22);
|
||||||
|
Wire1.setClock(400000);
|
||||||
|
|
||||||
|
// Set LDO2 & LDO3(TFT_LED & TFT) 3.0V
|
||||||
|
Write1Byte(0x28, 0xcc);
|
||||||
|
|
||||||
|
// Set ADC to All Enable
|
||||||
|
Write1Byte(0x82, 0xff);
|
||||||
|
|
||||||
|
// Bat charge voltage to 4.2, Current 100MA
|
||||||
|
Write1Byte(0x33, 0xc0);
|
||||||
|
|
||||||
|
// Enable Bat,ACIN,VBUS,APS adc
|
||||||
|
Write1Byte(0x82, 0xff);
|
||||||
|
|
||||||
|
// Enable Ext, LDO2, LDO3, DCDC1
|
||||||
|
Write1Byte(0x12, Read8bit(0x12) | 0x4D);
|
||||||
|
|
||||||
|
// 128ms power on, 4s power off
|
||||||
|
Write1Byte(0x36, 0x0C);
|
||||||
|
|
||||||
|
// Set RTC voltage to 3.3V
|
||||||
|
Write1Byte(0x91, 0xF0);
|
||||||
|
|
||||||
|
// Set GPIO0 to LDO
|
||||||
|
Write1Byte(0x90, 0x02);
|
||||||
|
|
||||||
|
// Disable vbus hold limit
|
||||||
|
Write1Byte(0x30, 0x80);
|
||||||
|
|
||||||
|
// Set temperature protection
|
||||||
|
Write1Byte(0x39, 0xfc);
|
||||||
|
|
||||||
|
// Enable RTC BAT charge
|
||||||
|
Write1Byte(0x35, 0xa2);
|
||||||
|
|
||||||
|
// Enable bat detection
|
||||||
|
Write1Byte(0x32, 0x46);
|
||||||
|
|
||||||
|
// ScreenBreath(80);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::Write1Byte(uint8_t Addr, uint8_t Data) {
|
||||||
|
Wire1.beginTransmission(0x34);
|
||||||
|
Wire1.write(Addr);
|
||||||
|
Wire1.write(Data);
|
||||||
|
Wire1.endTransmission();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t AXP192::Read8bit(uint8_t Addr) {
|
||||||
|
Wire1.beginTransmission(0x34);
|
||||||
|
Wire1.write(Addr);
|
||||||
|
Wire1.endTransmission();
|
||||||
|
Wire1.requestFrom(0x34, 1);
|
||||||
|
return Wire1.read();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::Read12Bit(uint8_t Addr) {
|
||||||
|
uint16_t Data = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(Addr, 2, buf);
|
||||||
|
Data = ((buf[0] << 4) + buf[1]); //
|
||||||
|
return Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::Read13Bit(uint8_t Addr) {
|
||||||
|
uint16_t Data = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(Addr, 2, buf);
|
||||||
|
Data = ((buf[0] << 5) + buf[1]); //
|
||||||
|
return Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::Read16bit(uint8_t Addr) {
|
||||||
|
uint16_t ReData = 0;
|
||||||
|
Wire1.beginTransmission(0x34);
|
||||||
|
Wire1.write(Addr);
|
||||||
|
Wire1.endTransmission();
|
||||||
|
Wire1.requestFrom(0x34, 2);
|
||||||
|
for (int i = 0; i < 2; i++) {
|
||||||
|
ReData <<= 8;
|
||||||
|
ReData |= Wire1.read();
|
||||||
|
}
|
||||||
|
return ReData;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t AXP192::Read24bit(uint8_t Addr) {
|
||||||
|
uint32_t ReData = 0;
|
||||||
|
Wire1.beginTransmission(0x34);
|
||||||
|
Wire1.write(Addr);
|
||||||
|
Wire1.endTransmission();
|
||||||
|
Wire1.requestFrom(0x34, 3);
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
ReData <<= 8;
|
||||||
|
ReData |= Wire1.read();
|
||||||
|
}
|
||||||
|
return ReData;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t AXP192::Read32bit(uint8_t Addr) {
|
||||||
|
uint32_t ReData = 0;
|
||||||
|
Wire1.beginTransmission(0x34);
|
||||||
|
Wire1.write(Addr);
|
||||||
|
Wire1.endTransmission();
|
||||||
|
Wire1.requestFrom(0x34, 4);
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
ReData <<= 8;
|
||||||
|
ReData |= Wire1.read();
|
||||||
|
}
|
||||||
|
return ReData;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::ReadBuff(uint8_t Addr, uint8_t Size, uint8_t *Buff) {
|
||||||
|
Wire1.beginTransmission(0x34);
|
||||||
|
Wire1.write(Addr);
|
||||||
|
Wire1.endTransmission();
|
||||||
|
Wire1.requestFrom(0x34, (int)Size);
|
||||||
|
for (int i = 0; i < Size; i++) {
|
||||||
|
*(Buff + i) = Wire1.read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::ScreenBreath(int brightness) {
|
||||||
|
if (brightness > 100 || brightness < 0) return;
|
||||||
|
int vol = map(brightness, 0, 100, 2500, 3200);
|
||||||
|
vol = (vol < 1800) ? 0 : (vol - 1800) / 100;
|
||||||
|
uint8_t buf = Read8bit(0x28);
|
||||||
|
Write1Byte(0x28, ((buf & 0x0f) | ((uint16_t)vol << 4)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::ScreenSwitch(bool state) {
|
||||||
|
uint8_t brightness;
|
||||||
|
if (state == false) {
|
||||||
|
brightness = 0;
|
||||||
|
} else if (state == true) {
|
||||||
|
brightness = 12;
|
||||||
|
}
|
||||||
|
uint8_t buf = Read8bit(0x28);
|
||||||
|
Write1Byte(0x28, ((buf & 0x0f) | (brightness << 4)));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AXP192::GetBatState() {
|
||||||
|
if (Read8bit(0x01) | 0x20)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//---------coulombcounter_from_here---------
|
||||||
|
// enable: void EnableCoulombcounter(void);
|
||||||
|
// disable: void DisableCOulombcounter(void);
|
||||||
|
// stop: void StopCoulombcounter(void);
|
||||||
|
// clear: void ClearCoulombcounter(void);
|
||||||
|
// get charge data: uint32_t GetCoulombchargeData(void);
|
||||||
|
// get discharge data: uint32_t GetCoulombdischargeData(void);
|
||||||
|
// get coulomb val affter calculation: float GetCoulombData(void);
|
||||||
|
//------------------------------------------
|
||||||
|
void AXP192::EnableCoulombcounter(void) {
|
||||||
|
Write1Byte(0xB8, 0x80);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::DisableCoulombcounter(void) {
|
||||||
|
Write1Byte(0xB8, 0x00);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::StopCoulombcounter(void) {
|
||||||
|
Write1Byte(0xB8, 0xC0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::ClearCoulombcounter(void) {
|
||||||
|
Write1Byte(0xB8, 0xA0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t AXP192::GetCoulombchargeData(void) {
|
||||||
|
return Read32bit(0xB0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t AXP192::GetCoulombdischargeData(void) {
|
||||||
|
return Read32bit(0xB4);
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetCoulombData(void) {
|
||||||
|
uint32_t coin = 0;
|
||||||
|
uint32_t coout = 0;
|
||||||
|
|
||||||
|
coin = GetCoulombchargeData();
|
||||||
|
coout = GetCoulombdischargeData();
|
||||||
|
|
||||||
|
// c = 65536 * current_LSB * (coin - coout) / 3600 / ADC rate
|
||||||
|
// Adc rate can be read from 84H ,change this variable if you change the ADC
|
||||||
|
// reate
|
||||||
|
float ccc = 65536 * 0.5 * (int32_t)(coin - coout) / 3600.0 / 25.0;
|
||||||
|
|
||||||
|
return ccc;
|
||||||
|
}
|
||||||
|
//----------coulomb_end_at_here----------
|
||||||
|
|
||||||
|
uint16_t AXP192::GetVbatData(void) {
|
||||||
|
uint16_t vbat = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x78, 2, buf);
|
||||||
|
vbat = ((buf[0] << 4) + buf[1]); // V
|
||||||
|
return vbat;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetVinData(void) {
|
||||||
|
uint16_t vin = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x56, 2, buf);
|
||||||
|
vin = ((buf[0] << 4) + buf[1]); // V
|
||||||
|
return vin;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetIinData(void) {
|
||||||
|
uint16_t iin = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x58, 2, buf);
|
||||||
|
iin = ((buf[0] << 4) + buf[1]);
|
||||||
|
return iin;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetVusbinData(void) {
|
||||||
|
uint16_t vin = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x5a, 2, buf);
|
||||||
|
vin = ((buf[0] << 4) + buf[1]); // V
|
||||||
|
return vin;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetIusbinData(void) {
|
||||||
|
uint16_t iin = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x5C, 2, buf);
|
||||||
|
iin = ((buf[0] << 4) + buf[1]);
|
||||||
|
return iin;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetIchargeData(void) {
|
||||||
|
uint16_t icharge = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x7A, 2, buf);
|
||||||
|
icharge = (buf[0] << 5) + buf[1];
|
||||||
|
return icharge;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetIdischargeData(void) {
|
||||||
|
uint16_t idischarge = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x7C, 2, buf);
|
||||||
|
idischarge = (buf[0] << 5) + buf[1];
|
||||||
|
return idischarge;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetTempData(void) {
|
||||||
|
uint16_t temp = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x5e, 2, buf);
|
||||||
|
temp = ((buf[0] << 4) + buf[1]);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t AXP192::GetPowerbatData(void) {
|
||||||
|
uint32_t power = 0;
|
||||||
|
uint8_t buf[3];
|
||||||
|
ReadBuff(0x70, 2, buf);
|
||||||
|
power = (buf[0] << 16) + (buf[1] << 8) + buf[2];
|
||||||
|
return power;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t AXP192::GetVapsData(void) {
|
||||||
|
uint16_t vaps = 0;
|
||||||
|
uint8_t buf[2];
|
||||||
|
ReadBuff(0x7e, 2, buf);
|
||||||
|
vaps = ((buf[0] << 4) + buf[1]);
|
||||||
|
return vaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::SetSleep(void) {
|
||||||
|
uint8_t buf = Read8bit(0x31);
|
||||||
|
buf = (1 << 3) | buf;
|
||||||
|
Write1Byte(0x31, buf);
|
||||||
|
Write1Byte(0x90, 0x00);
|
||||||
|
Write1Byte(0x12, 0x09);
|
||||||
|
// Write1Byte(0x12, 0x00);
|
||||||
|
Write1Byte(0x12, Read8bit(0x12) & 0xA1); // Disable all outputs but DCDC1
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t AXP192::GetWarningLeve(void) {
|
||||||
|
Wire1.beginTransmission(0x34);
|
||||||
|
Wire1.write(0x47);
|
||||||
|
Wire1.endTransmission();
|
||||||
|
Wire1.requestFrom(0x34, 1);
|
||||||
|
uint8_t buf = Wire1.read();
|
||||||
|
return (buf & 0x01);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- sleep
|
||||||
|
void AXP192::DeepSleep(uint64_t time_in_us) {
|
||||||
|
SetSleep();
|
||||||
|
|
||||||
|
if (time_in_us > 0) {
|
||||||
|
esp_sleep_enable_timer_wakeup(time_in_us);
|
||||||
|
} else {
|
||||||
|
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
|
||||||
|
}
|
||||||
|
(time_in_us == 0) ? esp_deep_sleep_start() : esp_deep_sleep(time_in_us);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::LightSleep(uint64_t time_in_us) {
|
||||||
|
SetSleep();
|
||||||
|
|
||||||
|
if (time_in_us > 0) {
|
||||||
|
esp_sleep_enable_timer_wakeup(time_in_us);
|
||||||
|
} else {
|
||||||
|
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
|
||||||
|
}
|
||||||
|
esp_light_sleep_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 0 not press, 0x01 long press, 0x02 press
|
||||||
|
uint8_t AXP192::GetBtnPress() {
|
||||||
|
uint8_t state = Read8bit(0x46);
|
||||||
|
if (state) {
|
||||||
|
Write1Byte(0x46, 0x03);
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t AXP192::GetWarningLevel(void) {
|
||||||
|
return Read8bit(0x47) & 0x01;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetBatVoltage() {
|
||||||
|
float ADCLSB = 1.1 / 1000.0;
|
||||||
|
uint16_t ReData = Read12Bit(0x78);
|
||||||
|
return ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetBatCurrent() {
|
||||||
|
float ADCLSB = 0.5;
|
||||||
|
uint16_t CurrentIn = Read13Bit(0x7A);
|
||||||
|
uint16_t CurrentOut = Read13Bit(0x7C);
|
||||||
|
return (CurrentIn - CurrentOut) * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetVinVoltage() {
|
||||||
|
float ADCLSB = 1.7 / 1000.0;
|
||||||
|
uint16_t ReData = Read12Bit(0x56);
|
||||||
|
return ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetVinCurrent() {
|
||||||
|
float ADCLSB = 0.625;
|
||||||
|
uint16_t ReData = Read12Bit(0x58);
|
||||||
|
return ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetVBusVoltage() {
|
||||||
|
float ADCLSB = 1.7 / 1000.0;
|
||||||
|
uint16_t ReData = Read12Bit(0x5A);
|
||||||
|
return ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetVBusCurrent() {
|
||||||
|
float ADCLSB = 0.375;
|
||||||
|
uint16_t ReData = Read12Bit(0x5C);
|
||||||
|
return ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetTempInAXP192() {
|
||||||
|
float ADCLSB = 0.1;
|
||||||
|
const float OFFSET_DEG_C = -144.7;
|
||||||
|
uint16_t ReData = Read12Bit(0x5E);
|
||||||
|
return OFFSET_DEG_C + ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetBatPower() {
|
||||||
|
float VoltageLSB = 1.1;
|
||||||
|
float CurrentLCS = 0.5;
|
||||||
|
uint32_t ReData = Read24bit(0x70);
|
||||||
|
return VoltageLSB * CurrentLCS * ReData / 1000.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetBatChargeCurrent() {
|
||||||
|
float ADCLSB = 0.5;
|
||||||
|
uint16_t ReData = Read12Bit(0x7A);
|
||||||
|
return ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
float AXP192::GetAPSVoltage() {
|
||||||
|
float ADCLSB = 1.4 / 1000.0;
|
||||||
|
uint16_t ReData = Read12Bit(0x7E);
|
||||||
|
return ReData * ADCLSB;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetBatCoulombInput() {
|
||||||
|
uint32_t ReData = Read32bit(0xB0);
|
||||||
|
return ReData * 65536 * 0.5 / 3600 / 25.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
float AXP192::GetBatCoulombOut() {
|
||||||
|
uint32_t ReData = Read32bit(0xB4);
|
||||||
|
return ReData * 65536 * 0.5 / 3600 / 25.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::SetCoulombClear() {
|
||||||
|
Write1Byte(0xB8, 0x20);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::SetLDO2(bool State) {
|
||||||
|
uint8_t buf = Read8bit(0x12);
|
||||||
|
if (State == true)
|
||||||
|
buf = (1 << 2) | buf;
|
||||||
|
else
|
||||||
|
buf = ~(1 << 2) & buf;
|
||||||
|
Write1Byte(0x12, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cut all power, except for LDO1 (RTC)
|
||||||
|
void AXP192::PowerOff() {
|
||||||
|
Write1Byte(0x32, Read8bit(0x32) | 0x80); // MSB for Power Off
|
||||||
|
}
|
||||||
|
|
||||||
|
void AXP192::SetPeripherialsPower(uint8_t state) {
|
||||||
|
if (!state)
|
||||||
|
Write1Byte(0x10, Read8bit(0x10) & 0XFB);
|
||||||
|
else if (state)
|
||||||
|
Write1Byte(0x10, Read8bit(0x10) | 0X04);
|
||||||
|
// uint8_t data;
|
||||||
|
// Set EXTEN to enable 5v boost
|
||||||
|
}
|
||||||
81
esp32_marauder/AXP192.h
Normal file
81
esp32_marauder/AXP192.h
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
#ifndef __AXP192_H__
|
||||||
|
#define __AXP192_H__
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include <Wire.h>
|
||||||
|
|
||||||
|
#define SLEEP_MSEC(us) (((uint64_t)us) * 1000L)
|
||||||
|
#define SLEEP_SEC(us) (((uint64_t)us) * 1000000L)
|
||||||
|
#define SLEEP_MIN(us) (((uint64_t)us) * 60L * 1000000L)
|
||||||
|
#define SLEEP_HR(us) (((uint64_t)us) * 60L * 60L * 1000000L)
|
||||||
|
|
||||||
|
class AXP192 {
|
||||||
|
public:
|
||||||
|
AXP192();
|
||||||
|
void begin(void);
|
||||||
|
void ScreenBreath(int brightness);
|
||||||
|
void ScreenSwitch(bool state);
|
||||||
|
|
||||||
|
bool GetBatState();
|
||||||
|
|
||||||
|
void EnableCoulombcounter(void);
|
||||||
|
void DisableCoulombcounter(void);
|
||||||
|
void StopCoulombcounter(void);
|
||||||
|
void ClearCoulombcounter(void);
|
||||||
|
uint32_t GetCoulombchargeData(void);
|
||||||
|
uint32_t GetCoulombdischargeData(void);
|
||||||
|
float GetCoulombData(void);
|
||||||
|
|
||||||
|
uint16_t GetVbatData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetIchargeData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetIdischargeData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetTempData(void) __attribute__((deprecated));
|
||||||
|
uint32_t GetPowerbatData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetVinData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetIinData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetVusbinData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetIusbinData(void) __attribute__((deprecated));
|
||||||
|
uint16_t GetVapsData(void) __attribute__((deprecated));
|
||||||
|
uint8_t GetBtnPress(void);
|
||||||
|
|
||||||
|
// -- sleep
|
||||||
|
void SetSleep(void);
|
||||||
|
void DeepSleep(uint64_t time_in_us = 0);
|
||||||
|
void LightSleep(uint64_t time_in_us = 0);
|
||||||
|
uint8_t GetWarningLeve(void);
|
||||||
|
|
||||||
|
public:
|
||||||
|
// void SetChargeVoltage( uint8_t );
|
||||||
|
// void SetChargeCurrent( uint8_t );
|
||||||
|
float GetBatVoltage();
|
||||||
|
float GetBatCurrent();
|
||||||
|
float GetVinVoltage();
|
||||||
|
float GetVinCurrent();
|
||||||
|
float GetVBusVoltage();
|
||||||
|
float GetVBusCurrent();
|
||||||
|
float GetTempInAXP192();
|
||||||
|
float GetBatPower();
|
||||||
|
float GetBatChargeCurrent();
|
||||||
|
float GetAPSVoltage();
|
||||||
|
float GetBatCoulombInput();
|
||||||
|
float GetBatCoulombOut();
|
||||||
|
uint8_t GetWarningLevel(void);
|
||||||
|
void SetCoulombClear();
|
||||||
|
void SetLDO2(bool State);
|
||||||
|
void SetPeripherialsPower(uint8_t state);
|
||||||
|
|
||||||
|
// -- Power Off
|
||||||
|
void PowerOff();
|
||||||
|
|
||||||
|
public:
|
||||||
|
void Write1Byte(uint8_t Addr, uint8_t Data);
|
||||||
|
uint8_t Read8bit(uint8_t Addr);
|
||||||
|
uint16_t Read12Bit(uint8_t Addr);
|
||||||
|
uint16_t Read13Bit(uint8_t Addr);
|
||||||
|
uint16_t Read16bit(uint8_t Addr);
|
||||||
|
uint32_t Read24bit(uint8_t Addr);
|
||||||
|
uint32_t Read32bit(uint8_t Addr);
|
||||||
|
void ReadBuff(uint8_t Addr, uint8_t Size, uint8_t *Buff);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -9,6 +9,9 @@ void CommandLine::RunSetup() {
|
|||||||
Serial.println(F("\n\n--------------------------------\n"));
|
Serial.println(F("\n\n--------------------------------\n"));
|
||||||
Serial.println(F(" ESP32 Marauder \n"));
|
Serial.println(F(" ESP32 Marauder \n"));
|
||||||
Serial.println(" " + version_number + "\n");
|
Serial.println(" " + version_number + "\n");
|
||||||
|
#ifdef WRITE_PACKETS_SERIAL
|
||||||
|
Serial.println(F(" >> Serial \n"));
|
||||||
|
#endif
|
||||||
Serial.println(F(" By: justcallmekoko\n"));
|
Serial.println(F(" By: justcallmekoko\n"));
|
||||||
Serial.println(F("--------------------------------\n\n"));
|
Serial.println(F("--------------------------------\n\n"));
|
||||||
|
|
||||||
@@ -36,21 +39,41 @@ void CommandLine::main(uint32_t currentTime) {
|
|||||||
|
|
||||||
LinkedList<String> CommandLine::parseCommand(String input, char* delim) {
|
LinkedList<String> CommandLine::parseCommand(String input, char* delim) {
|
||||||
LinkedList<String> cmd_args;
|
LinkedList<String> cmd_args;
|
||||||
|
|
||||||
if (input != "") {
|
bool inQuote = false;
|
||||||
|
bool inApostrophe = false;
|
||||||
char fancy[input.length() + 1] = {};
|
String buffer = "";
|
||||||
input.toCharArray(fancy, input.length() + 1);
|
|
||||||
|
for (int i = 0; i < input.length(); i++) {
|
||||||
char* ptr = strtok(fancy, delim);
|
char c = input.charAt(i);
|
||||||
|
|
||||||
while (ptr != NULL) {
|
if (c == '"') {
|
||||||
cmd_args.add(String(ptr));
|
// Check if the quote is within an apostrophe
|
||||||
|
if (inApostrophe) {
|
||||||
ptr = strtok(NULL, delim);
|
buffer += c;
|
||||||
|
} else {
|
||||||
|
inQuote = !inQuote;
|
||||||
|
}
|
||||||
|
} else if (c == '\'') {
|
||||||
|
// Check if the apostrophe is within a quote
|
||||||
|
if (inQuote) {
|
||||||
|
buffer += c;
|
||||||
|
} else {
|
||||||
|
inApostrophe = !inApostrophe;
|
||||||
|
}
|
||||||
|
} else if (!inQuote && !inApostrophe && strchr(delim, c) != NULL) {
|
||||||
|
cmd_args.add(buffer);
|
||||||
|
buffer = "";
|
||||||
|
} else {
|
||||||
|
buffer += c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the last argument
|
||||||
|
if (!buffer.isEmpty()) {
|
||||||
|
cmd_args.add(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
return cmd_args;
|
return cmd_args;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,6 +116,85 @@ bool CommandLine::hasSSIDs() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CommandLine::showCounts(int selected, int unselected) {
|
||||||
|
Serial.print((String) selected + " selected");
|
||||||
|
|
||||||
|
if (unselected != -1)
|
||||||
|
Serial.print(", " + (String) unselected + " unselected");
|
||||||
|
|
||||||
|
Serial.println("");
|
||||||
|
}
|
||||||
|
|
||||||
|
String CommandLine::toLowerCase(String str) {
|
||||||
|
String result = str;
|
||||||
|
for (int i = 0; i < str.length(); i++) {
|
||||||
|
int charValue = str.charAt(i);
|
||||||
|
if (charValue >= 65 && charValue <= 90) { // ASCII codes for uppercase letters
|
||||||
|
charValue += 32;
|
||||||
|
result.setCharAt(i, char(charValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CommandLine::filterAccessPoints(String filter) {
|
||||||
|
int count_selected = 0;
|
||||||
|
int count_unselected = 0;
|
||||||
|
|
||||||
|
// Split the filter string into individual filters
|
||||||
|
LinkedList<String> filters;
|
||||||
|
int start = 0;
|
||||||
|
int end = filter.indexOf(" or ");
|
||||||
|
while (end != -1) {
|
||||||
|
filters.add(filter.substring(start, end));
|
||||||
|
start = end + 4;
|
||||||
|
end = filter.indexOf(" or ", start);
|
||||||
|
}
|
||||||
|
filters.add(filter.substring(start));
|
||||||
|
|
||||||
|
// Loop over each access point and check if it matches any of the filters
|
||||||
|
for (int i = 0; i < access_points->size(); i++) {
|
||||||
|
bool matchesFilter = false;
|
||||||
|
for (int j = 0; j < filters.size(); j++) {
|
||||||
|
String f = toLowerCase(filters.get(j));
|
||||||
|
if (f.substring(0, 7) == "equals ") {
|
||||||
|
String ssidEquals = f.substring(7);
|
||||||
|
if ((ssidEquals.charAt(0) == '\"' && ssidEquals.charAt(ssidEquals.length() - 1) == '\"' && ssidEquals.length() > 1) ||
|
||||||
|
(ssidEquals.charAt(0) == '\'' && ssidEquals.charAt(ssidEquals.length() - 1) == '\'' && ssidEquals.length() > 1)) {
|
||||||
|
ssidEquals = ssidEquals.substring(1, ssidEquals.length() - 1);
|
||||||
|
}
|
||||||
|
if (access_points->get(i).essid.equalsIgnoreCase(ssidEquals)) {
|
||||||
|
matchesFilter = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (f.substring(0, 9) == "contains ") {
|
||||||
|
String ssidContains = f.substring(9);
|
||||||
|
if ((ssidContains.charAt(0) == '\"' && ssidContains.charAt(ssidContains.length() - 1) == '\"' && ssidContains.length() > 1) ||
|
||||||
|
(ssidContains.charAt(0) == '\'' && ssidContains.charAt(ssidContains.length() - 1) == '\'' && ssidContains.length() > 1)) {
|
||||||
|
ssidContains = ssidContains.substring(1, ssidContains.length() - 1);
|
||||||
|
}
|
||||||
|
String essid = toLowerCase(access_points->get(i).essid);
|
||||||
|
if (essid.indexOf(ssidContains) != -1) {
|
||||||
|
matchesFilter = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Toggles the selected state of the AP
|
||||||
|
AccessPoint new_ap = access_points->get(i);
|
||||||
|
new_ap.selected = matchesFilter;
|
||||||
|
access_points->set(i, new_ap);
|
||||||
|
|
||||||
|
if (matchesFilter) {
|
||||||
|
count_selected++;
|
||||||
|
} else {
|
||||||
|
count_unselected++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this->showCounts(count_selected, count_unselected);
|
||||||
|
}
|
||||||
|
|
||||||
void CommandLine::runCommand(String input) {
|
void CommandLine::runCommand(String input) {
|
||||||
if (input != "")
|
if (input != "")
|
||||||
Serial.println("#" + input);
|
Serial.println("#" + input);
|
||||||
@@ -113,6 +215,7 @@ void CommandLine::runCommand(String input) {
|
|||||||
Serial.println(HELP_UPDATE_CMD_A);
|
Serial.println(HELP_UPDATE_CMD_A);
|
||||||
|
|
||||||
// WiFi sniff/scan
|
// WiFi sniff/scan
|
||||||
|
Serial.println(HELP_SIGSTREN_CMD);
|
||||||
Serial.println(HELP_SCANAP_CMD);
|
Serial.println(HELP_SCANAP_CMD);
|
||||||
Serial.println(HELP_SCANSTA_CMD);
|
Serial.println(HELP_SCANSTA_CMD);
|
||||||
Serial.println(HELP_SNIFF_RAW_CMD);
|
Serial.println(HELP_SNIFF_RAW_CMD);
|
||||||
@@ -134,6 +237,7 @@ void CommandLine::runCommand(String input) {
|
|||||||
Serial.println(HELP_SEL_CMD_A);
|
Serial.println(HELP_SEL_CMD_A);
|
||||||
Serial.println(HELP_SSID_CMD_A);
|
Serial.println(HELP_SSID_CMD_A);
|
||||||
Serial.println(HELP_SSID_CMD_B);
|
Serial.println(HELP_SSID_CMD_B);
|
||||||
|
Serial.println(HELP_JOIN_WIFI_CMD);
|
||||||
|
|
||||||
// Bluetooth sniff/scan
|
// Bluetooth sniff/scan
|
||||||
Serial.println(HELP_BT_SNIFF_CMD);
|
Serial.println(HELP_BT_SNIFF_CMD);
|
||||||
@@ -246,9 +350,17 @@ void CommandLine::runCommand(String input) {
|
|||||||
|
|
||||||
//// WiFi/Bluetooth Scan/Attack commands
|
//// WiFi/Bluetooth Scan/Attack commands
|
||||||
if (!wifi_scan_obj.scanning()) {
|
if (!wifi_scan_obj.scanning()) {
|
||||||
|
// Signal strength scan
|
||||||
|
if (cmd_args.get(0) == SIGSTREN_CMD) {
|
||||||
|
Serial.println("Starting Signal Strength Scan. Stop with " + (String)STOPSCAN_CMD);
|
||||||
|
#ifdef HAS_SCREEN
|
||||||
|
display_obj.clearScreen();
|
||||||
|
menu_function_obj.drawStatusBar();
|
||||||
|
#endif
|
||||||
|
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_MAGENTA);
|
||||||
|
}
|
||||||
// AP Scan
|
// AP Scan
|
||||||
if (cmd_args.get(0) == SCANAP_CMD) {
|
else if (cmd_args.get(0) == SCANAP_CMD) {
|
||||||
int full_sw = -1;
|
int full_sw = -1;
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.clearScreen();
|
display_obj.clearScreen();
|
||||||
@@ -275,6 +387,9 @@ void CommandLine::runCommand(String input) {
|
|||||||
}
|
}
|
||||||
// Scan stations
|
// Scan stations
|
||||||
else if (cmd_args.get(0) == SCANSTA_CMD) {
|
else if (cmd_args.get(0) == SCANSTA_CMD) {
|
||||||
|
if(access_points->size() < 1)
|
||||||
|
Serial.println("The AP list is empty. Scan APs first with " + (String)SCANAP_CMD);
|
||||||
|
|
||||||
Serial.println("Starting Station scan. Stop with " + (String)STOPSCAN_CMD);
|
Serial.println("Starting Station scan. Stop with " + (String)STOPSCAN_CMD);
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.clearScreen();
|
display_obj.clearScreen();
|
||||||
@@ -331,6 +446,14 @@ void CommandLine::runCommand(String input) {
|
|||||||
else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
|
else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
|
||||||
int ch_sw = this->argSearch(&cmd_args, "-c");
|
int ch_sw = this->argSearch(&cmd_args, "-c");
|
||||||
int d_sw = this->argSearch(&cmd_args, "-d"); // Deauth for pmkid
|
int d_sw = this->argSearch(&cmd_args, "-d"); // Deauth for pmkid
|
||||||
|
int l_sw = this->argSearch(&cmd_args, "-l"); // Only run on list
|
||||||
|
|
||||||
|
if (l_sw != -1) {
|
||||||
|
if (!this->apSelected()) {
|
||||||
|
Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ch_sw != -1) {
|
if (ch_sw != -1) {
|
||||||
wifi_scan_obj.set_channel = cmd_args.get(ch_sw + 1).toInt();
|
wifi_scan_obj.set_channel = cmd_args.get(ch_sw + 1).toInt();
|
||||||
@@ -343,11 +466,15 @@ void CommandLine::runCommand(String input) {
|
|||||||
Serial.println("Starting PMKID sniff on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
|
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);
|
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
|
||||||
}
|
}
|
||||||
|
else if ((d_sw != -1) && (l_sw != -1)) {
|
||||||
|
Serial.println("Starting TARGETED PMKID sniff with deauthentication on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
|
||||||
|
wifi_scan_obj.StartScan(WIFI_SCAN_ACTIVE_LIST_EAPOL, TFT_VIOLET);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Serial.println("Starting PMKID sniff with deauthentication on channel " + (String)wifi_scan_obj.set_channel + ". Stop with " + (String)STOPSCAN_CMD);
|
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_scan_obj.StartScan(WIFI_SCAN_ACTIVE_EAPOL, TFT_VIOLET);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//// WiFi attack commands
|
//// WiFi attack commands
|
||||||
// attack
|
// attack
|
||||||
@@ -487,21 +614,29 @@ void CommandLine::runCommand(String input) {
|
|||||||
//// Bluetooth scan/attack commands
|
//// Bluetooth scan/attack commands
|
||||||
// Bluetooth scan
|
// Bluetooth scan
|
||||||
if (cmd_args.get(0) == BT_SNIFF_CMD) {
|
if (cmd_args.get(0) == BT_SNIFF_CMD) {
|
||||||
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
|
#ifdef HAS_BT
|
||||||
#ifdef HAS_SCREEN
|
Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
|
||||||
display_obj.clearScreen();
|
#ifdef HAS_SCREEN
|
||||||
menu_function_obj.drawStatusBar();
|
display_obj.clearScreen();
|
||||||
|
menu_function_obj.drawStatusBar();
|
||||||
|
#endif
|
||||||
|
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
|
||||||
|
#else
|
||||||
|
Serial.println("Bluetooth not supported");
|
||||||
#endif
|
#endif
|
||||||
wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
|
|
||||||
}
|
}
|
||||||
// Bluetooth CC Skimmer scan
|
// Bluetooth CC Skimmer scan
|
||||||
else if (cmd_args.get(0) == BT_SKIM_CMD) {
|
else if (cmd_args.get(0) == BT_SKIM_CMD) {
|
||||||
Serial.println("Starting Bluetooth CC Skimmer scan. Stop with " + (String)STOPSCAN_CMD);
|
#ifdef HAS_BT
|
||||||
#ifdef HAS_SCREEN
|
Serial.println("Starting Bluetooth CC Skimmer scan. Stop with " + (String)STOPSCAN_CMD);
|
||||||
display_obj.clearScreen();
|
#ifdef HAS_SCREEN
|
||||||
menu_function_obj.drawStatusBar();
|
display_obj.clearScreen();
|
||||||
|
menu_function_obj.drawStatusBar();
|
||||||
|
#endif
|
||||||
|
wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
|
||||||
|
#else
|
||||||
|
Serial.println("Bluetooth not supported");
|
||||||
#endif
|
#endif
|
||||||
wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update command
|
// Update command
|
||||||
@@ -535,6 +670,7 @@ void CommandLine::runCommand(String input) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int count_selected = 0;
|
||||||
//// WiFi aux commands
|
//// WiFi aux commands
|
||||||
// List access points
|
// List access points
|
||||||
if (cmd_args.get(0) == LIST_AP_CMD) {
|
if (cmd_args.get(0) == LIST_AP_CMD) {
|
||||||
@@ -545,20 +681,26 @@ void CommandLine::runCommand(String input) {
|
|||||||
// List APs
|
// List APs
|
||||||
if (ap_sw != -1) {
|
if (ap_sw != -1) {
|
||||||
for (int i = 0; i < access_points->size(); i++) {
|
for (int i = 0; i < access_points->size(); i++) {
|
||||||
if (access_points->get(i).selected)
|
if (access_points->get(i).selected) {
|
||||||
Serial.println("[" + (String)i + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi + " (selected)");
|
Serial.println("[" + (String)i + "][CH:" + (String)access_points->get(i).channel + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi + " (selected)");
|
||||||
|
count_selected += 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Serial.println("[" + (String)i + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi);
|
Serial.println("[" + (String)i + "][CH:" + (String)access_points->get(i).channel + "] " + access_points->get(i).essid + " " + (String)access_points->get(i).rssi);
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected);
|
||||||
}
|
}
|
||||||
// List SSIDs
|
// List SSIDs
|
||||||
else if (ss_sw != -1) {
|
else if (ss_sw != -1) {
|
||||||
for (int i = 0; i < ssids->size(); i++) {
|
for (int i = 0; i < ssids->size(); i++) {
|
||||||
if (ssids->get(i).selected)
|
if (ssids->get(i).selected) {
|
||||||
Serial.println("[" + (String)i + "] " + ssids->get(i).essid + " (selected)");
|
Serial.println("[" + (String)i + "] " + ssids->get(i).essid + " (selected)");
|
||||||
|
count_selected += 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Serial.println("[" + (String)i + "] " + ssids->get(i).essid);
|
Serial.println("[" + (String)i + "] " + ssids->get(i).essid);
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected);
|
||||||
}
|
}
|
||||||
// List Stations
|
// List Stations
|
||||||
else if (cl_sw != -1) {
|
else if (cl_sw != -1) {
|
||||||
@@ -571,6 +713,7 @@ void CommandLine::runCommand(String input) {
|
|||||||
Serial.print(" [" + (String)access_points->get(x).stations->get(i) + "] ");
|
Serial.print(" [" + (String)access_points->get(x).stations->get(i) + "] ");
|
||||||
Serial.print(sta_mac);
|
Serial.print(sta_mac);
|
||||||
Serial.println(" (selected)");
|
Serial.println(" (selected)");
|
||||||
|
count_selected += 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Serial.print(" [" + (String)access_points->get(x).stations->get(i) + "] ");
|
Serial.print(" [" + (String)access_points->get(x).stations->get(i) + "] ");
|
||||||
@@ -578,6 +721,7 @@ void CommandLine::runCommand(String input) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Serial.println("You did not specify which list to show");
|
Serial.println("You did not specify which list to show");
|
||||||
@@ -590,50 +734,66 @@ void CommandLine::runCommand(String input) {
|
|||||||
int ap_sw = this->argSearch(&cmd_args, "-a");
|
int ap_sw = this->argSearch(&cmd_args, "-a");
|
||||||
int ss_sw = this->argSearch(&cmd_args, "-s");
|
int ss_sw = this->argSearch(&cmd_args, "-s");
|
||||||
int cl_sw = this->argSearch(&cmd_args, "-c");
|
int cl_sw = this->argSearch(&cmd_args, "-c");
|
||||||
|
int filter_sw = this->argSearch(&cmd_args, "-f");
|
||||||
|
|
||||||
|
count_selected = 0;
|
||||||
|
int count_unselected = 0;
|
||||||
// select Access points
|
// select Access points
|
||||||
if (ap_sw != -1) {
|
if (ap_sw != -1) {
|
||||||
// Get list of indices
|
|
||||||
LinkedList<String> ap_index = this->parseCommand(cmd_args.get(ap_sw + 1), ",");
|
|
||||||
|
|
||||||
// Select ALL APs
|
// If the filters parameter was specified
|
||||||
if (cmd_args.get(ap_sw + 1) == "all") {
|
if (filter_sw != -1) {
|
||||||
for (int i = 0; i < access_points->size(); i++) {
|
String filter_ap = cmd_args.get(filter_sw + 1);
|
||||||
if (access_points->get(i).selected) {
|
this->filterAccessPoints(filter_ap);
|
||||||
// Unselect "selected" ap
|
} else {
|
||||||
AccessPoint new_ap = access_points->get(i);
|
// Get list of indices
|
||||||
new_ap.selected = false;
|
LinkedList<String> ap_index = this->parseCommand(cmd_args.get(ap_sw + 1), ",");
|
||||||
access_points->set(i, new_ap);
|
|
||||||
}
|
// Select ALL APs
|
||||||
else {
|
if (cmd_args.get(ap_sw + 1) == "all") {
|
||||||
// Select "unselected" ap
|
for (int i = 0; i < access_points->size(); i++) {
|
||||||
AccessPoint new_ap = access_points->get(i);
|
if (access_points->get(i).selected) {
|
||||||
new_ap.selected = true;
|
// Unselect "selected" ap
|
||||||
access_points->set(i, new_ap);
|
AccessPoint new_ap = access_points->get(i);
|
||||||
|
new_ap.selected = false;
|
||||||
|
access_points->set(i, new_ap);
|
||||||
|
count_unselected += 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Select "unselected" ap
|
||||||
|
AccessPoint new_ap = access_points->get(i);
|
||||||
|
new_ap.selected = true;
|
||||||
|
access_points->set(i, new_ap);
|
||||||
|
count_selected += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected, count_unselected);
|
||||||
}
|
}
|
||||||
}
|
// Select specific APs
|
||||||
// Select specific APs
|
else {
|
||||||
else {
|
// Mark APs as selected
|
||||||
// Mark APs as selected
|
for (int i = 0; i < ap_index.size(); i++) {
|
||||||
for (int i = 0; i < ap_index.size(); i++) {
|
int index = ap_index.get(i).toInt();
|
||||||
int index = ap_index.get(i).toInt();
|
if (!this->inRange(access_points->size(), index)) {
|
||||||
if (!this->inRange(access_points->size(), index)) {
|
Serial.println("Index not in range: " + (String)index);
|
||||||
Serial.println("Index not in range: " + (String)index);
|
continue;
|
||||||
continue;
|
}
|
||||||
}
|
if (access_points->get(index).selected) {
|
||||||
if (access_points->get(index).selected) {
|
// Unselect "selected" ap
|
||||||
// Unselect "selected" ap
|
AccessPoint new_ap = access_points->get(index);
|
||||||
AccessPoint new_ap = access_points->get(index);
|
new_ap.selected = false;
|
||||||
new_ap.selected = false;
|
access_points->set(index, new_ap);
|
||||||
access_points->set(index, new_ap);
|
count_unselected += 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Select "unselected" ap
|
// Select "unselected" ap
|
||||||
AccessPoint new_ap = access_points->get(index);
|
AccessPoint new_ap = access_points->get(index);
|
||||||
new_ap.selected = true;
|
new_ap.selected = true;
|
||||||
access_points->set(index, new_ap);
|
access_points->set(index, new_ap);
|
||||||
|
count_selected += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected, count_unselected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -648,14 +808,17 @@ void CommandLine::runCommand(String input) {
|
|||||||
Station new_sta = stations->get(i);
|
Station new_sta = stations->get(i);
|
||||||
new_sta.selected = false;
|
new_sta.selected = false;
|
||||||
stations->set(i, new_sta);
|
stations->set(i, new_sta);
|
||||||
|
count_unselected += 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Select "unselected" ap
|
// Select "unselected" ap
|
||||||
Station new_sta = stations->get(i);
|
Station new_sta = stations->get(i);
|
||||||
new_sta.selected = true;
|
new_sta.selected = true;
|
||||||
stations->set(i, new_sta);
|
stations->set(i, new_sta);
|
||||||
|
count_selected += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected, count_unselected);
|
||||||
}
|
}
|
||||||
// Select specific Stations
|
// Select specific Stations
|
||||||
else {
|
else {
|
||||||
@@ -671,14 +834,17 @@ void CommandLine::runCommand(String input) {
|
|||||||
Station new_sta = stations->get(index);
|
Station new_sta = stations->get(index);
|
||||||
new_sta.selected = false;
|
new_sta.selected = false;
|
||||||
stations->set(index, new_sta);
|
stations->set(index, new_sta);
|
||||||
|
count_unselected += 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Select "unselected" ap
|
// Select "unselected" ap
|
||||||
Station new_sta = stations->get(index);
|
Station new_sta = stations->get(index);
|
||||||
new_sta.selected = true;
|
new_sta.selected = true;
|
||||||
stations->set(index, new_sta);
|
stations->set(index, new_sta);
|
||||||
|
count_selected += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected, count_unselected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// select ssids
|
// select ssids
|
||||||
@@ -698,14 +864,17 @@ void CommandLine::runCommand(String input) {
|
|||||||
ssid new_ssid = ssids->get(index);
|
ssid new_ssid = ssids->get(index);
|
||||||
new_ssid.selected = false;
|
new_ssid.selected = false;
|
||||||
ssids->set(index, new_ssid);
|
ssids->set(index, new_ssid);
|
||||||
|
count_unselected += 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Select "unselected" ap
|
// Select "unselected" ap
|
||||||
ssid new_ssid = ssids->get(index);
|
ssid new_ssid = ssids->get(index);
|
||||||
new_ssid.selected = true;
|
new_ssid.selected = true;
|
||||||
ssids->set(index, new_ssid);
|
ssids->set(index, new_ssid);
|
||||||
|
count_selected += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this->showCounts(count_selected, count_unselected);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Serial.println("You did not specify which list to select from");
|
Serial.println("You did not specify which list to select from");
|
||||||
@@ -749,4 +918,41 @@ void CommandLine::runCommand(String input) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Join WiFi
|
||||||
|
else if (cmd_args.get(0) == JOINWIFI_CMD) {
|
||||||
|
int n_sw = this->argSearch(&cmd_args, "-n"); // name
|
||||||
|
int a_sw = this->argSearch(&cmd_args, "-a"); // access point
|
||||||
|
int s_sw = this->argSearch(&cmd_args, "-s"); // ssid
|
||||||
|
int p_sw = this->argSearch(&cmd_args, "-p");
|
||||||
|
|
||||||
|
String essid = "";
|
||||||
|
String pwx = "";
|
||||||
|
|
||||||
|
if (s_sw != -1) {
|
||||||
|
int index = cmd_args.get(s_sw + 1).toInt();
|
||||||
|
if (!this->inRange(ssids->size(), index)) {
|
||||||
|
Serial.println("Index not in range: " + (String)index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
essid = ssids->get(index).essid;
|
||||||
|
} else if (a_sw != -1) {
|
||||||
|
int index = cmd_args.get(a_sw + 1).toInt();
|
||||||
|
if (!this->inRange(access_points->size(), index)) {
|
||||||
|
Serial.println("Index not in range: " + (String)index);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
essid = access_points->get(index).essid;
|
||||||
|
} else if (n_sw != -1) {
|
||||||
|
essid = cmd_args.get(n_sw + 1);
|
||||||
|
} else {
|
||||||
|
Serial.println("You must specify an access point or ssid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p_sw != -1) {
|
||||||
|
pwx = cmd_args.get(p_sw + 1);
|
||||||
|
}
|
||||||
|
Serial.println("Attempting to join WiFi with ssid " + (String)essid);
|
||||||
|
wifi_scan_obj.joinWiFi(essid, pwx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ const char PROGMEM HELP_CMD[] = "help";
|
|||||||
const char PROGMEM SETTINGS_CMD[] = "settings";
|
const char PROGMEM SETTINGS_CMD[] = "settings";
|
||||||
|
|
||||||
// WiFi sniff/scan
|
// WiFi sniff/scan
|
||||||
|
const char PROGMEM SIGSTREN_CMD[] = "sigmon";
|
||||||
const char PROGMEM SCANAP_CMD[] = "scanap";
|
const char PROGMEM SCANAP_CMD[] = "scanap";
|
||||||
const char PROGMEM SCANSTA_CMD[] = "scansta";
|
const char PROGMEM SCANSTA_CMD[] = "scansta";
|
||||||
const char PROGMEM SNIFF_RAW_CMD[] = "sniffraw";
|
const char PROGMEM SNIFF_RAW_CMD[] = "sniffraw";
|
||||||
@@ -60,6 +61,7 @@ const char PROGMEM ATTACK_TYPE_RR[] = "rickroll";
|
|||||||
const char PROGMEM LIST_AP_CMD[] = "list";
|
const char PROGMEM LIST_AP_CMD[] = "list";
|
||||||
const char PROGMEM SEL_CMD[] = "select";
|
const char PROGMEM SEL_CMD[] = "select";
|
||||||
const char PROGMEM SSID_CMD[] = "ssid";
|
const char PROGMEM SSID_CMD[] = "ssid";
|
||||||
|
const char PROGMEM JOINWIFI_CMD[] = "join";
|
||||||
|
|
||||||
// Bluetooth sniff/scan
|
// Bluetooth sniff/scan
|
||||||
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
|
const char PROGMEM BT_SNIFF_CMD[] = "sniffbt";
|
||||||
@@ -76,6 +78,7 @@ const char PROGMEM HELP_UPDATE_CMD_A[] = "update -s/-w";
|
|||||||
const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>]/[-r]";
|
const char PROGMEM HELP_SETTINGS_CMD[] = "settings [-s <setting> enable/disable>]/[-r]";
|
||||||
|
|
||||||
// WiFi sniff/scan
|
// WiFi sniff/scan
|
||||||
|
const char PROGMEM HELP_SIGSTREN_CMD[] = "sigmon";
|
||||||
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
|
const char PROGMEM HELP_SCANAP_CMD[] = "scanap";
|
||||||
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
|
const char PROGMEM HELP_SCANSTA_CMD[] = "scansta";
|
||||||
const char PROGMEM HELP_SNIFF_RAW_CMD[] = "sniffraw";
|
const char PROGMEM HELP_SNIFF_RAW_CMD[] = "sniffraw";
|
||||||
@@ -84,8 +87,9 @@ const char PROGMEM HELP_SNIFF_PROBE_CMD[] = "sniffprobe";
|
|||||||
const char PROGMEM HELP_SNIFF_PWN_CMD[] = "sniffpwn";
|
const char PROGMEM HELP_SNIFF_PWN_CMD[] = "sniffpwn";
|
||||||
const char PROGMEM HELP_SNIFF_ESP_CMD[] = "sniffesp";
|
const char PROGMEM HELP_SNIFF_ESP_CMD[] = "sniffesp";
|
||||||
const char PROGMEM HELP_SNIFF_DEAUTH_CMD[] = "sniffdeauth";
|
const char PROGMEM HELP_SNIFF_DEAUTH_CMD[] = "sniffdeauth";
|
||||||
const char PROGMEM HELP_SNIFF_PMKID_CMD[] = "sniffpmkid [-c <channel>]";
|
const char PROGMEM HELP_SNIFF_PMKID_CMD[] = "sniffpmkid [-c <channel>][-d][-l]";
|
||||||
const char PROGMEM HELP_STOPSCAN_CMD[] = "stopscan";
|
const char PROGMEM HELP_STOPSCAN_CMD[] = "stopscan";
|
||||||
|
const char PROGMEM HELP_JOIN_WIFI_CMD[] = "join [-n <ssid_name>/-s <ssid_index>/-a <access_point_index>] -p <password>";
|
||||||
|
|
||||||
// WiFi attack
|
// WiFi attack
|
||||||
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]/[-s <src mac>] [-d <dst mac>]/probe/rickroll>";
|
const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]/[-s <src mac>] [-d <dst mac>]/probe/rickroll>";
|
||||||
@@ -94,7 +98,7 @@ const char PROGMEM HELP_ATTACK_CMD[] = "attack -t <beacon [-l/-r/-a]/deauth [-c]
|
|||||||
const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
|
const char PROGMEM HELP_LIST_AP_CMD_A[] = "list -s";
|
||||||
const char PROGMEM HELP_LIST_AP_CMD_B[] = "list -a";
|
const char PROGMEM HELP_LIST_AP_CMD_B[] = "list -a";
|
||||||
const char PROGMEM HELP_LIST_AP_CMD_C[] = "list -c";
|
const char PROGMEM HELP_LIST_AP_CMD_C[] = "list -c";
|
||||||
const char PROGMEM HELP_SEL_CMD_A[] = "select -a/-s/-c <index (comma separated)>";
|
const char PROGMEM HELP_SEL_CMD_A[] = "select -a/-s/-c <index (comma separated)>/-f \"equals <String> or contains <String>\"";
|
||||||
const char PROGMEM HELP_SSID_CMD_A[] = "ssid -a [-g <count>/-n <name>]";
|
const char PROGMEM HELP_SSID_CMD_A[] = "ssid -a [-g <count>/-n <name>]";
|
||||||
const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
|
const char PROGMEM HELP_SSID_CMD_B[] = "ssid -r <index>";
|
||||||
|
|
||||||
@@ -108,11 +112,14 @@ class CommandLine {
|
|||||||
private:
|
private:
|
||||||
String getSerialInput();
|
String getSerialInput();
|
||||||
LinkedList<String> parseCommand(String input, char* delim);
|
LinkedList<String> parseCommand(String input, char* delim);
|
||||||
|
String toLowerCase(String str);
|
||||||
|
void filterAccessPoints(String filter);
|
||||||
void runCommand(String input);
|
void runCommand(String input);
|
||||||
bool checkValueExists(LinkedList<String>* cmd_args_list, int index);
|
bool checkValueExists(LinkedList<String>* cmd_args_list, int index);
|
||||||
bool inRange(int max, int index);
|
bool inRange(int max, int index);
|
||||||
bool apSelected();
|
bool apSelected();
|
||||||
bool hasSSIDs();
|
bool hasSSIDs();
|
||||||
|
void showCounts(int selected, int unselected = -1);
|
||||||
int argSearch(LinkedList<String>* cmd_args, String key);
|
int argSearch(LinkedList<String>* cmd_args, String key);
|
||||||
|
|
||||||
const char* ascii_art =
|
const char* ascii_art =
|
||||||
|
|||||||
@@ -20,11 +20,17 @@ void Display::RunSetup()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
tft.init();
|
tft.init();
|
||||||
tft.setRotation(0); // Portrait
|
#ifndef MARAUDER_M5STICKC
|
||||||
|
tft.setRotation(0); // Portrait
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
tft.setRotation(3);
|
||||||
|
#endif
|
||||||
|
|
||||||
tft.setCursor(0, 0);
|
tft.setCursor(0, 0);
|
||||||
|
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
|
|
||||||
#ifdef TFT_SHIELD
|
#ifdef TFT_SHIELD
|
||||||
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
|
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
|
||||||
@@ -380,7 +386,7 @@ void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
|
|||||||
//Serial.println(" tfa: " + (String)tfa);
|
//Serial.println(" tfa: " + (String)tfa);
|
||||||
//Serial.println(" bfa: " + (String)bfa);
|
//Serial.println(" bfa: " + (String)bfa);
|
||||||
//Serial.println("yStart: " + (String)this->yStart);
|
//Serial.println("yStart: " + (String)this->yStart);
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
|
tft.writecommand(ILI9341_VSCRDEF); // Vertical scroll definition
|
||||||
tft.writedata(tfa >> 8); // Top Fixed Area line count
|
tft.writedata(tfa >> 8); // Top Fixed Area line count
|
||||||
tft.writedata(tfa);
|
tft.writedata(tfa);
|
||||||
@@ -393,7 +399,7 @@ void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
|
|||||||
|
|
||||||
|
|
||||||
void Display::scrollAddress(uint16_t vsp) {
|
void Display::scrollAddress(uint16_t vsp) {
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
|
tft.writecommand(ILI9341_VSCRSADD); // Vertical scrolling pointer
|
||||||
tft.writedata(vsp>>8);
|
tft.writedata(vsp>>8);
|
||||||
tft.writedata(vsp);
|
tft.writedata(vsp);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ MenuFunctions::MenuFunctions()
|
|||||||
// LVGL Stuff
|
// LVGL Stuff
|
||||||
/* Interrupt driven periodic handler */
|
/* Interrupt driven periodic handler */
|
||||||
|
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
void MenuFunctions::lv_tick_handler()
|
void MenuFunctions::lv_tick_handler()
|
||||||
{
|
{
|
||||||
lv_tick_inc(LVGL_TICK_PERIOD);
|
lv_tick_inc(LVGL_TICK_PERIOD);
|
||||||
@@ -860,7 +860,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
this->orientDisplay();
|
this->orientDisplay();
|
||||||
wifi_scan_obj.orient_display = false;
|
wifi_scan_obj.orient_display = false;
|
||||||
}
|
}
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
if ((wifi_scan_obj.currentScanMode != LV_JOIN_WIFI) &&
|
if ((wifi_scan_obj.currentScanMode != LV_JOIN_WIFI) &&
|
||||||
(wifi_scan_obj.currentScanMode != LV_ADD_SSID))
|
(wifi_scan_obj.currentScanMode != LV_ADD_SSID))
|
||||||
display_obj.updateBanner(current_menu->name);
|
display_obj.updateBanner(current_menu->name);
|
||||||
@@ -873,7 +873,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
if ((wifi_scan_obj.currentScanMode != LV_JOIN_WIFI) &&
|
if ((wifi_scan_obj.currentScanMode != LV_JOIN_WIFI) &&
|
||||||
(wifi_scan_obj.currentScanMode != LV_ADD_SSID))
|
(wifi_scan_obj.currentScanMode != LV_ADD_SSID))
|
||||||
this->updateStatusBar();
|
this->updateStatusBar();
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.updateBanner(current_menu->name);
|
display_obj.updateBanner(current_menu->name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -901,13 +901,13 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
int pre_getTouch = millis();
|
int pre_getTouch = millis();
|
||||||
|
|
||||||
// getTouch causes a 10ms delay which makes beacon spam less effective
|
// getTouch causes a 10ms delay which makes beacon spam less effective
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
pressed = display_obj.tft.getTouch(&t_x, &t_y);
|
pressed = display_obj.tft.getTouch(&t_x, &t_y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// This is if there are scans/attacks going on
|
// This is if there are scans/attacks going on
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
if ((wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
|
if ((wifi_scan_obj.currentScanMode != WIFI_SCAN_OFF) &&
|
||||||
(pressed) &&
|
(pressed) &&
|
||||||
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
|
(wifi_scan_obj.currentScanMode != OTA_UPDATE) &&
|
||||||
@@ -919,6 +919,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
||||||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
||||||
@@ -953,7 +954,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#ifdef HAS_BUTTONS
|
||||||
|
|
||||||
bool c_btn_press = c_btn.justPressed();
|
bool c_btn_press = c_btn.justPressed();
|
||||||
|
|
||||||
@@ -968,6 +969,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_RAW_CAPTURE) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_STATION) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_AP) ||
|
||||||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_SIG_STREN) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_TARGET_AP_FULL) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_PWN) ||
|
||||||
@@ -987,6 +989,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
|
(wifi_scan_obj.currentScanMode == BT_SCAN_SKIMMERS) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_EAPOL) ||
|
||||||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_ACTIVE_LIST_EAPOL) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR))
|
(wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR))
|
||||||
{
|
{
|
||||||
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
|
||||||
@@ -1009,7 +1012,7 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
|
|
||||||
// Check if any key coordinate boxes contain the touch coordinates
|
// Check if any key coordinate boxes contain the touch coordinates
|
||||||
// This is for when on a menu
|
// This is for when on a menu
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM) &&
|
if ((wifi_scan_obj.currentScanMode != WIFI_ATTACK_BEACON_SPAM) &&
|
||||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_AP_SPAM) &&
|
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_AP_SPAM) &&
|
||||||
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_AUTH) &&
|
(wifi_scan_obj.currentScanMode != WIFI_ATTACK_AUTH) &&
|
||||||
@@ -1069,23 +1072,25 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
y = -1;
|
y = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#ifdef HAS_BUTTONS
|
||||||
if (u_btn.justPressed()){
|
#ifndef MARAUDER_M5STICKC
|
||||||
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
|
if (u_btn.justPressed()){
|
||||||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
|
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
|
||||||
if (current_menu->selected > 0) {
|
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
|
||||||
current_menu->selected--;
|
if (current_menu->selected > 0) {
|
||||||
this->buttonSelected(current_menu->selected);
|
current_menu->selected--;
|
||||||
if (!current_menu->list->get(current_menu->selected + 1).selected)
|
this->buttonSelected(current_menu->selected);
|
||||||
this->buttonNotSelected(current_menu->selected + 1);
|
if (!current_menu->list->get(current_menu->selected + 1).selected)
|
||||||
|
this->buttonNotSelected(current_menu->selected + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
|
||||||
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
|
||||||
|
if (wifi_scan_obj.set_channel < 14)
|
||||||
|
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
|
#endif
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
|
|
||||||
if (wifi_scan_obj.set_channel < 14)
|
|
||||||
wifi_scan_obj.changeChannel(wifi_scan_obj.set_channel + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (d_btn.justPressed()){
|
if (d_btn.justPressed()){
|
||||||
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
|
if ((wifi_scan_obj.currentScanMode == WIFI_SCAN_OFF) ||
|
||||||
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
|
(wifi_scan_obj.currentScanMode == OTA_UPDATE)) {
|
||||||
@@ -1095,6 +1100,12 @@ void MenuFunctions::main(uint32_t currentTime)
|
|||||||
if (!current_menu->list->get(current_menu->selected - 1).selected)
|
if (!current_menu->list->get(current_menu->selected - 1).selected)
|
||||||
this->buttonNotSelected(current_menu->selected - 1);
|
this->buttonNotSelected(current_menu->selected - 1);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
current_menu->selected = 0;
|
||||||
|
this->buttonSelected(current_menu->selected);
|
||||||
|
if (!current_menu->list->get(current_menu->list->size() - 1).selected)
|
||||||
|
this->buttonNotSelected(current_menu->list->size() - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
|
else if ((wifi_scan_obj.currentScanMode == WIFI_PACKET_MONITOR) ||
|
||||||
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
|
(wifi_scan_obj.currentScanMode == WIFI_SCAN_EAPOL)) {
|
||||||
@@ -1213,7 +1224,7 @@ void MenuFunctions::updateStatusBar()
|
|||||||
{
|
{
|
||||||
display_obj.tft.setTextSize(1);
|
display_obj.tft.setTextSize(1);
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.setFreeFont(NULL);
|
display_obj.tft.setFreeFont(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1235,11 +1246,11 @@ void MenuFunctions::updateStatusBar()
|
|||||||
if (temp_obj.current_temp != temp_obj.old_temp) {
|
if (temp_obj.current_temp != temp_obj.old_temp) {
|
||||||
temp_obj.old_temp = temp_obj.current_temp;
|
temp_obj.old_temp = temp_obj.current_temp;
|
||||||
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
|
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 0, 0, 1);
|
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 0, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1249,11 +1260,11 @@ void MenuFunctions::updateStatusBar()
|
|||||||
if (wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) {
|
if (wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) {
|
||||||
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
|
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
|
||||||
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
|
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1);
|
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1263,11 +1274,11 @@ void MenuFunctions::updateStatusBar()
|
|||||||
if (wifi_scan_obj.free_ram != wifi_scan_obj.old_free_ram) {
|
if (wifi_scan_obj.free_ram != wifi_scan_obj.old_free_ram) {
|
||||||
wifi_scan_obj.old_free_ram = wifi_scan_obj.free_ram;
|
wifi_scan_obj.old_free_ram = wifi_scan_obj.free_ram;
|
||||||
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
|
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1);
|
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -1285,7 +1296,7 @@ void MenuFunctions::updateStatusBar()
|
|||||||
the_color = TFT_RED;
|
the_color = TFT_RED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawXBitmap(170,
|
display_obj.tft.drawXBitmap(170,
|
||||||
0,
|
0,
|
||||||
menu_icons[STATUS_SD],
|
menu_icons[STATUS_SD],
|
||||||
@@ -1295,7 +1306,7 @@ void MenuFunctions::updateStatusBar()
|
|||||||
the_color);
|
the_color);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
||||||
display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1);
|
display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
@@ -1304,7 +1315,7 @@ void MenuFunctions::updateStatusBar()
|
|||||||
void MenuFunctions::drawStatusBar()
|
void MenuFunctions::drawStatusBar()
|
||||||
{
|
{
|
||||||
display_obj.tft.setTextSize(1);
|
display_obj.tft.setTextSize(1);
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.setFreeFont(NULL);
|
display_obj.tft.setFreeFont(NULL);
|
||||||
#endif
|
#endif
|
||||||
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
@@ -1329,11 +1340,11 @@ void MenuFunctions::drawStatusBar()
|
|||||||
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
||||||
temp_obj.old_temp = temp_obj.current_temp;
|
temp_obj.old_temp = temp_obj.current_temp;
|
||||||
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(0, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
|
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 4, 0, 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 0, 0, 1);
|
display_obj.tft.drawString((String)temp_obj.current_temp + " C", 0, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
|
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);
|
||||||
@@ -1342,11 +1353,11 @@ void MenuFunctions::drawStatusBar()
|
|||||||
// WiFi Channel Stuff
|
// WiFi Channel Stuff
|
||||||
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
|
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
|
||||||
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
|
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1);
|
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, TFT_WIDTH/4, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1354,11 +1365,11 @@ void MenuFunctions::drawStatusBar()
|
|||||||
wifi_scan_obj.freeRAM();
|
wifi_scan_obj.freeRAM();
|
||||||
wifi_scan_obj.old_free_ram = wifi_scan_obj.free_ram;
|
wifi_scan_obj.old_free_ram = wifi_scan_obj.free_ram;
|
||||||
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
display_obj.tft.fillRect(100, 0, 60, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
|
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", 100, 0, 2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1);
|
display_obj.tft.drawString((String)wifi_scan_obj.free_ram + "B", TFT_WIDTH/1.75, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1375,7 +1386,7 @@ void MenuFunctions::drawStatusBar()
|
|||||||
the_color = TFT_RED;
|
the_color = TFT_RED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.drawXBitmap(170,
|
display_obj.tft.drawXBitmap(170,
|
||||||
0,
|
0,
|
||||||
menu_icons[STATUS_SD],
|
menu_icons[STATUS_SD],
|
||||||
@@ -1385,7 +1396,7 @@ void MenuFunctions::drawStatusBar()
|
|||||||
the_color);
|
the_color);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
display_obj.tft.setTextColor(the_color, STATUSBAR_COLOR);
|
||||||
display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1);
|
display_obj.tft.drawString("SD", TFT_WIDTH - 12, 0, 1);
|
||||||
#endif
|
#endif
|
||||||
@@ -1399,7 +1410,7 @@ void MenuFunctions::orientDisplay()
|
|||||||
|
|
||||||
display_obj.tft.setCursor(0, 0);
|
display_obj.tft.setCursor(0, 0);
|
||||||
|
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
#ifdef TFT_SHIELD
|
#ifdef TFT_SHIELD
|
||||||
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
|
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
|
||||||
//Serial.println("Using TFT Shield");
|
//Serial.println("Using TFT Shield");
|
||||||
@@ -1466,7 +1477,7 @@ void MenuFunctions::RunSetup()
|
|||||||
{
|
{
|
||||||
extern LinkedList<AccessPoint>* access_points;
|
extern LinkedList<AccessPoint>* access_points;
|
||||||
|
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
this->initLVGL();
|
this->initLVGL();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1595,7 +1606,7 @@ void MenuFunctions::RunSetup()
|
|||||||
this->drawStatusBar();
|
this->drawStatusBar();
|
||||||
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
|
wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
|
||||||
});
|
});
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
addNodes(&wifiSnifferMenu, text_table1[46], TFT_VIOLET, NULL, EAPOL, [this]() {
|
addNodes(&wifiSnifferMenu, text_table1[46], TFT_VIOLET, NULL, EAPOL, [this]() {
|
||||||
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
|
wifi_scan_obj.StartScan(WIFI_SCAN_EAPOL, TFT_VIOLET);
|
||||||
});
|
});
|
||||||
@@ -1639,6 +1650,13 @@ void MenuFunctions::RunSetup()
|
|||||||
this->drawStatusBar();
|
this->drawStatusBar();
|
||||||
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_WHITE);
|
wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_WHITE);
|
||||||
});
|
});
|
||||||
|
#ifdef HAS_ILI9341
|
||||||
|
addNodes(&wifiSnifferMenu, "Signal Monitor", TFT_CYAN, NULL, PACKET_MONITOR, [this]() {
|
||||||
|
display_obj.clearScreen();
|
||||||
|
this->drawStatusBar();
|
||||||
|
wifi_scan_obj.StartScan(WIFI_SCAN_SIG_STREN, TFT_CYAN);
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
// Build WiFi attack menu
|
// Build WiFi attack menu
|
||||||
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
wifiAttackMenu.parentMenu = &wifiMenu; // Main Menu is second menu parent
|
||||||
@@ -1691,7 +1709,7 @@ void MenuFunctions::RunSetup()
|
|||||||
addNodes(&wifiGeneralMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
addNodes(&wifiGeneralMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() {
|
||||||
changeMenu(wifiGeneralMenu.parentMenu);
|
changeMenu(wifiGeneralMenu.parentMenu);
|
||||||
});
|
});
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
addNodes(&wifiGeneralMenu, text_table1[55], TFT_DARKCYAN, NULL, JOIN_WIFI, [this](){
|
addNodes(&wifiGeneralMenu, text_table1[55], TFT_DARKCYAN, NULL, JOIN_WIFI, [this](){
|
||||||
display_obj.clearScreen();
|
display_obj.clearScreen();
|
||||||
wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
|
wifi_scan_obj.currentScanMode = LV_JOIN_WIFI;
|
||||||
@@ -1707,7 +1725,7 @@ void MenuFunctions::RunSetup()
|
|||||||
changeMenu(&generateSSIDsMenu);
|
changeMenu(&generateSSIDsMenu);
|
||||||
wifi_scan_obj.RunGenerateSSIDs();
|
wifi_scan_obj.RunGenerateSSIDs();
|
||||||
});
|
});
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||||
display_obj.clearScreen();
|
display_obj.clearScreen();
|
||||||
//wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
//wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||||
@@ -1727,7 +1745,7 @@ void MenuFunctions::RunSetup()
|
|||||||
changeMenu(&clearAPsMenu);
|
changeMenu(&clearAPsMenu);
|
||||||
wifi_scan_obj.RunClearStations();
|
wifi_scan_obj.RunClearStations();
|
||||||
});
|
});
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
// Select APs on OG
|
// Select APs on OG
|
||||||
addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
addNodes(&wifiGeneralMenu, text_table1[56], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){
|
||||||
display_obj.clearScreen();
|
display_obj.clearScreen();
|
||||||
@@ -1868,7 +1886,7 @@ void MenuFunctions::RunSetup()
|
|||||||
addNodes(&badusbMenu, text_table1[36], TFT_PURPLE, NULL, TEST_BAD_USB_ICO, [this]() {
|
addNodes(&badusbMenu, text_table1[36], TFT_PURPLE, NULL, TEST_BAD_USB_ICO, [this]() {
|
||||||
a32u4_obj.test();
|
a32u4_obj.test();
|
||||||
});
|
});
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
addNodes(&badusbMenu, text_table1[37], TFT_RED, NULL, BAD_USB_ICO, [this](){
|
addNodes(&badusbMenu, text_table1[37], TFT_RED, NULL, BAD_USB_ICO, [this](){
|
||||||
display_obj.clearScreen();
|
display_obj.clearScreen();
|
||||||
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
wifi_scan_obj.currentScanMode = LV_ADD_SSID;
|
||||||
@@ -2095,17 +2113,17 @@ void MenuFunctions::displayCurrentMenu()
|
|||||||
|
|
||||||
if (current_menu->list != NULL)
|
if (current_menu->list != NULL)
|
||||||
{
|
{
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
display_obj.tft.setFreeFont(MENU_FONT);
|
display_obj.tft.setFreeFont(MENU_FONT);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
display_obj.tft.setFreeFont(NULL);
|
display_obj.tft.setFreeFont(NULL);
|
||||||
display_obj.tft.setTextSize(1);
|
display_obj.tft.setTextSize(1);
|
||||||
#endif
|
#endif
|
||||||
for (uint8_t i = 0; i < current_menu->list->size(); i++)
|
for (uint8_t i = 0; i < current_menu->list->size(); i++)
|
||||||
{
|
{
|
||||||
#ifndef MARAUDER_MINI
|
#ifdef HAS_ILI9341
|
||||||
if (!current_menu->list->get(i).selected)
|
if (!current_menu->list->get(i).selected)
|
||||||
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
|
display_obj.key[i].drawButton(false, current_menu->list->get(i).name);
|
||||||
else
|
else
|
||||||
@@ -2122,7 +2140,7 @@ void MenuFunctions::displayCurrentMenu()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC)
|
||||||
if ((current_menu->selected == i) || (current_menu->list->get(i).selected))
|
if ((current_menu->selected == i) || (current_menu->list->get(i).selected))
|
||||||
display_obj.key[i].drawButton(true, current_menu->list->get(i).name);
|
display_obj.key[i].drawButton(true, current_menu->list->get(i).name);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include "a32u4_interface.h"
|
#include "a32u4_interface.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#ifdef HAS_BUTTONS
|
||||||
#include <SwitchLib.h>
|
#include <SwitchLib.h>
|
||||||
extern SwitchLib u_btn;
|
extern SwitchLib u_btn;
|
||||||
extern SwitchLib d_btn;
|
extern SwitchLib d_btn;
|
||||||
|
|||||||
@@ -76,9 +76,11 @@ void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SDInterface::openCapture(String file_name) {
|
void SDInterface::openCapture(String file_name) {
|
||||||
if (this->supported)
|
bool save_pcap = settings_obj.loadSetting<bool>("SavePCAP");
|
||||||
|
if ((this->supported) && (save_pcap)) {
|
||||||
buffer_obj.createPcapFile(&SD, file_name);
|
buffer_obj.createPcapFile(&SD, file_name);
|
||||||
buffer_obj.open();
|
buffer_obj.open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SDInterface::runUpdate() {
|
void SDInterface::runUpdate() {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "configs.h"
|
#include "configs.h"
|
||||||
|
|
||||||
|
#include "settings.h"
|
||||||
#include "SD.h"
|
#include "SD.h"
|
||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -11,6 +12,7 @@
|
|||||||
#include <Update.h>
|
#include <Update.h>
|
||||||
|
|
||||||
extern Buffer buffer_obj;
|
extern Buffer buffer_obj;
|
||||||
|
extern Settings settings_obj;
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
extern Display display_obj;
|
extern Display display_obj;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -67,6 +67,8 @@
|
|||||||
#define WIFI_SCAN_RAW_CAPTURE 25
|
#define WIFI_SCAN_RAW_CAPTURE 25
|
||||||
#define WIFI_SCAN_STATION 26
|
#define WIFI_SCAN_STATION 26
|
||||||
#define WIFI_ATTACK_DEAUTH_TARGETED 27
|
#define WIFI_ATTACK_DEAUTH_TARGETED 27
|
||||||
|
#define WIFI_SCAN_ACTIVE_LIST_EAPOL 28
|
||||||
|
#define WIFI_SCAN_SIG_STREN 29
|
||||||
|
|
||||||
#define GRAPH_REFRESH 100
|
#define GRAPH_REFRESH 100
|
||||||
|
|
||||||
@@ -88,6 +90,7 @@ esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, b
|
|||||||
|
|
||||||
struct ssid {
|
struct ssid {
|
||||||
String essid;
|
String essid;
|
||||||
|
int channel;
|
||||||
int bssid[6];
|
int bssid[6];
|
||||||
bool selected;
|
bool selected;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
//If not defined, will write packages to SD card if supported
|
//If not defined, will write packages to SD card if supported
|
||||||
//#define WRITE_PACKETS_SERIAL
|
//#define WRITE_PACKETS_SERIAL
|
||||||
|
|
||||||
|
//#define MARAUDER_M5STICKC
|
||||||
//#define MARAUDER_MINI
|
//#define MARAUDER_MINI
|
||||||
//#define MARAUDER_V4
|
//#define MARAUDER_V4
|
||||||
//#define MARAUDER_V6
|
//#define MARAUDER_V6
|
||||||
@@ -17,10 +18,17 @@
|
|||||||
//#define ESP32_LDDB
|
//#define ESP32_LDDB
|
||||||
//#define MARAUDER_DEV_BOARD_PRO
|
//#define MARAUDER_DEV_BOARD_PRO
|
||||||
|
|
||||||
#define MARAUDER_VERSION "v0.10.2"
|
#define MARAUDER_VERSION "v0.10.5"
|
||||||
|
|
||||||
|
//// POWER MANAGEMENT
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
#include "AXP192.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//// BUTTON DEFINITIONS
|
//// BUTTON DEFINITIONS
|
||||||
#ifdef MARAUDER_MINI
|
#ifdef MARAUDER_MINI
|
||||||
|
#define HAS_BUTTONS
|
||||||
|
|
||||||
#define L_BTN 13
|
#define L_BTN 13
|
||||||
#define C_BTN 34
|
#define C_BTN 34
|
||||||
#define U_BTN 36
|
#define U_BTN 36
|
||||||
@@ -28,12 +36,89 @@
|
|||||||
#define D_BTN 35
|
#define D_BTN 35
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
#define HAS_BUTTONS
|
||||||
|
|
||||||
|
#define L_BTN -1
|
||||||
|
#define C_BTN 37
|
||||||
|
#define U_BTN -1
|
||||||
|
#define R_BTN -1
|
||||||
|
#define D_BTN 39
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_V4
|
#ifdef MARAUDER_V4
|
||||||
#endif
|
#endif
|
||||||
//// END BUTTON DEFINITIONS
|
//// END BUTTON DEFINITIONS
|
||||||
|
|
||||||
//// DISPLAY DEFINITIONS
|
//// DISPLAY DEFINITIONS
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
//#define TFT_MISO 19
|
||||||
|
#define TFT_MOSI 15
|
||||||
|
#define TFT_SCLK 13
|
||||||
|
#define TFT_CS 5
|
||||||
|
#define TFT_DC 23
|
||||||
|
#define TFT_RST 18
|
||||||
|
#define TFT_BL 10
|
||||||
|
#define TOUCH_CS 10
|
||||||
|
//#define SD_CS 1
|
||||||
|
|
||||||
|
#define SCREEN_BUFFER
|
||||||
|
|
||||||
|
#define MAX_SCREEN_BUFFER 9
|
||||||
|
|
||||||
|
#define BANNER_TEXT_SIZE 1
|
||||||
|
|
||||||
|
#ifndef TFT_WIDTH
|
||||||
|
#define TFT_WIDTH 135
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TFT_HEIGHT
|
||||||
|
#define TFT_HEIGHT 240
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CHAR_WIDTH 6
|
||||||
|
#define SCREEN_WIDTH TFT_HEIGHT // Originally 240
|
||||||
|
#define SCREEN_HEIGHT TFT_WIDTH // 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 10
|
||||||
|
#define STATUS_BAR_WIDTH (TFT_HEIGHT/16)
|
||||||
|
#define LVGL_TICK_PERIOD 6
|
||||||
|
|
||||||
|
#define FRAME_X 100
|
||||||
|
#define FRAME_Y 64
|
||||||
|
#define FRAME_W 120
|
||||||
|
#define FRAME_H 50
|
||||||
|
|
||||||
|
// Red zone size
|
||||||
|
#define REDBUTTON_X FRAME_X
|
||||||
|
#define REDBUTTON_Y FRAME_Y
|
||||||
|
#define REDBUTTON_W (FRAME_W/2)
|
||||||
|
#define REDBUTTON_H FRAME_H
|
||||||
|
|
||||||
|
// Green zone size
|
||||||
|
#define GREENBUTTON_X (REDBUTTON_X + REDBUTTON_W)
|
||||||
|
#define GREENBUTTON_Y FRAME_Y
|
||||||
|
#define GREENBUTTON_W (FRAME_W/2)
|
||||||
|
#define GREENBUTTON_H FRAME_H
|
||||||
|
|
||||||
|
#define STATUSBAR_COLOR 0x4A49
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_V4
|
#ifdef MARAUDER_V4
|
||||||
|
#define HAS_ILI9341
|
||||||
#define BANNER_TEXT_SIZE 2
|
#define BANNER_TEXT_SIZE 2
|
||||||
|
|
||||||
#ifndef TFT_WIDTH
|
#ifndef TFT_WIDTH
|
||||||
@@ -88,6 +173,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_V6
|
#ifdef MARAUDER_V6
|
||||||
|
#define HAS_ILI9341
|
||||||
|
|
||||||
#define BANNER_TEXT_SIZE 2
|
#define BANNER_TEXT_SIZE 2
|
||||||
|
|
||||||
#ifndef TFT_WIDTH
|
#ifndef TFT_WIDTH
|
||||||
@@ -142,6 +229,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_KIT
|
#ifdef MARAUDER_KIT
|
||||||
|
#define HAS_ILI9341
|
||||||
|
|
||||||
#define BANNER_TEXT_SIZE 2
|
#define BANNER_TEXT_SIZE 2
|
||||||
|
|
||||||
#ifndef TFT_WIDTH
|
#ifndef TFT_WIDTH
|
||||||
@@ -337,6 +426,24 @@
|
|||||||
#define ICON_H 22
|
#define ICON_H 22
|
||||||
#define BUTTON_PADDING 10
|
#define BUTTON_PADDING 10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
#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/5)
|
||||||
|
#define KEY_W TFT_HEIGHT // Width and height
|
||||||
|
#define KEY_H (TFT_HEIGHT/17)
|
||||||
|
#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
|
//// END MENU DEFINITIONS
|
||||||
|
|
||||||
//// SD DEFINITIONS
|
//// SD DEFINITIONS
|
||||||
@@ -356,6 +463,10 @@
|
|||||||
#define SD_CS 4
|
#define SD_CS 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
#define SD_CS 10
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
#define SD_CS 10
|
#define SD_CS 10
|
||||||
#endif
|
#endif
|
||||||
@@ -375,6 +486,10 @@
|
|||||||
#define HAS_BT
|
#define HAS_BT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
#define HAS_SCREEN
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_V4
|
#ifdef MARAUDER_V4
|
||||||
#define HAS_SCREEN
|
#define HAS_SCREEN
|
||||||
#define HAS_BT
|
#define HAS_BT
|
||||||
|
|||||||
@@ -42,13 +42,25 @@ https://www.online-utility.org/image/convert/to/XBM
|
|||||||
#include "a32u4_interface.h"
|
#include "a32u4_interface.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_MINI
|
#ifdef HAS_BUTTONS
|
||||||
#include <SwitchLib.h>
|
#include <SwitchLib.h>
|
||||||
SwitchLib u_btn = SwitchLib(U_BTN, 1000, true);
|
|
||||||
SwitchLib d_btn = SwitchLib(D_BTN, 1000, true);
|
#if (U_BTN >= 0)
|
||||||
SwitchLib l_btn = SwitchLib(L_BTN, 1000, true);
|
SwitchLib u_btn = SwitchLib(U_BTN, 1000, true);
|
||||||
SwitchLib r_btn = SwitchLib(R_BTN, 1000, true);
|
#endif
|
||||||
SwitchLib c_btn = SwitchLib(C_BTN, 1000, true);
|
#if (D_BTN >= 0)
|
||||||
|
SwitchLib d_btn = SwitchLib(D_BTN, 1000, true);
|
||||||
|
#endif
|
||||||
|
#if (L_BTN >= 0)
|
||||||
|
SwitchLib l_btn = SwitchLib(L_BTN, 1000, true);
|
||||||
|
#endif
|
||||||
|
#if (R_BTN >= 0)
|
||||||
|
SwitchLib r_btn = SwitchLib(R_BTN, 1000, true);
|
||||||
|
#endif
|
||||||
|
#if (C_BTN >= 0)
|
||||||
|
SwitchLib c_btn = SwitchLib(C_BTN, 1000, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WiFiScan wifi_scan_obj;
|
WiFiScan wifi_scan_obj;
|
||||||
@@ -69,6 +81,10 @@ flipperLED flipper_led;
|
|||||||
A32u4Interface a32u4_obj;
|
A32u4Interface a32u4_obj;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
AXP192 axp192_obj;
|
||||||
|
#endif
|
||||||
|
|
||||||
const String PROGMEM version_number = MARAUDER_VERSION;
|
const String PROGMEM version_number = MARAUDER_VERSION;
|
||||||
|
|
||||||
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
|
Adafruit_NeoPixel strip = Adafruit_NeoPixel(Pixels, PIN, NEO_GRB + NEO_KHZ800);
|
||||||
@@ -103,6 +119,10 @@ void backlightOff() {
|
|||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
#ifdef MARAUDER_M5STICKC
|
||||||
|
axp192_obj.begin();
|
||||||
|
#endif
|
||||||
|
|
||||||
pinMode(FLASH_BUTTON, INPUT);
|
pinMode(FLASH_BUTTON, INPUT);
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
pictures/wifi-dev-board-pro-3v3-orientation.png
Normal file
BIN
pictures/wifi-dev-board-pro-3v3-orientation.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Reference in New Issue
Block a user