Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkEvents allow stack size to be changed. #10805

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thekurtovic
Copy link

@thekurtovic thekurtovic commented Jan 4, 2025

Description of Change

Replaced hardcoded stack size value for "arduino_events" task. Defaults to the original value. Application may override the value with a build flag i.e. -D ARDUINO_NETWORK_EVENT_TASK_STACK_SIZE=8192

Tests scenarios

N/A

Related links

N/A

@CLAassistant
Copy link

CLAassistant commented Jan 4, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

github-actions bot commented Jan 4, 2025

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello thekurtovic, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against b92e338

@thekurtovic thekurtovic force-pushed the arduino-events-stack branch from d6c61cf to b92e338 Compare January 4, 2025 15:50
@vortigont
Copy link
Contributor

I'm wondering if we'd better reuse default event loop's task for this also?

@me-no-dev
Copy link
Member

@vortigont not sure I understand what you mean?

@me-no-dev me-no-dev added the Status: Review needed Issue or PR is awaiting review label Jan 6, 2025
@vortigont
Copy link
Contributor

Hi @me-no-dev,
what I wanted to highlight is that currently NetworkEvents implementation uses it's own RTOS queue and task to generate/propagate and run callbacks for Network events. While IDF has exactly same thing implemented and used for similar network/Bluetooth event handling via Event Loop Library. An example from IDF. Under the hood it has same set of objects - a queue and a handling task, the default instance is created here. As soon as WiFi or BT code is used in the project this default event loop is started anyway.
So maybe reusing this queue could a feasible approach - at least we could save resources for same and reuse the IDF's event API.

I can reimplement NetworkEvents class over event loop's API if there is an interest in this.

