subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover (pisound HAT)

Sun Oct 13, 2019 6:14 pm

Hi, I have a Raspberry Pi 4b

When I run: sudo reboot now lights flicker and go dead as expected, network dongle light goes dead too. red light remains... GOOD! But, it never reboots. (red light stays on, no other lights come back).

To get the PI back, I need to unplug power. But 5-6 seconds is not enough. If I do that, no green light flickers at all. I need to unplug power ~10seconds or more to get it to boot.

I'm running Buster Lite in headless mode (ssh connection only). Im using the ethernet port for ssh.

Ideas?

Seems to me like 2 problems:
- sudo reboot now isn't working, or some problem with it... maybe leaves bios in a bad state
- maybe rpi power cycle needs 10 seconds (maybe some capacitance on board, need to let power dissipate?)

It might be 1 problem though.
- some memory on the rpi (BIOS?) is screwed up after shutdown due to sudo reboot now so complete power down is the only fix

If I simply pull the plug, wait 2 seconds, and plug back in - it boots fine. So it seems like some bad state is being set by sudo reboot now. (dont worry, I have a RO filesystem, so it's safe to pull the plug).

Background:
I'm creating an embedded consumer device, meant to be turned off and on via power switch. I like using sudo reboot now for development, but I dont really need it for production, since power cycle will be what the user will be doing ;-) I have a RO filesystem, so it's safe to pull the plug
Last edited by subatomicglue on Tue Oct 15, 2019 4:03 am, edited 1 time in total.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 7:52 pm

Looking at the man page for reboot now is not listed as an option so maybe it is creating a problem and causing your issue. Anyway the options always have a -- (minus, minus) in front of them e.g. --help.

I just use sudo reboot with no problems on all my various Pis including my Pi 4 running Raspbian Lite via SSH.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 8:14 pm

You're right, "now" is an option to shutdown
I was in the habit of typing "now" for shutdown (can be used for shutdown's TIME option), so I used it by habit for reboot as well.

sudo reboot (and also sudo reboot -f) actually works!

And...

sudo reboot now works too.... (of course the "now" does NOTHING)

Ha.
Haha.

Could there be something temperature related?

I was running 65C when I was having trouble, and now (at cold boot) it's 48C.
I'm running with 3 heatsinks, nice tall one on the CPU/GPU.

I'll let it heat back up and see if I get it to happen again.
Last edited by subatomicglue on Sun Oct 13, 2019 8:43 pm, edited 2 times in total.

MrEngman
Posts: 4140
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 8:36 pm

I wouldn't expect temperature to be a problem. My Pi 4 is siting idle at 47C (~116F) and reboots without problems.

All I can say is sudo reboot now is not a valid command according to the manpage.

According to the manpage try sudo reboot -f or sudo reboot --force to reboot immediately, although I only use sudo reboot which effectively reboots pretty much immediately.



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 8:42 pm

Ok... with R-pi warmed up to 54.0'C

The strange condition happens (again) with both commands:

sudo shutdown
and
sudo reboot

I then need to unplug power for ~10sec or more otherwise I get no green light, only red. (from what I understand, at first power the Green light indicates bios is initializing - i dont even get that under this condition).

If I unplug for ~6 or less seconds, then plug back in, only the red light turns on (no green)

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 8:47 pm

jcyr wrote:
Sun Oct 13, 2019 8:38 pm
Speaking of reboot... I long ago got trained to do sync;sudo reboot. Is the sync really necessary?
considering I have an RO filesystem, probably not necessary for me. :)
Last edited by subatomicglue on Sun Oct 13, 2019 10:14 pm, edited 1 time in total.

User avatar
rpdom
Posts: 20034
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 9:36 pm

jcyr wrote:
Sun Oct 13, 2019 8:38 pm
Speaking of reboot... I long ago got trained to do sync;sudo reboot. Is the sync really necessary?
Not really. A long time ago, when I first started using Unix, the recommended sequence was sync;sync;reboot (or equivalent command), but there is quite a bit of stuff written out to the disk during the reboot sequence. The reboot will perform a sync when it unmounts the file systems (or remounts them read only) anyway, so no point in doing it yourself.
Unreadable squiggle

User avatar
Imperf3kt
Posts: 4665
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 9:54 pm

subatomicglue wrote:
Sun Oct 13, 2019 8:42 pm
Ok... with R-pi warmed up to 54.0'C

The strange condition happens (again) with both commands:

sudo shutdown
and
sudo reboot

I then need to unplug power for ~10sec or more otherwise I get no green light, only red. (from what I understand, at first power the Green light indicates bios is initializing - i dont even get that under this condition).

If I unplug for ~6 or less seconds, then plug back in, only the red light turns on (no green)
Kindla sounds like your Pi may be damaged.
Can you inspect it for maybe dry solder joints?
55:55:44:44:4C
52:4C:52:42:41

Rose tinted glasses are difficult to see through.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 6814
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 9:58 pm

subatomicglue wrote:
Sun Oct 13, 2019 8:42 pm
Ok... with R-pi warmed up to 54.0'C

The strange condition happens (again) with both commands:

sudo shutdown
and
sudo reboot

I then need to unplug power for ~10sec or more otherwise I get no green light, only red. (from what I understand, at first power the Green light indicates bios is initializing - i dont even get that under this condition).

If I unplug for ~6 or less seconds, then plug back in, only the red light turns on (no green)
1)
I use these variants:
a) for shutdown:

