twchambers
Posts: 6
Joined: Fri Sep 28, 2012 7:59 am

Better status indication

Fri Sep 28, 2012 8:12 am

I've written myself a simple bash script that will automatically copy files from my camera to my external hard drive if both are plugged in, the idea being I can use it to empty the memory card when I'm away from a PC.
If the script runs successfully, then the Pi will shutdown. At the moment, as I'm running it headless, it's hard to tell if the Pi is idling or if it has completed its operations. I noticed that if I have the ethernet plugged in, it lights more of the status LEDs when the Pi is on, and these turn off after shutdown.

I don't want to play around with loads of extra code to change the operation of the LEDs, (my scripting knowledge is still pretty basic) and don't want to add any extra hardware... but the thought I had was that I could use a truncated ethernet cable to get the extra lights.
The lights don't come on unless both ends are plugged in, but would it be possible to safely loop/short some of the connections on the ethernet port to power up the lights without having a proper data connection??

Any alternative suggestions are gladly welcomed!

User avatar
RaTTuS
Posts: 10558
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Better status indication

Fri Sep 28, 2012 8:32 am

you can toggle the OK LED from software ...
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Better status indication

Fri Sep 28, 2012 8:51 am

You can safely cut an Ethernet cable and loop back the connections as follows...
Orange to green
Striped orange to striped green

This will cause the RPi to think that a valid device is at the other end of the cable.

twchambers
Posts: 6
Joined: Fri Sep 28, 2012 7:59 am

Re: Better status indication

Fri Sep 28, 2012 9:13 am

Thanks both. Will have a play around and see what I come up with and post results here.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Better status indication

Fri Sep 28, 2012 9:54 am

Here's a completely different way to check the status of your copying...

You could play audio files (tones or spoken messages) from within the script to tell the status. All you need is a pair of small earphones to listen to messages like
"Waiting to find camera"
"Found camera"
"Disk is full"
"Copy complete, shutting down"

There is also a text-to-speech converter (festival) which will do the job for you. Useful if you want to do something complex like "Copying file 4 of 17"
echo "Copying file $current of $total_files" | festival -tts

For other text-to-speech options, see http://www.raspberrypi.org/phpBB3/viewt ... 38&t=14791

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Better status indication

Fri Sep 28, 2012 10:54 am

There's no official way to tell if the PI is in shutdown mode the power light remains active as well as the power to the USB ports.
My Sandisk Cruzer does actually unlight itself when unmounted but not all USB flash drives behave in the same way.
So far the video port seems the only viable option which isn't surprising since video output is dependant on the running state of the PI.
The voltage output from the video port (about 0.9v unloaded) isn't sufficient to light an LED unless you construct a simple transistor circuit running off the 5v rail.

Richard S.

lingon
Posts: 157
Joined: Fri Aug 26, 2011 7:31 am

Re: Better status indication

Sun Sep 30, 2012 5:59 pm

Maybe the firmware could be changed so that one or more of the LEDs would blink in a unique pattern as an indicator of the halt state of the Raspberry Pi?

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Better status indication

Sun Sep 30, 2012 9:58 pm

When just about to shutdown, all of my RPi's blink the Ack light rapidly about 8 times. I just watch for that and know it is shutdown after that point.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

Return to “Advanced users”