diff --git a/esp32_marauder/EvilPortal.cpp b/esp32_marauder/EvilPortal.cpp index 44fa7af68..b17d0afaf 100644 --- a/esp32_marauder/EvilPortal.cpp +++ b/esp32_marauder/EvilPortal.cpp @@ -234,10 +234,13 @@ bool EvilPortal::setAP(LinkedList* ssids, LinkedList* access_ } void EvilPortal::startAP() { + const IPAddress AP_IP(172, 0, 0, 1); + Serial.print("starting ap "); Serial.println(apName); WiFi.mode(WIFI_AP); + WiFi.softAPConfig(AP_IP, AP_IP, IPAddress(255, 255, 255, 0)); WiFi.softAP(apName); #ifdef HAS_SCREEN diff --git a/esp32_marauder/GpsInterface.cpp b/esp32_marauder/GpsInterface.cpp index f10cfc639..24c5c04a0 100644 --- a/esp32_marauder/GpsInterface.cpp +++ b/esp32_marauder/GpsInterface.cpp @@ -12,7 +12,7 @@ HardwareSerial Serial2(GPS_SERIAL_INDEX); void GpsInterface::begin() { - #ifdef MARAUDER_MINI + /*#ifdef MARAUDER_MINI pinMode(26, OUTPUT); delay(1); @@ -22,7 +22,7 @@ void GpsInterface::begin() { Serial.println("Activated GPS"); delay(100); - #endif + #endif*/ Serial2.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX); @@ -34,11 +34,22 @@ void GpsInterface::begin() { delay(3900); + MicroNMEA::sendSentence(Serial2, "$PSTMFORCESTANDBY,00006"); + + delay(100); + if (Serial2.available()) { Serial.println("GPS Attached Successfully"); this->gps_enabled = true; - while (Serial2.available()) - Serial2.read(); + while (Serial2.available()) { + //Fetch the character one by one + char c = Serial2.read(); + //Serial.print(c); + //Pass the character to the library + Serial.print(c); + nmea.process(c); + } + Serial.println(nmea.getSentence()); } else { this->gps_enabled = false; diff --git a/esp32_marauder/MenuFunctions.cpp b/esp32_marauder/MenuFunctions.cpp index c3ffe2b74..b066c5ba0 100644 --- a/esp32_marauder/MenuFunctions.cpp +++ b/esp32_marauder/MenuFunctions.cpp @@ -1242,6 +1242,9 @@ void MenuFunctions::RunSetup() // WiFi HTML menu stuff htmlMenu.list = new LinkedList(); + #ifdef MARAUDER_MINI + miniKbMenu.list = new LinkedList(); + #endif // Bluetooth menu stuff bluetoothSnifferMenu.list = new LinkedList(); @@ -1277,6 +1280,9 @@ void MenuFunctions::RunSetup() gpsInfoMenu.name = "GPS Data"; #endif htmlMenu.name = "EP HTML List"; + #ifdef MARAUDER_MINI + miniKbMenu.name = "Mini Keyboard"; + #endif // Build Main Menu mainMenu.parentMenu = NULL; @@ -1457,6 +1463,12 @@ void MenuFunctions::RunSetup() addSSIDGFX(); }); #endif + #ifdef MARAUDER_MINI + this->addNodes(&wifiGeneralMenu, text_table1[1], TFT_NAVY, NULL, KEYBOARD_ICO, [this](){ + this->changeMenu(&miniKbMenu); + this->miniKeyboard(&miniKbMenu); + }); + #endif this->addNodes(&wifiGeneralMenu, text_table1[28], TFT_SILVER, NULL, CLEAR_ICO, [this]() { this->changeMenu(&clearSSIDsMenu); wifi_scan_obj.RunClearSSIDs(); @@ -1489,7 +1501,7 @@ void MenuFunctions::RunSetup() wifi_scan_obj.StartScan(LV_ADD_SSID, TFT_RED); selectEPHTMLGFX(); }); - #else + #else // Mini EP HTML select this->addNodes(&wifiGeneralMenu, "Select EP HTML File", TFT_CYAN, NULL, KEYBOARD_ICO, [this](){ this->changeMenu(&htmlMenu); #ifdef HAS_BUTTONS @@ -1501,7 +1513,6 @@ void MenuFunctions::RunSetup() else evil_portal_obj.selected_html_index = evil_portal_obj.html_files->size() - 1; - //Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index)); this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFT_CYAN, 0, NULL, true, NULL}); this->buildButtons(&htmlMenu); this->displayCurrentMenu(); @@ -1513,7 +1524,6 @@ void MenuFunctions::RunSetup() else evil_portal_obj.selected_html_index = 0; - //Serial.println("Setting button text as " + evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index)); this->htmlMenu.list->set(0, MenuNode{evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index), false, TFT_CYAN, 0, NULL, true, NULL}); this->buildButtons(&htmlMenu, 0, evil_portal_obj.html_files->get(evil_portal_obj.selected_html_index)); this->displayCurrentMenu(); @@ -1533,6 +1543,11 @@ void MenuFunctions::RunSetup() #endif }); + miniKbMenu.parentMenu = &wifiGeneralMenu; + this->addNodes(&miniKbMenu, "a", TFT_CYAN, NULL, 0, [this]() { + this->changeMenu(miniKbMenu.parentMenu); + }); + htmlMenu.parentMenu = &wifiGeneralMenu; this->addNodes(&htmlMenu, text09, TFT_LIGHTGREY, NULL, 0, [this]() { this->changeMenu(htmlMenu.parentMenu); @@ -1797,6 +1812,124 @@ void MenuFunctions::RunSetup() this->initTime = millis(); } +#ifdef MARAUDER_MINI + void MenuFunctions::miniKeyboard(Menu * targetMenu) { + // Prepare a char array and reset temp SSID string + extern LinkedList* ssids; + + bool pressed = true; + + wifi_scan_obj.current_mini_kb_ssid = ""; + + if (c_btn.isHeld()) { + while (!c_btn.justReleased()) + delay(1); + } + + int str_len = wifi_scan_obj.alfa.length() + 1; + + char char_array[str_len]; + + wifi_scan_obj.alfa.toCharArray(char_array, str_len); + + // Button loop until hold center button + #ifdef HAS_BUTTONS + #if !(defined(MARAUDER_V6) || defined(MARAUDER_V6_1)) + while(true) { + #ifndef MARAUDER_M5STICKC + // Cycle char previous + if (l_btn.justPressed()) { + pressed = true; + if (this->mini_kb_index > 0) + this->mini_kb_index--; + else + this->mini_kb_index = str_len - 2; + + targetMenu->list->set(0, MenuNode{String(char_array[this->mini_kb_index]).c_str(), false, TFT_CYAN, 0, NULL, true, NULL}); + this->buildButtons(targetMenu); + //this->displayCurrentMenu(); + + } + + // Add character + if (d_btn.justPressed()) { + pressed = true; + wifi_scan_obj.current_mini_kb_ssid.concat(String(char_array[this->mini_kb_index]).c_str()); + while (!d_btn.justReleased()) + delay(1); + } + + // Remove character + if (u_btn.justPressed()) { + pressed = true; + wifi_scan_obj.current_mini_kb_ssid.remove(wifi_scan_obj.current_mini_kb_ssid.length() - 1); + while (!u_btn.justReleased()) + delay(1); + } + #endif + + // Cycle char next + if (r_btn.justPressed()) { + pressed = true; + if (this->mini_kb_index < str_len - 2) + this->mini_kb_index++; + else + this->mini_kb_index = 0; + + targetMenu->list->set(0, MenuNode{String(char_array[this->mini_kb_index]).c_str(), false, TFT_CYAN, 0, NULL, true, NULL}); + this->buildButtons(targetMenu, 0, String(char_array[this->mini_kb_index]).c_str()); + //this->displayCurrentMenu(); + } + + // Add SSID + if (c_btn.justPressed()) { + while (!c_btn.justReleased()) { + c_btn.justPressed(); // Need to continue updating button hold status. My shitty library. + + // Exit + if (c_btn.isHeld()) { + this->changeMenu(targetMenu->parentMenu); + return; + } + delay(1); + } + // If we have a string, add it to list of SSIDs + if (wifi_scan_obj.current_mini_kb_ssid != "") { + pressed = true; + ssid s = {wifi_scan_obj.current_mini_kb_ssid, random(1, 12), {random(256), random(256), random(256), random(256), random(256), random(256)}, false}; + ssids->unshift(s); + wifi_scan_obj.current_mini_kb_ssid = ""; + } + } + + // Display info on screen + if (pressed) { + this->displayCurrentMenu(); + display_obj.tft.setTextWrap(false); + display_obj.tft.fillRect(0, SCREEN_HEIGHT / 3, SCREEN_WIDTH, STATUS_BAR_WIDTH, TFT_BLACK); + display_obj.tft.fillRect(0, SCREEN_HEIGHT / 3 + TEXT_HEIGHT * 2, SCREEN_WIDTH, STATUS_BAR_WIDTH, TFT_BLACK); + display_obj.tft.setCursor(0, SCREEN_HEIGHT / 3); + display_obj.tft.setTextColor(TFT_CYAN, TFT_BLACK); + display_obj.tft.println(wifi_scan_obj.current_mini_kb_ssid + "\n"); + display_obj.tft.setTextColor(TFT_GREEN, TFT_BLACK); + + display_obj.tft.println(ssids->get(0).essid); + + display_obj.tft.setTextColor(TFT_ORANGE, TFT_BLACK); + display_obj.tft.println("U - Remove Char"); + display_obj.tft.println("D - Add Char"); + display_obj.tft.println("L - Previous Char"); + display_obj.tft.println("R - Next Char"); + display_obj.tft.println("C - Save"); + display_obj.tft.println("C(Hold) - Exit"); + pressed = false; + } + } + #endif + #endif + } +#endif + // Function to change menu void MenuFunctions::changeMenu(Menu * menu) { diff --git a/esp32_marauder/MenuFunctions.h b/esp32_marauder/MenuFunctions.h index 50291bbb4..84ee4d4f6 100644 --- a/esp32_marauder/MenuFunctions.h +++ b/esp32_marauder/MenuFunctions.h @@ -121,6 +121,7 @@ class MenuFunctions uint32_t initTime = 0; uint8_t menu_start_index = 0; + uint8_t mini_kb_index = 0; // Main menu stuff Menu mainMenu; @@ -148,6 +149,7 @@ class MenuFunctions // WiFi General Menu Menu htmlMenu; + Menu miniKbMenu; // Bluetooth menu stuff Menu bluetoothSnifferMenu; @@ -171,6 +173,9 @@ class MenuFunctions void displaySetting(String key, Menu* menu, int index); void buttonSelected(uint8_t b, int8_t x = -1); void buttonNotSelected(uint8_t b, int8_t x = -1); + #ifdef MARAUDER_MINI + void miniKeyboard(Menu * targetMenu); + #endif uint8_t updateTouch(uint16_t *x, uint16_t *y, uint16_t threshold = 600); diff --git a/esp32_marauder/WiFiScan.h b/esp32_marauder/WiFiScan.h index 4abed74f8..a43c29b7c 100644 --- a/esp32_marauder/WiFiScan.h +++ b/esp32_marauder/WiFiScan.h @@ -196,7 +196,6 @@ class WiFiScan //String connected_network = ""; //const String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_"; - const String alfa = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789-=[];',./`\\_+{}:\"<>?~|!@#$%^&*()"; const char* rick_roll[8] = { "01 Never gonna give you up", @@ -356,6 +355,9 @@ class WiFiScan String dst_mac = "ff:ff:ff:ff:ff:ff"; byte src_mac[6] = {}; + String current_mini_kb_ssid = ""; + + const String alfa = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789-=[];',./`\\_+{}:\"<>?~|!@#$%^&*()"; wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); wifi_config_t ap_config; diff --git a/esp32_marauder/configs.h b/esp32_marauder/configs.h index 3e7eee4b3..63c6cbb7f 100644 --- a/esp32_marauder/configs.h +++ b/esp32_marauder/configs.h @@ -8,9 +8,9 @@ //// BOARD TARGETS //#define MARAUDER_M5STICKC - //#define MARAUDER_MINI + #define MARAUDER_MINI //#define MARAUDER_V4 - #define MARAUDER_V6 + //#define MARAUDER_V6 //#define MARAUDER_V6_1 //#define MARAUDER_KIT //#define GENERIC_ESP32 @@ -20,7 +20,7 @@ //#define XIAO_ESP32_S3 //// END BOARD TARGETS - #define MARAUDER_VERSION "v0.13.7" + #define MARAUDER_VERSION "v0.13.8" //// HARDWARE NAMES #ifdef MARAUDER_M5STICKC diff --git a/mechanical/Marauder-Mini/MarauderMini-Bottom v11.stl b/mechanical/Marauder-Mini/MarauderMini-Bottom v11.stl new file mode 100644 index 000000000..c98d22516 Binary files /dev/null and b/mechanical/Marauder-Mini/MarauderMini-Bottom v11.stl differ diff --git a/mechanical/Marauder-Mini/MarauderMini-Bottom v12 (SMA).stl b/mechanical/Marauder-Mini/MarauderMini-Bottom v12 (SMA).stl new file mode 100644 index 000000000..6b8167adc Binary files /dev/null and b/mechanical/Marauder-Mini/MarauderMini-Bottom v12 (SMA).stl differ diff --git a/mechanical/Marauder-Mini/MarauderMini-Bottom v8.stl b/mechanical/Marauder-Mini/MarauderMini-Bottom v8.stl deleted file mode 100644 index 33d4ce72c..000000000 Binary files a/mechanical/Marauder-Mini/MarauderMini-Bottom v8.stl and /dev/null differ