Copy link
Contributor

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32P4💚 -85K0💚 -8.480.00💚 -16⚠️ +64💚 -0.06⚠️ +0.25
ESP32S3💚 -4K0💚 -0.420.000⚠️ +400.00⚠️ +0.09
ESP32S2💚 -4K0💚 -0.430.00💚 -24⚠️ +16💚 -0.06⚠️ +0.08
ESP32C3💚 -86K0💚 -6.730.00💚 -24⚠️ +4💚 -0.06⚠️ +0.02
ESP32C6💚 -83K0💚 -6.440.00💚 -24‼️ +22K💚 -0.06‼️ +122.03
ESP32H2💚 -28K0💚 -5.210.000‼️ +22K0.00‼️ +121.25
ESP32💚 -4K0💚 -0.370.00💚 -320💚 -0.070.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
Ethernet/examples/ETH_TLK110💚 -16K0----------💚 -1440
Ethernet/examples/ETH_W5500_Arduino_SPI💚 -17K0💚 -308⚠️ +16💚 -2720💚 -16K⚠️ +4💚 -13K‼️ +22K💚 -13K‼️ +22K💚 -1440
Ethernet/examples/ETH_W5500_IDF_SPI💚 -17K0💚 -308⚠️ +16💚 -2600💚 -16K⚠️ +4💚 -13K‼️ +22K💚 -13K‼️ +22K💚 -1440
Ethernet/examples/ETH_WIFI_BRIDGE💚 -17K0💚 -408⚠️ +16💚 -2560💚 -19K0💚 -18K0--💚 -64💚 -24
NetworkClientSecure/examples/WiFiClientInsecure💚 -19K0💚 -400⚠️ +32💚 -2520💚 -22K0💚 -17K‼️ +22K--💚 -84💚 -24
NetworkClientSecure/examples/WiFiClientPSK💚 -19K0💚 -340⚠️ +32💚 -2640💚 -22K0💚 -17K‼️ +22K--💚 -80💚 -24
NetworkClientSecure/examples/WiFiClientSecure💚 -19K0💚 -404⚠️ +32💚 -2640💚 -22K0💚 -17K‼️ +22K--💚 -64💚 -24
NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade💚 -19K0💚 -372⚠️ +32💚 -2440💚 -22K0💚 -18K‼️ +22K--💚 -56💚 -24
NetworkClientSecure/examples/WiFiClientShowPeerCredentials💚 -22K0💚 -324⚠️ +16💚 -156💚 -16💚 -25K0💚 -20K‼️ +22K--💚 -68💚 -16
NetworkClientSecure/examples/WiFiClientTrustOnFirstUse💚 -22K0💚 -300⚠️ +32💚 -196💚 -16💚 -22K0💚 -18K‼️ +22K--💚 -88💚 -32
PPP/examples/PPP_Basic💚 -31K0💚 -296⚠️ +16💚 -252⚠️ +16💚 -31K⚠️ +4💚 -28K‼️ +22K💚 -28K‼️ +22K💚 -1480
PPP/examples/PPP_WIFI_BRIDGE💚 -32K0💚 -408⚠️ +16💚 -264💚 -16💚 -34K0💚 -33K💚 -16--💚 -120💚 -16
WebServer/examples/AdvancedWebServer💚 -25K0💚 -3K⚠️ +16💚 -3K0💚 -27K0💚 -23K‼️ +22K--💚 -3K💚 -24
WebServer/examples/FSBrowser💚 -28K⚠️ +64💚 -3K0💚 -3K💚 -16💚 -31K💚 -16💚 -27K‼️ +22K--💚 -3K0
WebServer/examples/Filters💚 -25K0💚 -3K⚠️ +16💚 -3K💚 -16💚 -27K0💚 -23K‼️ +22K--💚 -3K💚 -24
WebServer/examples/HelloServer💚 -24K0💚 -3K⚠️ +16💚 -3K0💚 -27K0💚 -23K‼️ +22K--💚 -3K💚 -24
WebServer/examples/HttpAdvancedAuth💚 -28K💚 -16💚 -3K⚠️ +16💚 -3K0💚 -31K0💚 -26K‼️ +22K--💚 -3K💚 -16
WebServer/examples/HttpAuthCallback💚 -28K💚 -16💚 -3K⚠️ +16💚 -3K0💚 -31K0💚 -26K‼️ +22K--💚 -3K💚 -16
WebServer/examples/HttpAuthCallbackInline💚 -28K💚 -16💚 -3K⚠️ +16💚 -3K0💚 -30K0💚 -26K‼️ +22K--💚 -3K💚 -16
WebServer/examples/HttpBasicAuth💚 -28K💚 -16💚 -3K⚠️ +16💚 -3K0💚 -31K0💚 -26K‼️ +22K--💚 -3K💚 -16
WebServer/examples/HttpBasicAuthSHA1💚 -29K💚 -16💚 -3K⚠️ +16💚 -3K0💚 -31K0💚 -27K‼️ +22K--💚 -3K💚 -16
WebServer/examples/HttpBasicAuthSHA1orBearerToken💚 -29K0💚 -3K0💚 -3K💚 -16💚 -31K💚 -24💚 -27K‼️ +22K--💚 -3K0
WebServer/examples/MultiHomedServers💚 -25K0💚 -3K⚠️ +16💚 -3K0💚 -27K0💚 -23K‼️ +22K--💚 -3K💚 -16
WebServer/examples/PathArgServer💚 -81K0💚 -3K0💚 -3K💚 -24💚 -83K0💚 -79K‼️ +22K--💚 -3K💚 -16
WebServer/examples/SDWebServer💚 -29K💚 -16💚 -3K⚠️ +32💚 -3K0💚 -32K💚 -24💚 -28K‼️ +22K--💚 -3K💚 -24
WebServer/examples/SimpleAuthentification💚 -25K⚠️ +64💚 -3K0💚 -3K💚 -24💚 -27K0💚 -23K‼️ +22K--💚 -3K💚 -16
WebServer/examples/UploadHugeFile💚 -85K0💚 -3K0💚 -3K0💚 -86K0💚 -83K‼️ +22K--💚 -3K💚 -32
WebServer/examples/WebServer💚 -32K💚 -16💚 -4K⚠️ +32💚 -4K💚 -16💚 -35K0💚 -31K‼️ +22K--💚 -4K💚 -24
WebServer/examples/WebUpdate💚 -26K0💚 -3K⚠️ +16💚 -3K0💚 -28K0💚 -24K‼️ +22K--💚 -3K💚 -16
WiFi/examples/FTM/FTM_Initiator💚 -15K0💚 -396⚠️ +16💚 -252💚 -16💚 -18K0💚 -17K💚 -16--💚 -124💚 -16
WiFi/examples/FTM/FTM_Responder💚 -15K⚠️ +64💚 -400⚠️ +16💚 -252💚 -16💚 -17K0💚 -16K💚 -16--💚 -128💚 -16
WiFi/examples/SimpleWiFiServer💚 -17K0💚 -408⚠️ +16💚 -2480💚 -20K0💚 -15K‼️ +22K--💚 -144💚 -16
WiFi/examples/WiFiAccessPoint💚 -17K0💚 -424⚠️ +16💚 -2600💚 -20K0💚 -16K‼️ +22K--💚 -164💚 -16
WiFi/examples/WiFiClient💚 -17K0💚 -408⚠️ +16💚 -280💚 -16💚 -20K0💚 -16K‼️ +22K--💚 -148💚 -16
WiFi/examples/WiFiClientBasic💚 -18K⚠️ +64💚 -420⚠️ +16💚 -276💚 -16💚 -20K0💚 -16K‼️ +22K--💚 -156💚 -16
WiFi/examples/WiFiClientConnect💚 -15K0💚 -408⚠️ +16💚 -2240💚 -18K0💚 -16K0--💚 -124💚 -16
WiFi/examples/WiFiClientEvents💚 -16K⚠️ +64💚 -404⚠️ +16💚 -268💚 -16💚 -18K0💚 -17K💚 -16--💚 -112💚 -16
WiFi/examples/WiFiClientStaticIP💚 -17K0💚 -420⚠️ +16💚 -284💚 -16💚 -20K0💚 -16K‼️ +22K--💚 -136💚 -16
WiFi/examples/WiFiExtender💚 -16K0💚 -408⚠️ +16💚 -260💚 -16💚 -18K0💚 -17K💚 -16--💚 -120💚 -16
WiFi/examples/WiFiIPv6💚 -18K0💚 -420⚠️ +16💚 -288💚 -16💚 -20K0💚 -16K‼️ +22K--💚 -184💚 -16
WiFi/examples/WiFiMulti💚 -16K⚠️ +64💚 -388⚠️ +16💚 -260💚 -16💚 -18K0💚 -17K💚 -16--💚 -100💚 -16
WiFi/examples/WiFiMultiAdvanced💚 -23K0💚 -320⚠️ +16💚 -1280💚 -26K0💚 -21K‼️ +22K--💚 -56💚 -24
WiFi/examples/WiFiScan💚 -15K⚠️ +64💚 -372⚠️ +16💚 -244💚 -16💚 -18K0💚 -17K💚 -16--💚 -124💚 -16
WiFi/examples/WiFiScanAsync💚 -15K⚠️ +64💚 -384⚠️ +16💚 -272💚 -16💚 -18K0💚 -17K💚 -16--💚 -124💚 -16
WiFi/examples/WiFiScanDualAntenna💚 -15K⚠️ +64💚 -412⚠️ +16💚 -260💚 -16💚 -18K0💚 -17K💚 -16--💚 -120💚 -16
WiFi/examples/WiFiScanTime💚 -15K⚠️ +64💚 -388⚠️ +16💚 -260💚 -16💚 -18K0💚 -17K💚 -16--💚 -120💚 -16
WiFi/examples/WiFiTelnetToSerial💚 -18K0💚 -404⚠️ +16💚 -2720💚 -20K0💚 -16K‼️ +22K--💚 -1480
WiFi/examples/WiFiUDPClient💚 -17K0💚 -400⚠️ +16💚 -228💚 -16💚 -19K0💚 -15K‼️ +22K--💚 -128💚 -16
NetworkClientSecure/examples/WiFiClientSecureEnterprise--💚 -336⚠️ +16💚 -1680💚 -23K0💚 -18K‼️ +22K--💚 -84💚 -32
WiFi/examples/WPS--💚 -400⚠️ +16💚 -2480💚 -18K0💚 -17K💚 -16--💚 -116💚 -16
WiFi/examples/WiFiBlueToothSwitch--💚 -7600--💚 -19K0💚 -17K0--💚 -1800
WiFi/examples/WiFiClientEnterprise--💚 -332⚠️ +16💚 -1800💚 -20K0💚 -16K‼️ +22K--💚 -76💚 -16
WiFi/examples/WiFiSmartConfig--💚 -396⚠️ +40💚 -2400💚 -17K0💚 -16K💚 -24--💚 -1040
Ethernet/examples/ETH_LAN8720------------💚 -1440

Copy link
Contributor

Test Results

62 files  62 suites   1h 30m 41s ⏱️
 7 tests  0 ✅ 0 💤  7 ❌
62 runs   0 ✅ 0 💤 62 ❌

For more details on these failures, see this check.

Results for commit b92e338.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review needed Issue or PR is awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants