Octopi Stops Working After Shut Down

What is the problem?

I have a modded ender 3 printer that has been out fitted with a raspberry pi b3+ for octopi support. the raspberry pi is powered of my printers power supply using a stepper module that I soldered myself, stepping the voltage down from 24V to 5V. frustratingly octopi works just fine after being flashed but once it is turned of it stop working all together. I have had to flash my micro sd multiple times because after one use it refuses to connect to my network.

What did you already try to solve it?

1 reflashing my micro sd. it temporarily solves the issue but after shut of it no longer connects.

2 unplugged the usb connection between my printer and the raspberry pi. did not solve the issue as octopi still refuses to connect unless it is reflashed.

3 check for file corruption on my micro sd. no corruption as far as I cant tell. all the octopi boot files are readable. scanning the card with windows also shows no errors.

4 used hot glue to hold both the power cable going to the raspberry pie and the ethernet cable connecting the pi to my network in place. I have had issues in the past where the ethernet cable was not fully plugged in but sadly that is not the case as it is now firmly held in place.

Have you tried running in safe mode?

yes and it did not help. still does not connect to network after shut off.

Did running in safe mode solve the problem?

no.

Additional information about my setup

my printer is a modded ender 3 with a bl touch. my mother board is a Ender 3 Bigtreetech SKR 1.3 mother board. the firmware is marlin 2.0.7.2. the pi is powered by the printer power supply using a stepper module.

After you turn it back on again, are you able to verify the Pi is booting? How are you turning the Pi off?

Best way to see what's happening is to connect the Pi up to a monitor/TV using the HDMI cable.

the pi light on the board itself lights up like normal the red led is constant in the board while the green one flickers and eventually stays off. on a fresh boot the green light continues to flicker. side note I haven't been home for a good two weeks. went on a vacation with my family. just now coming back to this project to discover something strange. it has started working again out of the blue. I haven't touched my printer since I made this post but now it appears to be booting just fine. still going to monitor it after a few boot to see if it still works.

@Charlie_Powell I plugged an monitor to the raspberry pi and saw that it booted just fine. showing the raspberry pi logo with the everything booting. it eventually finished and was waiting for a login. switching back to my pc I was able to log in like normal. thanks to you I think I found the root of the issue which is that my pi refuses to boot unless a monitor is detected in the HDMI port. I did some digging on this issue and I still don't quite understand why it occurring. from what I could find it isn't booting because " Without a display device the GUI desktop does not start so any program that requires GUI will not start." does that mean that octopi needs it GUI desktop to start in order for it to work?

the solution that other forums suggested I do was Add hdmi_force_hotplug=1 to /boot/config.txt . checking my boot files however this was already a line in my config.txt. I might just buy a small monitor for my pi and attach it to my printer to solve this issue if there are no other alternatives. which doesn't seem that bad all things considered.