Edgent indicator LED

In Edgent I configured Settings.h per Pete’s instructions to use my project’s RGB LED, and it works fine, blinks/pulses LED as expected for showing wifi connection status. But for my project to save power I turn off the wifi after some minutes of no UI input, and would like to use same LED for other program functions besides Blynk/wifi status. However, Edgent template, Indicator.h (?) continue to pulse my LED after wifi turned off, falsely indicating wifi still connected. I’m having difficulty finding how to wrest LED control back from Indicator.h when not using Blynk/wifi?

PS Does this issue have anything to do with the Settings.h ticker/timer/pthread configuration? These are also referenced in Indicator.h but I don’t understand their function and have not changed from default #define USE_PTHREAD.

fyi I had in previous project iteration used a neopixel (“WS2812” per Settings.h) LED, and was able to shut it off using function rgb.setBrightness(0). However now i’m just using a regular 4-pin RGB LED, so rgb.setBrightness(0) I think no longer applies.

Thanks so much!

Dane

Can you explain more about how you’re doing this?
Once you turn off WiFi you obviously can’t turn it back on again based on Blynk UI input, because the device isn’t talking to Blynk anymore.
I’m confused!

Pete.

Greetings Mr Pete!

Thanks for response. Yes for my project the device esp32 remains with the user during use, so they can press a physical button to wake up the WiFi when wishing to use Blynk UI. The UI is for battery % display, adjusting settings/ user preferences only, and once set the program carries on automatically without need of WiFi or user input.

For example the user might at first set their preferences, then spend many hours using device without need for UI again, so no need to maintain energy intensive wifi connection on battery power only. And I’d like the LED to pulse red for low battery but presently I can’t make it do that unless I forgo the wifi status functionality of the edgent Indicator.h

Best Regards,
Daner

So I’m gonna assume there is no recommended way to control the Edgent’s indicator.h functionality from my own code then. So to use my RGB LED for reasons other than Blynk/WiFi status i’ll have to write my own code and eschew the Indicator.h stuff.

You can assign whichever pin you want to be used by the LED for the Edgent functionality.
You just edit the Settings.h file for whatever board type you’ve defined in your .ino file.

Pete.

Hi Pete,

Thanks for reply. I followed your good instructions and succeeded to use the Edgent LED functionality. It runs fine on my project presently.

I don’t think my .ino file can/should change the Settings.h pin settings from within loop()?

My goal is that my program be able to turn Edgent LED control on/off, for example if WiFi turns off and I want the LED to stop waving. Showing Blynk connection status is good and useful but i’d like also that my LED can show other statuses such as battery level. The way I understand is that I either have Edgent LED control always off or always on, depending on Settings.h pin settings, but I want sometimes on, sometimes off.

Thanks

I guess you’re on your own with re-writing the Edgent functionality to do that then.
Personally, I’d probably add a second physical LED.

Pete.

Thank you Pete for clarifying!