Code: Select all

sudo shutdown -h now
and then wait for the shutdown led sequence to complete (ends with, IIRC, 10 flashes of the green led - time needed ~8 secs.)
b) for "reboot"

Code: Select all

sudo shutdown -r now
. Reboot occurs ~6 secs.

2) What are you using for a power supply? Where are you unplugging?
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 10:15 pm

I have a 3.0A official rPI power supply (white with a USB C connector)

When I let it rest for an hour, and come back, sudo reboot works again (temperature is at 38C)

I dont _see_ any solder joint problems. But you never know. HA. Still, it's strange that a solder joint would be affected by waiting 10seconds before replugging... Seems to be predictably time based...

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 6814
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 10:32 pm

subatomicglue wrote:
Sun Oct 13, 2019 10:15 pm
I have a 3.0A official rPI power supply (white with a USB C connector)

When I let it rest for an hour, and come back, sudo reboot works again (temperature is at 38C)

I dont _see_ any solder joint problems. But you never know. HA. Still, it's strange that a solder joint would be affected by waiting 10seconds before replugging... Seems to be predictably time based...
But are you unplugging the "C" connector or switching/unplugging at the AC end? I've used the black version of the official 3A supply, black version of the 2.5A supply + uUSB-to-C adapter, or a Tronsmart 18W USB 'C' supply and never had any rebooting failures with any of my P4B's but I never just unplug the "C" connector. (NB all power supplies will take a finite time to fully discharge to 0V)
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B, B+, and a A+) but Buster on the P3B+, P4B's & P400. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 10:59 pm

I plugged an HDMI display into it, and did sudo reboot
I saw lines of text flying by, then black screen.

This is the last thing to be seen before black screen...

Sometimes I get this:
Image
And sometimes I get this:
Image
Both result in the same frozen pi... (need to unplug for >10sec, before plugging power back in)

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 11:01 pm

But are you unplugging the "C" connector or switching/unplugging at the AC end? I've used the black version of the official 3A supply, black version of the 2.5A supply + uUSB-to-C adapter, or a Tronsmart 18W USB 'C' supply and never had any rebooting failures with any of my P4B's but I never just unplug the "C" connector. (NB all power supplies will take a finite time to fully discharge to 0V)
Trev.
I am unplugging the C connector to the PI. (not unplugging the AC end).
I think that unplugging the C connector will be a faster discharge - the power brick maybe probably holds more charge for power filtering purposes. So I think unplugging the USB C end should be fine... ...

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Sun Oct 13, 2019 11:06 pm

