Jump to content

sign of life (nanopi neo2): flash green LED each x seconds?


Superkoning

Recommended Posts

Sometimes it's unclear if my Nanopi NEO2 is still running, or fully locked up / FUBAR. Ping and SSH give no result. As there is no HDMI, I have no way to check if it's still there.

 

So I was thinking: can I let the green LED flash each x seconds as a sign of life?

 

Quote from Igor: "Both are accessible via sysfs, green is configurable while blue is not lit and reacting to anything. ".  

 

So a crontab script that writes something to /sys/ <LED> ... ? 

 

Feedback appreciated.

 

 

 

 

Link to comment
Share on other sites

Wow ... it works! Thank you

 

The blue LED:

root@nanopineo2:~# echo 1 > /sys/class/leds/nanopi:blue:status/brightness
root@nanopineo2:~# echo 0 > /sys/class/leds/nanopi:blue:status/brightness


 

The green LED

root@nanopineo2:~# echo 0 > /sys/class/leds/nanopi:green:pwr/brightness
root@nanopineo2:~# echo 1 > /sys/class/leds/nanopi:green:pwr/brightness

 


 

 

Link to comment
Share on other sites

root's crontab:

 

* * * * *    /root/green-on-and-off.sh

 

with that script being:

 

for i in `seq 10`
do
    echo 0 > /sys/class/leds/nanopi:green:pwr/brightness
    sleep 0.2
    echo 1 > /sys/class/leds/nanopi:green:pwr/brightness
    sleep 0.2
done

Result: green LED is always on, but flashes off/on 10 times each minute. That's a good sign of life for me.
 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines