Преглед на файлове

Merge flip_wifi from https://github.com/jblanked/FlipWiFi

Willy-JL преди 8 месеца
родител
ревизия
685884cb86
променени са 7 файла, в които са добавени 32 реда и са изтрити 19 реда
  1. 4 0
      flip_wifi/CHANGELOG.md
  2. 8 1
      flip_wifi/README.md
  3. 16 8
      flip_wifi/app.c
  4. 1 1
      flip_wifi/application.fam
  5. BIN
      flip_wifi/assets/01-home.png
  6. 2 8
      flip_wifi/callback/callback.c
  7. 1 1
      flip_wifi/flip_wifi.h

+ 4 - 0
flip_wifi/CHANGELOG.md

@@ -1,3 +1,7 @@
+## v1.5.2
+- Fixed a BusFault when leaving the AP Mode.
+- Increased the buffer size for sending HTML data.
+
 ## v1.5.1
 - Fixed a crash when setting an SSID in the Saved APs view.
 - Fixed auto-update functionality.

+ 8 - 1
flip_wifi/README.md

@@ -1,12 +1,19 @@
 FlipWiFi is the companion app for the popular FlipperHTTP flash, originally introduced in the https://github.com/jblanked/WebCrawler-FlipperZero/tree/main/assets/FlipperHTTP. It allows you to scan and save WiFi networks for use across all FlipperHTTP apps.
 
 ## Requirements
-- WiFi Developer Board, BW16, Raspberry Pi, or ESP32 Device flashed with FlipperHTTP v1.8.3 or higher: https://github.com/jblanked/FlipperHTTP
+- WiFi Developer Board, BW16, Raspberry Pi, or ESP32 Device flashed with FlipperHTTP v1.8.5 or higher: https://github.com/jblanked/FlipperHTTP
 - 2.4 GHz WiFi Access Point
 
+## Connect Online
+- Discord: https://discord.gg/5aN9qwkEc6
+- YouTube: https://www.youtube.com/@jblanked
+- Instagram: https://www.instagram.com/jblanked
+- Other: https://www.jblanked.com/social/
+
 ## Features
 
 - **Scan**: Discover nearby WiFi networks and add them to your list.
+- **AP Mode**: Create a captive portal with custom HTML and auto-input routing.
 - **Saved Access Points**: View your saved networks, manually add new ones, or configure the WiFi network to be used across all FlipperHTTP apps.
 
 ## Setup

+ 16 - 8
flip_wifi/app.c

@@ -16,6 +16,8 @@ int32_t flip_wifi_main(void *p)
         return -1;
     }
 
+    save_char("app_version", VERSION);
+
     // check if board is connected (Derek Jamison)
     FlipperHTTP *fhttp = flipper_http_alloc();
     if (!fhttp)
@@ -31,23 +33,29 @@ int32_t flip_wifi_main(void *p)
         return -1;
     }
 
+    furi_delay_ms(100);
+
     // Try to wait for pong response.
     uint32_t counter = 10;
     while (fhttp->state == INACTIVE && --counter > 0)
     {
         FURI_LOG_D(TAG, "Waiting for PONG");
-        furi_delay_ms(100); // this causes a BusFault
+        furi_delay_ms(100);
     }
 
-    if (counter == 0)
+    // last response should be PONG
+    if (!fhttp->last_response || strcmp(fhttp->last_response, "[PONG]") != 0)
+    {
         easy_flipper_dialog("FlipperHTTP Error", "Ensure your WiFi Developer\nBoard or Pico W is connected\nand the latest FlipperHTTP\nfirmware is installed.");
-
-    save_char("app_version", VERSION);
-
-    // for now use the catalog API until I implement caching on the server
-    if (update_is_ready(fhttp, true))
+        FURI_LOG_E(TAG, "Failed to receive PONG");
+    }
+    else
     {
-        easy_flipper_dialog("Update Status", "Complete.\nRestart your Flipper Zero.");
+        // for now use the catalog API until I implement caching on the server
+        if (update_is_ready(fhttp, true))
+        {
+            easy_flipper_dialog("Update Status", "Complete.\nRestart your Flipper Zero.");
+        }
     }
 
     flipper_http_free(fhttp);

+ 1 - 1
flip_wifi/application.fam

@@ -9,6 +9,6 @@ App(
     fap_icon_assets="assets",
     fap_author="JBlanked",
     fap_weburl="https://github.com/jblanked/FlipWiFi",
-    fap_version="1.5.1",
+    fap_version="1.5.2",
     fap_description="FlipperHTTP companion app.",
 )

BIN
flip_wifi/assets/01-home.png


+ 2 - 8
flip_wifi/callback/callback.c

@@ -13,12 +13,6 @@ uint32_t callback_submenu_ap(void *context)
 {
     FlipWiFiApp *app = (FlipWiFiApp *)context;
     furi_check(app);
-    if (app->timer)
-    {
-        furi_timer_stop(app->timer);
-        furi_timer_free(app->timer);
-        app->timer = NULL;
-    }
     back_from_ap = true;
     return FlipWiFiViewSubmenu;
 }
@@ -214,7 +208,7 @@ bool callback_view_input_callback_saved(InputEvent *event, void *context)
             furi_delay_ms(100);
         }
 
-                // check success (if [SUCCESS] is in the response)
+        // check success (if [SUCCESS] is in the response)
         if (strstr(fhttp->last_response, "[SUCCESS]") == NULL)
         {
             char response[256];
@@ -357,7 +351,7 @@ static bool callback_run_ap_mode(void *context)
         size_t offset = 0;
         while (offset < send_buffer_size)
         {
-            size_t chunk_size = send_buffer_size - offset > 64 ? 64 : send_buffer_size - offset;
+            size_t chunk_size = send_buffer_size - offset > 512 ? 512 : send_buffer_size - offset;
             furi_hal_serial_tx(app->fhttp->serial_handle, (const uint8_t *)(send_buffer + offset), chunk_size);
             offset += chunk_size;
             furi_delay_ms(50); // cant go faster than this, no matter the chunk size

+ 1 - 1
flip_wifi/flip_wifi.h

@@ -6,7 +6,7 @@
 #include <storage/storage.h>
 
 #define TAG "FlipWiFi"
-#define VERSION "1.5.1"
+#define VERSION "1.5.2"
 #define VERSION_TAG TAG " " VERSION
 #define MAX_SCAN_NETWORKS 100
 #define MAX_SAVED_NETWORKS 25