Skip to content

Conversation

@JakubAndrysek
Copy link

This pull request introduces a new HTTP client feature for the ESP32 project, along with several supporting changes to enhance functionality and usability. The primary focus is on enabling HTTP operations (GET, POST, PUT, DELETE) with WiFi integration, and providing a demonstration script for testing the new feature.

Needs additional testing and review.

Below are the most important changes grouped by theme:

New HTTP Client Feature:

  • Added a new HttpClientFeature class in main/espFeatures/httpClientFeature.h to support asynchronous HTTP requests with methods for GET, POST, PUT, and DELETE. This feature integrates with FreeRTOS and the ESP-IDF HTTP client library.
  • Integrated the HttpClientFeature into the main application by updating main.cpp to include the feature in the machine composition and import its header file. [1] [2]

WiFi Enhancements:

  • Added a waitForIp method to EspWifiController in main/platform/espWifi.cpp and main/platform/espWifi.h, allowing the application to block until the device obtains an IP address, with an optional timeout. [1] [2]
  • Exposed the waitForIp method to JavaScript in the WifiFeature module, enabling scripts to wait for a WiFi connection before proceeding with network operations.

Demonstration and Testing:

  • Created a new TypeScript example script ts-examples/src/httpClientDemo.ts to showcase the HTTP client functionality. The script demonstrates all HTTP methods, error handling, and continuous testing.

Configuration and Build Updates:

  • Updated the CMake minimum required version in main/resources/CMakeLists.txt from 3.0 to 3.10 to ensure compatibility with new features.
  • Commented out the fatfs_create_spiflash_image line in the root CMakeLists.txt to disable SPIFFS image generation for this build.

Dependency and Workflow Adjustments:

  • Added esp_http_client as a required component in main/CMakeLists.txt to support the new HTTP client feature.
  • Updated the GitHub Actions workflow in .github/workflows/esp-idf.yaml to trigger on all branches instead of just the master branch.

…on; update example to demonstrate POST usage
…nd add waitForIp method; update example usage
…ve demo; update import paths and enhance error handling
…ches; remove unused httpClientFeature header; enhance httpClient demo with async examples and improved error handling
@cubicap cubicap force-pushed the master branch 3 times, most recently from 882f36c to e2cd344 Compare July 2, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant