BeagleBone Black powers down when AC adapter is removed while the USB is connected.

797 views
Skip to first unread message

David Hirst

unread,
Nov 16, 2014, 11:26:57 AM11/16/14
to beagl...@googlegroups.com
I am trying to manage power myself including battery backup, however if I have USB power and AC adapter power whenever I disconnect the AC power, the system shuts down shortly after. I would like to manage the shutdown myself.
Can anyone tell me how to disable the default control

Thanks

William Pretty Security

unread,
Nov 16, 2014, 1:45:59 PM11/16/14
to beagl...@googlegroups.com

As far as I know, it shouldn’t do that.

The USB should provide power if the AC (+5v) is removed.

 

What else is connected to the BBB ?

 

 

 

"No one could make a greater mistake than he who did nothing because he could do only a little."

"All that is necessary for the triumph of evil is that good men do nothing" Edmond Burke (1729 - 1797)

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5577 / Virus Database: 4213/8581 - Release Date: 11/16/14


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.5577 / Virus Database: 4213/8571 - Release Date: 11/14/14

David Hirst

unread,
Nov 16, 2014, 5:39:48 PM11/16/14
to beagl...@googlegroups.com


On Sunday, November 16, 2014 1:45:59 PM UTC-5, William Pretty Security wrote:

As far as I know, it shouldn’t do that.

The USB should provide power if the AC (+5v) is removed.

 

What else is connected to the BBB ?


I have a cape with a lithium battery, a serial port talking to a wireless gateway which is powered from the AC input also and an ethernet cable to the BBB nothing else, the battery is connected to the charging circuit of the PMIC.
I have two BBB which both do the same

David Hirst

unread,
Nov 16, 2014, 5:47:58 PM11/16/14
to beagl...@googlegroups.com


On Sunday, November 16, 2014 5:39:48 PM UTC-5, David Hirst wrote:


On Sunday, November 16, 2014 1:45:59 PM UTC-5, William Pretty Security wrote:

As far as I know, it shouldn’t do that.

The USB should provide power if the AC (+5v) is removed.

 

What else is connected to the BBB ?


I have a cape with a lithium battery, a serial port talking to a wireless gateway which is powered from the AC input also and an ethernet cable to the BBB nothing else, the battery is connected to the charging circuit of the PMIC.
I have two BBB which both do the same

 

I just tried the same thing without the cape and the same thing happens so all that is connected to the BBB is AC, USB and ethernet.  uname -a gives "Linux beaglebone 3.8.13 #1 SMP Wed Sep 4 09:09:32 CEST 2013 armv7l GNU/Linux"

evilwulfie

unread,
Nov 16, 2014, 5:54:43 PM11/16/14
to beagl...@googlegroups.com
unplug the ethernet.    some USB sources are unable to provide enough power for everything.

William Hermans

unread,
Nov 16, 2014, 6:49:34 PM11/16/14
to beagl...@googlegroups.com
Yeah, I doubt its the ethernet jack being plugged in and used. I have a TEMPER USB thermometer plugged in and running, plus ethernet, and USB networking.

There could be a service on these new images that monitors AC power, so that it issues a shutdown when this occurs. I know threre is at least "CTRL + ALT + DEL" key press combo "event" in /etc/inittab, but have not looked to see if there is anything else. There could also a a conditional systemd service potentially doing this.

William Hermans

unread,
Nov 16, 2014, 6:52:18 PM11/16/14
to beagl...@googlegroups.com
in /etc/inittab

# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop
You need to do some google "research" and see if this is a potential issue for you.

David Funk

unread,
Nov 16, 2014, 7:09:23 PM11/16/14
to beagl...@googlegroups.com
There is a previous thread, several weeks ago about this same behavior. That thread involved an application that ran off mains but had battery backup and everytime mains failed, and 5V goes away, the BBB shutdown. 

IIRC, this is a known software default behavior when the 5V goes away, it is programmable and needs to be set accordingly to how the end user whats it to behave.


-david
.


