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

[Feature Request] Identify / LED Blink function #17

Open
mkopec opened this issue Feb 28, 2024 · 4 comments
Open

[Feature Request] Identify / LED Blink function #17

mkopec opened this issue Feb 28, 2024 · 4 comments

Comments

@mkopec
Copy link
Member

mkopec commented Feb 28, 2024

Can we add an "identify" function to the WebUI that would blink an LED, to make it easier to find a given RTE in a rack full of RTEs? We have lots of RTEs in the rack now and finding one can be a problem.

@krystian-hebel
Copy link
Member

It should also have a timeout (5 min?), otherwise it is something that I would forget to turn off after locating RTE.

@macpijan
Copy link
Member

Do you have a specific LED in mind?

I'm not sure if we have capacity and skills to continue with the web UI development. Are you using that one?
But at least extending the HTTP API should be feasible.

@macpijan
Copy link
Member

I do not see any LED on RTE we can control. D2 and D3 are hardwired to power.

You can use RED LED from OPi Zero with:

root@rte:~# echo 1 > /sys/class/leds/orangepi\:red\:status/brightness                                                                                                                                                                      
root@rte:~# echo 0 > /sys/class/leds/orangepi\:red\:status/brightness

@macpijan
Copy link
Member

So something like should do the trick as a minimum solution

#!/bin/bash                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                            
LED_PATH="/sys/class/leds/orangepi:red:status/brightness"                                                                                                                                                                                   
                                                                                                                                                                                                                                            
turn_on() {                                                                                                                                                                                                                                 
    echo 1 > "$LED_PATH"                                                                                                                                                                                                                    
}                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                            
turn_off() {                                                                                                                                                                                                                                
    echo 0 > "$LED_PATH"                                                                                                                                                                                                                    
}                                                                                                                                                                                                                                           
                                                                                                                                                                                                                                            
blink() {                                                                                                                                                                                                                                   
    local count=0                                                                                                                                                                                                                           
    local max_count=10                                                                                                                                                                                                                      
                                                                                                                                                                                                                                            
    while [ $count -lt $max_count ]; do                                                                                                                                                                                                     
        turn_on                                                                                                                                                                                                                             
        sleep 1                                                                                                                                                                                                                             
        turn_off                                                                                                                                                                                                                            
        sleep 1                                                                                                                                                                                                                             
        ((count++))
    done
}

blink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants