Gracefull shutdown of Raspberry Pi

Is there a way to explicitly shut down the Pi rather than a hard power off? The PhotoVision webinterface doesn’t have this feature, and SSH I can’t get past the login screen. Username: Pi Password: Raspberry doesn’t work.

I’m trying to avoid SD corruption and frying the board.

Thanks

It’s case sensitive. Camera Troubleshooting - PhotonVision Docs

the best way would be

https://core-electronics.com.au/guides/read-only-raspberry-pi/

another one

and always have spare sd card.

1 Like

Thanks for the response. I guess following the documentation exactly as written helps!

For context the example below I am using Team 6666 but are not from there, have this setup temporarily on the secondary test bot to ensure don’t step on the main radio connection with the working robot.

When SSH directly to host IP address (SSH 10.66.66.10) asks for password and using login fails as the user has not been defined

Change to (SSH **pi@**10.66.66.10) with the user name prepended to the host IP address. Now user is defined and asks for password and using login success

Sudo shutdown now works as expected, shuts down gracefully and we power off the external switch

The WPILibPi image is already set up this way (read only filesystem by default, with commands to make writable) for this exact reason.

3 Likes

I guess there’s no need to worry about that. Photon Vision doesn’t write anything to the file system unless you’re changing the configurations.

The other situation I’m trying to avoid is frying the board. The workbench is full of Pi’s that don’t even start after being turned off. We have now set up the Pi’s on their own dedicated power circuit through a buck converter and switch so when the robot is turned on and off all the time when the team is working on it, the boards aren’t getting rev’d up all the time. The policy is to gracefully shut them down the recommended way.

Would be nice if the PhotonVision page had an extra button next to the “Restart PhotonVison”, and “Restart Host” → could have one “Power Down Host” so just do it from there instead.

Generally speaking, turning it off is unlikely to fry the board. The concern here would be data bits that haven’t done writing to the SD card cause data corruption.

Actually not quite. Idk how wpilibpi solves this, but Fallback to extracting native libraries to system temp directory · Issue #5846 · wpilibsuite/allwpilib · GitHub

Do we suggest shutting down the coprocessor cleanly? I don’t remember suggesting that at least.

The normal wpilibpi install doesn’t do any extraction of native libraries because they are already installed on the system. The alternative would be to extract to a memory-backed filesystem as per that issue (eg /tmp is memory-backed so that would be an option).

1 Like