Michel Gerin

unread,
Nov 17, 2014, 6:29:51 AM11/17/14
to beagl...@googlegroups.com
Hello,
I had a similar problem. David mentions perhaps this thread:

https://mail.google.com/mail/u/0/?tab=wm#inbox/149198bbf7826f64

Bremenpl suggested to use the debian console version instead of the LXDE version. It solved my problem.

We just encontered a 2 hours mains power outage this saterday.The BBB went on running flawless with the battery backup.

Michel

Gerald Coley

unread,
Nov 17, 2014, 6:32:24 AM11/17/14
to beagl...@googlegroups.com
Interesting. Sounds like something I need to get fixed.

Gerald


--

Michel Gerin

unread,
Nov 17, 2014, 9:58:29 AM11/17/14
to beagl...@googlegroups.com
Attn Gerald Coley,

Hello,
In order to avoid any misunderstanding, I wrote "I had a similar problem". But I didn't use the USB connection.
Only 5V DC and battery were connected to the BBB.
As soon as 5V DC PS was off, the Debian LXDE version was shutting down but a warning was appearing telling the user the system was shutting down within 60s if this procedure wasn't canceled.
Maybe David Hirst's problem is related to the same software "mecanism".

Kind regards

Michel. 
  

Gerald Coley

unread,
Nov 17, 2014, 10:04:21 AM11/17/14
to beagl...@googlegroups.com
That should be bale to be fixed by changing the behavior of the SW. You can look at the datasheet for the TPS65217C to see what registers to change.

Gerald

David Hirst

unread,
Nov 18, 2014, 11:37:36 AM11/18/14
to beagl...@googlegroups.com
The fact that it powers down is a problem to me, if for instance a slight power interruption occurs ( lets say 5 seconds) during which time the CPU is powered by the battery backup I would like to carry on running, if its longer then I would like to make the decision when to shutdown.
As it stands now I have no option but to have the system power down.
With the current implementation In the event of a small interruption, the system will start to power down but if that the power has now returned prior to the shutdown occurring  the system needs intervention to power back up, by power cycling either the USB or AC. I want to smooth out short power cycles and let the long power outages re-power the board when the power returns
Gerald
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gerald Coley

unread,
Nov 18, 2014, 1:57:47 PM11/18/14
to beagl...@googlegroups.com
Then the SW needs to be changed to change that behavior.

Gerald

dhi...@schneiderdcim.com

unread,
Nov 19, 2014, 9:57:47 AM11/19/14
to beagl...@googlegroups.com
I guess a rebuild is in order, I did the same test with Debian and saw the same result, except that with Debian a message is posted to the console explaining that shutdown is occurring due to loss of AC power

dhi...@schneiderdcim.com

