What is the problem?
I have two Raspberries (1 and 3B+), and I have never done anything on Raspi before.
I downloaded the most current OctoPi image last week and used balenaEtcher to copy it to an 8GB microSD Card. Then I tried it on my 3B+. The LEDs blink, there are several pages of boot log shown on the monitor (too fast to read, but the last line I can read is "Started Login Services" most of the time. Sometimes the last line is something with LSB)), and then the monitor gets dark again, and it all starts again, and again and .. you get the picture.
What did you already try to solve it?
I put the microSD card in an SD-Card adapter and tried it on my Raspi 1, to make sure that it is not a faulty image or card. And I see the same log information, and after some time, I get to the point where I am asked for username and password (which I have not yet changed), and after that, I get a normal
command prompt.
So it seems, the image is OK, right? Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, what kind of hardware precisely, ...)
OctoPi Buster Lite 0.17.0#
Raspberry 1373331 Pi 3 Modell B+ Mainboard, 1 GB
Anet A2
The only thing I have connected is: power, Monitor, Mouse and KEyboard (mouse and keyboard via a USB port). I've tried with and without cable to the printer. The cam is not attached, nor do I have any extra LEDs.
The point where Raspberry restarts is not always the same, so I assume you're suggestion that this is "power related" is valid.
I will try without mouse (no use for it anyway) and without keyboard first, and then I will try another power supply, and then report back.
Verify that your power adapter is indeed an adapter and not a charger. It needs to be 5V @ 2.5A.
If you have a multimeter or oscilloscope you can check the 5V input on the GPIO pins as you connect/disconnect each device (keyboard, for example).
The writing activity of the microSD card consumes a fair amount of power from what I've seen. You might temporarily do a sudo service octoprint stop, let that run for a while and watch for a reboot. If it's now clean then it could be that the write was the "straw that broke the camel's back", so-to-speak. Check the logs for under-voltage.