Implement async HTTP client feature #11
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
HttpClientFeatureclass inmain/espFeatures/httpClientFeature.hto support asynchronous HTTP requests with methods for GET, POST, PUT, and DELETE. This feature integrates with FreeRTOS and the ESP-IDF HTTP client library.HttpClientFeatureinto the main application by updatingmain.cppto include the feature in the machine composition and import its header file. [1] [2]WiFi Enhancements:
waitForIpmethod toEspWifiControllerinmain/platform/espWifi.cppandmain/platform/espWifi.h, allowing the application to block until the device obtains an IP address, with an optional timeout. [1] [2]waitForIpmethod to JavaScript in theWifiFeaturemodule, enabling scripts to wait for a WiFi connection before proceeding with network operations.Demonstration and Testing:
ts-examples/src/httpClientDemo.tsto showcase the HTTP client functionality. The script demonstrates all HTTP methods, error handling, and continuous testing.Configuration and Build Updates:
main/resources/CMakeLists.txtfrom 3.0 to 3.10 to ensure compatibility with new features.fatfs_create_spiflash_imageline in the rootCMakeLists.txtto disable SPIFFS image generation for this build.Dependency and Workflow Adjustments:
esp_http_clientas a required component inmain/CMakeLists.txtto support the new HTTP client feature..github/workflows/esp-idf.yamlto trigger on all branches instead of just themasterbranch.