unread,
Nov 19, 2014, 10:12:05 AM11/19/14
to beagl...@googlegroups.com
in /drivers/mfd/tps65217.c  i believe this is where the magic happens, and needs to be changed


         if (int_reg & TPS65217_INT_PBI) {
                 /* Handle push button */
                 dev_dbg(tps->dev, "power button status change\n");
               input_report_key(tps->pwr_
but, KEY_POWER,
                             status_reg & TPS65217_STATUS_PB);
             input_sync(tps->pwr_but);
         }
         if (int_reg & TPS65217_INT_ACI) {
                 /* Handle AC power status change */



On Tuesday, November 18, 2014 1:57:47 PM UTC-5, Gerald wrote:

toni incog

unread,
Feb 25, 2015, 12:34:16 PM2/25/15
to beagl...@googlegroups.com, dhi...@schneiderdcim.com
I like this behaviour and thought I could use it to cleanly shutdown the bbb. I therefore connected a 'powerbar' usb battery to the usb otg port. Now when I remove the 5V (strangely called ac) I expect a clean shutdown on power delivered by my cheap 'ups'. Only I find out that in /this/ case the bbb shutdown immediate instead of a clean shutdown!

So there seams to be a difference in connecting the otg usb to a pc or just to a powerbar.

Anyone who can explain this behaviour? In my quest to shutdown a bbb simple, cheap and clean.

William Pretty Security

unread,
Feb 25, 2015, 2:11:33 PM2/25/15
to beagl...@googlegroups.com

There is a signal, on P9 I believe, called “power”.

If you pull this pin low with a pushbutton switch, you will get the clean shutdown you are looking for.

 

 

 

"No one could make a greater mistake than he who did nothing because he could do only a little."

"All that is necessary for the triumph of evil is that good men do nothing" Edmond Burke (1729 - 1797)

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

--

For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No virus found in this message.
Checked by AVG - www.avg.com

Version: 2015.0.5646 / Virus Database: 4299/9178 - Release Date: 02/25/15

toni incog

unread,
Feb 25, 2015, 6:51:21 PM2/25/15
to beagl...@googlegroups.com
Yes indeed, and that is a perfect way to shut down our baby. It's another way of pressing the power button. Thing is you need another 10 sec. of shutdown power (to cleanly shutdown).

So I'm looking for the use case where somebody stupid (talking 'bout me) yanks the 5V and I still get a clean shutdown. We need external 'ups' power for that last 10 sec. of shutdown. Now I keep 5V always on. Till power company screws up. 64 million dollar question: how many times can power company screw up before bbb screws up?

Question remains why I get a unclean shutdow with me (the stupid one) feeding 5v to otg usb with powerbar and getting clean shutdown when connected to regular pc.

Call me stupid but the correct answer awaits tickets for the next frank zappa concert!

thx,
Michiel

Harvey White

unread,
Feb 25, 2015, 7:33:01 PM2/25/15
to beagl...@googlegroups.com
On Wed, 25 Feb 2015 15:51:21 -0800 (PST), you wrote:

>Yes indeed, and that is a perfect way to shut down our baby. It's another
>way of pressing the power button. Thing is you need another 10 sec. of
>shutdown power (to cleanly shutdown).

That's possible with a backup supply, NIMH/NICD with a resistor to
charge and a diode to prevent overcharge, if you have a cutoff when
the batteries reach 1.1 volts, you're fine. I'd suggest a 1 farad
capacitor, but the BBB wants several hundred mills when running, and I
suspect that's a bit much.

>
>So I'm looking for the use case where somebody stupid (talking 'bout me)
>yanks the 5V and I still get a clean shutdown. We need external 'ups' power
>for that last 10 sec. of shutdown. Now I keep 5V always on. Till power
>company screws up. 64 million dollar question: how many times can power
>company screw up before bbb screws up?

Ok, comparator and you shut down (gracefully) when the DC power goes
away. Problem is to determine that (if you're also battery
powered.... this is good....)

>
>Question remains why I get a unclean shutdow with me (the stupid one)
>feeding 5v to otg usb with powerbar and getting clean shutdown when
>connected to regular pc.

May have to do with how the power is actually disconnected, clean off
vs make/break/make/break by disconnecting

>
>Call me stupid but the correct answer awaits tickets for the next frank
>zappa concert!

*or is that a *sears* poncho?*

Harvey

>
>thx,
>Michiel

toni incog

unread,
Feb 25, 2015, 7:52:40 PM2/25/15
to beagl...@googlegroups.com, ma...@dragonworks.info


On Thursday, February 26, 2015 at 1:33:01 AM UTC+1, Harvey White wrote:
On Wed, 25 Feb 2015 15:51:21 -0800 (PST), you wrote:

>Yes indeed, and that is a perfect way to shut down our baby. It's another
>way of pressing the power button. Thing is you need another 10 sec. of
>shutdown power (to cleanly shutdown).

That's possible with a backup supply, NIMH/NICD with a resistor to
charge and a diode to prevent overcharge, if you have a cutoff when
the batteries reach 1.1 volts, you're fine.  I'd suggest a 1 farad
capacitor, but the BBB wants several hundred mills when running, and I
suspect that's a bit much.

