mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-12 07:40:58 -08:00
Add status LED for neopixel
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -18,6 +18,50 @@ void LedInterface::RunSetup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LedInterface::main(uint32_t currentTime) {
|
void LedInterface::main(uint32_t currentTime) {
|
||||||
|
if ((!settings_obj.loadSetting<bool>("EnableLED")) ||
|
||||||
|
(this->current_mode == MODE_OFF)) {
|
||||||
|
this->ledOff();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (this->current_mode == MODE_RAINBOW) {
|
||||||
|
this->rainbow();
|
||||||
|
}
|
||||||
|
else if (this->current_mode == MODE_ATTACK) {
|
||||||
|
this->attackLed();
|
||||||
|
}
|
||||||
|
else if (this->current_mode == MODE_SNIFF) {
|
||||||
|
this->sniffLed();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this->ledOff();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void LedInterface::setMode(uint8_t new_mode) {
|
||||||
|
this->current_mode = new_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t LedInterface::getMode() {
|
||||||
|
return this->current_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LedInterface::sniffLed() {
|
||||||
|
strip.setPixelColor(0, strip.Color(0, 0, 255));
|
||||||
|
strip.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LedInterface::attackLed() {
|
||||||
|
strip.setPixelColor(0, strip.Color(255, 0, 0));
|
||||||
|
strip.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LedInterface::ledOff() {
|
||||||
|
strip.setPixelColor(0, strip.Color(0, 0, 0));
|
||||||
|
strip.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LedInterface::rainbow() {
|
||||||
strip.setPixelColor(0, this->Wheel((0 * 256 / 100 + this->wheel_pos) % 256));
|
strip.setPixelColor(0, this->Wheel((0 * 256 / 100 + this->wheel_pos) % 256));
|
||||||
strip.show();
|
strip.show();
|
||||||
|
|
||||||
@@ -26,7 +70,7 @@ void LedInterface::main(uint32_t currentTime) {
|
|||||||
this->wheel_pos = this->wheel_pos - this->wheel_speed;
|
this->wheel_pos = this->wheel_pos - this->wheel_speed;
|
||||||
if (this->wheel_pos < 0)
|
if (this->wheel_pos < 0)
|
||||||
this->wheel_pos = 255;
|
this->wheel_pos = 255;
|
||||||
};
|
}
|
||||||
|
|
||||||
uint32_t LedInterface::Wheel(byte WheelPos) {
|
uint32_t LedInterface::Wheel(byte WheelPos) {
|
||||||
WheelPos = 255 - WheelPos;
|
WheelPos = 255 - WheelPos;
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
#ifndef LedInterface_h
|
#ifndef LedInterface_h
|
||||||
#define LedInterface_h
|
#define LedInterface_h
|
||||||
|
|
||||||
|
#include "configs.h"
|
||||||
|
#include "settings.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <Adafruit_NeoPixel.h>
|
#include <Adafruit_NeoPixel.h>
|
||||||
|
|
||||||
#define PIN 25
|
|
||||||
#define Pixels 1
|
#define Pixels 1
|
||||||
|
|
||||||
|
#define MODE_OFF 0
|
||||||
|
#define MODE_RAINBOW 1
|
||||||
|
#define MODE_ATTACK 2
|
||||||
|
#define MODE_SNIFF 3
|
||||||
|
|
||||||
|
extern Settings settings_obj;
|
||||||
extern Adafruit_NeoPixel strip;
|
extern Adafruit_NeoPixel strip;
|
||||||
|
|
||||||
class LedInterface {
|
class LedInterface {
|
||||||
@@ -19,12 +26,23 @@ class LedInterface {
|
|||||||
int wheel_speed = 1; // lower = slower
|
int wheel_speed = 1; // lower = slower
|
||||||
|
|
||||||
uint32_t Wheel(byte WheelPos);
|
uint32_t Wheel(byte WheelPos);
|
||||||
|
|
||||||
|
uint8_t current_mode = MODE_OFF;
|
||||||
|
|
||||||
|
void rainbow();
|
||||||
|
void ledOff();
|
||||||
|
void attackLed();
|
||||||
|
void sniffLed();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LedInterface();
|
LedInterface();
|
||||||
|
|
||||||
void RunSetup();
|
void RunSetup();
|
||||||
void main(uint32_t currentTime);
|
void main(uint32_t currentTime);
|
||||||
|
|
||||||
|
void setMode(uint8_t);
|
||||||
|
uint8_t getMode();
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -363,6 +363,8 @@ void WiFiScan::startWiFiAttacks(uint8_t scan_mode, uint16_t color, String title_
|
|||||||
this->wifi_initialized = true;
|
this->wifi_initialized = true;
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.attackLED();
|
flipper_led.attackLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_ATTACK);
|
||||||
#endif
|
#endif
|
||||||
initTime = millis();
|
initTime = millis();
|
||||||
}
|
}
|
||||||
@@ -381,6 +383,8 @@ bool WiFiScan::shutdownWiFi() {
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.offLED();
|
flipper_led.offLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_OFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
this->wifi_initialized = false;
|
this->wifi_initialized = false;
|
||||||
@@ -401,6 +405,8 @@ bool WiFiScan::shutdownBLE() {
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.offLED();
|
flipper_led.offLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_OFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
this->ble_initialized = false;
|
this->ble_initialized = false;
|
||||||
@@ -524,6 +530,8 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Serial.println(text_table4[9] + (String)access_points->size());
|
Serial.println(text_table4[9] + (String)access_points->size());
|
||||||
@@ -759,6 +767,8 @@ void WiFiScan::RunEspressifScan(uint8_t scan_mode, uint16_t color) {
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -794,6 +804,8 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sd_obj.openCapture("packet_monitor");
|
sd_obj.openCapture("packet_monitor");
|
||||||
@@ -867,6 +879,8 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
|
|||||||
{
|
{
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
num_eapol = 0;
|
num_eapol = 0;
|
||||||
@@ -1000,6 +1014,8 @@ void WiFiScan::RunPwnScan(uint8_t scan_mode, uint16_t color)
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -1038,6 +1054,8 @@ void WiFiScan::RunBeaconScan(uint8_t scan_mode, uint16_t color)
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -1075,6 +1093,8 @@ void WiFiScan::RunRawScan(uint8_t scan_mode, uint16_t color)
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -1112,6 +1132,8 @@ void WiFiScan::RunDeauthScan(uint8_t scan_mode, uint16_t color)
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
@@ -1151,6 +1173,8 @@ void WiFiScan::RunProbeScan(uint8_t scan_mode, uint16_t color)
|
|||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
flipper_led.sniffLED();
|
flipper_led.sniffLED();
|
||||||
|
#else
|
||||||
|
led_obj.setMode(MODE_SNIFF);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "Assets.h"
|
#include "Assets.h"
|
||||||
#include "flipperLED.h"
|
#include "flipperLED.h"
|
||||||
|
#include "LedInterface.h"
|
||||||
//#include "MenuFunctions.h"
|
//#include "MenuFunctions.h"
|
||||||
|
|
||||||
#define bad_list_length 3
|
#define bad_list_length 3
|
||||||
@@ -78,6 +79,7 @@ extern BatteryInterface battery_obj;
|
|||||||
extern TemperatureInterface temp_obj;
|
extern TemperatureInterface temp_obj;
|
||||||
extern Settings settings_obj;
|
extern Settings settings_obj;
|
||||||
extern flipperLED flipper_led;
|
extern flipperLED flipper_led;
|
||||||
|
extern LedInterface led_obj;
|
||||||
|
|
||||||
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
|
esp_err_t esp_wifi_80211_tx(wifi_interface_t ifx, const void *buffer, int len, bool en_sys_seq);
|
||||||
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
|
//int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3);
|
||||||
|
|||||||
@@ -9,9 +9,10 @@
|
|||||||
//#define MARAUDER_V6
|
//#define MARAUDER_V6
|
||||||
//#define MARAUDER_KIT
|
//#define MARAUDER_KIT
|
||||||
//#define GENERIC_ESP32
|
//#define GENERIC_ESP32
|
||||||
#define MARAUDER_FLIPPER
|
//#define MARAUDER_FLIPPER
|
||||||
|
#define ESP32_LDDB
|
||||||
|
|
||||||
#define MARAUDER_VERSION "v0.9.18"
|
#define MARAUDER_VERSION "v0.9.19"
|
||||||
|
|
||||||
//// BUTTON DEFINITIONS
|
//// BUTTON DEFINITIONS
|
||||||
#ifdef MARAUDER_MINI
|
#ifdef MARAUDER_MINI
|
||||||
@@ -353,6 +354,10 @@
|
|||||||
#ifdef MARAUDER_FLIPPER
|
#ifdef MARAUDER_FLIPPER
|
||||||
#define SD_CS 10
|
#define SD_CS 10
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ESP32_LDDB
|
||||||
|
#define SD_CS 4
|
||||||
|
#endif
|
||||||
//// END SD DEFINITIONS
|
//// END SD DEFINITIONS
|
||||||
|
|
||||||
//// SCREEN STUFF
|
//// SCREEN STUFF
|
||||||
@@ -403,4 +408,12 @@
|
|||||||
#endif
|
#endif
|
||||||
//// END SCREEN STUFF
|
//// END SCREEN STUFF
|
||||||
|
|
||||||
|
//// NEOPIXEL STUFF
|
||||||
|
#ifdef ESP32_LDDB
|
||||||
|
#define PIN 17
|
||||||
|
#else
|
||||||
|
#define PIN 25
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -142,10 +142,6 @@ void setup()
|
|||||||
// Serial.println("Does not have screen");
|
// Serial.println("Does not have screen");
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
#ifdef MARAUDER_FLIPPER
|
|
||||||
flipper_led.RunSetup();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
display_obj.RunSetup();
|
display_obj.RunSetup();
|
||||||
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
display_obj.tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||||
@@ -191,6 +187,10 @@ void setup()
|
|||||||
|
|
||||||
settings_obj.begin();
|
settings_obj.begin();
|
||||||
|
|
||||||
|
#ifdef MARAUDER_FLIPPER
|
||||||
|
flipper_led.RunSetup();
|
||||||
|
#endif
|
||||||
|
|
||||||
//Serial.println("This is a test Channel: " + (String)settings_obj.loadSetting<uint8_t>("Channel"));
|
//Serial.println("This is a test Channel: " + (String)settings_obj.loadSetting<uint8_t>("Channel"));
|
||||||
//if (settings_obj.loadSetting<bool>( "Force PMKID"))
|
//if (settings_obj.loadSetting<bool>( "Force PMKID"))
|
||||||
// Serial.println("This is a test Force PMKID: true");
|
// Serial.println("This is a test Force PMKID: true");
|
||||||
@@ -314,6 +314,9 @@ void loop()
|
|||||||
#ifdef HAS_SCREEN
|
#ifdef HAS_SCREEN
|
||||||
menu_function_obj.main(currentTime);
|
menu_function_obj.main(currentTime);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MARAUDER_FLIPPER
|
||||||
|
led_obj.main(currentTime);
|
||||||
|
#endif
|
||||||
//cli_obj.main(currentTime);
|
//cli_obj.main(currentTime);
|
||||||
}
|
}
|
||||||
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
if (wifi_scan_obj.currentScanMode == OTA_UPDATE)
|
||||||
@@ -336,6 +339,9 @@ void loop()
|
|||||||
display_obj.main(wifi_scan_obj.currentScanMode);
|
display_obj.main(wifi_scan_obj.currentScanMode);
|
||||||
menu_function_obj.main(currentTime);
|
menu_function_obj.main(currentTime);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef MARAUDER_FLIPPER
|
||||||
|
led_obj.main(currentTime);
|
||||||
|
#endif
|
||||||
//cli_obj.main(currentTime);
|
//cli_obj.main(currentTime);
|
||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
esp32_marauder/esp32_marauder.ino.d32.bin
Normal file
BIN
esp32_marauder/esp32_marauder.ino.d32.bin
Normal file
Binary file not shown.
@@ -5,6 +5,9 @@ void flipperLED::RunSetup() {
|
|||||||
pinMode(G_PIN, OUTPUT);
|
pinMode(G_PIN, OUTPUT);
|
||||||
pinMode(R_PIN, OUTPUT);
|
pinMode(R_PIN, OUTPUT);
|
||||||
|
|
||||||
|
if (!settings_obj.loadSetting<bool>("EnableLED"))
|
||||||
|
return;
|
||||||
|
|
||||||
delay(50);
|
delay(50);
|
||||||
|
|
||||||
digitalWrite(B_PIN, LOW);
|
digitalWrite(B_PIN, LOW);
|
||||||
@@ -19,14 +22,20 @@ void flipperLED::RunSetup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void flipperLED::attackLED() {
|
void flipperLED::attackLED() {
|
||||||
|
if (!settings_obj.loadSetting<bool>("EnableLED"))
|
||||||
|
return;
|
||||||
|
|
||||||
digitalWrite(B_PIN, HIGH);
|
digitalWrite(B_PIN, HIGH);
|
||||||
digitalWrite(G_PIN, HIGH);
|
digitalWrite(G_PIN, HIGH);
|
||||||
digitalWrite(R_PIN, HIGH);
|
digitalWrite(R_PIN, HIGH);
|
||||||
delay(10);
|
delay(10);
|
||||||
digitalWrite(R_PIN, LOW);
|
digitalWrite(R_PIN, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
void flipperLED::sniffLED() {
|
void flipperLED::sniffLED() {
|
||||||
|
if (!settings_obj.loadSetting<bool>("EnableLED"))
|
||||||
|
return;
|
||||||
|
|
||||||
digitalWrite(B_PIN, HIGH);
|
digitalWrite(B_PIN, HIGH);
|
||||||
digitalWrite(G_PIN, HIGH);
|
digitalWrite(G_PIN, HIGH);
|
||||||
digitalWrite(R_PIN, HIGH);
|
digitalWrite(R_PIN, HIGH);
|
||||||
@@ -35,6 +44,9 @@ void flipperLED::sniffLED() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void flipperLED::offLED() {
|
void flipperLED::offLED() {
|
||||||
|
if (!settings_obj.loadSetting<bool>("EnableLED"))
|
||||||
|
return;
|
||||||
|
|
||||||
digitalWrite(B_PIN, HIGH);
|
digitalWrite(B_PIN, HIGH);
|
||||||
digitalWrite(G_PIN, HIGH);
|
digitalWrite(G_PIN, HIGH);
|
||||||
digitalWrite(R_PIN, HIGH);
|
digitalWrite(R_PIN, HIGH);
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
#ifndef flipperLED_h
|
#ifndef flipperLED_h
|
||||||
#define flipperLED_h
|
#define flipperLED_h
|
||||||
|
|
||||||
|
#include "configs.h"
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#define B_PIN 4
|
#define B_PIN 4
|
||||||
#define G_PIN 5
|
#define G_PIN 5
|
||||||
#define R_PIN 6
|
#define R_PIN 6
|
||||||
|
|
||||||
|
extern Settings settings_obj;
|
||||||
|
|
||||||
class flipperLED {
|
class flipperLED {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -282,6 +282,12 @@ bool Settings::createDefaultSettings(fs::FS &fs) {
|
|||||||
jsonBuffer["Settings"][2]["range"]["min"] = false;
|
jsonBuffer["Settings"][2]["range"]["min"] = false;
|
||||||
jsonBuffer["Settings"][2]["range"]["max"] = true;
|
jsonBuffer["Settings"][2]["range"]["max"] = true;
|
||||||
|
|
||||||
|
jsonBuffer["Settings"][3]["name"] = "EnableLED";
|
||||||
|
jsonBuffer["Settings"][3]["type"] = "bool";
|
||||||
|
jsonBuffer["Settings"][3]["value"] = true;
|
||||||
|
jsonBuffer["Settings"][3]["range"]["min"] = false;
|
||||||
|
jsonBuffer["Settings"][3]["range"]["max"] = true;
|
||||||
|
|
||||||
//jsonBuffer.printTo(settingsFile);
|
//jsonBuffer.printTo(settingsFile);
|
||||||
if (serializeJson(jsonBuffer, settingsFile) == 0) {
|
if (serializeJson(jsonBuffer, settingsFile) == 0) {
|
||||||
Serial.println(F("Failed to write to file"));
|
Serial.println(F("Failed to write to file"));
|
||||||
|
|||||||
Reference in New Issue
Block a user