1 1
Superkoning

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

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.

 

 

 

 

Share this post


Link to post
Share on other sites
4 hours ago, chrisf said:

If your LED's are in the device tree,

echo "heartbeat" > /sys/class/leds/xxxx/trigger 

 

OK, thanks, I will try ... as soon as I get my Neo2 back to life ... ;-)

Share this post


Link to post
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

 


 

 

Share this post


Link to post
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.
 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
1 1