Yeah 1 Farad is not enough to shutdown clean.
 
>
>So I'm looking for the use case where somebody stupid (talking 'bout me)
>yanks the 5V and I still get a clean shutdown. We need external 'ups' power
>for that last 10 sec. of shutdown. Now I keep 5V always on. Till power
>company screws up. 64 million dollar question: how many times can power
>company screw up before bbb screws up?

Ok, comparator and you shut down (gracefully) when the DC power goes
away.  Problem is to determine that (if you're also battery
powered.... this is good....)

reading ten times, no comprending. Do you no who you are? You aint what your not. And that al there is.

>
>Question remains why I get a unclean shutdow with me (the stupid one)
>feeding 5v to otg usb with powerbar and getting clean shutdown when
>connected to regular pc.

May have to do with how the power is actually disconnected, clean off
vs make/break/make/break by disconnecting

Ok. Could be. But it think it's hard & propably software. Don't believe in statistics on average.
 

>
>Call me stupid but the correct answer awaits tickets for the next frank
>zappa concert!

*or is that a *sears* poncho?*

Harvey


I guess: in serious leather!

Thanks and sorry for zappian confusion, questions still stands:
 
>
>thx,
>Michiel

William Pretty Security

unread,
Feb 25, 2015, 9:08:44 PM2/25/15
to beagl...@googlegroups.com

The BBB has a battery backup connector on it you might want to look into ?

 

 

"No one could make a greater mistake than he who did nothing because he could do only a little."

"All that is necessary for the triumph of evil is that good men do nothing" Edmond Burke (1729 - 1797)

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

--

For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No virus found in this message.
Checked by AVG - www.avg.com

toni incog

unread,
Feb 26, 2015, 6:58:21 AM2/26/15
to beagl...@googlegroups.com
Yeah, you probably mean this:

https://plus.google.com/+DrewFustini/posts/jUkFsbVJVHQ

Apart from some highly regarded bb'ners advising against it I'm not looking for battery backup. I'm looking for easy automatic clean shutdown (aka eacs).
In the plc world they're using a super capacitor to do the clean shutdown (and save some data to flash).
 
I was hoping that with power supplied to the usb otg port I had an easy solution. Now it seems I have to make a momentary switch to short pwr_but for lees than 8 sec. or program a gpio to shut down the bbb when power is removed.

Unless I understand why the bbb is shutting down clean with usb otg connected to pc but not when usb otg connected to a battery. Comments appreciated!

thx,
Michiel

oat...@chello.hu

unread,
Jul 22, 2017, 10:23:35 PM7/22/17
to BeagleBoard
Delete the /etc/acpi/powerbtn-acpi-support.sh file or add 'exit 0' to second line this file:

#/bin/sh
exit 0
# This script initiates a shutdown when the power putton has been
...

bglaz...@gmail.com

unread,
Apr 5, 2018, 11:39:07 PM4/5/18
to BeagleBoard
Sorry to revive an old thread but I wanted to add my solution to this problem somewhere and this seems like the most appropriate place to do it. I was also experiencing the Bone shutting itself down on AC Power removal regardless of a battery present. The logs showed it was registering the removal as a button press condition and powering down the unit. I had a product running on 4.1.19-bone20 and did not want to update to a later kernel but it appears to be resolved in later kernels already. 

To fix on 4.1.19-bone20, I modified the file mentioned here (/drivers/mfd/tps65217.c) and commented out this code entirely:

/*
if (int_reg & TPS65217_INT_ACI) {
/* Handle AC power status change 
dev_dbg(tps->dev, "AC power status change\n");
/* Press KEY_POWER when AC not present 
input_report_key(tps->pwr_but, KEY_POWER,
~status_reg & TPS65217_STATUS_ACPWR);
input_sync(tps->pwr_but);
}
*/

After I rebuilt and deployed the modified kernel, the problem was resolved, no more power down on AC removal.
For anyone who needs further instructions, I'd be happy to help.
Reply all
Reply to author
Forward
0 new messages