Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06c70562a7 | ||
|
|
17dd0dda4f | ||
|
|
06a172e28c | ||
|
|
53cef7f44f | ||
|
|
804bdc5150 | ||
|
|
857f61cdf0 | ||
|
|
cf2d5df4d5 | ||
|
|
c8cddedd2b | ||
|
|
2f023a6dbe | ||
|
|
7c137a84af | ||
|
|
ece6b63de4 | ||
|
|
a327c75727 | ||
|
|
018198d51b | ||
|
|
0f4a94134e | ||
|
|
a1dd40a928 | ||
|
|
d32388eb2f | ||
|
|
9ee434ae7f | ||
|
|
2572b83701 | ||
|
|
d914ebd7c0 | ||
|
|
79cdb806f1 | ||
|
|
9f07bc4843 | ||
|
|
b3e98b64ce | ||
|
|
dead80e2f3 | ||
|
|
7db2d0e05d | ||
|
|
f86b5a4df0 | ||
|
|
c7cf1e09f7 | ||
|
|
f623880772 | ||
|
|
ec3ca6d0ad | ||
|
|
59b143fb3e | ||
|
|
c5136b5d2e | ||
|
|
ba05c388b1 | ||
|
|
a98be0d435 | ||
|
|
da43c8b369 | ||
|
|
7a5134bb86 | ||
|
|
bbc10e4452 | ||
|
|
f05776ba45 | ||
|
|
20694f593a | ||
|
|
140451b47c | ||
|
|
6490a12b30 | ||
|
|
1a4136137d | ||
|
|
e79db36906 | ||
|
|
d9d25b0010 | ||
|
|
8a18e55bb7 | ||
|
|
1c86a71704 | ||
|
|
f7db1ea401 | ||
|
|
bdc209d489 | ||
|
|
cc891457ce | ||
|
|
6c3a0d30b7 | ||
|
|
12182af21c | ||
|
|
c9c6bbf971 | ||
|
|
7391a05c8a | ||
|
|
dd6f800b48 | ||
|
|
6f2c2862f6 |
49
.travis.yml
@@ -11,24 +11,6 @@ env:
|
||||
|
||||
before_install:
|
||||
|
||||
# TODO: undo
|
||||
# remove submodules, we don't want those to be actually tested for compliance
|
||||
- git submodule status | rm -Rf `cut -d ' ' -f 3`
|
||||
|
||||
# Formatting checks:
|
||||
# Check for files starting with a blank line
|
||||
- find . -path './.git' -prune -or -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
|
||||
# Check for tabs
|
||||
- find . -path './.git' -prune -or -type f \( ! -iname ".gitmodules" \) -exec grep --with-filename --line-number --binary-files=without-match --regexp=$'\t' '{}' \; -exec echo 'Tab found.' \; -exec false '{}' +
|
||||
# Check for trailing whitespace
|
||||
- find . -path './.git' -prune -or -type f -exec grep --with-filename --line-number --binary-files=without-match --regexp='[[:blank:]]$' '{}' \; -exec echo 'Trailing whitespace found.' \; -exec false '{}' +
|
||||
# Check for non-Unix line endings
|
||||
- find . -path './.git' -prune -or -type f -exec grep --files-with-matches --binary-files=without-match --regexp=$'\r$' '{}' \; -exec echo 'Non-Unix EOL detected.' \; -exec false '{}' +
|
||||
# Check for blank lines at end of files
|
||||
- find . -path './.git' -prune -or -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
|
||||
# Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
|
||||
- find . -path './.git' -prune -or -type f -print0 | xargs -0 -L1 bash -c 'if test "$(grep --files-with-matches --binary-files=without-match --max-count=1 --regexp='.*' "$0")" && test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
|
||||
|
||||
- git clone https://github.com/per1234/arduino-ci-script.git "${HOME}/scripts/arduino-ci-script"
|
||||
- cd "${HOME}/scripts/arduino-ci-script"
|
||||
# Get new tags from the remote
|
||||
@@ -46,19 +28,23 @@ before_install:
|
||||
- set_application_folder "$APPLICATION_FOLDER"
|
||||
- set_sketchbook_folder "$SKETCHBOOK_FOLDER"
|
||||
|
||||
- install_ide '("1.8.0" "1.8.9" "newest")'
|
||||
#- install_ide '("1.8.11" "1.8.12" "newest")'
|
||||
- install_ide '("newest")'
|
||||
|
||||
# Install the library from the repository
|
||||
- install_library
|
||||
- install_library "M5Stack"
|
||||
- install_library 'https://github.com/bblanchon/ArduinoJson.git' # "ArduinoJSON"
|
||||
|
||||
- ls ${TRAVIS_BUILD_DIR} -la
|
||||
- ls ${TRAVIS_BUILD_DIR}/examples/M5Stack-SD-Menu/ -la
|
||||
- ls $SKETCHBOOK_FOLDER -la
|
||||
- ls $SKETCHBOOK_FOLDER/libraries -la
|
||||
- pwd
|
||||
# what the fsck is wrong install_package() ??
|
||||
#- install_library "https://github.com/lvgl/lv_port_esp32/archive/master.zip"
|
||||
- install_library "TFT_eSPI"
|
||||
- install_library "JPEGDecoder"
|
||||
- install_library "LinkedList"
|
||||
- install_library "lv_arduino"
|
||||
- install_library "https://github.com/adafruit/Adafruit_NeoPixel/archive/1.5.0.zip" ## "Adafruit_NeoPixel"
|
||||
- install_library 'https://github.com/bblanchon/ArduinoJson/releases/download/v5.13.5/ArduinoJson-v5.13.5.zip'
|
||||
- install_library 'https://github.com/h2zero/NimBLE-Arduino/archive/master.zip' # NimBLE
|
||||
|
||||
- cp ${TRAVIS_BUILD_DIR}/User_Setup.h /home/travis/arduino-sketchbook/libraries/TFT_eSPI/User_Setup.h
|
||||
#- install_library 'https://github.com/bblanchon/ArduinoJson.git'
|
||||
#- install_library "https://github.com/spacehuhn/SimpleList.git"
|
||||
#
|
||||
- install_package "esp32:esp32" "https://dl.espressif.com/dl/package_esp32_index.json" # # esp32:esp32:m5stack-core-esp32
|
||||
#- /home/travis/arduino-ide/arduino-1.8.10/arduino --pref "compiler.warning_level=none" --save-prefs &>/dev/null
|
||||
#- /home/travis/arduino-ide/arduino-1.8.10/arduino --pref "build.warn_data_percentage=75" --save-prefs &>/dev/null
|
||||
@@ -69,8 +55,9 @@ before_install:
|
||||
script:
|
||||
# Compile all example sketches included with the library
|
||||
# build_sketch arguments: sketch name, fqbn, allow failure, IDE version/list/range
|
||||
- check_library_manager_compliance "$TRAVIS_BUILD_DIR"
|
||||
- build_sketch "${TRAVIS_BUILD_DIR}/examples/M5Stack-SD-Menu/M5Stack-SD-Menu.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "newest"
|
||||
# - check_library_manager_compliance "$TRAVIS_BUILD_DIR"
|
||||
- set_ide_preference "compiler.warning_level=auto"
|
||||
- build_sketch "${TRAVIS_BUILD_DIR}/esp32_marauder/esp32_marauder.ino" "esp32:esp32:d32_pro:FlashFreq=80,UploadSpeed=921600,PartitionScheme=min_spiffs" "false" "newest"
|
||||
|
||||
after_script:
|
||||
# Commit a report of the job results to the CI-reports repository
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 11 and column 76.
|
57
README.md
@@ -3,7 +3,7 @@
|
||||
<!---[](https://travis-ci.com/justcallmekoko/ESP32Marauder)--->
|
||||
<!---Shields/Badges https://shields.io/--->
|
||||
|
||||
# ESP32 Marauder v0.6.4
|
||||
# ESP32 Marauder v0.7.0
|
||||
<p align="center"><img alt="Marauder logo" src="https://github.com/justcallmekoko/ESP32Marauder/blob/master/pictures/marauder3L.jpg?raw=true" width="300"></p>
|
||||
<p align="center">
|
||||
<b>A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32</b>
|
||||
@@ -18,6 +18,9 @@
|
||||
<a href="https://www.tindie.com/products/justcallmekoko/esp32-marauder/"><img src="https://d2ss6ovg47m0r5.cloudfront.net/badges/tindie-larges.png" alt="I sell on Tindie" width="200" height="104"></a>
|
||||
</p>
|
||||
|
||||
[](http://hits.dwyl.io/justcallmekoko/badges)
|
||||
[](https://travis-ci.com/justcallmekoko/ESP32Marauder)
|
||||
|
||||
# Table Of Condensation
|
||||
- [About](#about)
|
||||
- [YouTube](#youtube)
|
||||
@@ -49,20 +52,30 @@ You can check out the marauder article written [here](https://www.hackster.io/ne
|
||||
|
||||
## Capabilities
|
||||
### Current
|
||||
- Join WiFi: Just join a WiFi network
|
||||
- Shutdown WiFi: Shutdown the Marauder WiFi interface to save some RAM
|
||||
- Generate SSIDs: Add 20 random SSIDs to your list of SSIDs
|
||||
- Add SSID: Use an on-screen keyboard to add your own SSIDs to the SSID list
|
||||
- Clear SSIDs: Clear the list of SSIDs
|
||||
- Probe Request Sniff: Sniff for WiFi [probe request frames](https://mrncciew.com/2014/10/27/cwap-802-11-probe-requestresponse/) sent by wireless devices
|
||||
- Beacon Sniff: Sniff [beacon frames](https://en.wikipedia.org/wiki/Beacon_frame) sent by wireless acccess points
|
||||
- Beacon Spam List: Spam a list of SSIDs and monitoring connection attempts to those networks
|
||||
- Beacon Spam Random: Spam hundreds of random beacon frames to wireless devices within range
|
||||
- Rick Roll Beacon: Broadcast the rick roll lyrics as WiFi access points
|
||||
- Bluetooth Sniffer: Sniff bluetooth devices within range
|
||||
- Shutdown BLE: Shutdown the Marauder BLE interface to save RAM
|
||||
- Detect Card Skimmers: Detect bluetooth enabled credit card skimmers
|
||||
- Packet Monitor: Show WiFi packet density on a given channel using a time bar graph
|
||||
- EAPOL/PMKID Scan: Capture EAPOL/PMKID frames
|
||||
- Detect Pwnagotchi: Detect any pwnagotchis in range
|
||||
- Detect Espressif: Detect any espressif devices in range
|
||||
- Deauth Sniff: Detect deauthentication packets sent on all channels
|
||||
- Draw: Just doodle on the screen or whatever
|
||||
- Update Firmware: Update Marauder firmware over the air via web interface or with SD card
|
||||
- Save PCAP files to SD card
|
||||
|
||||
# Do It Yourself
|
||||
<p align="center"><img alt="Marauder logo" src="https://github.com/justcallmekoko/ESP32Marauder/blob/master/pictures/diy.png?raw=true" width="800"></p>
|
||||
|
||||
## Hardware
|
||||
This project requires the following hardware in order to work:
|
||||
@@ -92,6 +105,14 @@ Make the following connections between your 2.8" TFT Screen and your ESP32 board
|
||||
| | T_IRQ | |
|
||||
| SD_CS | | GPIO12 |
|
||||
|
||||
For the analog battery circuit, use a 4 to 1 voltage divider, and (optional) a mosfet.
|
||||
For the charge detection circuit, use a 1 to 2 voltage divider (the charge detection is optional and only changes the battery icon colour while charging)
|
||||
| BATTERY | ESP32 |
|
||||
| ------- | ------ |
|
||||
| BAT + | GPIO34 |
|
||||
| MOSFET | GPIO13 |
|
||||
| CHARGE +| GPIO27 |
|
||||
|
||||
## Flashing Firmware
|
||||
### Using Arduino IDE
|
||||
1. Install the [Arduino IDE](https://www.arduino.cc/en/main/software)
|
||||
@@ -111,11 +132,18 @@ Make the following connections between your 2.8" TFT Screen and your ESP32 board
|
||||
8. Install the [CH340 Drivers](https://github.com/justcallmekoko/ESP32Marauder/blob/master/Drivers/CH34x_Install_Windows_v3_4.EXE)
|
||||
9. Download or clone this repository
|
||||
10. Open `esp32_marauder.ino`
|
||||
10.5. If you're using the analog battery measuring circuit, go to the MenuFunctions.h and change "#define BATTERY_ANALOG_ON" to 1
|
||||
11. Plug your ESP32 into a USB port and select the COM port under `Tools`>`Port`
|
||||
12. Select `LOLIN D32` under `Tools`>`Boards`
|
||||
12.5 If you want an upscaled version of the logo, go to the data folder and rename "marauder3L1.jpg" to "marauder3L.jpg"
|
||||
13. Click `ESP32 Sketch Data Upload` and wait for the SPIFFS upload to finish
|
||||
14. Click the upload button
|
||||
|
||||
<p align="center">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/m5stack.jpg?raw=true" height="300">
|
||||
<img alt="Marauder logo" src="https://github.com/justcallmekoko/ESP32Marauder/blob/master/pictures/odroid_marauder.jpg?raw=true" height="300">
|
||||
</p>
|
||||
|
||||
## Updating Firmware
|
||||
There are multiple options available to update the Marauder firmware. If you have already built the project from this repo, you can just pull the latest commit and flash the firmware using the Arduino IDE (see [here](#using-arduino-ide)).
|
||||
If you own an ESP32 Marauder (v0.4.0 or later) and have not build the project, you can follow [these instructions](#web-update) for installing the latest update over the air via Marauder's web interface or [these instructions](#sd-update) for installing the latest update using an SD Card.
|
||||
@@ -160,6 +188,33 @@ How to do the thing:
|
||||
3. Lower the Marauder into the body of the enclosure and ensure the battery sits within the trench in the center of the body
|
||||
4. Fasten the face plate to the body using 4 M2.5x10 hex screws.
|
||||
- The top of the screws should be flush with the surface of the face plate
|
||||
|
||||
# Icons
|
||||
I put these here just because
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/attack_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/beacon_sniff_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/beacon_spam_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/bluetooth_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/bluetooth_sniff_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/deauth_sniff_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/device_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/device_info_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/draw_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/eapol_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/espressif_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/general_apps_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/monitor_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/probe_sniff_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/pwnagotchi_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/reboot_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/rick_roll_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/scan_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/sd_update_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/skimmer_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/sniff_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/update_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/web_update_22.bmp">
|
||||
<img alt="Marauder logo" src="https://raw.githubusercontent.com/justcallmekoko/ESP32Marauder/master/pictures/icons/wifi_22.bmp">
|
||||
|
||||
# Under Development
|
||||
Currently the ESP32 Marauder has limited firmware capabilities. Most of the work so far has been put into designing the hardware. New firmware features will be added over time and will eventually reach a point where this project will be a fully capable hacking machine.
|
||||
|
||||
@@ -3,6 +3,56 @@
|
||||
|
||||
#define jquery_min_js_v3_2_1_gz_len 30178
|
||||
|
||||
PROGMEM static String espressif_macs[] = {
|
||||
"fc:f5:c4",
|
||||
"f4:cf:a2",
|
||||
"f0:08:d1",
|
||||
"ec:fa:bc",
|
||||
"e0:98:06",
|
||||
"dc:4f:22",
|
||||
"d8:f1:5b",
|
||||
"d8:bf:c0",
|
||||
"d8:a0:1d",
|
||||
"cc:50:e3",
|
||||
"c8:2b:96",
|
||||
"c4:4f:33",
|
||||
"bc:dd:c2",
|
||||
"b8:f0:09",
|
||||
"b4:e6:2d",
|
||||
"ac:d0:74",
|
||||
"ac:67:b2",
|
||||
"a4:cf:12",
|
||||
"a4:7b:9d",
|
||||
"a0:20:a6",
|
||||
"98:f4:ab",
|
||||
"90:97:d5",
|
||||
"8c:aa:b5",
|
||||
"84:f3:eb",
|
||||
"84:cc:a8",
|
||||
"84:0d:8e",
|
||||
"80:7d:3a",
|
||||
"7c:df:a1",
|
||||
"7c:9e:bd",
|
||||
"70:03:9f",
|
||||
"68:c6:3a",
|
||||
"60:01:94",
|
||||
"5c:cf:7f",
|
||||
"54:5a:a6",
|
||||
"50:02:91",
|
||||
"4c:11:ae",
|
||||
"48:3f:da",
|
||||
"40:f5:20",
|
||||
"3c:71:bf",
|
||||
"30:ae:a4",
|
||||
"2c:f4:32",
|
||||
"2c:3a:e8",
|
||||
"24:b2:de",
|
||||
"24:6f:28",
|
||||
"24:62:ab",
|
||||
"24:0a:c4",
|
||||
"18:fe:34",
|
||||
"10:52:1c"
|
||||
};
|
||||
|
||||
|
||||
PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
@@ -143,7 +193,55 @@ PROGMEM static const unsigned char menu_icons[][66] = {
|
||||
0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0xFF, 0xFF},
|
||||
{0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0x07, 0xF8, 0x07, 0xF0, 0x07, 0xE0, // SD: 23
|
||||
0x67, 0xE7, 0x97, 0xE9, 0x17, 0xE9, 0x67, 0xE9, 0x87, 0xE9, 0x97, 0xE9,
|
||||
0x67, 0xE7, 0x07, 0xE0, 0x07, 0xE0, 0xFF, 0xFF}
|
||||
0x67, 0xE7, 0x07, 0xE0, 0x07, 0xE0, 0xFF, 0xFF},
|
||||
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0x7F, 0x80, 0x3F, 0xBF, 0x7F, 0x3F, // PWNAGOTCHI: 24
|
||||
0xDF, 0xC0, 0x3E, 0x6F, 0xBF, 0x3D, 0xBF, 0x61, 0x3F, 0xFF, 0xDE, 0x3F,
|
||||
0xFF, 0xF3, 0x3F, 0xFF, 0xFF, 0x3F, 0xFB, 0xFF, 0x37, 0xFD, 0xFF, 0x2F,
|
||||
0xFE, 0xFF, 0x1F, 0x8E, 0x7F, 0x1C, 0x36, 0xBF, 0x19, 0x16, 0xBF, 0x18,
|
||||
0x06, 0x3F, 0x18, 0x8E, 0x7F, 0x1C, 0xFD, 0xFF, 0x2F, 0xDB, 0xF3, 0x36,
|
||||
0x3F, 0x0C, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xC7, 0x3F, 0x7F, 0x0E, 0x3F, // ESPRESSIF: 25
|
||||
0x2F, 0x30, 0x3E, 0x37, 0x40, 0x3C, 0xF3, 0x83, 0x38, 0x0B, 0x04, 0x39,
|
||||
0x03, 0x18, 0x32, 0x01, 0x20, 0x32, 0xF1, 0x21, 0x34, 0x01, 0x46, 0x34,
|
||||
0x03, 0x84, 0x38, 0x7B, 0x88, 0x38, 0x93, 0x88, 0x38, 0x17, 0x89, 0x3C,
|
||||
0x07, 0x89, 0x3F, 0xCF, 0x89, 0x3D, 0x9F, 0x49, 0x3C, 0x7F, 0x00, 0x3F,
|
||||
0xFF, 0xE3, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xF3, 0x3F, 0xFF, 0xE1, 0x3F, 0xCF, 0xE1, 0x3C, 0x87, 0x61, 0x38, // SHUTDOWN: 26
|
||||
0xC3, 0xE1, 0x30, 0xE1, 0xE1, 0x21, 0xF1, 0xE1, 0x23, 0xF1, 0xE1, 0x23,
|
||||
0xF8, 0xE1, 0x07, 0xF8, 0xE1, 0x07, 0xF8, 0xE1, 0x07, 0xF8, 0xF3, 0x07,
|
||||
0xF8, 0xFF, 0x07, 0xF9, 0xFF, 0x27, 0xF1, 0xFF, 0x23, 0xF1, 0xFF, 0x23,
|
||||
0xE1, 0xFF, 0x21, 0xC3, 0xFF, 0x30, 0x07, 0x3F, 0x38, 0x0F, 0x00, 0x3C,
|
||||
0x1F, 0x00, 0x3E, 0xFF, 0xC1, 0x3F},
|
||||
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xF3, 0x3F, 0xFF, 0xE1, 0x3F, // BEACON_LIST: 27
|
||||
0xFF, 0xDE, 0x3F, 0x1F, 0x12, 0x3E, 0xEF, 0xF3, 0x3D, 0xE7, 0xF3, 0x39,
|
||||
0x37, 0x1E, 0x3B, 0x37, 0x1E, 0x3B, 0xEF, 0xF3, 0x3D, 0xEF, 0xF3, 0x3D,
|
||||
0x37, 0x1E, 0x3B, 0x37, 0x1E, 0x3B, 0xE7, 0xF3, 0x39, 0xEF, 0xF3, 0x3D,
|
||||
0x1F, 0x12, 0x3E, 0xFF, 0xDE, 0x3F, 0xFF, 0xE1, 0x3F, 0xFF, 0xF3, 0x3F,
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0x3F, 0x77, 0x77, 0x37, 0x2B, 0xAB, 0x32, 0x6B, 0xAB, 0x36, // GENERATE: 28
|
||||
0x6B, 0xAB, 0x36, 0x6B, 0xAB, 0x36, 0x77, 0x77, 0x37, 0xFF, 0xFF, 0x3F,
|
||||
0x77, 0x77, 0x37, 0xB3, 0x2A, 0x2B, 0xB7, 0x6A, 0x2B, 0xB7, 0x6A, 0x2B,
|
||||
0xB7, 0x6A, 0x2B, 0x77, 0x77, 0x37, 0xFF, 0xFF, 0x3F, 0x77, 0x77, 0x37,
|
||||
0x33, 0x2B, 0x33, 0x77, 0x6B, 0x37, 0x77, 0x6B, 0x37, 0x77, 0x6B, 0x37,
|
||||
0x77, 0x77, 0x37, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0x1F, 0x00, 0x3E, // CLEAR_ICO: 29
|
||||
0xEF, 0xFF, 0x3D, 0xEF, 0xFF, 0x3D, 0x1F, 0x1E, 0x3E, 0xFF, 0xE1, 0x3F,
|
||||
0x7F, 0x9E, 0x3F, 0xFF, 0xED, 0x3F, 0x07, 0x00, 0x38, 0x0B, 0x00, 0x34,
|
||||
0xE3, 0xDE, 0x31, 0xEB, 0xDE, 0x35, 0xA5, 0x52, 0x29, 0x0D, 0x00, 0x2C,
|
||||
0xFD, 0xFF, 0x2F, 0xF3, 0xFF, 0x33, 0x0F, 0x1E, 0x3C, 0xF3, 0xE1, 0x33,
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3C, 0xFF, 0xFF, 0x3E, 0xFF, 0x7F, 0x3E, // KEYBOARD_ICO: 30
|
||||
0xFF, 0x0F, 0x3F, 0xFF, 0xE7, 0x3F, 0xFF, 0xF3, 0x3F, 0x00, 0x00, 0x00,
|
||||
0xFE, 0xFF, 0x1F, 0x92, 0x92, 0x12, 0x92, 0x92, 0x12, 0xFE, 0xFF, 0x1F,
|
||||
0x22, 0x29, 0x11, 0x22, 0x29, 0x11, 0xFE, 0xFF, 0x1F, 0x92, 0x40, 0x12,
|
||||
0x92, 0x40, 0x12, 0xFE, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x3F,
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F},
|
||||
{0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xC0, 0x3F, // JOIN_WIFI: 31
|
||||
0x3F, 0x00, 0x3F, 0x1F, 0x00, 0x3E, 0x03, 0x00, 0x30, 0x01, 0xF0, 0x2F,
|
||||
0x54, 0x12, 0x1A, 0x54, 0xD0, 0x1F, 0x7C, 0xD2, 0x1B, 0x7C, 0x12, 0x1B,
|
||||
0x38, 0xD2, 0x1B, 0x28, 0xD0, 0x1B, 0x01, 0xF8, 0x2F, 0x03, 0x00, 0x30,
|
||||
0x1F, 0x00, 0x3E, 0x3F, 0x00, 0x3F, 0xFF, 0xC0, 0x3F, 0xFF, 0xFF, 0x3F,
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ Big thanks to bodmer for having great TFT and JPEG libraries
|
||||
https://github.com/bodmer
|
||||
*/
|
||||
|
||||
//PROGMEM lv_obj_t * slider_label;
|
||||
//PROGMEM lv_obj_t * ta1;
|
||||
//PROGMEM lv_obj_t * ta2;
|
||||
|
||||
Display::Display()
|
||||
{
|
||||
}
|
||||
@@ -30,10 +34,10 @@ void Display::RunSetup()
|
||||
|
||||
#ifdef 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(F("Using TFT Shield"));
|
||||
#else if defined(TFT_DIY)
|
||||
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
|
||||
Serial.println("Using TFT DIY");
|
||||
Serial.println(F("Using TFT DIY"));
|
||||
#endif
|
||||
tft.setTouch(calData);
|
||||
|
||||
@@ -48,22 +52,94 @@ void Display::RunSetup()
|
||||
// Initialize file system
|
||||
// This should probably have its own class
|
||||
if (!SPIFFS.begin()) {
|
||||
Serial.println("SPIFFS initialisation failed!");
|
||||
Serial.println(F("SPIFFS initialisation failed!"));
|
||||
while (1) yield(); // Stay here twiddling thumbs waiting
|
||||
}
|
||||
|
||||
//this->initLVGL();
|
||||
|
||||
|
||||
// Draw the title screen
|
||||
drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
|
||||
//drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
|
||||
|
||||
//showCenterText(version_number, 250);
|
||||
tft.drawCentreString(version_number, 120, 250, 2);
|
||||
//tft.drawCentreString(version_number, 120, 250, 2);
|
||||
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
//digitalWrite(TFT_BL, HIGH);
|
||||
|
||||
delay(5000);
|
||||
//delay(5000);
|
||||
}
|
||||
|
||||
/* Interrupt driven periodic handler */
|
||||
/*
|
||||
void Display::lv_tick_handler()
|
||||
{
|
||||
lv_tick_inc(LVGL_TICK_PERIOD);
|
||||
}*/
|
||||
|
||||
/* Display flushing */
|
||||
/*
|
||||
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
|
||||
{
|
||||
extern Display display_obj;
|
||||
uint16_t c;
|
||||
|
||||
display_obj.tft.startWrite();
|
||||
display_obj.tft.setAddrWindow(area->x1, area->y1, (area->x2 - area->x1 + 1), (area->y2 - area->y1 + 1));
|
||||
for (int y = area->y1; y <= area->y2; y++) {
|
||||
for (int x = area->x1; x <= area->x2; x++) {
|
||||
c = color_p->full;
|
||||
display_obj.tft.writeColor(c, 1);
|
||||
color_p++;
|
||||
}
|
||||
}
|
||||
display_obj.tft.endWrite();
|
||||
lv_disp_flush_ready(disp);
|
||||
}
|
||||
|
||||
|
||||
bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data)
|
||||
{
|
||||
extern Display display_obj;
|
||||
|
||||
uint16_t touchX, touchY;
|
||||
|
||||
bool touched = display_obj.tft.getTouch(&touchX, &touchY, 600);
|
||||
|
||||
if(!touched)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(touchX>WIDTH_1 || touchY > HEIGHT_1)
|
||||
{
|
||||
Serial.println("Y or y outside of expected parameters..");
|
||||
Serial.print("y:");
|
||||
Serial.print(touchX);
|
||||
Serial.print(" x:");
|
||||
Serial.print(touchY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
data->state = touched ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL;
|
||||
|
||||
//if(data->state == LV_INDEV_STATE_PR) touchpad_get_xy(&last_x, &last_y);
|
||||
|
||||
data->point.x = touchX;
|
||||
data->point.y = touchY;
|
||||
|
||||
Serial.print("Data x");
|
||||
Serial.println(touchX);
|
||||
|
||||
Serial.print("Data y");
|
||||
Serial.println(touchY);
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}*/
|
||||
|
||||
void Display::tftDrawGraphObjects(byte x_scale)
|
||||
{
|
||||
//draw the graph objects
|
||||
@@ -239,7 +315,7 @@ void Display::touchToExit()
|
||||
// Function to just draw the screen black
|
||||
void Display::clearScreen()
|
||||
{
|
||||
Serial.println("clearScreen()");
|
||||
Serial.println(F("clearScreen()"));
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setCursor(0, 0);
|
||||
}
|
||||
@@ -281,7 +357,7 @@ void Display::showCenterText(String text, int y)
|
||||
|
||||
void Display::initScrollValues(bool tte)
|
||||
{
|
||||
Serial.println("initScrollValues()");
|
||||
Serial.println(F("initScrollValues()"));
|
||||
yDraw = YMAX - BOT_FIXED_AREA - TEXT_HEIGHT;
|
||||
|
||||
xPos = 0;
|
||||
@@ -299,7 +375,7 @@ void Display::initScrollValues(bool tte)
|
||||
yArea = YMAX - TOP_FIXED_AREA_2 - BOT_FIXED_AREA;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 18; i++) blank[i] = 0;
|
||||
for(uint8_t i = 0; i < 18; i++) blank[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -337,7 +413,7 @@ int Display::scroll_line(uint32_t color) {
|
||||
|
||||
// Function to setup hardware scroll for TFT screen
|
||||
void Display::setupScrollArea(uint16_t tfa, uint16_t bfa) {
|
||||
Serial.println("setupScrollArea()");
|
||||
Serial.println(F("setupScrollArea()"));
|
||||
Serial.println(" tfa: " + (String)tfa);
|
||||
Serial.println(" bfa: " + (String)bfa);
|
||||
Serial.println("yStart: " + (String)this->yStart);
|
||||
@@ -385,10 +461,19 @@ void Display::drawJpeg(const char *filename, int xpos, int ypos) {
|
||||
jpegRender(xpos, ypos);
|
||||
}
|
||||
else {
|
||||
Serial.println("Jpeg file format not supported!");
|
||||
Serial.println(F("Jpeg file format not supported!"));
|
||||
}
|
||||
}
|
||||
|
||||
void Display::setupDraw() {
|
||||
this->tft.drawLine(0, 0, 10, 0, TFT_MAGENTA);
|
||||
this->tft.drawLine(0, 0, 0, 10, TFT_GREEN);
|
||||
this->tft.drawLine(0, 0, 0, 0, TFT_CYAN);
|
||||
}
|
||||
|
||||
uint16_t xlast;
|
||||
uint16_t ylast;
|
||||
uint32_t AH;
|
||||
void Display::drawStylus()
|
||||
{
|
||||
uint16_t x = 0, y = 0; // To store the touch coordinates
|
||||
@@ -396,13 +481,61 @@ void Display::drawStylus()
|
||||
// Pressed will be set true is there is a valid touch on the screen
|
||||
boolean pressed = tft.getTouch(&x, &y);
|
||||
|
||||
if ((x <= 10) && (y <= 10) && (pressed)) {
|
||||
Serial.println(F("Exit draw function"));
|
||||
this->draw_tft = false;
|
||||
this->exit_draw = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw a white spot at the detected coordinates
|
||||
if (pressed) {
|
||||
tft.fillCircle(x, y, 2, TFT_WHITE);
|
||||
// tft.fillCircle(x, y, 2, TFT_WHITE);
|
||||
if ( xlast > 0 && ylast > 0 ) {
|
||||
uint16_t the_color = TFT_WHITE;
|
||||
uint16_t wd = 1;
|
||||
int xlast2;
|
||||
int ylast2;
|
||||
int x2;
|
||||
int y2;
|
||||
int n;
|
||||
int n2 = -wd;
|
||||
xlast2 = xlast - wd;
|
||||
x2 = x - wd;
|
||||
for (n = -wd; n <= wd; n++) {
|
||||
ylast2 = ylast + n;
|
||||
y2 = y + n;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
for (n2 = -wd; n2 <= wd; n2++) {
|
||||
xlast2 = xlast + n2;
|
||||
x2 = x + n2;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
for (n = wd; n >= -wd; n--) {
|
||||
ylast2 = ylast + n;
|
||||
y2 = y + n;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
for (n2 = wd; n2 >= -wd; n2--) {
|
||||
xlast2 = xlast + n2;
|
||||
x2 = x + n2;
|
||||
tft.drawLine(xlast2, ylast2, x2, y2, the_color);
|
||||
}
|
||||
// tft.drawLine(xlast, ylast, x, y, TFT_WHITE);
|
||||
}
|
||||
xlast = x;
|
||||
ylast = y;
|
||||
AH = 0;
|
||||
//Serial.print("x,y = ");
|
||||
//Serial.print(x);
|
||||
//Serial.print(",");
|
||||
//Serial.println(y);
|
||||
} else if ( AH < 5 ) {
|
||||
AH++;
|
||||
} else if ( AH == 5 ) {
|
||||
xlast = 0;
|
||||
ylast = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,16 +649,16 @@ void createArray(const char *filename) {
|
||||
uint8_t data;
|
||||
byte line_len = 0;
|
||||
Serial.println("");
|
||||
Serial.println("// Generated by a JPEGDecoder library example sketch:");
|
||||
Serial.println("// https://github.com/Bodmer/JPEGDecoder");
|
||||
Serial.println(F("// Generated by a JPEGDecoder library example sketch:"));
|
||||
Serial.println(F("// https://github.com/Bodmer/JPEGDecoder"));
|
||||
Serial.println("");
|
||||
Serial.println("#if defined(__AVR__)");
|
||||
Serial.println(" #include <avr/pgmspace.h>");
|
||||
Serial.println("#endif");
|
||||
Serial.println(F("#if defined(__AVR__)"));
|
||||
Serial.println(F(" #include <avr/pgmspace.h>"));
|
||||
Serial.println(F("#endif"));
|
||||
Serial.println("");
|
||||
Serial.print ("const uint8_t ");
|
||||
Serial.print (F("const uint8_t "));
|
||||
while (*filename != '.') Serial.print(*filename++);
|
||||
Serial.println("[] PROGMEM = {"); // PROGMEM added for AVR processors, it is ignored by Due
|
||||
Serial.println(F("[] PROGMEM = {")); // PROGMEM added for AVR processors, it is ignored by Due
|
||||
|
||||
while ( jpgFile.available()) {
|
||||
|
||||
@@ -551,13 +684,13 @@ void createArray(const char *filename) {
|
||||
#ifdef ESP8266
|
||||
void Display::listFiles(void) {
|
||||
Serial.println();
|
||||
Serial.println("SPIFFS files found:");
|
||||
Serial.println(F("SPIFFS files found:"));
|
||||
|
||||
fs::Dir dir = SPIFFS.openDir("/"); // Root directory
|
||||
String line = "=====================================";
|
||||
|
||||
Serial.println(line);
|
||||
Serial.println(" File name Size");
|
||||
Serial.println(F(" File name Size"));
|
||||
Serial.println(line);
|
||||
|
||||
while (dir.next()) {
|
||||
@@ -590,22 +723,22 @@ void Display::listFiles(void) {
|
||||
void Display::listDir(fs::FS &fs, const char * dirname, uint8_t levels) {
|
||||
|
||||
Serial.println();
|
||||
Serial.println("SPIFFS files found:");
|
||||
Serial.println(F("SPIFFS files found:"));
|
||||
|
||||
Serial.printf("Listing directory: %s\n", "/");
|
||||
String line = "=====================================";
|
||||
|
||||
Serial.println(line);
|
||||
Serial.println(" File name Size");
|
||||
Serial.println(F(" File name Size"));
|
||||
Serial.println(line);
|
||||
|
||||
fs::File root = fs.open(dirname);
|
||||
if (!root) {
|
||||
Serial.println("Failed to open directory");
|
||||
Serial.println(F("Failed to open directory"));
|
||||
return;
|
||||
}
|
||||
if (!root.isDirectory()) {
|
||||
Serial.println("Not a directory");
|
||||
Serial.println(F("Not a directory"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -686,8 +819,117 @@ void Display::buildBanner(String msg, int xpos)
|
||||
img.print(msg);
|
||||
}
|
||||
|
||||
void Display::main()
|
||||
/*
|
||||
void Display::initLVGL() {
|
||||
tick.attach_ms(LVGL_TICK_PERIOD, lv_tick_handler);
|
||||
|
||||
lv_init();
|
||||
|
||||
lv_disp_buf_init(&disp_buf, buf, NULL, LV_HOR_RES_MAX * 10);
|
||||
|
||||
lv_disp_drv_t disp_drv;
|
||||
lv_disp_drv_init(&disp_drv);
|
||||
disp_drv.hor_res = WIDTH_1;
|
||||
disp_drv.ver_res = HEIGHT_1;
|
||||
disp_drv.flush_cb = my_disp_flush;
|
||||
disp_drv.buffer = &disp_buf;
|
||||
lv_disp_drv_register(&disp_drv);
|
||||
|
||||
lv_indev_drv_t indev_drv;
|
||||
lv_indev_drv_init(&indev_drv);
|
||||
indev_drv.type = LV_INDEV_TYPE_POINTER;
|
||||
indev_drv.read_cb = my_touchpad_read;
|
||||
lv_indev_drv_register(&indev_drv);
|
||||
}
|
||||
|
||||
|
||||
void Display::deinitLVGL() {
|
||||
Serial.println(F("Deinit LVGL"));
|
||||
//lv_deinit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Display::joinWiFiGFX(){
|
||||
|
||||
// Create one text area
|
||||
ta1 = lv_textarea_create(lv_scr_act(), NULL);
|
||||
lv_textarea_set_one_line(ta1, true);
|
||||
lv_obj_set_width(ta1, LV_HOR_RES / 2 - 20);
|
||||
lv_obj_set_pos(ta1, 5, 20);
|
||||
//lv_ta_set_cursor_type(ta, LV_CURSOR_BLOCK);
|
||||
lv_textarea_set_text(ta1, "");
|
||||
lv_obj_set_event_cb(ta1, ta_event_cb);
|
||||
|
||||
// Create first label
|
||||
lv_obj_t * ssid_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(ssid_label, "SSID:");
|
||||
lv_obj_align(ssid_label, ta1, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||
|
||||
// Create second text area
|
||||
ta2 = lv_textarea_create(lv_scr_act(), ta1);
|
||||
//lv_textarea_set_pwd_mode(ta2, true); // This shit makes it so backspace does not work
|
||||
//lv_textarea_set_pwd_show_time(ta2, 1000);
|
||||
lv_textarea_set_cursor_hidden(ta2, true);
|
||||
lv_obj_align(ta2, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
|
||||
|
||||
// Create second label
|
||||
lv_obj_t * pw_label = lv_label_create(lv_scr_act(), NULL);
|
||||
lv_label_set_text(pw_label, "Password:");
|
||||
lv_obj_align(pw_label, ta2, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||
|
||||
// Create a keyboard and apply the styles
|
||||
kb = lv_keyboard_create(lv_scr_act(), NULL);
|
||||
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
|
||||
lv_obj_set_event_cb(kb, keyboard_event_cb);
|
||||
|
||||
// Focus it on one of the text areas to start
|
||||
lv_keyboard_set_textarea(kb, ta1);
|
||||
lv_keyboard_set_cursor_manage(kb, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event){
|
||||
extern Display display_obj;
|
||||
lv_keyboard_def_event_cb(kb, event);
|
||||
if(event == LV_EVENT_APPLY){
|
||||
printf("LV_EVENT_APPLY\n");
|
||||
//String ta1_text = lv_textarea_get_text(lv_keyboard_get_textarea(kb));
|
||||
String ta1_text = lv_textarea_get_text(ta1);
|
||||
String ta2_text = lv_textarea_get_text(ta2);
|
||||
Serial.println(ta1_text);
|
||||
Serial.println(ta2_text);
|
||||
//joinWiFi(ta1_text, ta2_text);
|
||||
}else if(event == LV_EVENT_CANCEL){
|
||||
printf("LV_EVENT_CANCEL\n");
|
||||
//lv_textarea_set_text(lv_keyboard_get_textarea(kb), "");
|
||||
display_obj.deinitLVGL();
|
||||
display_obj.exit_draw = true; // set everything back to normal
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ta_event_cb(lv_obj_t * ta, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_CLICKED) {
|
||||
if(kb != NULL)
|
||||
lv_keyboard_set_textarea(kb, ta);
|
||||
}
|
||||
|
||||
//else if(event == LV_EVENT_INSERT) {
|
||||
// const char * str = lv_event_get_data();
|
||||
// if(str[0] == '\n') {
|
||||
// printf("Ready\n");
|
||||
// }
|
||||
//}
|
||||
}*/
|
||||
|
||||
void Display::main(uint8_t scan_mode)
|
||||
{
|
||||
if ((scan_mode == LV_JOIN_WIFI) ||
|
||||
(scan_mode == LV_ADD_SSID))
|
||||
lv_task_handler();
|
||||
return;
|
||||
}
|
||||
// End SPIFFS_functions
|
||||
|
||||
@@ -8,11 +8,34 @@
|
||||
//#include <SimpleList.h>
|
||||
#include <LinkedList.h>
|
||||
#include <SPI.h>
|
||||
#include <lvgl.h>
|
||||
#include <Ticker.h>
|
||||
//#include <M5Stack.h>
|
||||
#include "SPIFFS.h"
|
||||
#include "Assets.h"
|
||||
|
||||
#include <TFT_eSPI.h>
|
||||
|
||||
// WiFi stuff
|
||||
#define OTA_UPDATE 100
|
||||
#define SHOW_INFO 101
|
||||
#define WIFI_SCAN_OFF 0
|
||||
#define WIFI_SCAN_PROBE 1
|
||||
#define WIFI_SCAN_AP 2
|
||||
#define WIFI_SCAN_PWN 3
|
||||
#define WIFI_SCAN_EAPOL 4
|
||||
#define WIFI_SCAN_DEAUTH 5
|
||||
#define WIFI_SCAN_ALL 6
|
||||
#define WIFI_PACKET_MONITOR 7
|
||||
#define WIFI_ATTACK_BEACON_SPAM 8
|
||||
#define WIFI_ATTACK_RICK_ROLL 9
|
||||
#define BT_SCAN_ALL 10
|
||||
#define BT_SCAN_SKIMMERS 11
|
||||
#define WIFI_SCAN_ESPRESSIF 12
|
||||
#define LV_JOIN_WIFI 13
|
||||
#define LV_ADD_SSID 14
|
||||
#define WIFI_ATTACK_BEACON_LIST 15
|
||||
|
||||
#define TFT_SHIELD
|
||||
//#define TFT_DIY
|
||||
|
||||
@@ -33,9 +56,23 @@
|
||||
//#define MENU_FONT &FreeSansBold9pt7b
|
||||
#define BUTTON_ARRAY_LEN 7
|
||||
#define STATUS_BAR_WIDTH 16
|
||||
#define LVGL_TICK_PERIOD 6
|
||||
|
||||
#define STATUSBAR_COLOR 0x4A49
|
||||
|
||||
/*
|
||||
PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
|
||||
PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
|
||||
|
||||
PROGMEM static lv_disp_buf_t disp_buf;
|
||||
PROGMEM static lv_color_t buf[LV_HOR_RES_MAX * 10];
|
||||
|
||||
PROGMEM static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
|
||||
PROGMEM static void keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
|
||||
|
||||
// lvgl stuff
|
||||
PROGMEM static lv_obj_t *kb;
|
||||
*/
|
||||
|
||||
class Display
|
||||
{
|
||||
@@ -53,18 +90,21 @@ class Display
|
||||
//void addNodes(Menu* menu, String name, Menu* child, std::function<void()> callable);
|
||||
//void changeMenu(Menu* menu);
|
||||
//void showMenuList(Menu* menu, int layer);
|
||||
//static void lv_tick_handler();
|
||||
|
||||
public:
|
||||
Display();
|
||||
//Ticker tick;
|
||||
TFT_eSPI tft = TFT_eSPI();
|
||||
TFT_eSprite img = TFT_eSprite(&tft);
|
||||
TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
|
||||
String version_number = "v0.6.5";
|
||||
const String PROGMEM version_number = "v0.8.0";
|
||||
|
||||
bool printing = false;
|
||||
bool loading = false;
|
||||
bool tteBar = false;
|
||||
bool draw_tft = false;
|
||||
bool exit_draw = false;
|
||||
|
||||
int TOP_FIXED_AREA_2 = 48;
|
||||
int print_delay_1, print_delay_2 = 10;
|
||||
@@ -94,6 +134,9 @@ class Display
|
||||
// We can speed up scrolling of short text lines by just blanking the character we drew
|
||||
int blank[19]; // We keep all the strings pixel lengths to optimise the speed of the top line blanking
|
||||
|
||||
//void initLVGL();
|
||||
//void deinitLVGL();
|
||||
//void joinWiFiGFX();
|
||||
void tftDrawGraphObjects(byte x_scale);
|
||||
void tftDrawEapolColorKey();
|
||||
void tftDrawColorKey();
|
||||
@@ -105,6 +148,7 @@ class Display
|
||||
void clearScreen();
|
||||
void displayBuffer(bool do_clear = false);
|
||||
void drawJpeg(const char *filename, int xpos, int ypos);
|
||||
void setupDraw();
|
||||
void drawStylus();
|
||||
void getTouchWhileFunction(bool pressed);
|
||||
void initScrollValues(bool tte = false);
|
||||
@@ -112,7 +156,7 @@ class Display
|
||||
void jpegRender(int xpos, int ypos);
|
||||
void listDir(fs::FS &fs, const char * dirname, uint8_t levels);
|
||||
void listFiles();
|
||||
void main();
|
||||
void main(uint8_t scan_mode);
|
||||
void RunSetup();
|
||||
void scrollAddress(uint16_t vsp);
|
||||
int scroll_line(uint32_t color);
|
||||
|
||||
@@ -6,12 +6,13 @@ LedInterface::LedInterface() {
|
||||
|
||||
void LedInterface::RunSetup() {
|
||||
Serial.println("Setting neopixel to black...");
|
||||
strip.setBrightness(0);
|
||||
strip.begin();
|
||||
strip.setBrightness(50);
|
||||
strip.setPixelColor(0, strip.Color(0, 0, 0));
|
||||
strip.show();
|
||||
delay(100);
|
||||
strip.setPixelColor(0, strip.Color(255, 0, 0));
|
||||
strip.setBrightness(50);
|
||||
strip.setPixelColor(0, strip.Color(0, 0, 0));
|
||||
strip.show();
|
||||
this->initTime = millis();
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
#ifndef MenuFunctions_h
|
||||
#define MenuFunctions_h
|
||||
|
||||
#define BATTERY_ANALOG_ON 0
|
||||
|
||||
#include "WiFiScan.h"
|
||||
#include "Display.h"
|
||||
#include "BatteryInterface.h"
|
||||
#include "SDInterface.h"
|
||||
#include "Web.h"
|
||||
|
||||
|
||||
extern Display display_obj;
|
||||
extern WiFiScan wifi_scan_obj;
|
||||
extern Web web_obj;
|
||||
@@ -28,6 +31,12 @@ extern BatteryInterface battery_obj;
|
||||
|
||||
#define FLASH_BUTTON 0
|
||||
|
||||
#if BATTERY_ANALOG_ON == 1
|
||||
#define BATTERY_PIN 13
|
||||
#define ANALOG_PIN 34
|
||||
#define CHARGING_PIN 27
|
||||
#endif
|
||||
|
||||
// Icon definitions
|
||||
#define ATTACKS 0
|
||||
#define BEACON_SNIFF 1
|
||||
@@ -53,41 +62,62 @@ extern BatteryInterface battery_obj;
|
||||
#define EAPOL 21
|
||||
#define STATUS_BAT 22
|
||||
#define STATUS_SD 23
|
||||
#define PWNAGOTCHI 24
|
||||
#define ESPRESSIF 25
|
||||
#define SHUTDOWN 26
|
||||
#define BEACON_LIST 27
|
||||
#define GENERATE 28
|
||||
#define CLEAR_ICO 29
|
||||
#define KEYBOARD_ICO 30
|
||||
#define JOIN_WIFI 31
|
||||
|
||||
PROGMEM void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
|
||||
PROGMEM bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
|
||||
|
||||
PROGMEM static lv_disp_buf_t disp_buf;
|
||||
PROGMEM static lv_color_t buf[LV_HOR_RES_MAX * 10];
|
||||
|
||||
PROGMEM static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
|
||||
PROGMEM static void join_wifi_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
|
||||
PROGMEM static void add_ssid_keyboard_event_cb(lv_obj_t * keyboard, lv_event_t event);
|
||||
|
||||
// lvgl stuff
|
||||
PROGMEM static lv_obj_t *kb;
|
||||
|
||||
struct Menu;
|
||||
|
||||
// Individual Nodes of a menu
|
||||
|
||||
struct MenuNode {
|
||||
String name;
|
||||
uint16_t color;
|
||||
int icon;
|
||||
TFT_eSPI_Button* button;
|
||||
std::function<void()> callable;
|
||||
String name;
|
||||
uint16_t color;
|
||||
int icon;
|
||||
TFT_eSPI_Button* button;
|
||||
std::function<void()> callable;
|
||||
};
|
||||
|
||||
// Full Menus
|
||||
struct Menu {
|
||||
String name;
|
||||
LinkedList<MenuNode>* list;
|
||||
Menu * parentMenu;
|
||||
uint8_t selected;
|
||||
String name;
|
||||
LinkedList<MenuNode>* list;
|
||||
Menu * parentMenu;
|
||||
//uint8_t selected;
|
||||
};
|
||||
|
||||
|
||||
class MenuFunctions
|
||||
{
|
||||
private:
|
||||
private:
|
||||
|
||||
String u_result = "";
|
||||
|
||||
uint32_t initTime = 0;
|
||||
|
||||
|
||||
Menu* current_menu;
|
||||
|
||||
// Main menu stuff
|
||||
Menu mainMenu;
|
||||
|
||||
|
||||
Menu wifiMenu;
|
||||
Menu bluetoothMenu;
|
||||
Menu generalMenu;
|
||||
@@ -104,28 +134,47 @@ class MenuFunctions
|
||||
Menu wifiSnifferMenu;
|
||||
Menu wifiScannerMenu;
|
||||
Menu wifiAttackMenu;
|
||||
Menu wifiGeneralMenu;
|
||||
|
||||
// Bluetooth menu stuff
|
||||
Menu bluetoothSnifferMenu;
|
||||
Menu bluetoothScannerMenu;
|
||||
Menu bluetoothGeneralMenu;
|
||||
|
||||
// Settings things menus
|
||||
Menu shutdownWiFiMenu;
|
||||
Menu shutdownBLEMenu;
|
||||
Menu generateSSIDsMenu;
|
||||
Menu clearSSIDsMenu;
|
||||
|
||||
static void lv_tick_handler();
|
||||
|
||||
// Menu icons
|
||||
|
||||
|
||||
|
||||
//TFT_eSPI_Button key[BUTTON_ARRAY_LEN];
|
||||
|
||||
|
||||
void addNodes(Menu* menu, String name, uint16_t color, Menu* child, int place, std::function<void()> callable);
|
||||
void drawStatusBar();
|
||||
void updateStatusBar();
|
||||
void battery(bool initial = false);
|
||||
void battery2(bool initial = false);
|
||||
void showMenuList(Menu* menu, int layer);
|
||||
void orientDisplay();
|
||||
|
||||
public:
|
||||
public:
|
||||
MenuFunctions();
|
||||
|
||||
Ticker tick;
|
||||
|
||||
uint16_t x = -1, y = -1;
|
||||
boolean pressed = false;
|
||||
|
||||
void initLVGL();
|
||||
void deinitLVGL();
|
||||
void joinWiFiGFX();
|
||||
void addSSIDGFX();
|
||||
|
||||
void buildButtons(Menu* menu);
|
||||
void changeMenu(Menu* menu);
|
||||
void displayCurrentMenu();
|
||||
|
||||
@@ -4,7 +4,7 @@ bool SDInterface::initSD() {
|
||||
String display_string = "";
|
||||
|
||||
if (!SD.begin(SD_CS)) {
|
||||
Serial.println("Failed to mount SD Card");
|
||||
Serial.println(F("Failed to mount SD Card"));
|
||||
this->supported = false;
|
||||
return false;
|
||||
}
|
||||
@@ -12,13 +12,13 @@ bool SDInterface::initSD() {
|
||||
this->supported = true;
|
||||
this->cardType = SD.cardType();
|
||||
if (cardType == CARD_MMC)
|
||||
Serial.println("SD: MMC Mounted");
|
||||
Serial.println(F("SD: MMC Mounted"));
|
||||
else if(cardType == CARD_SD)
|
||||
Serial.println("SD: SDSC Mounted");
|
||||
Serial.println(F("SD: SDSC Mounted"));
|
||||
else if(cardType == CARD_SDHC)
|
||||
Serial.println("SD: SDHC Mounted");
|
||||
Serial.println(F("SD: SDHC Mounted"));
|
||||
else
|
||||
Serial.println("SD: UNKNOWN Card Mounted");
|
||||
Serial.println(F("SD: UNKNOWN Card Mounted"));
|
||||
|
||||
//this->cardSizeBT = SD.cardSize();
|
||||
//this->cardSizeKB = SD.cardSize() / 1024;
|
||||
@@ -76,13 +76,13 @@ void SDInterface::runUpdate() {
|
||||
display_obj.tft.setTextSize(1);
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
|
||||
display_obj.tft.println("Opening /update.bin...");
|
||||
display_obj.tft.println(F("Opening /update.bin..."));
|
||||
File updateBin = SD.open("/update.bin");
|
||||
if (updateBin) {
|
||||
if(updateBin.isDirectory()){
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println("Error, could not find update.bin");
|
||||
Serial.println("Error, update.bin is not a file");
|
||||
display_obj.tft.println(F("Error, could not find update.bin"));
|
||||
Serial.println(F("Error, update.bin is not a file"));
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
updateBin.close();
|
||||
return;
|
||||
@@ -91,14 +91,14 @@ void SDInterface::runUpdate() {
|
||||
size_t updateSize = updateBin.size();
|
||||
|
||||
if (updateSize > 0) {
|
||||
display_obj.tft.println("Starting SD Update...");
|
||||
Serial.println("Try to start update");
|
||||
display_obj.tft.println(F("Starting SD Update..."));
|
||||
Serial.println(F("Try to start update"));
|
||||
this->performUpdate(updateBin, updateSize);
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println("Error, update.bin is empty");
|
||||
Serial.println("Error, file is empty");
|
||||
display_obj.tft.println(F("Error, update.bin is empty"));
|
||||
Serial.println(F("Error, file is empty"));
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
return;
|
||||
}
|
||||
@@ -106,16 +106,16 @@ void SDInterface::runUpdate() {
|
||||
updateBin.close();
|
||||
|
||||
// whe finished remove the binary from sd card to indicate end of the process
|
||||
display_obj.tft.println("rebooting...");
|
||||
Serial.println("rebooting...");
|
||||
display_obj.tft.println(F("rebooting..."));
|
||||
Serial.println(F("rebooting..."));
|
||||
//SD.remove("/update.bin");
|
||||
delay(1000);
|
||||
ESP.restart();
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
display_obj.tft.println("Could not load update.bin from /");
|
||||
Serial.println("Could not load update.bin from sd root");
|
||||
display_obj.tft.println(F("Could not load update.bin from /"));
|
||||
Serial.println(F("Could not load update.bin from sd root"));
|
||||
display_obj.tft.setTextColor(TFT_WHITE);
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ void SDInterface::runUpdate() {
|
||||
void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
|
||||
if (Update.begin(updateSize)) {
|
||||
display_obj.tft.println("File size: " + String(updateSize));
|
||||
display_obj.tft.println("Writing file to partition...");
|
||||
display_obj.tft.println(F("Writing file to partition..."));
|
||||
size_t written = Update.writeStream(updateSource);
|
||||
if (written == updateSize) {
|
||||
display_obj.tft.println("Written: " + String(written) + " successfully");
|
||||
@@ -136,8 +136,8 @@ void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
|
||||
if (Update.end()) {
|
||||
Serial.println("OTA done!");
|
||||
if (Update.isFinished()) {
|
||||
display_obj.tft.println("Update complete");
|
||||
Serial.println("Update successfully completed. Rebooting.");
|
||||
display_obj.tft.println(F("Update complete"));
|
||||
Serial.println(F("Update successfully completed. Rebooting."));
|
||||
}
|
||||
else {
|
||||
display_obj.tft.setTextColor(TFT_RED);
|
||||
|
||||
@@ -43,6 +43,8 @@ void Web::onJavaScript(void) {
|
||||
|
||||
void Web::setupOTAupdate()
|
||||
{
|
||||
uint8_t newMACAddress[] = {0x06, 0x07, 0x0D, 0x09, 0x0E, 0x0D};
|
||||
|
||||
display_obj.tft.setTextWrap(false);
|
||||
display_obj.tft.setFreeFont(NULL);
|
||||
display_obj.tft.setCursor(0, 100);
|
||||
@@ -67,6 +69,7 @@ void Web::setupOTAupdate()
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
|
||||
Serial.println("Starting softAP...");
|
||||
esp_wifi_set_mac(ESP_IF_WIFI_AP, &newMACAddress[0]);
|
||||
WiFi.softAP(ssid, password);
|
||||
Serial.println("");
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
#ifndef WiFiScan_h
|
||||
#define WiFiScan_h
|
||||
|
||||
#include <BLEDevice.h>
|
||||
#include <BLEUtils.h>
|
||||
#include <BLEScan.h>
|
||||
#include <BLEAdvertisedDevice.h>
|
||||
//#include <BLEDevice.h>
|
||||
//#include <BLEUtils.h>
|
||||
//#include <BLEScan.h>
|
||||
//#include <BLEAdvertisedDevice.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
// Testing NimBLE
|
||||
#include <NimBLEDevice.h>
|
||||
#include <NimBLEAdvertisedDevice.h>
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <math.h>
|
||||
@@ -16,6 +21,7 @@
|
||||
#include "Buffer.h"
|
||||
#include "BatteryInterface.h"
|
||||
#include "TemperatureInterface.h"
|
||||
#include "Assets.h"
|
||||
//#include "MenuFunctions.h"
|
||||
|
||||
#define bad_list_length 3
|
||||
@@ -25,14 +31,19 @@
|
||||
#define WIFI_SCAN_OFF 0
|
||||
#define WIFI_SCAN_PROBE 1
|
||||
#define WIFI_SCAN_AP 2
|
||||
#define WIFI_SCAN_EAPOL 3
|
||||
#define WIFI_SCAN_DEAUTH 4
|
||||
#define WIFI_SCAN_ALL 5
|
||||
#define WIFI_PACKET_MONITOR 6
|
||||
#define WIFI_ATTACK_BEACON_SPAM 7
|
||||
#define WIFI_ATTACK_RICK_ROLL 8
|
||||
#define BT_SCAN_ALL 9
|
||||
#define BT_SCAN_SKIMMERS 10
|
||||
#define WIFI_SCAN_PWN 3
|
||||
#define WIFI_SCAN_EAPOL 4
|
||||
#define WIFI_SCAN_DEAUTH 5
|
||||
#define WIFI_SCAN_ALL 6
|
||||
#define WIFI_PACKET_MONITOR 7
|
||||
#define WIFI_ATTACK_BEACON_SPAM 8
|
||||
#define WIFI_ATTACK_RICK_ROLL 9
|
||||
#define BT_SCAN_ALL 10
|
||||
#define BT_SCAN_SKIMMERS 11
|
||||
#define WIFI_SCAN_ESPRESSIF 12
|
||||
#define LV_JOIN_WIFI 13
|
||||
#define LV_ADD_SSID 14
|
||||
#define WIFI_ATTACK_BEACON_LIST 15
|
||||
|
||||
#define GRAPH_REFRESH 100
|
||||
|
||||
@@ -46,6 +57,11 @@ extern TemperatureInterface temp_obj;
|
||||
|
||||
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
|
||||
|
||||
struct ssid {
|
||||
String essid;
|
||||
int bssid[6];
|
||||
};
|
||||
|
||||
class WiFiScan
|
||||
{
|
||||
private:
|
||||
@@ -68,12 +84,12 @@ class WiFiScan
|
||||
|
||||
uint32_t initTime = 0;
|
||||
bool run_setup = true;
|
||||
int set_channel = 1;
|
||||
int bluetoothScanTime = 5;
|
||||
int packets_sent = 0;
|
||||
const wifi_promiscuous_filter_t filt = {.filter_mask=WIFI_PROMIS_FILTER_MASK_MGMT | WIFI_PROMIS_FILTER_MASK_DATA};
|
||||
BLEScan* pBLEScan;
|
||||
|
||||
//String connected_network = "";
|
||||
String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
|
||||
|
||||
char* rick_roll[8] = {
|
||||
@@ -128,28 +144,58 @@ class WiFiScan
|
||||
void tftDrawColorKey();
|
||||
void tftDrawGraphObjects();
|
||||
void broadcastRandomSSID(uint32_t currentTime);
|
||||
void broadcastCustomBeacon(uint32_t current_time, ssid custom_ssid);
|
||||
void broadcastSetSSID(uint32_t current_time, char* ESSID);
|
||||
void RunRickRoll(uint8_t scan_mode, uint16_t color);
|
||||
void RunBeaconSpam(uint8_t scan_mode, uint16_t color);
|
||||
void RunBeaconList(uint8_t scan_mode, uint16_t color);
|
||||
void RunEspressifScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunPwnScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunBeaconScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunDeauthScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunEapolScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunProbeScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunPacketMonitor(uint8_t scan_mode, uint16_t color);
|
||||
void RunBluetoothScan(uint8_t scan_mode, uint16_t color);
|
||||
void RunLvJoinWiFi(uint8_t scan_mode, uint16_t color);
|
||||
static void scanCompleteCB(BLEScanResults scanResults);
|
||||
|
||||
public:
|
||||
WiFiScan();
|
||||
|
||||
//LinkedList<ssid>* ssids;
|
||||
|
||||
int set_channel = 1;
|
||||
|
||||
int old_channel = 0;
|
||||
|
||||
bool orient_display = false;
|
||||
bool wifi_initialized = false;
|
||||
bool ble_initialized = false;
|
||||
|
||||
String free_ram = "";
|
||||
String old_free_ram = "";
|
||||
String connected_network = "";
|
||||
|
||||
//lv_obj_t * scr = lv_cont_create(NULL, NULL);
|
||||
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
|
||||
void RunSetup();
|
||||
int clearSSIDs();
|
||||
bool addSSID(String essid);
|
||||
int generateSSIDs();
|
||||
bool shutdownWiFi();
|
||||
bool shutdownBLE();
|
||||
void joinWiFi(String ssid, String password);
|
||||
String getStaMAC();
|
||||
String getApMAC();
|
||||
String freeRAM();
|
||||
void RunInfo();
|
||||
void RunShutdownWiFi();
|
||||
void RunShutdownBLE();
|
||||
void RunGenerateSSIDs();
|
||||
void RunClearSSIDs();
|
||||
void channelHop();
|
||||
uint8_t currentScanMode = 0;
|
||||
void main(uint32_t currentTime);
|
||||
@@ -157,9 +203,12 @@ class WiFiScan
|
||||
void StopScan(uint8_t scan_mode);
|
||||
|
||||
static void getMAC(char *addr, uint8_t* data, uint16_t offset);
|
||||
static void espressifSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void pwnSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void beaconSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void deauthSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void probeSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void beaconListSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void eapolSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
static void wifiSnifferCallback(void* buf, wifi_promiscuous_pkt_type_t type);
|
||||
};
|
||||
|
||||
BIN
esp32_marauder/data/marauder3L1.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
@@ -55,11 +55,14 @@ uint32_t currentTime = 0;
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
||||
pinMode(FLASH_BUTTON, INPUT);
|
||||
pinMode(TFT_BL, OUTPUT);
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
|
||||
#if BATTERY_ANALOG_ON == 1
|
||||
pinMode(BATTERY_PIN, OUTPUT);
|
||||
pinMode(CHARGING_PIN, INPUT);
|
||||
#endif
|
||||
|
||||
// Preset SPI CS pins to avoid bus conflicts
|
||||
digitalWrite(TFT_CS, HIGH);
|
||||
digitalWrite(SD_CS, HIGH);
|
||||
@@ -67,44 +70,97 @@ void setup()
|
||||
Serial.begin(115200);
|
||||
|
||||
Serial.begin(115200);
|
||||
Serial.println("\n\n--------------------------------\n");
|
||||
Serial.println(" ESP32 Marauder \n");
|
||||
|
||||
display_obj.RunSetup();
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
|
||||
display_obj.tft.println("Marauder " + display_obj.version_number + "\n");
|
||||
|
||||
display_obj.tft.println("Started Serial");
|
||||
|
||||
Serial.println(F("\n\n--------------------------------\n"));
|
||||
Serial.println(F(" ESP32 Marauder \n"));
|
||||
Serial.println(" " + display_obj.version_number + "\n");
|
||||
Serial.println(" By: justcallmekoko\n");
|
||||
Serial.println("--------------------------------\n\n");
|
||||
Serial.println(F(" By: justcallmekoko\n"));
|
||||
Serial.println(F("--------------------------------\n\n"));
|
||||
|
||||
//Serial.println("Internal Temp: " + (String)((temprature_sens_read() - 32) / 1.8));
|
||||
|
||||
// Do some LED stuff
|
||||
led_obj.RunSetup();
|
||||
wifi_scan_obj.RunSetup();
|
||||
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
|
||||
display_obj.tft.println("Checked RAM");
|
||||
|
||||
// Do some SD stuff
|
||||
if(sd_obj.initSD())
|
||||
Serial.println("SD Card supported");
|
||||
else
|
||||
Serial.println("SD Card NOT Supported");
|
||||
if(sd_obj.initSD()) {
|
||||
Serial.println(F("SD Card supported"));
|
||||
display_obj.tft.println(F("Initialized SD Card"));
|
||||
}
|
||||
else {
|
||||
Serial.println(F("SD Card NOT Supported"));
|
||||
display_obj.tft.setTextColor(TFT_RED, TFT_BLACK);
|
||||
display_obj.tft.println(F("Failed to Initialize SD Card"));
|
||||
display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK);
|
||||
}
|
||||
|
||||
// Run display setup
|
||||
display_obj.RunSetup();
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
//display_obj.RunSetup();
|
||||
|
||||
// Build menus
|
||||
menu_function_obj.RunSetup();
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
//menu_function_obj.RunSetup();
|
||||
|
||||
//display_obj.tft.println("Created Menu Structure");
|
||||
|
||||
// Battery stuff
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
battery_obj.RunSetup();
|
||||
|
||||
display_obj.tft.println(F("Checked battery configuration"));
|
||||
|
||||
// Temperature stuff
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
temp_obj.RunSetup();
|
||||
|
||||
display_obj.tft.println(F("Initialized temperature interface"));
|
||||
|
||||
battery_obj.battery_level = battery_obj.getBatteryLevel();
|
||||
|
||||
if (battery_obj.i2c_supported) {
|
||||
Serial.println("IP5306 I2C Supported: true");
|
||||
Serial.println(F("IP5306 I2C Supported: true"));
|
||||
}
|
||||
else
|
||||
Serial.println("IP5306 I2C Supported: false");
|
||||
Serial.println(F("IP5306 I2C Supported: false"));
|
||||
|
||||
Serial.println(wifi_scan_obj.freeRAM());
|
||||
|
||||
// Do some LED stuff
|
||||
led_obj.RunSetup();
|
||||
|
||||
display_obj.tft.println(F("Initialized LED Interface"));
|
||||
|
||||
display_obj.tft.println(F("Starting..."));
|
||||
|
||||
delay(1000);
|
||||
|
||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
|
||||
digitalWrite(TFT_BL, LOW);
|
||||
|
||||
// Draw the title screen
|
||||
display_obj.drawJpeg("/marauder3L.jpg", 0 , 0); // 240 x 320 image
|
||||
|
||||
//showCenterText(version_number, 250);
|
||||
display_obj.tft.drawCentreString(display_obj.version_number, 120, 250, 2);
|
||||
|
||||
digitalWrite(TFT_BL, HIGH);
|
||||
|
||||
delay(5000);
|
||||
|
||||
menu_function_obj.RunSetup();
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +175,7 @@ void loop()
|
||||
// (wifi_scan_obj.currentScanMode != OTA_UPDATE))
|
||||
if (!display_obj.draw_tft)
|
||||
{
|
||||
display_obj.main();
|
||||
display_obj.main(wifi_scan_obj.currentScanMode);
|
||||
wifi_scan_obj.main(currentTime);
|
||||
sd_obj.main();
|
||||
battery_obj.main(currentTime);
|
||||
|
||||
BIN
esp32_marauder/esp32_marauder_v0_8_0_20200831_new_hardware.bin
Normal file
BIN
esp32_marauder/esp32_marauder_v0_8_0_20200831_old_hardware.bin
Normal file
BIN
pictures/IMG_0420.JPG
Normal file
|
After Width: | Height: | Size: 7.4 MiB |
BIN
pictures/IMG_0421.JPG
Normal file
|
After Width: | Height: | Size: 7.3 MiB |
BIN
pictures/IMG_0423.JPG
Normal file
|
After Width: | Height: | Size: 7.5 MiB |
BIN
pictures/IMG_0424.JPG
Normal file
|
After Width: | Height: | Size: 8.3 MiB |
BIN
pictures/IMG_0425.JPG
Normal file
|
After Width: | Height: | Size: 6.6 MiB |
BIN
pictures/IMG_0426.JPG
Normal file
|
After Width: | Height: | Size: 7.0 MiB |
BIN
pictures/IMG_2519 - Copy.jpg
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
pictures/IMG_2520 - Copy.jpg
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
pictures/diy.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
pictures/icons/beacon_list_22.bmp
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
pictures/icons/clear_22.bmp
Normal file
|
After Width: | Height: | Size: 382 B |
BIN
pictures/icons/espressif_22.bmp
Normal file
|
After Width: | Height: | Size: 382 B |
BIN
pictures/icons/generate_22.bmp
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
pictures/icons/join_wifi_22.bmp
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
pictures/icons/keyboard_22.bmp
Normal file
|
After Width: | Height: | Size: 150 B |
BIN
pictures/icons/pwnagotchi_22.bmp
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
pictures/icons/shutdown_22.bmp
Normal file
|
After Width: | Height: | Size: 382 B |
BIN
pictures/m5stack.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
pictures/odroid_marauder.jpg
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
9
pictures/xbm/beacon_list_22.XBM
Normal file
@@ -0,0 +1,9 @@
|
||||
#define 1598678411119_width 22
|
||||
#define 1598678411119_height 22
|
||||
static char 1598678411119_bits[] = {
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xF3, 0x3F, 0xFF, 0xE1, 0x3F,
|
||||
0xFF, 0xDE, 0x3F, 0x1F, 0x12, 0x3E, 0xEF, 0xF3, 0x3D, 0xE7, 0xF3, 0x39,
|
||||
0x37, 0x1E, 0x3B, 0x37, 0x1E, 0x3B, 0xEF, 0xF3, 0x3D, 0xEF, 0xF3, 0x3D,
|
||||
0x37, 0x1E, 0x3B, 0x37, 0x1E, 0x3B, 0xE7, 0xF3, 0x39, 0xEF, 0xF3, 0x3D,
|
||||
0x1F, 0x12, 0x3E, 0xFF, 0xDE, 0x3F, 0xFF, 0xE1, 0x3F, 0xFF, 0xF3, 0x3F,
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, };
|
||||
9
pictures/xbm/espressif_22.XBM
Normal file
@@ -0,0 +1,9 @@
|
||||
#define 1593729689573_width 22
|
||||
#define 1593729689573_height 22
|
||||
static char 1593729689573_bits[] = {
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xC7, 0x3F, 0x7F, 0x0E, 0x3F,
|
||||
0x2F, 0x30, 0x3E, 0x37, 0x40, 0x3C, 0xF3, 0x83, 0x38, 0x0B, 0x04, 0x39,
|
||||
0x03, 0x18, 0x32, 0x01, 0x20, 0x32, 0xF1, 0x21, 0x34, 0x01, 0x46, 0x34,
|
||||
0x03, 0x84, 0x38, 0x7B, 0x88, 0x38, 0x93, 0x88, 0x38, 0x17, 0x89, 0x3C,
|
||||
0x07, 0x89, 0x3F, 0xCF, 0x89, 0x3D, 0x9F, 0x49, 0x3C, 0x7F, 0x00, 0x3F,
|
||||
0xFF, 0xE3, 0x3F, 0xFF, 0xFF, 0x3F, };
|
||||
9
pictures/xbm/pwnagotchi_22.XBM
Normal file
@@ -0,0 +1,9 @@
|
||||
#define 1592872258566_width 22
|
||||
#define 1592872258566_height 22
|
||||
static char 1592872258566_bits[] = {
|
||||
0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0x7F, 0x80, 0x3F, 0xBF, 0x7F, 0x3F,
|
||||
0xDF, 0xC0, 0x3E, 0x6F, 0xBF, 0x3D, 0xBF, 0x61, 0x3F, 0xFF, 0xDE, 0x3F,
|
||||
0xFF, 0xF3, 0x3F, 0xFF, 0xFF, 0x3F, 0xFB, 0xFF, 0x37, 0xFD, 0xFF, 0x2F,
|
||||
0xFE, 0xFF, 0x1F, 0x8E, 0x7F, 0x1C, 0x36, 0xBF, 0x19, 0x16, 0xBF, 0x18,
|
||||
0x06, 0x3F, 0x18, 0x8E, 0x7F, 0x1C, 0xFD, 0xFF, 0x2F, 0xDB, 0xF3, 0x36,
|
||||
0x3F, 0x0C, 0x3F, 0xFF, 0xFF, 0x3F, };
|
||||
9
pictures/xbm/shutdown_22.XBM
Normal file
@@ -0,0 +1,9 @@
|
||||
#define 1598662153627_width 22
|
||||
#define 1598662153627_height 22
|
||||
static char 1598662153627_bits[] = {
|
||||
0xFF, 0xF3, 0x3F, 0xFF, 0xE1, 0x3F, 0xCF, 0xE1, 0x3C, 0x87, 0x61, 0x38,
|
||||
0xC3, 0xE1, 0x30, 0xE1, 0xE1, 0x21, 0xF1, 0xE1, 0x23, 0xF1, 0xE1, 0x23,
|
||||
0xF8, 0xE1, 0x07, 0xF8, 0xE1, 0x07, 0xF8, 0xE1, 0x07, 0xF8, 0xF3, 0x07,
|
||||
0xF8, 0xFF, 0x07, 0xF9, 0xFF, 0x27, 0xF1, 0xFF, 0x23, 0xF1, 0xFF, 0x23,
|
||||
0xE1, 0xFF, 0x21, 0xC3, 0xFF, 0x30, 0x07, 0x3F, 0x38, 0x0F, 0x00, 0x3C,
|
||||
0x1F, 0x00, 0x3E, 0xFF, 0xC1, 0x3F, };
|
||||