strange.... sudo reboot still freezing right after shutdown with black screen / red light (temp == 46C now), but I can unplug the power brick (AC side or the USB C, same result), and plug back in ~3seconds and PI boots fine... running sudo reboot hangs again, same black screen / red light as before...

didn't need to wait the ~10sec as before...

same ~3sec power cycle timing at 56C... after I let it heat up again...

And to verify, I let it cool to 37C, and sudo reboot works as it should

Ernst
Posts: 1381
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 6:25 am

subatomicglue wrote:
Sun Oct 13, 2019 6:14 pm
If I simply pull the plug, wait 2 seconds, and plug back in - it boots fine. So it seems like some bad state is being set by sudo reboot now. (dont worry, I have a RO filesystem, so it's safe to pull the plug).

Background:
I'm creating an embedded consumer device, meant to be turned off and on via power switch. I like using sudo reboot now for development, but I dont really need it for production, since power cycle will be what the user will be doing ;-) I have a RO filesystem, so it's safe to pull the plug
What happens when you test with an unmodified* Raspbian Lite image ?

If the problem disappears with an unmodified image it means that the cause for your problem could be your modifications to create a RO filesystem.

* unmodified = new image without any changes except for ssh and network configuration.
The road to insanity is paved with static ip addresses

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 8:37 pm

Testing now with a clean image:

Hardware:
  • Micro Center 128GB MicroSDXC flash card. (It's cheap, branded by the store, but seems to work well, never had a problem).
  • There is a pisound https://blokas.io/pisound/ sitting on it as well (though I haven't set it up on this clean Buster image).
  • Ethernet Cable with crossover adaptor. TP-LINK model UE300 USB dongle
  • MacBook Pro 2015 15"
  • Raspberry Pi 4b 1GB
  • an Adafruit HDMI 800x480 with touchscreen: https://learn.adafruit.com/adafruit-5-8 ... -pi-config
  • Official Raspberry PI USBC 3amp PSU
With image: 2019-07-10-raspbian-buster-lite.img, Burned with Etcher on MacOSX

After burning the image, I use these steps to setup:


Setup Raspberry Pi 4b for SSH:

Code: Select all

 touch /Volumes/boot/ssh

Setup the HDMI Screen so we can see bootup
edit /Volumes/boot/config.txt (on the MicroSD card) for my Adafruit HDMI device above:
These lines are the only things uncommented in my config.txt file

Code: Select all

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (here we are forcing 800x480!)
hdmi_group=2
hdmi_mode=87
hdmi_cvt=800 480 60 6 0 0 0
hdmi_drive=1

max_usb_current=1

BOOT IT UP - DO NOT UNPLUG - FS HAS TO INIT


Log in

Code: Select all

ssh pi@raspberrypi.local

Edit ssh server:

Code: Select all

sudo vi /etc/ssh/sshd_config
With the following:

Code: Select all

PasswordAuthentication yes
PermitRootLogin yes

Restart SSH server:

Code: Select all

sudo service ssh restart
sudo passwd root   (pass: raspberry)

check temperature

Code: Select all

vcgencmd measure_temp
64deg

reboot:

Code: Select all

sudo reboot
stays at black screen
must unplug USB C, waiting for +10seconds (tried 3, 5, 7, 9... wouldn't boot)


check temperature

Code: Select all

vcgencmd measure_temp
40deg

reboot:

Code: Select all

sudo reboot
reboot happens as expected
cold unplug of USBC (yep on a RW filesystem, eek!), wait 2 seconds, reboots as expected



Sounds temperature related... Another idea: maybe a firmware update? I heard the Rpi4 has firmware now (used to be on the disk image)
Last edited by subatomicglue on Mon Oct 14, 2019 10:24 pm, edited 1 time in total.

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 8:41 pm

I'm gonna try the above with the latest Buster image, and will try without HDMI (skip touching the config.txt). Will report back

User avatar
B.Goode
Posts: 13784
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 8:52 pm

Another idea: maybe bios update?

Whatever your issue is, it is not that.

No model of RPi board has a BIOS as found on a 'conventional' (ie. 'WinTel' ) PC.

Ernst
Posts: 1381
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 8:57 pm

subatomicglue wrote:
Mon Oct 14, 2019 8:41 pm
I'm gonna try the above with the latest Buster image, and will try without HDMI (skip touching the config.txt). Will report back
It would make sense to (physically) remove the pisound while testing.
The road to insanity is paved with static ip addresses

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 10:22 pm

Using 2019-09-26-raspbian-buster-lite.img this time without any HDMI connected

38C to 48C was able to sudo reboot

When it hit 51C sudo reboot hung after shutdown, then unplugged USB C for 4 seconds, replugged, and booted normally...

Tried a few more times, same results, w/ similar temp 50-52C...
Last edited by subatomicglue on Mon Oct 14, 2019 10:46 pm, edited 1 time in total.

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 10:24 pm

Whatever your issue is, it is not that.

No model of RPi board has a BIOS as found on a 'conventional' (ie. 'WinTel' ) PC.
I read the Rpi4 has firmware now... Maybe we dont call it a BIOS. But it does have firmware - and that's what I meant
https://www.raspberrypi.org/forums/view ... p?t=244585

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Mon Oct 14, 2019 10:44 pm

It would make sense to (physically) remove the pisound while testing.
Removed it. And a 32GB (empty) USB stick I forgot was plugged into one of the USB3 ports...
It's naked now.

Ok, been able to reboot clean maybe 20 times so far, along the range from 40C to 61C, still warming it up more, but looking better. Hard to keep it warm outside of it's pisound box....

Interesting...

All is good with the USB stick as well. so indicators are pointing to the pisound (or presense of something on the GPIO pins).
maybe the pi can't deal well with something (or specifically the pisound) on the GPIO pins

User avatar
rpdom
Posts: 20034
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Tue Oct 15, 2019 2:56 am

subatomicglue wrote:
Mon Oct 14, 2019 10:24 pm
Whatever your issue is, it is not that.

No model of RPi board has a BIOS as found on a 'conventional' (ie. 'WinTel' ) PC.
I read the Rpi4 has firmware now... Maybe we dont call it a BIOS. But it does have firmware - and that's what I meant
https://www.raspberrypi.org/forums/view ... p?t=244585
All of the Pi models use what has been termed "firmware". The Pi 4B is only different in that the firmware file is stored on a chip on the board instead of on the SD card.
Unreadable squiggle

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Tue Oct 15, 2019 3:02 am

The Pi 4B is only different in that the firmware file is stored on a chip on the board instead of on the SD card.
yep, that's what i was referring to, thanks.

subatomicglue
Posts: 54
Joined: Sun Oct 13, 2019 5:58 pm

Re: Raspberry Pi 4b - sudo reboot now - need to unplug power > 10seconds to recover

Tue Oct 15, 2019 3:47 am

Relevant perhaps:

https://github.com/raspberrypi/linux/issues/3065
Once the issue occurs, the 3.3V rail gets unstuck only after leaving RPi4 unplugged for about 15 seconds.
hmmmm

And this:
https://github.com/raspberrypi/linux/issues/3168
The reboot process appears to properly finish, then the 3.3V regulator is shut off???, and the system will not actually reboot. It appears to wait forever for something with no hdmi output. The 3.3V regulator seems to have maybe 0.5V on that pin, presumably the leakage from the i2c pullup resistors.

Note that this does NOT happen when PINN "reboots" to start Buster, only when Buster tries to sudo reboot.
And This:
https://community.blokas.io/t/pisound-w ... -4/1238/12
Regarding the Pi 4 reboot issue with Pisound, the issue seems to be a change of how the 3.3V supply on the GPIO header of Raspberry Pi 4 works - it now gets turned on with a 60ms delay, while 5V supply is available immediately, and during shutdown and reboot it gets turned off. 3.3V power supply on earlier Rasbperry Pi models was getting turned on nearly instantly.

There’s a temporary workaround available, consisting of 2 parts:

Return to “Troubleshooting”