Skip to content

Maximum LED brightness not honored #7742

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

Closed
1 task done
mondolirondo opened this issue Jan 22, 2023 · 2 comments
Closed
1 task done

Maximum LED brightness not honored #7742

mondolirondo opened this issue Jan 22, 2023 · 2 comments
Assignees
Labels
Type: Example Issue is related to specific example.

Comments

@mondolirondo
Copy link

mondolirondo commented Jan 22, 2023

Board

ESP32-CAM

Device Description

None

Hardware Configuration

Nothing

Version

latest master (checkout manually)

IDE Name

Arduino IDE

Operating System

Windows 11

Flash frequency

IDK

PSRAM enabled

yes

Upload speed

115200

Description

I was tinkering with the ESP32 Camera Web Server example.
In line 78 of app_httpd.cpp I modified the value of CONFIG_LED_MAX_INTENSITY since a much lower value is bright enough for me and high values make the LED worryingly hot when streaming.
It works OK except after taking a picture with flash. The following steps should reproduce the issue:

  • Enter the web UI
  • Start streaming
  • Set LED intensity at a high value (ex. 255)
  • The LED intensity is topped at the value set in CONFIG_LED_MAX_INTENSITY as expected
  • Stop streaming
  • Take a picture using the flash still set in a high value, it will not be limited by CONFIG_LED_MAX_INTENSITY, which seems to be the desired behavior (see this fragment of code)
  • Start streaming again

Expected behavior:
The LED intensity is topped at the value set in CONFIG_LED_MAX_INTENSITY

Observed behavior:
The LED intensity is the same as when taking a picture (the high value)

I have found that the issue can be fixed setting the streaming flag before switching the LED on; i.e. replace

    enable_led(true);
    isStreaming = true;

in this portion of code with

    isStreaming = true;
    enable_led(true);

Sketch

No code required, can be reproduced directly in the web UI.

Debug Message

No error message

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@mondolirondo mondolirondo added the Status: Awaiting triage Issue is waiting for triage label Jan 22, 2023
@PilnyTomas
Copy link
Contributor

Hi, @mondolirondo thanks for catching the issue and for the excellent description - I was able to reproduce it quickly and can confirm the problem and your solution.
We are an open-source project and welcome contributions from users. Since you already have the solution, could you please create a Pull Request with your fix? I don't want to take credit for your work ;-)
On the other hand, if you explicitly ask me to do it for you, that is no problem either.

@PilnyTomas PilnyTomas added Type: Example Issue is related to specific example. and removed Status: Awaiting triage Issue is waiting for triage labels Feb 24, 2023
@PilnyTomas
Copy link
Contributor

Change merged - closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Example Issue is related to specific example.
Projects
None yet
Development

No branches or pull requests

2 participants