Camera works then it doesn't

Hello, I have a Raspberry Pi Camera Module V2-8 Megapixel,1080p (RPI-CAM-V2) and never had an issue with it for a few years now. Recently I have been getting a Webcam stream loading.... after the print has started but the camera works just fine before that but after I get the message and want to view with camera I have to restart Octoprint and it will work again but do the same thing after printing starts.

Capture

Hello @oxicottin !

What happened to this:?


What did you already try to solve it?

Logs ( /var/log/webcamd.log , syslog, dmesg, ... no logs, no support )

Additional information about your setup (OctoPrint version, OctoPi version, ...)


You also may attach the systeminfo bundle.

I havent tried anything thats why i came here for suggestions

A suggestion is to share these informations:

I've had similar problems with the webcam stream. Each time the stream doesn't load, I ssh into the RPi and issue a ' sudo service webcams restart' to resolve the issue.

It's an inconvenience, but gets the job done. It would be nice to have a plugin that allows for Linux commands to be run directly in Octoprint.

Well I dont know what to say, it just started working again? For several prints it didn't now it works every time... Only thing I did and it didn't even pertain to Octoprint was I installed JyersUI on my ender 3 V2. Anyways thanks for the replys!

I've had this issue repeatedly with a webcam, a Lofitech Pro 9000 which does work, sometimes. Judging by the number of Octopi webcam problems round the web, it seems to be an ongoing issue for many.
When my webcam fails to load, I boot up from a fresh Octopi install and the webcam works again, then at some point it doesn't and I have to reboot from another fresh intall to resurrect it.
I'm a complete noob with Python, and struggle making changes to code, but I may have found what's stopping the webcam, in terms of physical actions.
As my laptop with the Octoprint control dashboard is downstairs, and the printer upstairs, I've been stopping a failed print by turning off the printer and Raspberry Pi when I spot it upstairs, rather than going downstairs to terminate it through the Octoprint dashboard.
When it reboots, the camera is not reachable.
I suspect the issue is within the timelapse function, as I don't recall it being a problem when this wasn't running. It seems to occur within Octolapse but also with the standard dashboard timelapse function, without the Octolapse plugin installed.
Maybe it leaves something latched on when the timelapse is terminated unexpectedly and doesn't check on reboot?
More of a suggestion than a solution, but that appears to be my experience.

Turning off the power to the RPi without a proper shutdown will eventually result in a corrupted SD card. Turning off the printer may disrupt the communications and require giving the RPi some attention, but the SD card should stay healthy.

My OctoPrint instance on my RPi 3B has been up for 199 days (as reported by top) and my camera has been working the whole time. The right solution is to figure out why your webcam has issues and resolve them.

Thanks for that.
Well, it's not the print termination directly anyway.
As I use my printer intermittently, I tend to turn off both the printer and RPi 3B+ Β©2017 when I'm not using them, printer at the wall, the RPi with the switch on the power lead. I've been doing that when prints fail too.
When the last print failed, I rushed downstairs and terminated it through the dashboard before switching everything off. The webcam still disappeared again next time though.
I wasn't aware of the shutdown button, but I've just found it on the dashboard, so I should probably try that as well. Maybe others have missed it too? We'll see...

Probably should be a different topic, but related to my camera issue as I was trying to recover it with a fresh install.
As I've been rewriting my SD card with a new instance of Octopi each time I lose the camera stream, to try and get my camera back up, I'm used to the procedure. (I used to run an IT helpdesk, so I'm very patient).
It appears the release of OctoPi I was using originally has been updated and sadly, I've deleted my downloaded copy. Now I find it impossible to get past the initial log in screen, as it doesn't recognise my credentials. I've gone in via PuTTY and can log into the system with the pi username and password I give the start up login in the SSD wizard, so it's in there, but the OctoPi user pi doesn't exist when I try to change the password via PuTTY.
I've tried changing the username in the SSD wizard as well (against the instructions) and this is reflected in the PuTTY login fine, but Octopi still won't let me in to the startup wizard.
I've done this at least a dozen times, probably more, using the setup wizard and also burning an image direct to the card and setting up the details with Notepad++, but I still hit the same roadblock.
I'm still learning my way round with PuTTY and I haven't found the directory with the logs in yet, but I'm tearing my hair out! I can't get to the Octopi desktop to download the logs either of course.

Images are octopi-0.18.0-1.8.2-20220816135025 & octopi-0.18.0-1.8.2-20220809123918.
Summary
I've burned Octopi to SSD several times successfully with no issue. Suddenly I can't get past the startup login to the setup wizard, despite numerous attempts.
System username and password match those in the setup, but no Octopi username pi.

Feel free to shunt this to a more appropriate topic - I'm still very much a newbie here. Thanks

The hostname out of the box on an OctoPi image is octopi, not raspberrypi as it's showing in your screenshot.

Are you sure you are using the correct image through the Raspberry Pi Imager? Or are you changing the hostname yourself in the options in there?

Thanks @Charlie_Powell
I used the standard hostname from the imager -
selected through Other specific-purpose OS / 3D printing / OctoPi / OctoPi (stable)
I just tracked down the Rasperry Pi Imager in Program Files and deleted it to ensure a fresh install too.
As far as I know there's nothing cached on my laptop that would change it.
Hostname

And what did you use for username?

I've left the username as pi, put my own username in, used no password and my own password, tried raspberry, raspberrypi, copied the password from a text file at setup and the same file again at login. Same UK keyboard, same laptop, cleared firefox cache, checked the registry for raspberrypi (it wasn't there). I've clicked all the boxes, clicked none of the boxes, tried every combination I can think of, repeatedly, but always with the same result.
I've tried SSLing into the mounted card from PuTTY to check what I can and try and change the user password or add another user, but it appears users haven't been set up, because the initial set up hasn't completed.
The set up was working perfectly - I'd done it multiple times playing with my web cam to try and get it working consistently, but then, suddenly, it wouldn't log on doing exactly what I'd done before and the login to setup hasn't worked at all since.
I've been stumped for a while now, but not for want of trying...
Edit for @Charlie_Powell
I tried changing the hostname to octopi and tried pi. I still couldn't log in to the set up. Pretty sure, from memory, that it's always been set as raspberrypi as long as I've been using it.
I can connect and get to the login screen, so the raspberry hardware seems to be OK. I've tried rebooting it with no card, in between fresh installs, in case there's some internal cache messing it up, but that didn't work either and I'm also using two differend SSD cards, one to write the next attempt to and one in the raspberry pi. I haven't changed any hardware, programs or settings since it was working, so I'm at a complete loss.

@Charlie_Powell @Ewald_Ikemann
SORTED!
The problem appears to be linked to my firefox browser.
I downloaded and set up a new Chrome browser and tried logging in on that - no initial username screen, straight into the setup screen! Now I have a personal username set up, I can get straight into that on firefox.
I changed the hostname to octopi on this install, so I'll stick with that for safety, but it still wouldn't work with Firefox. Firefox keeps throwing updates at me, so maybe one of those was to blame, I have no idea, but at least it's working now.
Many thanks for your help.