From 65bb0de970e0913c1f9d555f725aad1fd68da97c Mon Sep 17 00:00:00 2001 From: Spooks <62370103+Spooks4576@users.noreply.github.com> Date: Wed, 7 Aug 2024 23:34:07 -0600 Subject: [PATCH] flipper app completed and Serial FS Support Finished --- scripts/ScriptConverter_Switch.py | 72 ------------------ scripts/ghost_esp.fap | Bin 0 -> 20804 bytes scripts/start_debug.bat | 7 -- src/components/gps_module/gps_module.cpp | 44 +++++++---- src/components/gps_module/gps_module.h | 1 + .../sdcard_module/sd_card_module.cpp | 22 +----- src/core/system_manager.h | 2 +- 7 files changed, 32 insertions(+), 116 deletions(-) delete mode 100644 scripts/ScriptConverter_Switch.py create mode 100644 scripts/ghost_esp.fap delete mode 100644 scripts/start_debug.bat diff --git a/scripts/ScriptConverter_Switch.py b/scripts/ScriptConverter_Switch.py deleted file mode 100644 index 6d39f7e8..00000000 --- a/scripts/ScriptConverter_Switch.py +++ /dev/null @@ -1,72 +0,0 @@ -import pygame -import json -import time - -pygame.init() -pygame.joystick.init() - -if pygame.joystick.get_count() > 0: - joystick = pygame.joystick.Joystick(0) - joystick.init() -else: - print("No joystick detected.") - exit() - -joystick_mapping = { - 0: "BUTTON_A", - 1: "BUTTON_B", - 2: "BUTTON_X", - 3: "BUTTON_Y", - 4: "BUTTON_LBUMPER", - 5: "BUTTON_RBUMPER", - # Assuming D-pad is represented as buttons: - 11: "DPAD_UP", - 12: "DPAD_DOWN", - 13: "DPAD_LEFT", - 14: "DPAD_RIGHT", - # Additional mappings as needed -} - - -current_pressed_buttons = set() - -action_sequence = [] -last_time = time.time() - - -time_threshold = 100 - -try: - while True: - events = pygame.event.get() - for event in events: - if event.type in [pygame.JOYBUTTONDOWN, pygame.JOYBUTTONUP]: - button = joystick_mapping.get(event.button) - if button: - if event.type == pygame.JOYBUTTONDOWN: - current_pressed_buttons.add(button) - else: - current_pressed_buttons.discard(button) - - - if events: - current_time = time.time() - delay = int((current_time - last_time) * 1000) - - - if delay < time_threshold and current_pressed_buttons: - action = { - "type": "nsw", - "buttons": list(current_pressed_buttons), - "action": "press", - "delay": delay - } - action_sequence.append(action) - print(f"Detected: {action}") - - last_time = current_time - -except KeyboardInterrupt: - with open('action_sequence.json', 'w') as file: - json.dump({"sequence": action_sequence}, file, indent=4) - print("\nAction sequence saved to 'action_sequence.json'.") \ No newline at end of file diff --git a/scripts/ghost_esp.fap b/scripts/ghost_esp.fap new file mode 100644 index 0000000000000000000000000000000000000000..966aec7246fb3eea74cc43c26894e5062b78a6bf GIT binary patch literal 20804 zcmbVU4PaEowLbUmCfOt#5+G`{QEz_GU;x8kjh1TuxJz6DseuRn?k>rOyO3np-3lp6H+L_**S>dk z_M9_k=FH5QGiT=BIpGWQ7wU?lQ1Vfzf|#10Y38&o7BFLu02Sn>Tq@X+>2>O4^m(Yv zu|_G;42O63;ewhX4?S(xB9xgR%Q!-+v3jU3q?(jW#mg4is1-ddES<~f>$7Cwj;3ZoXkq+>#j@htW#c5X4OGj zMoJo$?K$F{{lVyXU#1^P)Mw~#C0^=v8PgWI^*tUc$@)*t81$@Or&JE<-q)86X$ErT zXa+sXh1L4*!--qf$~gxr*EuTZ4m&F|hSkdB2hR0sdY|Y0Q7+FT`+D8^uis`Am8u^( zmi~IEa((MA%}`1PJ(cUJ@{I$J8dP~`IAk1#t`3eW7v_7j)*MVYd;2_jUOHN%)IioB zAxkOQ=h-{zto%7zo4hLvZM-z9RK74u7d~kjM^Z0IIQ_`j;t9rEiHA4bHkhwFF|Ol} zUvpk@iSm)7?74HEJMM8fwrF~bx6hL>uEOuWT~~SEO8DZ=)pyAO}u^ID={b6wNW{M@G(kEywf z$1-x25-M3dHZ6x`7MES4JMQ0~pngps@NipuJWLgry_KK`9rs^@wuU{9ZH{BkoZMp$ zhwsBXKRj2b8M6=UIz~#-(`JoI@8|T3FlPrLW!O_x_M{Q3A6|YTM$u4uf%g{O?D4Ln znW-A37+Yj>GsfY#-=XIoD_1jSYWhCUxn7aC{oJ`nA6Gu@*mD1#X@EAvCU8@^>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r>T^DB`Y^*`4lba5!)!rA-GV~N1&siIogr?!I5X&Z@#N$8bM{G9!38cLJx?C z6#0Bt&HM%l5qT!cAxu)_BPvdm=R0Y&Ld2bs`XS`HK|{Wi;ZewC2ssF$6Xg+LDQHAl z3W!ik0TFL0pe7;TW%E361SZ!<92==`VSX5H!~8IO67$3G4$Ke3yI?O2kHcOV?lAAH z)yLQJEudj!Oh`YRH5{S+O5NIH*|Ph-MXX5FAJ9AK}*|jQ}}B%VED@_-FVJna_9RJPriPAu<*1%Y4Lr zigk`CWzinrm9zgvgshN{Fj)Z+2PpK1fJ!mn2(lw}KgLr4xD)aij>4Zagr7xp9jW;1 zPre&h9SX{096#!zIuY!#lCBGJFtvVz>-?V)!=J5yMTeXNLE| zP8p(KeGD-k1pJBq^)vi6_9KS(V0|g05io}cN%Wr~`vW{YUTmiV!d(i8@NNk=OSo0SJ_#R?uwTN5B^;3OF$o7Hd_uyV5^3Ez?Mu!QePI40o<39%(3`W)+k;kRHn41WSUXNbo6u1NhQ))7N= zp6@1A3~q$sa}Y8kwyrZCSOFNvAKNiBl305n(iy~u*cmJFUArx~qI+dWsB1ONXvZHf z&A7kRoBVs<*fHbNnV|;+_$D+-%K(sJkH{=CZDkjaGryI#L<9yk+|Igq~y4O eil-S0{cdiO8t)UTit#5o1&fJVk_2F~3;zx6-C-R7 literal 0 HcmV?d00001 diff --git a/scripts/start_debug.bat b/scripts/start_debug.bat deleted file mode 100644 index 7fa746df..00000000 --- a/scripts/start_debug.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -set MSYS2_PATH=C:\msys64 -set QEMU_PATH=%MSYS2_PATH%\mingw64\bin -set FIRMWARE_FILE=%~dp0.pio\build\esp32dev\firmware.bin - -set PATH=%QEMU_PATH%;%PATH% -bash -c "qemu-system-xtensa -nographic -machine esp32 -m 4M -drive file=%FIRMWARE_FILE%,if=mtd,format=raw -gdb tcp::1234 -S" \ No newline at end of file diff --git a/src/components/gps_module/gps_module.cpp b/src/components/gps_module/gps_module.cpp index 7fc031a0..877e5e11 100644 --- a/src/components/gps_module/gps_module.cpp +++ b/src/components/gps_module/gps_module.cpp @@ -108,8 +108,15 @@ void gps_module::WarDrivingLoop() #ifdef HAS_GPS if (gps.location.isValid() && gps.location.isUpdated()) { - String streetName = findClosestStreet(gps.location.lat(), gps.location.lng()); - Serial.println(streetName); + + String streetName = ""; + + if (SystemManager::getInstance().sdCardModule.Initlized) + { + streetName = findClosestStreet(gps.location.lat(), gps.location.lng()); + } + + int Networks = WiFi.scanNetworks(); for (int i = 0; i < Networks; i++) @@ -122,11 +129,24 @@ void gps_module::WarDrivingLoop() String Message = G_Utils::formatString("%s, %s, %s, %s, %i, %i, %f, %f, %f, %f", BSSID.c_str(), SSID.c_str(), SecurityType.c_str(), GetDateAndTime().c_str(), Channel, RSSI, gps.location.lat(), gps.location.lng(), gps.altitude.meters(), 2.5 * gps.hdop.hdop() / 10); String MessageWithStreet = G_Utils::formatString("%s, %s, %s, %s, %i, %i, %f, %f, %f, %f, %s", BSSID.c_str(), SSID.c_str(), SecurityType.c_str(), GetDateAndTime().c_str(), Channel, RSSI, gps.location.lat(), gps.location.lng(), gps.altitude.meters(), 2.5 * gps.hdop.hdop() / 10, streetName.c_str()); - LOG_RESULTS("wardiving.csv", "gps", Message); - LOG_RESULTS("wardiving_withstreets.csv", "gps", MessageWithStreet); - Serial.println("Logged Info At " + streetName); + + LOG_RESULTS("wardiving.csv", "gps", Message.c_str()); + if (SystemManager::getInstance().sdCardModule.Initlized) + { + LOG_RESULTS("wardiving_withstreets.csv", "gps", MessageWithStreet.c_str()); + } + + if (SystemManager::getInstance().sdCardModule.Initlized) + { + Serial.println("Logged Info At " + streetName); + } + else + { + Serial.println("Logged WiFi " + SSID); + } } - uint8_t set_channel = random(1, 13); + CurrentChannel = CurrentChannel + 1 % 13; + uint8_t set_channel = CurrentChannel; esp_wifi_set_channel(set_channel, WIFI_SECOND_CHAN_NONE); } else { Serial.println("GPS signal not found"); @@ -167,7 +187,7 @@ void gps_module::streetloop() Serial.print("Altitude: "); Serial.println(gps.altitude.kilometers()); Serial.print("Speed: "); Serial.println(gps.speed.kmph()); Serial.println(streetName); - LOG_RESULTS("streets.txt", "gps", "Visited " + streetName); + LOG_RESULTS("streets.txt", "gps", String(streetName + " Visited").c_str()); } else { Serial.println("GPS signal not found"); } @@ -180,8 +200,7 @@ void gps_module::streetloop() void gps_module::setup(bool EnableBLEScans) { - if (SystemManager::getInstance().sdCardModule.Initlized) - { + #ifdef HAS_GPS Serial1.begin(9600, SERIAL_8N1, GPS_TX, GPS_RX); #endif @@ -192,11 +211,4 @@ void gps_module::setup(bool EnableBLEScans) SystemManager::getInstance().bleModule->InitWarDriveCallback(); #endif Serial.println("Initilized GPS Serial"); - } - else - { - Initilized = false; - Stop = true; - Serial.println("Failed to Initilize GPS Serial Possible SD Card Init Failure"); - } } \ No newline at end of file diff --git a/src/components/gps_module/gps_module.h b/src/components/gps_module/gps_module.h index f7299acf..d377e196 100644 --- a/src/components/gps_module/gps_module.h +++ b/src/components/gps_module/gps_module.h @@ -16,6 +16,7 @@ class gps_module #endif File MapData; bool Initilized; + uint8_t CurrentChannel; bool Stop; unsigned long lastUpdate = 0; long updateInterval = 1000; diff --git a/src/components/sdcard_module/sd_card_module.cpp b/src/components/sdcard_module/sd_card_module.cpp index 561a4f1e..6246ff5c 100644 --- a/src/components/sdcard_module/sd_card_module.cpp +++ b/src/components/sdcard_module/sd_card_module.cpp @@ -14,28 +14,10 @@ bool SDCardModule::init() { Initlized = SD_MMC.begin(); IsMMCCard = true; CardType = ECardType::MMC; +#else +CardType = ECardType::Serial; #endif - // if (!Initlized) - // { - // Serial.print("HELLO"); - - // unsigned long startTime = millis(); - // unsigned long timeout = 5000; - - // while (millis() - startTime < timeout) - // { - // String data = Serial.readString(); - // if (data.indexOf("RECIEVED") != -1) { - // Serial.println("Message received successfully."); - // Initlized = true; - // CardType = ECardType::Serial; - // break; - // } - // } - // } - - if (!Initlized) { Serial.println("SD Card initialization failed!"); return false; diff --git a/src/core/system_manager.h b/src/core/system_manager.h index cbf99fd8..a828a384 100644 --- a/src/core/system_manager.h +++ b/src/core/system_manager.h @@ -134,7 +134,7 @@ neopixelModule->breatheLED(SystemManager::getInstance().neopixelModule->strip.Co #define LOG_RESULTS(filename, folder, message) SystemManager::getInstance().sdCardModule.logMessage(filename, folder, message) #else #define LOG_MESSAGE_TO_SD(message) // Not Supported do nothing -#define LOG_RESULTS(filename, folder, message) +#define LOG_RESULTS(filename, folder, message) SystemManager::getInstance().sdCardModule.logPacket((const uint8_t*)message, strlen(message)) #endif namespace G_Utils