New IT forum
27 June 2022, 12:08:29 pm *
Welcome, %1$s. Please login or register.

: PiHub now in stock.
 
Pages: [1]

Author Topic: Auto shutdown for solar SheevaPlug how to?  (Read 9012 times)

MJAB

  • Newbie
  • *
  • Posts: 3
Auto shutdown for solar SheevaPlug how to?
« on: 08 September 2010, 04:12:10 pm »

Hi all,

I am making a project to use a SheevaPlug eSata in a remote location for monitoring and sending some environmental data.
Since in the remote location there are no power lines I will use a soalr panel, so I need to save as much energy as I can.
SheevaPlug is a eSata SheevaPlug booting from SD card with Debian Squeeze onboard.

I will use a microcontroller with RTC to switch on power the 5V rail of SheevaPlug (since I have seen that there is not implemented on the board low power functionalities, or am I not right?).

I use /etc/rc.local to start the scripts at boot:
- reading data from local remote devices (Wavenis protocol on ISM 868 MHz)
- using Sakis3G script to connect to Internet using a UMTS usb modem (Vodafone Huawei Internet key)
- send data via SFTP
- closing USB modem connection

All this works quite well.

Now I woulkd like to automatically shutdown the SheevaPlug to make a safe shutdown of Linux.

Is it possible to put in /etc/rc.local command "at now + 2 minutes" to activate the shutdown without being impossible to login in the system anymore?
So, to resume, I would like to know which options can be used to safely shutdown the system without the risk to be closed out of the system.

I was also thinking to use a led connection to trigger the microcontroller to start he procedure to power off the system after n minutes.
Is it possible to activate any led (switch on / of / blink, ...) just before halt ? maybe on a runlevel stop sequence?

Ciao,
Marco.

 


 
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Auto shutdown for solar SheevaPlug how to?
« Reply #1 on: 08 September 2010, 05:26:54 pm »

The LEDs can be controlled:

http://nil-techno.blogspot.com/2009/10/accessing-blue-led-on-sheevaplug.html
http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/LEDs

There are also a number of posts on the plug computer forum on the same topic.

Here's your key question:

Quote
Is it possible to put in /etc/rc.local command "at now + 2 minutes" to activate the shutdown without being impossible to login in the system anymore?

I'm not clear on which aspect is troubling you. Is it the actual shutdown command, or the mechanism by which you should execute it? I think the command itself is straightforward (shutdown -h), but if you're trying to figure out how to determine that the tasks you want to run have completed, that's somewhat dependent upon the nature of those tasks.
Logged

MJAB

  • Newbie
  • *
  • Posts: 3
Re: Auto shutdown for solar SheevaPlug how to?
« Reply #2 on: 08 September 2010, 05:58:57 pm »

Hi,
thanks for the response.

What I would like to do is put shutdown anction in /etc/rc.local, but my question is: will I be able to login if the shutdown action started? How to stop shutdown sequence if I am not still loggedd in?
For example: if I put "shutdown -h 2", this gives 2 minute before shutdown procedure starts.
But can I arrive in that 2 minutes to login (jtag port or via network), or once activated (if I am not logged in) I will be not enabled to login?

I have not tried to do it since don't know if I can take again login :-)

Thanks in advance.
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Auto shutdown for solar SheevaPlug how to?
« Reply #3 on: 08 September 2010, 08:27:48 pm »

Well, supposedly shutdown -c should cancel it, but as to whether you are going to be able to get in via ssh, I think that you have to try it for yourself. You should do, but it will get more difficult the closer you get to that 2 minutes.
Logged

MJAB

  • Newbie
  • *
  • Posts: 3
Re: Auto shutdown for solar SheevaPlug how to?
« Reply #4 on: 14 September 2010, 12:50:50 am »

Hi all,

this are the results of the test.

using at and shutdown commands the shutdown sequence can be automatically controlled in /etc/rc.local.

User can login and use atrm number of job (job are listed using atq command) or shutdown -c (if shutdown process alredy started).

at commands can be put in an external file:

at now + 5 minutes < my_at_commands.txt

Have a nice day!
Marco.
Logged

KristoferKowalski

  • Newbie
  • *
  • Posts: 1
Re: Auto shutdown for solar SheevaPlug how to?
« Reply #5 on: 15 February 2014, 10:58:06 am »

Hi all,

I am making a project to use a SheevaPlug eSata in a remote location for monitoring and sending some environmental data.
Since in the remote location there are no power lines I will use a soalr panel, so I need to save as much energy as I can.
SheevaPlug is a eSata SheevaPlug booting from solar panels with Debian Squeeze onboard.

I will use a microcontroller with RTC to switch on power the 5V rail of SheevaPlug (since I have seen that there is not implemented on the board low power functionalities, or am I not right?).

I use /etc/rc.local to start the scripts at boot:
- reading data from local remote devices (Wavenis protocol on ISM 868 MHz)
- using Sakis3G script to connect to Internet using a UMTS usb modem (Vodafone Huawei Internet key)
- send data via SFTP
- closing USB modem connection

All this works quite well.

Now I woulkd like to automatically shutdown the SheevaPlug to make a safe shutdown of Linux.

Is it possible to put in /etc/rc.local command "at now + 2 minutes" to activate the shutdown without being impossible to login in the system anymore?
So, to resume, I would like to know which options can be used to safely shutdown the system without the risk to be closed out of the system.

I was also thinking to use a led connection to trigger the microcontroller to start he procedure to power off the system after n minutes.
Is it possible to activate any led (switch on / of / blink, ...) just before halt ? maybe on a runlevel stop sequence?

Ciao,
Marco.

 


 


Hello friend were you able to execute auto shutdown? I have been facing similar problem so can you help me out? Waiting for quick reply.
« Last Edit: 17 February 2014, 04:32:31 pm by KristoferKowalski »
Logged
Pages: [1]
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!