Disabling Status LED

Is there any way to disable the status LED? I’m working on a project that will be in a low light setting and the LED is very bright and distracting. For now I’ve been just putting tape over it, but I am wondering if there’s a way to control it with software so that I could still show when there are bad states but nothing when it is operating normally.

1 Like

Try this, although I'm not sure what the effect will be on the error codes...

Here’s the full documentation:
https://docs.particle.io/reference/firmware/photon/#rgb

And here are two key functions:

RGB.brightness(0); // all of the way off (MAX DARK)
RGB.brightness(255); // scaled all of the way on (MAX BRIGHT)

Also if you forget whether you are in control or not, you can test with:

if( RGB.controlled() == true ) {
  // we are in control do something
}
else {
  // we are are not in control, what ever shall we do?
}

:spark:

4 Likes

Just did some digging in the firmware and managed to find this:

/*
 * default status, works the way it does now, no need to define explicitly
 */
//#define RGB_NOTIFICATIONS_ON

/*
 * should prevent any of the Spark notifications from ever being shown on the LED;
 * if the user never takes manual control of the LED, it should never turn on.
 */
//#define RGB_NOTIFICATIONS_OFF

/*
 * keep all of the statuses except the 'breathing cyan' - this would be a good
 * power saver while still showing when important things are happening on the Core.
 */
//#define RGB_NOTIFICATIONS_CONNECTING_ONLY

It’s located in the core-firmware-master/inc/main.h file.
I have no idea if and/or how this works, but my best guess would be to add #define RGB_NOTIFICATIONS_CONNECTING_ONLY to your sketch, and see if it works. If you’re able to do a local build you could try and edit the main.h file directly (uncommenting the line).
Since I have no experience with this at all, I’m hoping one of the elite :spark:ies can comment some more, and maybe clarify it a bit better than I’m able to.
Either way, good luck :smile:

2 Likes

I just tested a local build with #define RBG_NOTIFICATIONS_OFF not commented out and it totally turns off the LED which is both awesome and somewhat disconcerting when you are used to the whole flashing and breathing LED thing!

If you can build locally, this will work for sure for you.

3 Likes

Thanks for giving it a try!

Thanks everyone for the replies. My current solution is to add this to my setup()

RGB.control(true); 
RGB.color(0, 0, 0);

The status will still show while it is booting, but go off after it starts running.

1 Like

Nice to hear that you’ve got it working. I’m afraid though that if you want to receive other indicators (other than breathing cyan) that this won’t work. This will, as far as I know, completely disable any and all led notifications from the moment your code starts running (after cloud connection).
If you’re okay with that, then go ahead. Otherwise you might want to give my example from above a try.

Either way, good luck :slight_smile:

1 Like

Thanks, I will definitely try your solution once I get local building set up.

You could try just adding this to the top of your sketch,#define RGB_NOTIFICATIONS_CONNECTING_ONLY, but I’m not really sure if that’ll work.

No luck. Thank you for the suggestion though.

You’re welcome, thank you for trying. I’m new to all of this, so it’s a learning process for me. So it’ll have to be a local build for now. May be a neat feature to add in the future :smiley: (:spark:, maybe add it to some backlog somewhere?)

1 Like

I have tested this with local builds and it works, it would seem the change must be made core-firmware/master/inc/main.h, placing the #define in your sketch doesn't work

I guess this code has to be initialized before running any user-firmware then. Thanks for giving it a try though!
Seeing as @Dave liked my “maybe add it to some backlog”, I’m hoping it’ll be added in any of the upcoming sprints, as it would be a nice feature to have. Not that I don’t like the indicator lights, but they’re awfully bright :wink:

1 Like

Hi @Moors7,

:slight_smile: Cool that it’s working locally, it should also work on the build site, so I’ll check that out. Added to the backlog!

Thanks,
David

1 Like

Has this been fixed?

Wow this is an old thread!

Sounds like you want a combo of RGB.control, and the startup hack:

https://docs.particle.io/reference/firmware/electron/#control-user_control-

and

https://docs.particle.io/reference/firmware/photon/#startup-

Thanks!
David

HI Dave, bumping this again for future users and my own clarification.
So if we solely want to disable the pulsing blue for power reasons this would be the best code:

    LEDSystemTheme theme; // Enable custom themes
    theme.setColor(LED_SIGNAL_NETWORK_ON, 0x00000000); // Set LED_SIGNAL_NETWORK_ON to no color
    theme.apply(); // Apply theme settings

Can't get this to compile - where do I add this? "theme does not name a type"
Thanks

Make sure your device is running system firmware 0.6.1 or later. Earlier system firmware versions don’t include LEDSystemTheme.

https://docs.particle.io/reference/firmware/#ledsystemtheme-class

1 Like