# Networking stays active when 12.3-R "shut down" on RPI B+/2



## rowan194 (Mar 31, 2022)

After doing `shutdown -p now` or `shutdown -h now`, serial console says:


```
The operating system has halted.
Please press any key to reboot.
```

...but the device still responds to pings and TCP connect request via ethernet. If no serial console is attached to see the final message, it's impossible to know if it has safely shut down and power can be disconnected.

Seems odd that the kernel seems to be still running, I guess so it can detect a keypress and initiate a reboot - but why not just have a small section of dedicated code for this? Why would ethernet interrupts and TCP/IP packets still need to be handled?

Curious whether this is a Raspberry Pi thing, or it's more generic and happens with all systems that cannot be powered off by the OS. (Perhaps most tier 1 hardware supporting that may explain why there's no dedicated "shut everything down except serial and/or keyboard interrupts" code.)

I notice the power LED switches off during boot. Would be handy if this could stay on, and instead was switched off at the point FreeBSD prints the final halt message to the console?


----------



## mark_j (Mar 31, 2022)

Known issue. You can try raspberrypi-gpioshutdown.


----------



## Phishfry (Mar 31, 2022)

rowan194 said:


> Would be handy if this could stay on


This is user configurable. On alot of Arm board the LED's are devoted to GPIO so you can use various web tutorials that show how to manipulate them.

You don't want that but gpioled(4) from what you are asking.


----------



## Phishfry (Mar 31, 2022)

On the RaspberryPi there are pre-compiled overlays in the sysutils/rpi-firmware port.
Perhaps there is an GPIOLED overlay ready to use.

Notice the different Pi board schemes for PowerLED or pwr_led








						firmware/README at master · raspberrypi/firmware
					

This repository contains pre-compiled binaries of the current Raspberry Pi  kernel and modules, userspace libraries, and bootloader/GPU firmware. - firmware/README at master · raspberrypi/firmware




					github.com


----------



## rowan194 (Apr 1, 2022)

mark_j said:


> Known issue. You can try raspberrypi-gpioshutdown.


I did see this earlier, but I didn't realise it was a kernel module. I presume you use an LED on a GPIO pin, and the kernel mod will switch it off as it unloads? Not sure this is much better than "initiate shutdown then wait 30 seconds" 

I do note that when viewing boot with a serial console, the power LED goes off around the time that GPIO is (presumably) initialised, which is strange, since according to the RPI B+ schematics the power LED appears to be connected to a voltage supervisor IC, rather than being controlled by the CPU through a GPIO.


```
gpio0: <BCM2708/2835 GPIO controller> mem 0x7e200000-0x7e2000b3 irq 19,20 on simplebus0
gpiobus0: <OFW GPIO bus> on gpio0
```


----------



## rowan194 (Apr 1, 2022)

Phishfry said:


> On the RaspberryPi there are pre-compiled overlays in the sysutils/rpi-firmware port.
> Perhaps there is an GPIOLED overlay ready to use.
> 
> Notice the different Pi board schemes for PowerLED or pwr_led
> ...


Interesting. There's more information here: https://github.com/raspberrypi/firmware/tree/master/boot/overlays

Seems gpio-poweroff is able to drive a GPIO pin at shutdown, but you need external hardware to actually cut the power.

I tried adding this to /boot/msdos/config.txt as an experiment, but the power and status LED behaviour doesn't change (status goes off shortly after power applied, pwr goes off as kernel is probing). Possible the Pi 1 B+ is too old for this.


```
dtparam=pwr_led_trigger=heartbeat
dtparam=act_led_trigger=mmc
```


----------

