0

I have my rPi hooked up to my printer via USB connection and powered by a power adapter as supplied with the kit from amazon: https://www.amazon.ca/gp/product/B07BD3WHCK/ref=oh_aui_detailpage_o04_s00?ie=UTF8&psc=1

The Pi and the printer and plugged into two separate outlets so there shouldn't be a power surge/drop issue.

The Pi is flashed as per the official instructions provided on the OctoPi website using Etcher and the supplied .zip file. From what I understand, OctoPi is built on a lite version of Raspberian. I do the basic wifi setup on my PC, insert the SD card, power the Pi, and it works as it is meant to.

The sequence of events, I shut down the printer using the built-in on/off switch. Upon powering on the printer again, I am unable to connect to OctoPi. Upon connecting a monitor, I discover that there appears to be a boot error identical to this post: Error on Boot. 'No working init found.'

Unfortunately the suggestion there is to do a reflash, and the author is also not using OctoPi.

I found another post that was unfortunately unsolved where the author installed the full Raspberrian as a work-around and suggested it may be a problem with the lite version: SD Card corrupted at shutdown (no gui)

One last note, this has only occurred twice now and the printer power reboot appears to be the common element. I have not attempted to connect the monitor and replicate the situation to see what happens on the Pi as of yet. That will be my next step once I have time.

Update

In an attempt to re-create the issue I hooked up a monitor and power cycled the 3D printer several times with no problems.

I then attempted to cut power to the Pi to see what that might do, and now it appears I'm stuck in a boot loop with an "error -110 transferring data, sector.." to what appears to be about a dozen different sectors.

At this point, I'm going to re-flash again.

Any more inputs or am I still being a tad useless?

Update

Got a new error. I turned off the printer and left the rPi on over the weekend and came back to discover the uploaded image. Because I didn't really see an option, I did a power cycle which resulted in a boot loop and I'm now re-flashing yet again. This is getting to be a little annoying.

Is there something I should be pulling from the SD card before I re-flash that would be helpful information?

Pi Error

Original post

I'm new to the whole Pi scene, I recently got a 3B+ and OctoPi all set up to run my 3D printer (Taz6 if important). It's been running great, however, I've now discovered an apparent trend where if I shut off the printer it corrupts the OS and I have to start from scratch. It can't seem to initialize the boot sequence and according to my research, I'm best off just doing a total reinstall. The whole process is more than a little frustrating.

I get everything set up as per the basic OctoPi instructions and I make sure I run a full update on the Pi when it boots the first time. I saw another post suggesting that running a lite OS might cause some troubles like this.

Any thoughts?

S7RM7RPR
  • 1
  • 2
  • i think that you posted incomplete information ..... please add a description of the shutdown sequence that you are using ..... also describe how the RPi and the printer are powered (a diagram would be best) – jsotola Jan 08 '19 at 02:11
  • 1
    `I saw another post` where? `suggesting that running a lite OS` which one? `might cause some troubles like this` the internet is full of misinformation - this sounds like a perfect example – Jaromanda X Jan 08 '19 at 04:41
  • Welcome. As per the previous comments, please elaborate 1) About how everything is connected and powered, 2) Exactly how you "shut off" the printer, 3) Exactly what happens immediately after you shut off the printer. *Edit these details into the question, do not add them as comments.* – goldilocks Jan 08 '19 at 05:58
  • thank you @goldilocks I hadn't realized my post was a little too basic – S7RM7RPR Jan 09 '19 at 02:03
  • Much better. I'm still not sure how much anyone can say here though. – goldilocks Jan 09 '19 at 08:10
  • Simply being on two separate outlets doesn't mean they're electrically-isolated; they can still be on the same circuit as one another. – fluffy Jan 09 '19 at 19:05
  • As *goldilocks* pointed out in his answer, never switch off the power supply without executing `sudo systemctl poweroff` before otherwise it will corrupt your file system. – Ingo Jan 09 '19 at 20:30
  • @Ingo it seems like you're implying the OS isn't robust enough to deal with a power loss, but that doesn't make sense to me or else everyone with a rPi will have to re-flash every time they have a power loss... – S7RM7RPR Jan 10 '19 at 02:18
  • I implied that you know you have to take attention with interrupted power. @goldilocks pointed it already out in his answer. Unix in general isn't failsafe on power loss. Linux takes much effort with **ext4** filesystem and journaling to minimize filesystem corruption for one time disaster recovery. But always trusting on this results in the problem you have. – Ingo Jan 10 '19 at 13:40
  • No, everyone does not have to re-flash after an arbitrary power loss everytime; I've never had to and with my pile o' pis going back 6+ years (during most of which I've had at least one or two running 24/7), I've lost count of how many times I've had to pull the plug or the power's gone out, etc. A couple of times I have noticed that there was corruption on reboot, but the system attempts to repair this and usually should succeed; this is not a mechanism used only on the Raspberry Pi. – goldilocks Jan 10 '19 at 14:05
  • *However*, I have observed here that some people seem to have a lot of problems with this. This implies there's some additional factor at work. It also seems to be much less reported now than during the first 2-3 years that I was here. My hunch is that the early models had a problem with the SD card reader such that it was/maybe subject to some brief surge or fluctuation when the power fails which causes a much more serious degree of corruption than what occurs simply because the filesystem is out of sync, etc. – goldilocks Jan 10 '19 at 14:07
  • ...That kind of damage might as well be done when the OS isn't even running. If turning off a USB connected device is triggering a reboot, obviously there is some electrical problem there. – goldilocks Jan 10 '19 at 14:08
  • Thanks for the info @goldilocks. Seems like there isn't a whole lot for me to fiddle with. Maybe at some point, I'll try a full OS and/or a different brand of SD card if I see one on sale – S7RM7RPR Jan 10 '19 at 23:07

1 Answers1

1

The problem certainly looks like it is SD card corruption, which can happen as a result of arbitrarily cycling the power.

It shouldn't happen during normal operation. Reboots should be obvious in the system logs, OctoPi is Raspbian based, so you could start with /var/log/syslog (you can also use journalctl).

If you can observe with a monitor that it happens exactly when you turn off the printer, it would decisively confirm whether or not that is the cause. If it is, the Pi and software are not to blame. Which is sort of unfortunate, because it means there is nothing you can do about it other than try another 3D printer...

I saw another post suggesting that running a lite OS might cause some troubles like this.

Is magical thinking of the sort whereby someone swears they have a hat that causes it to rain when they wear it. That person may believe this, and may have anecdotal correspondences that "prove" it ("Everytime I wear this hat it rains! Everytime!") but anyone with a rudimentary education in science would observe that there is no possible causation there.

What you could try realistically is another SD card. Some of them fare better than others. However, if turning off the printer really causes the Pi to suddenly reboot, there's not much you can do about it beyond investigate to provide details to either the manufacturer of the printer or of the Pi.

powered by a power adapter as supplied with the kit from amazon

I have a number of those power supplies from Canakit and they are better than anything else I've found at that price (~$15). Unless it is defective it should be fine.

goldilocks
  • 56,430
  • 17
  • 109
  • 217
  • thank you for the input! As with all my new endeavors, when anything goes wrong I like to try and get input from those with more experience so I don't get started on the wrong foot. I should actually be able to try an observed reboot today so we shall see if that provides more answers! – S7RM7RPR Jan 09 '19 at 15:57