SOFTWARE SHUTDOWN

Started by junetec, June 19, 2014, 07:17:01 PM

Previous topic - Next topic

junetec

I work in a kiosk app and I make a python script to control the correct shutdown of the A20 with lipo.

That means, I'm sure that all my constumers don't go to shutdown icon and they go directly to the switch.

Because of that I detect when it's discharging (without power) and make a software shutdown like.

"sudo shutdown now -h"

But it looks like it's not the good way to make a software shutdown, because after 20 or 30 switchoff the A20 starts to don't boot correctly and it need son resets to come back.

There's another way to make a proper shutdown?

thanks,

smysnk

I am also in need of this feature, it is bit ridiculous we can't get A20 to shutdown / reboot under linux..

JohnS

Use the watchdog?

Or a tiny external circuit.

John

smysnk

None of these are suitable answers IMO.

JohnS

The watchdog is the way Linux is doing it.

John

smysnk

No, the watchdog will shutdown the system if something goes wrong. 

The problem is with the halt command:
https://www.olimex.com/forum/index.php?topic=3057.0


JohnS

Go look at the kernel list.  That's where I got the info from.

Regardless, it's all WIP so it is what it is - unless you do work yourself.

John

martinayotte

I've started the thread mentionned above, but I've never got answers ...

If the A20 board is powered with only one power source, the "halt" command works just fine, but if both DC barrel power supply is attached along with the LiPo battery, then the AXP driver simply turns the "halt" into a "reboot".

Doing some searches on "sunxi" forum, I found that someone complains about the same thing using a CubieBoard.

So, there is something wrong in the logic of the AXP driver ...

junetec

After 100 power on and shutdowns it looks like it's working fine.

Looks like the problem was that tha A20 board was connected serial with othe device in UART0.
And someting it's sended to console that cause the problem.
Now I use the serial port in UART1 and it looks for more than 100 cicles that it works fine.
But to be secure I wait to more than 500 shutdowns.

martinayotte

Do you means that "shutdown" or "halt" is now working fine for you when you have both LiPo and DC attached ?
Which Image are you using ?
(because I'm still using Debian-Rev5, I didn't try Debian-Rev7, and without having any serial attached, I still have the problem when both power sources are there)

junetec

I have power and battery, but Shutdown works fine because I use the comand to shutdown de board (battery powered) when power has gone. I use like UPS to shurdown when power it's gone.

If both power are on shutdown don't work but don't it's a problem for me.

I use release 7

kriptomik

for me

/sbin/shutdown -hH now
works (with both Battery and USB power)

I hope this helps
Kripto